; LLVM IR from Leet-Us-Code/DSA-A-Z-Practice :: Sid's Levels/Level - 1/DynamicProgramming (PaintManyHouse1)

; 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %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
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %20 = 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)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = zext i32 %22 to i64
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = call ptr @llvm.stacksave.p0()
  store ptr %26, ptr %4, align 8
  %27 = mul nuw i64 %23, %25
  %28 = alloca i32, i64 %27, align 16
  store i64 %23, ptr %5, align 8
  store i64 %25, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %53, %0
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %56

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %49, %34
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %52

40:                                               ; preds = %35
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %42, %25
  %44 = getelementptr inbounds i32, ptr %28, i64 %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  br label %49

49:                                               ; preds = %40
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %9, align 4, !tbaa !5
  br label %35, !llvm.loop !9

52:                                               ; preds = %39
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %7, align 4, !tbaa !5
  br label %29, !llvm.loop !11

56:                                               ; preds = %33
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = zext i32 %57 to i64
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = mul nuw i64 %58, %60
  %62 = alloca i32, i64 %61, align 16
  store i64 %58, ptr %10, align 8
  store i64 %60, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %80, %56
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %83

68:                                               ; preds = %63
  %69 = mul nsw i64 0, %25
  %70 = getelementptr inbounds i32, ptr %28, i64 %69
  %71 = load i32, ptr %12, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %70, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = mul nsw i64 0, %60
  %76 = getelementptr inbounds i32, ptr %62, i64 %75
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %76, i64 %78
  store i32 %74, ptr %79, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %68
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %12, align 4, !tbaa !5
  br label %63, !llvm.loop !12

83:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %154, %83
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %157

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %150, %89
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

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

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = mul nsw i64 %97, %25
  %99 = getelementptr inbounds i32, ptr %28, i64 %98
  %100 = load i32, ptr %14, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %99, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 2147483647, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %136, %95
  %105 = load i32, ptr %17, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %139

109:                                              ; preds = %104
  %110 = load i32, ptr %17, align 4, !tbaa !5
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = icmp ne i32 %110, %111
  br i1 %112, label %113, label %135

113:                                              ; preds = %109
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = mul nsw i64 %116, %60
  %118 = getelementptr inbounds i32, ptr %62, i64 %117
  %119 = load i32, ptr %17, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %16, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %135

125:                                              ; preds = %113
  %126 = load i32, ptr %13, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %128, %60
  %130 = getelementptr inbounds i32, ptr %62, i64 %129
  %131 = load i32, ptr %17, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  store i32 %134, ptr %16, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %125, %113, %109
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %17, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %17, align 4, !tbaa !5
  br label %104, !llvm.loop !13

139:                                              ; preds = %108
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = add nsw i32 %140, %141
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = mul nsw i64 %144, %60
  %146 = getelementptr inbounds i32, ptr %62, i64 %145
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %146, i64 %148
  store i32 %142, ptr %149, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %150

150:                                              ; preds = %139
  %151 = load i32, ptr %14, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %14, align 4, !tbaa !5
  br label %90, !llvm.loop !14

153:                                              ; preds = %94
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %13, align 4, !tbaa !5
  br label %84, !llvm.loop !15

157:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 2147483647, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %186, %157
  %159 = load i32, ptr %19, align 4, !tbaa !5
  %160 = load i32, ptr %3, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %158
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %189

163:                                              ; preds = %158
  %164 = load i32, ptr %2, align 4, !tbaa !5
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = mul nsw i64 %166, %60
  %168 = getelementptr inbounds i32, ptr %62, i64 %167
  %169 = load i32, ptr %19, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %175, label %185

175:                                              ; preds = %163
  %176 = load i32, ptr %2, align 4, !tbaa !5
  %177 = sub nsw i32 %176, 1
  %178 = sext i32 %177 to i64
  %179 = mul nsw i64 %178, %60
  %180 = getelementptr inbounds i32, ptr %62, i64 %179
  %181 = load i32, ptr %19, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %180, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  store i32 %184, ptr %18, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %175, %163
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %19, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %19, align 4, !tbaa !5
  br label %158, !llvm.loop !16

189:                                              ; preds = %162
  %190 = load i32, ptr %18, align 4, !tbaa !5
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %190)
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %193 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %193)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %194 = load i32, ptr %1, align 4
  ret i32 %194
}

; 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

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

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

; 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 = { 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 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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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

; 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) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = zext i32 %5 to i64
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = call ptr @llvm.stacksave.p0()
  %10 = mul nuw i64 %8, %6
  %11 = alloca i32, i64 %10, align 16
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  %.pre101 = load i32, ptr %2, align 4, !tbaa !5
  br i1 %13, label %.preheader51.lr.ph, label %._crit_edge54

.preheader51.lr.ph:                               ; preds = %0
  %14 = icmp sgt i32 %.pre101, 0
  br i1 %14, label %.preheader51, label %._crit_edge71

