; LLVM IR from imteekay/algorithms :: competitive-programming/uri (lucro)

; 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 nounwind uwtable
declare dso_local noundef i32 @_Z3maxii(i32 noundef, i32 noundef) #0

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

18:                                               ; preds = %199, %0
  %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)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr %20, i64 %23
  %25 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %24)
  br i1 %25, label %26, label %204

26:                                               ; preds = %18
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = add nsw i32 %27, 1
  %29 = zext i32 %28 to i64
  %30 = call ptr @llvm.stacksave.p0()
  store ptr %30, ptr %5, align 8
  %31 = alloca i32, i64 %29, align 16
  store i64 %29, ptr %6, align 8
  %32 = getelementptr inbounds i32, ptr %31, i64 0
  store i32 0, ptr %32, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %33

33:                                               ; preds = %44, %26
  %34 = load i32, ptr %7, align 4, !tbaa !8
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %47

38:                                               ; preds = %33
  %39 = 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)
  %40 = load i32, ptr %3, align 4, !tbaa !8
  %41 = load i32, ptr %7, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %31, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %38
  %45 = load i32, ptr %7, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !8
  br label %33, !llvm.loop !11

47:                                               ; preds = %37
  %48 = load i32, ptr %2, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  %50 = zext i32 %49 to i64
  %51 = load i32, ptr %2, align 4, !tbaa !8
  %52 = add nsw i32 %51, 1
  %53 = zext i32 %52 to i64
  %54 = mul nuw i64 %50, %53
  %55 = alloca i32, i64 %54, align 16
  store i64 %50, ptr %8, align 8
  store i64 %53, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %103, %47
  %57 = load i32, ptr %10, align 4, !tbaa !8
  %58 = load i32, ptr %2, align 4, !tbaa !8
  %59 = add nsw i32 %58, 1
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 7, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %106

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %63

63:                                               ; preds = %99, %62
  %64 = load i32, ptr %12, align 4, !tbaa !8
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = add nsw i32 %65, 1
  %67 = icmp slt i32 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %102

69:                                               ; preds = %63
  %70 = load i32, ptr %10, align 4, !tbaa !8
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %90

72:                                               ; preds = %69
  %73 = load i32, ptr %10, align 4, !tbaa !8
  %74 = load i32, ptr %12, align 4, !tbaa !8
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %90

76:                                               ; preds = %72
  %77 = load i32, ptr %10, align 4, !tbaa !8
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %31, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = load i32, ptr %4, align 4, !tbaa !8
  %82 = sub nsw i32 %80, %81
  %83 = load i32, ptr %10, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = mul nsw i64 %84, %53
  %86 = getelementptr inbounds i32, ptr %55, i64 %85
  %87 = load i32, ptr %12, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  store i32 %82, ptr %89, align 4, !tbaa !8
  br label %98

90:                                               ; preds = %72, %69
  %91 = load i32, ptr %10, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = mul nsw i64 %92, %53
  %94 = getelementptr inbounds i32, ptr %55, i64 %93
  %95 = load i32, ptr %12, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  store i32 0, ptr %97, align 4, !tbaa !8
  br label %98

98:                                               ; preds = %90, %76
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %12, align 4, !tbaa !8
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %12, align 4, !tbaa !8
  br label %63, !llvm.loop !13

102:                                              ; preds = %68
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %10, align 4, !tbaa !8
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %10, align 4, !tbaa !8
  br label %56, !llvm.loop !14

106:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !8
  br label %107

107:                                              ; preds = %163, %106
  %108 = load i32, ptr %13, align 4, !tbaa !8
  %109 = load i32, ptr %2, align 4, !tbaa !8
  %110 = add nsw i32 %109, 1
  %111 = icmp slt i32 %108, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i32 13, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %166

113:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %114 = load i32, ptr %13, align 4, !tbaa !8
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %14, align 4, !tbaa !8
  br label %116

116:                                              ; preds = %159, %113
  %117 = load i32, ptr %14, align 4, !tbaa !8
  %118 = load i32, ptr %2, align 4, !tbaa !8
  %119 = add nsw i32 %118, 1
  %120 = icmp slt i32 %117, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %116
  store i32 16, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %162

