; LLVM IR from kazunetakahashi/atcoder :: 2017/1124_code-fes-2016-final (E)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5powerxx(i64 noundef, i64 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @A)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %13 = load i64, ptr @N, align 8, !tbaa !5
  %14 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %13)
  %15 = fadd double %14, 1.000000e+00
  %16 = fptosi double %15 to i64
  store i64 %16, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 2, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %17 = load i64, ptr @N, align 8, !tbaa !5
  store i64 %17, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %127, %0
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 1000
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 2, ptr %6, align 4
  br label %130

22:                                               ; preds = %18
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = call noundef i64 @_Z5powerxx(i64 noundef 2, i64 noundef %24)
  %26 = load i64, ptr @N, align 8, !tbaa !5
  %27 = icmp sgt i64 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %22
  store i32 2, ptr %6, align 4
  br label %130

29:                                               ; preds = %22
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = icmp eq i32 %30, 2
  br i1 %31, label %32, label %55

32:                                               ; preds = %29
  br label %33

33:                                               ; preds = %53, %32
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = load i64, ptr %3, align 8, !tbaa !5
  %36 = sub nsw i64 %34, %35
  %37 = icmp sgt i64 %36, 1
  br i1 %37, label %38, label %54

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %39 = load i64, ptr %2, align 8, !tbaa !5
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = add nsw i64 %39, %40
  %42 = sdiv i64 %41, 2
  store i64 %42, ptr %7, align 8, !tbaa !5
  %43 = load i64, ptr %7, align 8, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = call noundef i64 @_Z5powerxx(i64 noundef %43, i64 noundef %45)
  %47 = load i64, ptr @N, align 8, !tbaa !5
  %48 = icmp sgt i64 %46, %47
  br i1 %48, label %49, label %51

49:                                               ; preds = %38
  %50 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %50, ptr %2, align 8, !tbaa !5
  br label %53

51:                                               ; preds = %38
  %52 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %52, ptr %3, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %51, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %33, !llvm.loop !11

54:                                               ; preds = %33
  br label %78

55:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %73, %55
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 12000
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 7, ptr %6, align 4
  br label %76

60:                                               ; preds = %56
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = call noundef i64 @_Z5powerxx(i64 noundef %62, i64 noundef %64)
  %66 = load i64, ptr @N, align 8, !tbaa !5
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %68, label %71

68:                                               ; preds = %60
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  store i64 %70, ptr %3, align 8, !tbaa !5
  br label %72

71:                                               ; preds = %60
  store i32 7, ptr %6, align 4
  br label %76

72:                                               ; preds = %68
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %8, align 4, !tbaa !9
  br label %56, !llvm.loop !13

76:                                               ; preds = %71, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77, %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %121, %78
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = load i32, ptr %5, align 4, !tbaa !9
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 10, ptr %6, align 4
  br label %124

84:                                               ; preds = %79
  %85 = load i64, ptr %3, align 8, !tbaa !5
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = sub nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = call noundef i64 @_Z5powerxx(i64 noundef %85, i64 noundef %89)
  %91 = load i64, ptr %3, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = call noundef i64 @_Z5powerxx(i64 noundef %92, i64 noundef %94)
  %96 = mul nsw i64 %90, %95
  %97 = load i64, ptr @N, align 8, !tbaa !5
  %98 = icmp sge i64 %96, %97
  br i1 %98, label %99, label %120

99:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %100 = load i64, ptr %3, align 8, !tbaa !5
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sub nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  %105 = mul nsw i64 %100, %104
  %106 = load i64, ptr %3, align 8, !tbaa !5
  %107 = add nsw i64 %106, 1
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %107, %109
  %111 = add nsw i64 %105, %110
  %112 = load i64, ptr @A, align 8, !tbaa !5
  %113 = load i32, ptr %5, align 4, !tbaa !9
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = mul nsw i64 %112, %115
  %117 = add nsw i64 %111, %116
  store i64 %117, ptr %10, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %119 = load i64, ptr %118, align 8, !tbaa !5
  store i64 %119, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  store i32 10, ptr %6, align 4
  br label %124

120:                                              ; preds = %84
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %9, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %9, align 4, !tbaa !9
  br label %79, !llvm.loop !14

124:                                              ; preds = %99, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %125

125:                                              ; preds = %124
  %126 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %126, ptr %2, align 8, !tbaa !5
  store i64 2, ptr %3, align 8, !tbaa !5
  br label %127

127:                                              ; preds = %125
  %128 = load i32, ptr %5, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %5, align 4, !tbaa !9
  br label %18, !llvm.loop !15

130:                                              ; preds = %28, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %131