.preheader51:                                     ; preds = %.preheader51.lr.ph, %._crit_edge
  %15 = phi i32 [ %27, %._crit_edge ], [ %12, %.preheader51.lr.ph ]
  %16 = phi i32 [ %28, %._crit_edge ], [ %.pre101, %.preheader51.lr.ph ]
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %._crit_edge ], [ 0, %.preheader51.lr.ph ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader51
  %18 = mul nuw nsw i64 %indvars.iv77, %8
  %19 = getelementptr inbounds i32, ptr %11, i64 %18
  br label %31

._crit_edge54:                                    ; preds = %._crit_edge, %0
  %20 = phi i32 [ %.pre101, %0 ], [ %28, %._crit_edge ]
  %.lcssa = phi i32 [ %12, %0 ], [ %27, %._crit_edge ]
  %21 = zext i32 %.lcssa to i64
  %22 = zext i32 %20 to i64
  %23 = mul nuw i64 %22, %21
  %24 = alloca i32, i64 %23, align 16
  %25 = icmp sgt i32 %20, 0
  br i1 %25, label %.lr.ph57.preheader, label %.preheader50

.lr.ph57.preheader:                               ; preds = %._crit_edge54
  %26 = shl nuw nsw i64 %22, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %24, ptr nonnull align 16 %11, i64 %26, i1 false), !tbaa !5
  br label %.preheader50

._crit_edge.loopexit:                             ; preds = %31
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader51
  %27 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %15, %.preheader51 ]
  %28 = phi i32 [ %34, %._crit_edge.loopexit ], [ %16, %.preheader51 ]
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %29 = sext i32 %27 to i64
  %30 = icmp slt i64 %indvars.iv.next78, %29
  br i1 %30, label %.preheader51, label %._crit_edge54, !llvm.loop !9

31:                                               ; preds = %.lr.ph, %31
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %31 ]
  %32 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %31, label %._crit_edge.loopexit, !llvm.loop !12

.preheader50:                                     ; preds = %.lr.ph57.preheader, %._crit_edge54
  %37 = icmp sgt i32 %.lcssa, 1
  br i1 %37, label %.preheader49.lr.ph, label %.preheader

.preheader49.lr.ph:                               ; preds = %.preheader50
  br i1 %25, label %.preheader49.us.preheader, label %._crit_edge71

.preheader49.us.preheader:                        ; preds = %.preheader49.lr.ph
  %xtraiter = and i64 %22, 1
  %38 = icmp eq i32 %20, 1
  %unroll_iter = and i64 %22, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader49.us

.preheader49.us:                                  ; preds = %.preheader49.us.preheader, %._crit_edge66.split.us.us
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %._crit_edge66.split.us.us ], [ 1, %.preheader49.us.preheader ]
  %39 = mul nuw nsw i64 %indvars.iv91, %8
  %40 = getelementptr inbounds i32, ptr %11, i64 %39
  %41 = add nsw i64 %indvars.iv91, -1
  %42 = mul nuw nsw i64 %41, %22
  %43 = getelementptr inbounds i32, ptr %24, i64 %42
  %44 = mul nuw nsw i64 %indvars.iv91, %22
  %45 = getelementptr inbounds i32, ptr %24, i64 %44
  br label %.lr.ph61.us.us

.lr.ph61.us.us:                                   ; preds = %._crit_edge62.us.us, %.preheader49.us
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge62.us.us ], [ 0, %.preheader49.us ]
  %46 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv86
  %47 = load i32, ptr %46, align 4, !tbaa !5
  br i1 %38, label %._crit_edge62.us.us.unr-lcssa, label %.lr.ph61.us.us.new

.lr.ph61.us.us.new:                               ; preds = %.lr.ph61.us.us, %55
  %indvars.iv83 = phi i64 [ %indvars.iv.next84.1, %55 ], [ 0, %.lr.ph61.us.us ]
  %.03858.us.us = phi i32 [ %.139.us.us.1, %55 ], [ 2147483647, %.lr.ph61.us.us ]
  %niter = phi i64 [ %niter.next.1, %55 ], [ 0, %.lr.ph61.us.us ]
  %.not.us.us = icmp eq i64 %indvars.iv83, %indvars.iv86
  br i1 %.not.us.us, label %51, label %48

48:                                               ; preds = %.lr.ph61.us.us.new
  %49 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv83
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %spec.select.us.us = call i32 @llvm.smin.i32(i32 %50, i32 %.03858.us.us)
  br label %51

51:                                               ; preds = %48, %.lr.ph61.us.us.new
  %.139.us.us = phi i32 [ %.03858.us.us, %.lr.ph61.us.us.new ], [ %spec.select.us.us, %48 ]
  %indvars.iv.next84 = or disjoint i64 %indvars.iv83, 1
  %.not.us.us.1 = icmp eq i64 %indvars.iv.next84, %indvars.iv86
  br i1 %.not.us.us.1, label %55, label %52