122:                                              ; preds = %116
  %123 = load i32, ptr %13, align 4, !tbaa !8
  %124 = sext i32 %123 to i64
  %125 = mul nsw i64 %124, %53
  %126 = getelementptr inbounds i32, ptr %55, i64 %125
  %127 = load i32, ptr %14, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %126, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !8
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %158

132:                                              ; preds = %122
  %133 = load i32, ptr %13, align 4, !tbaa !8
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %134, %53
  %136 = getelementptr inbounds i32, ptr %55, i64 %135
  %137 = load i32, ptr %14, align 4, !tbaa !8
  %138 = sub nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i32, ptr %136, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !8
  %142 = load i32, ptr %14, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = mul nsw i64 %143, %53
  %145 = getelementptr inbounds i32, ptr %55, i64 %144
  %146 = load i32, ptr %14, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr %145, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = add nsw i32 %141, %149
  %151 = load i32, ptr %13, align 4, !tbaa !8
  %152 = sext i32 %151 to i64
  %153 = mul nsw i64 %152, %53
  %154 = getelementptr inbounds i32, ptr %55, i64 %153
  %155 = load i32, ptr %14, align 4, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr %154, i64 %156
  store i32 %150, ptr %157, align 4, !tbaa !8
  br label %158

158:                                              ; preds = %132, %122
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %14, align 4, !tbaa !8
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %14, align 4, !tbaa !8
  br label %116, !llvm.loop !15

162:                                              ; preds = %121
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %13, align 4, !tbaa !8
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %13, align 4, !tbaa !8
  br label %107, !llvm.loop !16

166:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !8
  br label %167

167:                                              ; preds = %196, %166
  %168 = load i32, ptr %16, align 4, !tbaa !8
  %169 = load i32, ptr %2, align 4, !tbaa !8
  %170 = add nsw i32 %169, 1
  %171 = icmp slt i32 %168, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %167
  store i32 19, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %199

173:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %174 = load i32, ptr %16, align 4, !tbaa !8
  store i32 %174, ptr %17, align 4, !tbaa !8
  br label %175

175:                                              ; preds = %192, %173
  %176 = load i32, ptr %17, align 4, !tbaa !8
  %177 = load i32, ptr %2, align 4, !tbaa !8
  %178 = add nsw i32 %177, 1
  %179 = icmp slt i32 %176, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %175
  store i32 22, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %195

181:                                              ; preds = %175
  %182 = load i32, ptr %16, align 4, !tbaa !8
  %183 = sext i32 %182 to i64
  %184 = mul nsw i64 %183, %53
  %185 = getelementptr inbounds i32, ptr %55, i64 %184
  %186 = load i32, ptr %17, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds i32, ptr %185, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !8
  %190 = load i32, ptr %15, align 4, !tbaa !8
  %191 = call noundef i32 @_Z3maxii(i32 noundef %189, i32 noundef %190)
  store i32 %191, ptr %15, align 4, !tbaa !8
  br label %192

192:                                              ; preds = %181
  %193 = load i32, ptr %17, align 4, !tbaa !8
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %17, align 4, !tbaa !8
  br label %175, !llvm.loop !17

195:                                              ; preds = %180
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %16, align 4, !tbaa !8
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %16, align 4, !tbaa !8
  br label %167, !llvm.loop !18

199:                                              ; preds = %172
  %200 = load i32, ptr %15, align 4, !tbaa !8
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %200)
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  %203 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %203)
  br label %18, !llvm.loop !19

204:                                              ; preds = %18
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %205 = load i32, ptr %1, align 4
  ret i32 %205
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #4 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !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}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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 nounwind uwtable
declare dso_local noundef i32 @_Z3maxii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %4 = 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)
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr %5, i64 %8
  %10 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %9)
  br i1 %10, label %.lr.ph84, label %._crit_edge85

.lr.ph84:                                         ; preds = %0, %._crit_edge81
  %11 = load i32, ptr %1, align 4, !tbaa !8
  %12 = add nsw i32 %11, 1
  %13 = zext i32 %12 to i64
  %14 = call ptr @llvm.stacksave.p0()
  %15 = alloca i32, i64 %13, align 16
  store i32 0, ptr %15, align 16, !tbaa !8
  %16 = load i32, ptr %1, align 4, !tbaa !8
  %.not56 = icmp slt i32 %16, 1
  br i1 %.not56, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph84
  %17 = phi i32 [ %16, %.lr.ph84 ], [ %28, %.lr.ph ]
  %18 = add i32 %17, 1
  %19 = zext i32 %18 to i64
  %20 = mul nuw i64 %19, %19
  %21 = alloca i32, i64 %20, align 16
  %.not4662 = icmp slt i32 %17, 0
  br i1 %.not4662, label %._crit_edge81, label %.preheader53.lr.ph

