; LLVM IR from ravireddy07/cpp-book :: src/Coding-Blocks (DeepakAndPrimes2)

; 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" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca [1000000 x i64], align 16
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %161, %0
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %164

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8000000, ptr %7) #7
  %28 = getelementptr inbounds [1000000 x i64], ptr %7, i64 0, i64 0
  %29 = getelementptr inbounds [1000000 x i64], ptr %7, i64 0, i64 0
  %30 = getelementptr inbounds i64, ptr %29, i64 1000000
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef %28, ptr noundef %30, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %31 = load i64, ptr %6, align 8, !tbaa !9
  %32 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %31)
  %33 = fptosi double %32 to i64
  store i64 %33, ptr %9, align 8, !tbaa !9
  %34 = load i64, ptr %9, align 8, !tbaa !9
  %35 = add nsw i64 %34, 1
  %36 = call ptr @llvm.stacksave.p0()
  store ptr %36, ptr %10, align 8
  %37 = alloca i64, i64 %35, align 16
  store i64 %35, ptr %11, align 8
  %38 = load i64, ptr %9, align 8, !tbaa !9
  %39 = getelementptr inbounds i64, ptr %37, i64 %38
  %40 = getelementptr inbounds i64, ptr %39, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef %37, ptr noundef %40, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 2, ptr %13, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %76, %25
  %42 = load i64, ptr %13, align 8, !tbaa !9
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = mul nsw i64 %42, %43
  %45 = load i64, ptr %13, align 8, !tbaa !9
  %46 = mul nsw i64 %44, %45
  %47 = load i64, ptr %13, align 8, !tbaa !9
  %48 = mul nsw i64 %46, %47
  %49 = load i64, ptr %6, align 8, !tbaa !9
  %50 = icmp sle i64 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %41
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %79

52:                                               ; preds = %41
  %53 = load i64, ptr %13, align 8, !tbaa !9
  %54 = getelementptr inbounds i64, ptr %37, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = icmp ne i64 %55, 0
  br i1 %56, label %57, label %75

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %58 = load i64, ptr %13, align 8, !tbaa !9
  %59 = mul nsw i64 2, %58
  store i64 %59, ptr %14, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %70, %57
  %61 = load i64, ptr %14, align 8, !tbaa !9
  %62 = load i64, ptr %14, align 8, !tbaa !9
  %63 = mul nsw i64 %61, %62
  %64 = load i64, ptr %6, align 8, !tbaa !9
  %65 = icmp sle i64 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %60
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %74

67:                                               ; preds = %60
  %68 = load i64, ptr %14, align 8, !tbaa !9
  %69 = getelementptr inbounds i64, ptr %37, i64 %68
  store i64 0, ptr %69, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %67
  %71 = load i64, ptr %13, align 8, !tbaa !9
  %72 = load i64, ptr %14, align 8, !tbaa !9
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr %14, align 8, !tbaa !9
  br label %60, !llvm.loop !11

74:                                               ; preds = %66
  br label %75

75:                                               ; preds = %74, %52
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %13, align 8, !tbaa !9
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %13, align 8, !tbaa !9
  br label %41, !llvm.loop !13

79:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 2, ptr %15, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %122, %79
  %81 = load i64, ptr %15, align 8, !tbaa !9
  %82 = load i64, ptr %15, align 8, !tbaa !9
  %83 = mul nsw i64 %81, %82
  %84 = load i64, ptr %6, align 8, !tbaa !9
  %85 = icmp sle i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %80
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %125

87:                                               ; preds = %80
  %88 = load i64, ptr %15, align 8, !tbaa !9
  %89 = getelementptr inbounds i64, ptr %37, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = icmp ne i64 %90, 0
  br i1 %91, label %92, label %121

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %93 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %93, ptr %16, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %119, %92
  %95 = load i64, ptr %16, align 8, !tbaa !9
  %96 = load i64, ptr %6, align 8, !tbaa !9
  %97 = icmp sle i64 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %120

99:                                               ; preds = %94
  %100 = load i64, ptr %16, align 8, !tbaa !9
  %101 = load i64, ptr %15, align 8, !tbaa !9
  %102 = icmp sgt i64 %100, %101
  br i1 %102, label %103, label %116

103:                                              ; preds = %99
  %104 = load i64, ptr %16, align 8, !tbaa !9
  %105 = load i64, ptr %15, align 8, !tbaa !9
  %106 = srem i64 %104, %105
  %107 = icmp eq i64 %106, 0
  br i1 %107, label %108, label %116