131:                                              ; preds = %130
  %132 = load i64, ptr %4, align 8, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %132)
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %135 = load i32, ptr %1, align 4
  ret i32 %135
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5powerxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %5 = load i64, ptr @N, align 8, !tbaa !5
  %6 = tail call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %5)
  %7 = fadd double %6, 1.000000e+00
  %8 = fptosi double %7 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %9 = load i64, ptr @N, align 8, !tbaa !5
  store i64 %9, ptr %1, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %0, %.loopexit
  %indvars.iv65 = phi i64 [ 2, %0 ], [ %indvars.iv.next66, %.loopexit ]
  %indvars.iv63 = phi i64 [ 3, %0 ], [ %indvars.iv.next64, %.loopexit ]
  %.03451 = phi i64 [ %8, %0 ], [ %.4, %.loopexit ]
  %11 = call noundef i64 @_Z5powerxx(i64 noundef 2, i64 noundef %indvars.iv65)
  %12 = load i64, ptr @N, align 8, !tbaa !5
  %13 = icmp sgt i64 %11, %12
  br i1 %13, label %48, label %14

14:                                               ; preds = %10
  %15 = icmp eq i64 %indvars.iv65, 2
  br i1 %15, label %.preheader, label %.preheader41.preheader

.preheader41.preheader:                           ; preds = %14
  %16 = call noundef i64 @_Z5powerxx(i64 noundef 1, i64 noundef %indvars.iv65)
  %17 = load i64, ptr @N, align 8, !tbaa !5
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %.lr.ph78, label %.loopexit40

.preheader:                                       ; preds = %14
  %19 = icmp sgt i64 %.03451, 3
  br i1 %19, label %.lr.ph, label %.loopexit40

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.148 = phi i64 [ %..1, %.lr.ph ], [ %.03451, %.preheader ]
  %.13747 = phi i64 [ %.137., %.lr.ph ], [ 2, %.preheader ]
  %20 = add nsw i64 %.148, %.13747
  %21 = sdiv i64 %20, 2
  %22 = call noundef i64 @_Z5powerxx(i64 noundef %21, i64 noundef 2)
  %23 = load i64, ptr @N, align 8, !tbaa !5
  %24 = icmp sgt i64 %22, %23
  %.137. = select i1 %24, i64 %.13747, i64 %21
  %..1 = select i1 %24, i64 %21, i64 %.148
  %25 = sub nsw i64 %..1, %.137.
  %26 = icmp sgt i64 %25, 1
  br i1 %26, label %.lr.ph, label %.loopexit40, !llvm.loop !9

.lr.ph78:                                         ; preds = %.preheader41.preheader, %.preheader41
  %indvars.iv77 = phi i64 [ %indvars.iv.next, %.preheader41 ], [ 1, %.preheader41.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv77, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 12000
  br i1 %exitcond.not, label %.loopexit40, label %.preheader41, !llvm.loop !11

.preheader41:                                     ; preds = %.lr.ph78
  %27 = call noundef i64 @_Z5powerxx(i64 noundef %indvars.iv.next, i64 noundef %indvars.iv65)
  %28 = load i64, ptr @N, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %.lr.ph78, label %.loopexit40, !llvm.loop !11

.loopexit40:                                      ; preds = %.preheader41, %.lr.ph78, %.lr.ph, %.preheader41.preheader, %.preheader
  %.4 = phi i64 [ 2, %.preheader ], [ 2, %.preheader41.preheader ], [ %.137., %.lr.ph ], [ 11999, %.lr.ph78 ], [ %indvars.iv77, %.preheader41 ]
  %30 = add nsw i64 %.4, 1
  br label %32

31:                                               ; preds = %32
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next58, %indvars.iv63
  br i1 %exitcond62.not, label %.loopexit, label %32, !llvm.loop !12

32:                                               ; preds = %.loopexit40, %31
  %indvars.iv57 = phi i64 [ 0, %.loopexit40 ], [ %indvars.iv.next58, %31 ]
  %33 = sub nsw i64 %indvars.iv65, %indvars.iv57
  %34 = call noundef i64 @_Z5powerxx(i64 noundef %.4, i64 noundef %33)
  %35 = call noundef i64 @_Z5powerxx(i64 noundef %30, i64 noundef %indvars.iv57)
  %36 = mul nsw i64 %35, %34
  %37 = load i64, ptr @N, align 8, !tbaa !5
  %.not39 = icmp slt i64 %36, %37
  br i1 %.not39, label %31, label %38

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %39 = mul nsw i64 %.4, %33
  %40 = mul nsw i64 %30, %indvars.iv57
  %41 = add nsw i64 %39, %40
  %42 = load i64, ptr @A, align 8, !tbaa !5
  %43 = add nsw i64 %indvars.iv65, -1
  %44 = mul nsw i64 %42, %43
  %45 = add nsw i64 %41, %44
  store i64 %45, ptr %2, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %47 = load i64, ptr %46, align 8, !tbaa !5
  store i64 %47, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %.loopexit

.loopexit:                                        ; preds = %31, %38
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next66, 1000
  br i1 %exitcond70.not, label %48, label %10, !llvm.loop !13

48:                                               ; preds = %10, %.loopexit
  %49 = load i64, ptr %1, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %49)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass