; LLVM IR from hanzohasashi33/Competetive_programming :: Geeks4Geeks/Array (Pythagorean_Triplets(not opt))

; 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
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %12 = 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)
  br label %13

13:                                               ; preds = %170, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %2, align 4, !tbaa !5
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %172

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = call ptr @llvm.stacksave.p0()
  store ptr %21, ptr %4, align 8
  %22 = alloca i32, i64 %20, align 16
  store i64 %20, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %33, %17
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %36

28:                                               ; preds = %23
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr %22, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %31)
  br label %33

33:                                               ; preds = %28
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %7, align 4, !tbaa !5
  br label %23, !llvm.loop !9

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %161, %36
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %164

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %10, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %157, %42
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %160

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %11, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %152, %50
  %54 = load i32, ptr %11, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 13, ptr %9, align 4
  br label %155

58:                                               ; preds = %53
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %22, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %22, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = mul nsw i32 %62, %66
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %22, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %22, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = mul nsw i32 %71, %75
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %22, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %22, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = mul nsw i32 %80, %84
  %86 = add nsw i32 %76, %85
  %87 = icmp eq i32 %67, %86
  br i1 %87, label %148, label %88

88:                                               ; preds = %58
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %22, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr %22, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = mul nsw i32 %92, %96
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %22, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %22, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = mul nsw i32 %101, %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %22, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %22, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = mul nsw i32 %110, %114
  %116 = add nsw i32 %106, %115
  %117 = icmp eq i32 %97, %116
  br i1 %117, label %148, label %118

118:                                              ; preds = %88
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %22, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i32, ptr %22, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = mul nsw i32 %122, %126
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %22, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %22, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = mul nsw i32 %131, %135
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %22, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %22, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = mul nsw i32 %140, %144
  %146 = add nsw i32 %136, %145
  %147 = icmp eq i32 %127, %146
  br i1 %147, label %148, label %151

148:                                              ; preds = %118, %88, %58
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 1, ptr %6, align 4, !tbaa !5
  store i32 13, ptr %9, align 4
  br label %155

151:                                              ; preds = %118
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %11, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %11, align 4, !tbaa !5
  br label %53, !llvm.loop !11

155:                                              ; preds = %148, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %10, align 4, !tbaa !5
  br label %45, !llvm.loop !12

160:                                              ; preds = %49
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %8, align 4, !tbaa !5
  br label %37, !llvm.loop !13

164:                                              ; preds = %41
  %165 = load i32, ptr %6, align 4, !tbaa !5
  %166 = icmp eq i32 %165, 0
  br i1 %166, label %167, label %170

167:                                              ; preds = %164
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %168, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %170

170:                                              ; preds = %167, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %171 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %171)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %13, !llvm.loop !14

172:                                              ; preds = %13
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %173 = load i32, ptr %1, align 4
  ret i32 %173
}

; 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: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

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 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 #6 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; 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
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %3 = 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)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr %1, align 4, !tbaa !5
  %.not51 = icmp eq i32 %4, 0
  br i1 %.not51, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %0, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %6 = 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)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = call ptr @llvm.stacksave.p0()
  %10 = alloca i32, i64 %8, align 16
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %13 = icmp sgt i32 %16, 0
  br i1 %13, label %.lr.ph49, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.lr.ph53, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph53 ]
  %14 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %.preheader, !llvm.loop !9

.loopexit40.loopexit:                             ; preds = %.loopexit
  %.pre71 = sext i32 %52 to i64
  br label %.loopexit40

.loopexit40:                                      ; preds = %.loopexit40.loopexit, %.lr.ph49
  %.pre-phi = phi i64 [ %.pre71, %.loopexit40.loopexit ], [ %23, %.lr.ph49 ]
  %19 = phi i32 [ %52, %.loopexit40.loopexit ], [ %22, %.lr.ph49 ]
  %.1.lcssa = phi i32 [ %.2, %.loopexit40.loopexit ], [ %.03447, %.lr.ph49 ]
  %20 = icmp slt i64 %indvars.iv.next69, %.pre-phi
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  br i1 %20, label %.lr.ph49, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.loopexit40
  %21 = icmp eq i32 %.1.lcssa, 0
  br i1 %21, label %._crit_edge.thread, label %57