108:                                              ; preds = %103
  %109 = load i64, ptr %16, align 8, !tbaa !9
  %110 = load i64, ptr %5, align 8, !tbaa !9
  %111 = sub nsw i64 %109, %110
  %112 = getelementptr inbounds [1000000 x i64], ptr %7, i64 0, i64 %111
  store i64 0, ptr %112, align 8, !tbaa !9
  %113 = load i64, ptr %15, align 8, !tbaa !9
  %114 = load i64, ptr %16, align 8, !tbaa !9
  %115 = add nsw i64 %114, %113
  store i64 %115, ptr %16, align 8, !tbaa !9
  br label %119

116:                                              ; preds = %103, %99
  %117 = load i64, ptr %16, align 8, !tbaa !9
  %118 = add nsw i64 %117, 1
  store i64 %118, ptr %16, align 8, !tbaa !9
  br label %119

119:                                              ; preds = %116, %108
  br label %94, !llvm.loop !14

120:                                              ; preds = %98
  br label %121

121:                                              ; preds = %120, %87
  br label %122

122:                                              ; preds = %121
  %123 = load i64, ptr %15, align 8, !tbaa !9
  %124 = add nsw i64 %123, 1
  store i64 %124, ptr %15, align 8, !tbaa !9
  br label %80, !llvm.loop !15

125:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %126 = load i64, ptr %5, align 8, !tbaa !9
  %127 = icmp eq i64 %126, 1
  br i1 %127, label %128, label %129

128:                                              ; preds = %125
  br label %131

129:                                              ; preds = %125
  %130 = load i64, ptr %5, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %129, %128
  %132 = phi i64 [ 2, %128 ], [ %130, %129 ]
  store i64 %132, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %133 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %133, ptr %18, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %151, %131
  %135 = load i64, ptr %18, align 8, !tbaa !9
  %136 = load i64, ptr %6, align 8, !tbaa !9
  %137 = icmp sle i64 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %154

139:                                              ; preds = %134
  %140 = load i64, ptr %18, align 8, !tbaa !9
  %141 = load i64, ptr %5, align 8, !tbaa !9
  %142 = sub nsw i64 %140, %141
  %143 = getelementptr inbounds [1000000 x i64], ptr %7, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !9
  %145 = icmp ne i64 %144, 0
  br i1 %145, label %146, label %150

146:                                              ; preds = %139
  %147 = load i64, ptr %18, align 8, !tbaa !9
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %147)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %150

150:                                              ; preds = %146, %139
  br label %151

151:                                              ; preds = %150
  %152 = load i64, ptr %18, align 8, !tbaa !9
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %18, align 8, !tbaa !9
  br label %134, !llvm.loop !16

154:                                              ; preds = %138
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %159

157:                                              ; preds = %154
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %159

159:                                              ; preds = %157, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %160 = load ptr, ptr %10, align 8
  call void @llvm.stackrestore.p0(ptr %160)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8000000, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %161

161:                                              ; preds = %159
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !17

164:                                              ; preds = %24
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; 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)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 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) #3 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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #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 = { 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 #6 = { nocallback nofree nosync nounwind willreturn }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca [1000000 x i64], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %0
  %10 = getelementptr inbounds i8, ptr %4, i64 8000000
  br label %11

._crit_edge69:                                    ; preds = %62, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

11:                                               ; preds = %.lr.ph68, %62
  %.03966 = phi i32 [ 0, %.lr.ph68 ], [ %63, %62 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 8000000, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull %4, ptr noundef nonnull %10, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %14 = load i64, ptr %3, align 8, !tbaa !9
  %15 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %14)
  %16 = fptosi double %15 to i64
  %17 = add nsw i64 %16, 1
  %18 = call ptr @llvm.stacksave.p0()
  %19 = alloca i64, i64 %17, align 16
  %20 = getelementptr inbounds i64, ptr %19, i64 %16
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull %19, ptr noundef nonnull %21, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %22 = load i64, ptr %3, align 8, !tbaa !9
  %.not51 = icmp slt i64 %22, 16
  br i1 %.not51, label %.preheader, label %.lr.ph53

.preheader:                                       ; preds = %.loopexit48, %11
  %.not4057 = icmp slt i64 %22, 4
  %.pre = load i64, ptr %2, align 8
  br i1 %.not4057, label %._crit_edge, label %.lr.ph60

.lr.ph60:                                         ; preds = %.preheader
  %.not4554 = icmp sgt i64 %.pre, %22
  %.not4554.fr = freeze i1 %.not4554
  br i1 %.not4554.fr, label %._crit_edge, label %.lr.ph60.split

.lr.ph53:                                         ; preds = %11, %.loopexit48
  %.03852 = phi i64 [ %31, %.loopexit48 ], [ 2, %11 ]
  %23 = getelementptr inbounds i64, ptr %19, i64 %.03852
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %.not46 = icmp eq i64 %24, 0
  br i1 %.not46, label %.loopexit48, label %25