52:                                               ; preds = %51
  %53 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv.next84
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %spec.select.us.us.1 = call i32 @llvm.smin.i32(i32 %54, i32 %.139.us.us)
  br label %55

55:                                               ; preds = %52, %51
  %.139.us.us.1 = phi i32 [ %.139.us.us, %51 ], [ %spec.select.us.us.1, %52 ]
  %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 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_edge62.us.us.unr-lcssa, label %.lr.ph61.us.us.new, !llvm.loop !13

._crit_edge62.us.us.unr-lcssa:                    ; preds = %55, %.lr.ph61.us.us
  %.139.us.us.lcssa.ph = phi i32 [ poison, %.lr.ph61.us.us ], [ %.139.us.us.1, %55 ]
  %indvars.iv83.unr = phi i64 [ 0, %.lr.ph61.us.us ], [ %indvars.iv.next84.1, %55 ]
  %.03858.us.us.unr = phi i32 [ 2147483647, %.lr.ph61.us.us ], [ %.139.us.us.1, %55 ]
  br i1 %lcmp.mod.not, label %._crit_edge62.us.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge62.us.us.unr-lcssa
  %.not.us.us.epil = icmp eq i64 %indvars.iv83.unr, %indvars.iv86
  br i1 %.not.us.us.epil, label %._crit_edge62.us.us, label %56

56:                                               ; preds = %.epil.preheader
  %57 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv83.unr
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %spec.select.us.us.epil = call i32 @llvm.smin.i32(i32 %58, i32 %.03858.us.us.unr)
  br label %._crit_edge62.us.us

._crit_edge62.us.us:                              ; preds = %.epil.preheader, %56, %._crit_edge62.us.us.unr-lcssa
  %.139.us.us.lcssa = phi i32 [ %.139.us.us.lcssa.ph, %._crit_edge62.us.us.unr-lcssa ], [ %.03858.us.us.unr, %.epil.preheader ], [ %spec.select.us.us.epil, %56 ]
  %59 = add nsw i32 %.139.us.us.lcssa, %47
  %60 = getelementptr inbounds i32, ptr %45, i64 %indvars.iv86
  store i32 %59, ptr %60, align 4, !tbaa !5
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next87, %22
  br i1 %exitcond90.not, label %._crit_edge66.split.us.us, label %.lr.ph61.us.us, !llvm.loop !14

._crit_edge66.split.us.us:                        ; preds = %._crit_edge62.us.us
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next92, %21
  br i1 %exitcond95.not, label %.preheader, label %.preheader49.us, !llvm.loop !15

.preheader:                                       ; preds = %._crit_edge66.split.us.us, %.preheader50
  br i1 %25, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %.preheader
  %61 = add nsw i32 %.lcssa, -1
  %62 = sext i32 %61 to i64
  %63 = mul nsw i64 %22, %62
  %64 = getelementptr inbounds i32, ptr %24, i64 %63
  %min.iters.check = icmp ult i32 %20, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph70
  %indvars.iv96.ph = phi i64 [ 0, %.lr.ph70 ], [ %n.vec, %middle.block ]
  %.03668.ph = phi i32 [ 2147483647, %.lr.ph70 ], [ %70, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph70
  %n.vec = and i64 %22, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %67, %vector.body ]
  %vec.phi118 = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %68, %vector.body ]
  %65 = getelementptr inbounds i32, ptr %64, i64 %index
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  %wide.load = load <4 x i32>, ptr %65, align 4, !tbaa !5
  %wide.load119 = load <4 x i32>, ptr %66, align 4, !tbaa !5
  %67 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %68 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load119, <4 x i32> %vec.phi118)
  %index.next = add nuw i64 %index, 8
  %69 = icmp eq i64 %index.next, %n.vec
  br i1 %69, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %67, <4 x i32> %68)
  %70 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
  %cmp.n = icmp eq i64 %n.vec, %22
  br i1 %cmp.n, label %._crit_edge71, label %scalar.ph.preheader

._crit_edge71:                                    ; preds = %scalar.ph, %middle.block, %.preheader51.lr.ph, %.preheader49.lr.ph, %.preheader
  %.036.lcssa = phi i32 [ 2147483647, %.preheader ], [ 2147483647, %.preheader49.lr.ph ], [ 2147483647, %.preheader51.lr.ph ], [ %70, %middle.block ], [ %spec.select48, %scalar.ph ]
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.036.lcssa)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %scalar.ph ], [ %indvars.iv96.ph, %scalar.ph.preheader ]
  %.03668 = phi i32 [ %spec.select48, %scalar.ph ], [ %.03668.ph, %scalar.ph.preheader ]
  %73 = getelementptr inbounds i32, ptr %64, i64 %indvars.iv96
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %spec.select48 = call i32 @llvm.smin.i32(i32 %74, i32 %.03668)
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %22
  br i1 %exitcond100.not, label %._crit_edge71, label %scalar.ph, !llvm.loop !19
}

; 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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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 #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)) #5

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #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 nocallback nofree nosync nounwind willreturn }
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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !10, !18, !17}


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