.preheader53.lr.ph:                               ; preds = %._crit_edge
  %22 = load i32, ptr %3, align 4
  %23 = shl nuw nsw i64 %19, 2
  %smax = call i32 @llvm.smax.i32(i32 %18, i32 1)
  %wide.trip.count97 = zext nneg i32 %smax to i64
  %xtraiter = and i64 %19, 1
  %24 = icmp eq i32 %17, 0
  %unroll_iter = and i64 %19, 4294967294
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader53

.lr.ph:                                           ; preds = %.lr.ph84, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph84 ]
  %25 = 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)
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv
  store i32 %26, ptr %27, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %1, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %.not.not = icmp slt i64 %indvars.iv, %29
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader55:                                     ; preds = %._crit_edge61
  %.not4769 = icmp eq i32 %17, 0
  br i1 %.not4769, label %._crit_edge81, label %.lr.ph71.preheader

.lr.ph71.preheader:                               ; preds = %.preheader55
  %30 = zext nneg i32 %17 to i64
  %31 = add nsw i32 %17, -2
  br label %.lr.ph71

.preheader53:                                     ; preds = %.preheader53.lr.ph, %._crit_edge61
  %indvar = phi i64 [ 0, %.preheader53.lr.ph ], [ %indvar.next, %._crit_edge61 ]
  %.not52.not = icmp eq i64 %indvar, 0
  %32 = mul nuw nsw i64 %indvar, %19
  %33 = getelementptr inbounds i32, ptr %21, i64 %32
  %34 = getelementptr inbounds i32, ptr %15, i64 %indvar
  br i1 %.not52.not, label %.lr.ph60.split.us.preheader, label %.lr.ph60.split.preheader

.lr.ph60.split.preheader:                         ; preds = %.preheader53
  %35 = getelementptr inbounds i32, ptr %33, i64 %indvar
  br i1 %24, label %._crit_edge61.loopexit.unr-lcssa, label %.lr.ph60.split

.lr.ph60.split.us.preheader:                      ; preds = %.preheader53
  %36 = mul nuw nsw i64 %23, %indvar
  %scevgep = getelementptr i8, ptr %21, i64 %36
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %23, i1 false), !tbaa !8
  br label %._crit_edge61

._crit_edge61.loopexit.unr-lcssa:                 ; preds = %55, %.lr.ph60.split.preheader
  %indvars.iv90.unr = phi i64 [ 0, %.lr.ph60.split.preheader ], [ %indvars.iv.next91.1, %55 ]
  br i1 %lcmp.mod.not, label %._crit_edge61, label %.lr.ph60.split.epil

.lr.ph60.split.epil:                              ; preds = %._crit_edge61.loopexit.unr-lcssa
  %37 = icmp eq i64 %indvar, %indvars.iv90.unr
  br i1 %37, label %40, label %38

38:                                               ; preds = %.lr.ph60.split.epil
  %39 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv90.unr
  store i32 0, ptr %39, align 4, !tbaa !8
  br label %._crit_edge61

40:                                               ; preds = %.lr.ph60.split.epil
  %41 = load i32, ptr %34, align 4, !tbaa !8
  %42 = sub nsw i32 %41, %22
  store i32 %42, ptr %35, align 4, !tbaa !8
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit.unr-lcssa, %40, %38, %.lr.ph60.split.us.preheader
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond98 = icmp eq i64 %indvar.next, %wide.trip.count97
  br i1 %exitcond98, label %.preheader55, label %.preheader53, !llvm.loop !13

.lr.ph60.split:                                   ; preds = %.lr.ph60.split.preheader, %55
  %indvars.iv90 = phi i64 [ %indvars.iv.next91.1, %55 ], [ 0, %.lr.ph60.split.preheader ]
  %niter = phi i64 [ %niter.next.1, %55 ], [ 0, %.lr.ph60.split.preheader ]
  %43 = icmp eq i64 %indvar, %indvars.iv90
  br i1 %43, label %44, label %47