25:                                               ; preds = %.lr.ph53
  %26 = shl nuw nsw i64 %.03852, 1
  %27 = mul nuw nsw i64 %26, %26
  %.not4749 = icmp sgt i64 %27, %22
  br i1 %.not4749, label %.loopexit48, label %.lr.ph

.lr.ph:                                           ; preds = %25, %.lr.ph
  %.03750 = phi i64 [ %29, %.lr.ph ], [ %26, %25 ]
  %28 = getelementptr inbounds i64, ptr %19, i64 %.03750
  store i64 0, ptr %28, align 8, !tbaa !9
  %29 = add nuw nsw i64 %.03750, %.03852
  %30 = mul nuw nsw i64 %29, %29
  %.not47 = icmp sgt i64 %30, %22
  br i1 %.not47, label %.loopexit48, label %.lr.ph, !llvm.loop !11

.loopexit48:                                      ; preds = %.lr.ph, %25, %.lr.ph53
  %31 = add nuw nsw i64 %.03852, 1
  %32 = mul i64 %31, %31
  %33 = mul i64 %32, %32
  %.not = icmp sgt i64 %33, %22
  br i1 %.not, label %.preheader, label %.lr.ph53, !llvm.loop !13

._crit_edge:                                      ; preds = %..loopexit_crit_edge, %.lr.ph60, %.preheader
  %34 = icmp eq i64 %.pre, 1
  %35 = select i1 %34, i64 2, i64 %.pre
  %.not4161 = icmp sgt i64 %35, %22
  br i1 %.not4161, label %._crit_edge65, label %.lr.ph64

.lr.ph60.split:                                   ; preds = %.lr.ph60, %..loopexit_crit_edge
  %.03658 = phi i64 [ %46, %..loopexit_crit_edge ], [ 2, %.lr.ph60 ]
  %36 = getelementptr inbounds i64, ptr %19, i64 %.03658
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %.not44 = icmp eq i64 %37, 0
  br i1 %.not44, label %..loopexit_crit_edge, label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph60.split, %45
  %.03555 = phi i64 [ %.1, %45 ], [ %.pre, %.lr.ph60.split ]
  %38 = icmp sgt i64 %.03555, %.03658
  br i1 %38, label %39, label %45

39:                                               ; preds = %.lr.ph56
  %40 = srem i64 %.03555, %.03658
  %41 = icmp eq i64 %40, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = sub nsw i64 %.03555, %.pre
  %44 = getelementptr inbounds [1000000 x i64], ptr %4, i64 0, i64 %43
  store i64 0, ptr %44, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %.lr.ph56, %39, %42
  %.036.pn = phi i64 [ %.03658, %42 ], [ 1, %39 ], [ 1, %.lr.ph56 ]
  %.1 = add nsw i64 %.036.pn, %.03555
  %.not45 = icmp sgt i64 %.1, %22
  br i1 %.not45, label %..loopexit_crit_edge, label %.lr.ph56, !llvm.loop !14

..loopexit_crit_edge:                             ; preds = %45, %.lr.ph60.split
  %46 = add nuw nsw i64 %.03658, 1
  %47 = mul nuw nsw i64 %46, %46
  %.not40 = icmp sgt i64 %47, %22
  br i1 %.not40, label %._crit_edge, label %.lr.ph60.split, !llvm.loop !15

._crit_edge65:                                    ; preds = %57, %._crit_edge
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %.not42 = icmp eq i32 %48, 0
  br i1 %.not42, label %62, label %60

.lr.ph64:                                         ; preds = %._crit_edge, %57
  %49 = phi i64 [ %58, %57 ], [ %22, %._crit_edge ]
  %.062 = phi i64 [ %59, %57 ], [ %35, %._crit_edge ]
  %50 = load i64, ptr %2, align 8, !tbaa !9
  %51 = sub nsw i64 %.062, %50
  %52 = getelementptr inbounds [1000000 x i64], ptr %4, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %.not43 = icmp eq i64 %53, 0
  br i1 %.not43, label %57, label %54

54:                                               ; preds = %.lr.ph64
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.062)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %.pre71 = load i64, ptr %3, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %.lr.ph64, %54
  %58 = phi i64 [ %49, %.lr.ph64 ], [ %.pre71, %54 ]
  %59 = add nsw i64 %.062, 1
  %.not41.not = icmp slt i64 %.062, %58
  br i1 %.not41.not, label %.lr.ph64, label %._crit_edge65, !llvm.loop !16

60:                                               ; preds = %._crit_edge65
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %62

62:                                               ; preds = %60, %._crit_edge65
  call void @llvm.stackrestore.p0(ptr %18)
  call void @llvm.lifetime.end.p0(i64 8000000, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %63 = add nuw nsw i32 %.03966, 1
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %11, label %._crit_edge69, !llvm.loop !17
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; 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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

; 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 #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; 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 #3 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 #3 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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #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 = { 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 #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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