.lr.ph49:                                         ; preds = %.preheader, %.loopexit40
  %22 = phi i32 [ %19, %.loopexit40 ], [ %16, %.preheader ]
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.loopexit40 ], [ 0, %.preheader ]
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.loopexit40 ], [ 1, %.preheader ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.loopexit40 ], [ 2, %.preheader ]
  %.03447 = phi i32 [ %.1.lcssa, %.loopexit40 ], [ 0, %.preheader ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next69, %23
  br i1 %24, label %.lr.ph46, label %.loopexit40

.lr.ph46:                                         ; preds = %.lr.ph49
  %25 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv68
  br label %26

26:                                               ; preds = %.lr.ph46, %.loopexit
  %27 = phi i32 [ %22, %.lr.ph46 ], [ %52, %.loopexit ]
  %28 = phi i32 [ %22, %.lr.ph46 ], [ %53, %.loopexit ]
  %indvars.iv65 = phi i64 [ %indvars.iv63, %.lr.ph46 ], [ %indvars.iv.next66, %.loopexit ]
  %indvars.iv58 = phi i64 [ %indvars.iv56, %.lr.ph46 ], [ %indvars.iv.next59, %.loopexit ]
  %.144 = phi i32 [ %.03447, %.lr.ph46 ], [ %.2, %.loopexit ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %29 = trunc nuw i64 %indvars.iv.next66 to i32
  %30 = icmp sgt i32 %28, %29
  br i1 %30, label %.lr.ph43, label %.loopexit

.lr.ph43:                                         ; preds = %26
  %31 = load i32, ptr %25, align 4, !tbaa !5
  %32 = mul nsw i32 %31, %31
  %33 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv65
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = mul nsw i32 %34, %34
  %36 = add nuw nsw i32 %35, %32
  br label %40

37:                                               ; preds = %40
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %38 = trunc nuw i64 %indvars.iv.next61 to i32
  %39 = icmp sgt i32 %28, %38
  br i1 %39, label %40, label %.loopexit, !llvm.loop !12

40:                                               ; preds = %.lr.ph43, %37
  %indvars.iv60 = phi i64 [ %indvars.iv58, %.lr.ph43 ], [ %indvars.iv.next61, %37 ]
  %41 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv60
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = mul nsw i32 %42, %42
  %44 = add nuw nsw i32 %43, %35
  %45 = icmp eq i32 %32, %44
  %46 = add nuw nsw i32 %43, %32
  %47 = icmp eq i32 %35, %46
  %or.cond = select i1 %45, i1 true, i1 %47
  %48 = icmp eq i32 %43, %36
  %or.cond39 = select i1 %or.cond, i1 true, i1 %48
  br i1 %or.cond39, label %49, label %37

49:                                               ; preds = %40
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %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_)
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %37, %26, %49
  %52 = phi i32 [ %.pre, %49 ], [ %27, %26 ], [ %27, %37 ]
  %53 = phi i32 [ %.pre, %49 ], [ %28, %26 ], [ %28, %37 ]
  %.2 = phi i32 [ 1, %49 ], [ %.144, %26 ], [ %.144, %37 ]
  %54 = icmp sgt i32 %53, %29
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  br i1 %54, label %26, label %.loopexit40.loopexit, !llvm.loop !13

._crit_edge.thread:                               ; preds = %.lr.ph53, %.preheader, %._crit_edge
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %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_)
  br label %57

57:                                               ; preds = %._crit_edge.thread, %._crit_edge
  call void @llvm.stackrestore.p0(ptr %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %58, 0
  br i1 %.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !14

._crit_edge54:                                    ; preds = %57, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

; 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 nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

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 nocallback nofree nosync nounwind willreturn }
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 = { 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 #6 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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