44:                                               ; preds = %.lr.ph60.split
  %45 = load i32, ptr %34, align 4, !tbaa !8
  %46 = sub nsw i32 %45, %22
  store i32 %46, ptr %35, align 4, !tbaa !8
  br label %.lr.ph60.split.1

47:                                               ; preds = %.lr.ph60.split
  %48 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv90
  store i32 0, ptr %48, align 4, !tbaa !8
  br label %.lr.ph60.split.1

.lr.ph60.split.1:                                 ; preds = %44, %47
  %indvars.iv.next91 = or disjoint i64 %indvars.iv90, 1
  %49 = icmp eq i64 %indvar, %indvars.iv.next91
  br i1 %49, label %52, label %50

50:                                               ; preds = %.lr.ph60.split.1
  %51 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv.next91
  store i32 0, ptr %51, align 4, !tbaa !8
  br label %55

52:                                               ; preds = %.lr.ph60.split.1
  %53 = load i32, ptr %34, align 4, !tbaa !8
  %54 = sub nsw i32 %53, %22
  store i32 %54, ptr %35, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %52, %50
  %indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge61.loopexit.unr-lcssa, label %.lr.ph60.split, !llvm.loop !14

.loopexit:                                        ; preds = %.prol.loopexit, %95, %.lr.ph71
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next106, %19
  %indvar.next129 = add i32 %indvar128, 1
  br i1 %exitcond109.not, label %.preheader54, label %.lr.ph71, !llvm.loop !15

.preheader54:                                     ; preds = %.loopexit
  br i1 %.not4769, label %._crit_edge81, label %.preheader

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %.loopexit
  %indvar128 = phi i32 [ 0, %.lr.ph71.preheader ], [ %indvar.next129, %.loopexit ]
  %indvars.iv105 = phi i64 [ 1, %.lr.ph71.preheader ], [ %indvars.iv.next106, %.loopexit ]
  %indvars.iv99 = phi i64 [ 2, %.lr.ph71.preheader ], [ %indvars.iv.next100, %.loopexit ]
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %.not5065.not = icmp ult i64 %indvars.iv105, %30
  br i1 %.not5065.not, label %.lr.ph68, label %.loopexit

.lr.ph68:                                         ; preds = %.lr.ph71
  %56 = mul nuw nsw i64 %indvars.iv105, %19
  %57 = getelementptr inbounds i32, ptr %21, i64 %56
  %58 = sub i32 %indvar128, %17
  %59 = and i32 %58, 1
  %lcmp.mod131.not.not = icmp eq i32 %59, 0
  br i1 %lcmp.mod131.not.not, label %.prol.preheader, label %.prol.loopexit

.prol.preheader:                                  ; preds = %.lr.ph68
  %60 = getelementptr inbounds i32, ptr %57, i64 %indvars.iv99
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %.prol.loopexit.unr-lcssa

63:                                               ; preds = %.prol.preheader
  %64 = getelementptr i8, ptr %60, i64 -4
  %65 = load i32, ptr %64, align 4, !tbaa !8
  %66 = mul nuw nsw i64 %indvars.iv99, %19
  %67 = getelementptr inbounds i32, ptr %21, i64 %66
  %68 = getelementptr inbounds i32, ptr %67, i64 %indvars.iv99
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = add nsw i32 %69, %65
  store i32 %70, ptr %60, align 4, !tbaa !8
  br label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %63, %.prol.preheader
  %indvars.iv.next102.prol = add nuw nsw i64 %indvars.iv99, 1
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph68
  %indvars.iv101.unr = phi i64 [ %indvars.iv99, %.lr.ph68 ], [ %indvars.iv.next102.prol, %.prol.loopexit.unr-lcssa ]
  %71 = icmp eq i32 %31, %indvar128
  br i1 %71, label %.loopexit, label %.lr.ph68.new

.lr.ph68.new:                                     ; preds = %.prol.loopexit, %95
  %indvars.iv101 = phi i64 [ %indvars.iv.next102.1, %95 ], [ %indvars.iv101.unr, %.prol.loopexit ]
  %72 = getelementptr inbounds i32, ptr %57, i64 %indvars.iv101
  %73 = load i32, ptr %72, align 4, !tbaa !8
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %83

75:                                               ; preds = %.lr.ph68.new
  %76 = getelementptr i8, ptr %72, i64 -4
  %77 = load i32, ptr %76, align 4, !tbaa !8
  %78 = mul nuw nsw i64 %indvars.iv101, %19
  %79 = getelementptr inbounds i32, ptr %21, i64 %78
  %80 = getelementptr inbounds i32, ptr %79, i64 %indvars.iv101
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = add nsw i32 %81, %77
  store i32 %82, ptr %72, align 4, !tbaa !8
  br label %83

83:                                               ; preds = %.lr.ph68.new, %75
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %84 = getelementptr inbounds i32, ptr %57, i64 %indvars.iv.next102
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %95

87:                                               ; preds = %83
  %88 = getelementptr i8, ptr %84, i64 -4
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = mul nuw nsw i64 %indvars.iv.next102, %19
  %91 = getelementptr inbounds i32, ptr %21, i64 %90
  %92 = getelementptr inbounds i32, ptr %91, i64 %indvars.iv.next102
  %93 = load i32, ptr %92, align 4, !tbaa !8
  %94 = add nsw i32 %93, %89
  store i32 %94, ptr %84, align 4, !tbaa !8
  br label %95

95:                                               ; preds = %87, %83
  %indvars.iv.next102.1 = add nuw nsw i64 %indvars.iv101, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next102.1 to i32
  %exitcond104.not.1 = icmp eq i32 %18, %lftr.wideiv.1
  br i1 %exitcond104.not.1, label %.loopexit, label %.lr.ph68.new, !llvm.loop !16

.preheader:                                       ; preds = %.preheader54, %._crit_edge76
  %96 = phi i32 [ %109, %._crit_edge76 ], [ %17, %.preheader54 ]
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %._crit_edge76 ], [ 1, %.preheader54 ]
  %.03979 = phi i32 [ %.1.lcssa, %._crit_edge76 ], [ 0, %.preheader54 ]
  %97 = sext i32 %96 to i64
  %.not4972 = icmp sgt i64 %indvars.iv110, %97
  br i1 %.not4972, label %._crit_edge76, label %.lr.ph75

.lr.ph75:                                         ; preds = %.preheader
  %98 = mul nuw nsw i64 %indvars.iv110, %19
  %99 = getelementptr inbounds i32, ptr %21, i64 %98
  br label %110

._crit_edge81:                                    ; preds = %._crit_edge76, %._crit_edge, %.preheader55, %.preheader54
  %.039.lcssa = phi i32 [ 0, %.preheader54 ], [ 0, %.preheader55 ], [ 0, %._crit_edge ], [ %.1.lcssa, %._crit_edge76 ]
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.039.lcssa)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %14)
  %102 = 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)
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %102, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = getelementptr i8, ptr %104, i64 -24
  %106 = load i64, ptr %105, align 8
  %107 = getelementptr inbounds i8, ptr %103, i64 %106
  %108 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %107)
  br i1 %108, label %.lr.ph84, label %._crit_edge85, !llvm.loop !17

._crit_edge76:                                    ; preds = %110, %.preheader
  %.pre-phi = phi i64 [ %97, %.preheader ], [ %115, %110 ]
  %109 = phi i32 [ %96, %.preheader ], [ %114, %110 ]
  %.1.lcssa = phi i32 [ %.03979, %.preheader ], [ %113, %110 ]
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %.not48.not = icmp slt i64 %indvars.iv110, %.pre-phi
  br i1 %.not48.not, label %.preheader, label %._crit_edge81, !llvm.loop !18

110:                                              ; preds = %.lr.ph75, %110
  %indvars.iv112 = phi i64 [ %indvars.iv110, %.lr.ph75 ], [ %indvars.iv.next113, %110 ]
  %.173 = phi i32 [ %.03979, %.lr.ph75 ], [ %113, %110 ]
  %111 = getelementptr inbounds i32, ptr %99, i64 %indvars.iv112
  %112 = load i32, ptr %111, align 4, !tbaa !8
  %113 = call noundef i32 @_Z3maxii(i32 noundef %112, i32 noundef %.173)
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %114 = load i32, ptr %1, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %.not49.not = icmp slt i64 %indvars.iv112, %115
  br i1 %.not49.not, label %110, label %._crit_edge76, !llvm.loop !19

._crit_edge85:                                    ; preds = %._crit_edge81, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #4 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; 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 #4 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)) #6

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !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}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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