; LLVM IR from manishbisht/Competitive-Programming :: Algorithms/Dynamic Programming (Coin Change Problem)

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

@arr = external dso_local global [5 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 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 ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %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)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, 1
  %15 = zext i32 %14 to i64
  %16 = call ptr @llvm.stacksave.p0()
  store ptr %16, ptr %3, align 8
  %17 = mul nuw i64 6, %15
  %18 = alloca i32, i64 %17, align 16
  store i64 %15, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %31, %0
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %34

25:                                               ; preds = %19
  %26 = mul nsw i64 0, %15
  %27 = getelementptr inbounds i32, ptr %18, i64 %26
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %27, i64 %29
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %25
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %5, align 4, !tbaa !5
  br label %19, !llvm.loop !9

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

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

38:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %48

39:                                               ; preds = %35
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = mul nsw i64 %41, %15
  %43 = getelementptr inbounds i32, ptr %18, i64 %42
  %44 = getelementptr inbounds i32, ptr %43, i64 0
  store i32 1, ptr %44, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %39
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !5
  br label %35, !llvm.loop !11

48:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %123, %48
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 4
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %119, %53
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %122

60:                                               ; preds = %54
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [5 x i32], ptr @arr, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sub nsw i32 %61, %66
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %69, label %86

69:                                               ; preds = %60
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %72, %15
  %74 = getelementptr inbounds i32, ptr %18, i64 %73
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %74, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %80, %15
  %82 = getelementptr inbounds i32, ptr %18, i64 %81
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  store i32 %78, ptr %85, align 4, !tbaa !5
  br label %118

86:                                               ; preds = %60
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = mul nsw i64 %89, %15
  %91 = getelementptr inbounds i32, ptr %18, i64 %90
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %91, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = mul nsw i64 %97, %15
  %99 = getelementptr inbounds i32, ptr %18, i64 %98
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [5 x i32], ptr @arr, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sub nsw i32 %100, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %99, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = add nsw i32 %95, %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %112, %15
  %114 = getelementptr inbounds i32, ptr %18, i64 %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i32, ptr %114, i64 %116
  store i32 %110, ptr %117, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %86, %69
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !5
  br label %54, !llvm.loop !12

122:                                              ; preds = %59
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %7, align 4, !tbaa !5
  br label %49, !llvm.loop !13

126:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %154, %126
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = icmp slt i32 %128, 4
  br i1 %129, label %131, label %130

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

131:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %149, %131
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = icmp slt i32 %133, %135
  br i1 %136, label %138, label %137

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

138:                                              ; preds = %132
  %139 = load i32, ptr %10, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = mul nsw i64 %140, %15
  %142 = getelementptr inbounds i32, ptr %18, i64 %141
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %146)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @.str)
  br label %149

149:                                              ; preds = %138
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %11, align 4, !tbaa !5
  br label %132, !llvm.loop !14

152:                                              ; preds = %137
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %154

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

157:                                              ; preds = %130
  %158 = 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)
  %159 = mul nsw i64 3, %15
  %160 = getelementptr inbounds i32, ptr %18, i64 %159
  %161 = load i32, ptr %2, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %160, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %158, i32 noundef %164)
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %165, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  %167 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %167)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %168 = load i32, ptr %1, align 4
  ret i32 %168
}

; 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

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) #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}
!15 = distinct !{!15, !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" }

@arr = external dso_local local_unnamed_addr global [5 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %2 = 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)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = add nsw i32 %3, 1
  %5 = zext i32 %4 to i64
  %6 = call ptr @llvm.stacksave.p0()
  %7 = mul nuw nsw i64 %5, 6
  %8 = alloca i32, i64 %7, align 16
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %.not42 = icmp slt i32 %9, 0
  br i1 %.not42, label %.preheader41, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %10 = add nuw i32 %9, 1
  %11 = zext i32 %10 to i64
  %12 = shl nuw nsw i64 %11, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %8, i8 0, i64 %12, i1 false), !tbaa !5
  br label %.preheader41

.preheader41:                                     ; preds = %.lr.ph.preheader, %0
  store i32 1, ptr %8, align 16, !tbaa !5
  %13 = getelementptr inbounds i32, ptr %8, i64 %5
  store i32 1, ptr %13, align 4, !tbaa !5
  %.idx69 = shl nuw nsw i64 %5, 3
  %14 = getelementptr inbounds i8, ptr %8, i64 %.idx69
  store i32 1, ptr %14, align 8, !tbaa !5
  %.idx70 = mul nuw nsw i64 %5, 12
  %15 = getelementptr inbounds i8, ptr %8, i64 %.idx70
  store i32 1, ptr %15, align 4, !tbaa !5
  %.not3745 = icmp slt i32 %9, 1
  br i1 %.not3745, label %.preheader38, label %.preheader39.preheader

.preheader39.preheader:                           ; preds = %.preheader41
  %16 = load i32, ptr @arr, align 16, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = zext nneg i32 %9 to i64
  %19 = zext nneg i32 %9 to i64
  %20 = add nsw i64 %19, -1
  %xtraiter = and i64 %18, 1
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %._crit_edge.unr-lcssa, label %.preheader39.preheader.new

.preheader39.preheader.new:                       ; preds = %.preheader39.preheader
  %unroll_iter = and i64 %18, 2147483646
  br label %97

.preheader38.loopexit.unr-lcssa:                  ; preds = %95, %._crit_edge.1
  %indvars.iv.2.unr = phi i64 [ 1, %._crit_edge.1 ], [ %indvars.iv.next.2.1, %95 ]
  %lcmp.mod85.not = icmp eq i64 %xtraiter84, 0
  br i1 %lcmp.mod85.not, label %.preheader38, label %.epil.preheader83

.epil.preheader83:                                ; preds = %.preheader38.loopexit.unr-lcssa
  %22 = sub nsw i64 %indvars.iv.2.unr, %74
  %23 = icmp slt i64 %22, 0
  %24 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.2.unr
  %25 = load i32, ptr %24, align 4, !tbaa !5
  br i1 %23, label %.preheader38.loopexit.epilog-lcssa, label %26

26:                                               ; preds = %.epil.preheader83
  %27 = getelementptr inbounds i32, ptr %15, i64 %22
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %28, %25
  br label %.preheader38.loopexit.epilog-lcssa

.preheader38.loopexit.epilog-lcssa:               ; preds = %26, %.epil.preheader83
  %.sink72.epil = phi i32 [ %29, %26 ], [ %25, %.epil.preheader83 ]
  %30 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.2.unr
  store i32 %.sink72.epil, ptr %30, align 4, !tbaa !5
  br label %.preheader38

.preheader38:                                     ; preds = %.preheader38.loopexit.epilog-lcssa, %.preheader38.loopexit.unr-lcssa, %.preheader41
  br i1 %.not42, label %._crit_edge52, label %.lr.ph51

._crit_edge.unr-lcssa:                            ; preds = %116, %.preheader39.preheader
  %indvars.iv.unr = phi i64 [ 1, %.preheader39.preheader ], [ %indvars.iv.next.177, %116 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa
  %31 = sub nsw i64 %indvars.iv.unr, %17
  %32 = icmp slt i64 %31, 0
  %33 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv.unr
  %34 = load i32, ptr %33, align 4, !tbaa !5
  br i1 %32, label %._crit_edge.epilog-lcssa, label %35

35:                                               ; preds = %.epil.preheader
  %36 = getelementptr inbounds i32, ptr %13, i64 %31
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, %34
  br label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %35, %.epil.preheader
  %.sink74.epil = phi i32 [ %38, %35 ], [ %34, %.epil.preheader ]
  %39 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.unr
  store i32 %.sink74.epil, ptr %39, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %xtraiter79 = and i64 %18, 1
  %42 = icmp eq i64 %20, 0
  br i1 %42, label %._crit_edge.1.unr-lcssa, label %._crit_edge.new

._crit_edge.new:                                  ; preds = %._crit_edge
  %unroll_iter81 = and i64 %18, 2147483646
  br label %43

43:                                               ; preds = %62, %._crit_edge.new
  %indvars.iv.1 = phi i64 [ 1, %._crit_edge.new ], [ %indvars.iv.next.1.1, %62 ]
  %niter82 = phi i64 [ 0, %._crit_edge.new ], [ %niter82.next.1, %62 ]
  %44 = sub nsw i64 %indvars.iv.1, %41
  %45 = icmp slt i64 %44, 0
  %46 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.1
  %47 = load i32, ptr %46, align 4, !tbaa !5
  br i1 %45, label %52, label %48

48:                                               ; preds = %43
  %49 = getelementptr inbounds i32, ptr %14, i64 %44
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %50, %47
  br label %52

52:                                               ; preds = %43, %48
  %.sink = phi i32 [ %51, %48 ], [ %47, %43 ]
  %53 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.1
  store i32 %.sink, ptr %53, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %54 = sub nsw i64 %indvars.iv.next.1, %41
  %55 = icmp slt i64 %54, 0
  %56 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.next.1
  %57 = load i32, ptr %56, align 4, !tbaa !5
  br i1 %55, label %62, label %58

58:                                               ; preds = %52
  %59 = getelementptr inbounds i32, ptr %14, i64 %54
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, %57
  br label %62

62:                                               ; preds = %58, %52
  %.sink.1 = phi i32 [ %61, %58 ], [ %57, %52 ]
  %63 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next.1
  store i32 %.sink.1, ptr %63, align 4, !tbaa !5
  %indvars.iv.next.1.1 = add nuw nsw i64 %indvars.iv.1, 2
  %niter82.next.1 = add i64 %niter82, 2
  %niter82.ncmp.1 = icmp eq i64 %niter82.next.1, %unroll_iter81
  br i1 %niter82.ncmp.1, label %._crit_edge.1.unr-lcssa, label %43, !llvm.loop !9

._crit_edge.1.unr-lcssa:                          ; preds = %62, %._crit_edge
  %indvars.iv.1.unr = phi i64 [ 1, %._crit_edge ], [ %indvars.iv.next.1.1, %62 ]
  %lcmp.mod80.not = icmp eq i64 %xtraiter79, 0
  br i1 %lcmp.mod80.not, label %._crit_edge.1, label %.epil.preheader78

.epil.preheader78:                                ; preds = %._crit_edge.1.unr-lcssa
  %64 = sub nsw i64 %indvars.iv.1.unr, %41
  %65 = icmp slt i64 %64, 0
  %66 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.1.unr
  %67 = load i32, ptr %66, align 4, !tbaa !5
  br i1 %65, label %._crit_edge.1.epilog-lcssa, label %68

68:                                               ; preds = %.epil.preheader78
  %69 = getelementptr inbounds i32, ptr %14, i64 %64
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, %67
  br label %._crit_edge.1.epilog-lcssa

._crit_edge.1.epilog-lcssa:                       ; preds = %68, %.epil.preheader78
  %.sink.epil = phi i32 [ %71, %68 ], [ %67, %.epil.preheader78 ]
  %72 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.1.unr
  store i32 %.sink.epil, ptr %72, align 4, !tbaa !5
  br label %._crit_edge.1

._crit_edge.1:                                    ; preds = %._crit_edge.1.unr-lcssa, %._crit_edge.1.epilog-lcssa
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 8), align 8, !tbaa !5
  %74 = sext i32 %73 to i64
  %xtraiter84 = and i64 %18, 1
  %75 = icmp eq i64 %20, 0
  br i1 %75, label %.preheader38.loopexit.unr-lcssa, label %._crit_edge.1.new

._crit_edge.1.new:                                ; preds = %._crit_edge.1
  %unroll_iter86 = and i64 %18, 2147483646
  br label %76

76:                                               ; preds = %95, %._crit_edge.1.new
  %indvars.iv.2 = phi i64 [ 1, %._crit_edge.1.new ], [ %indvars.iv.next.2.1, %95 ]
  %niter87 = phi i64 [ 0, %._crit_edge.1.new ], [ %niter87.next.1, %95 ]
  %77 = sub nsw i64 %indvars.iv.2, %74
  %78 = icmp slt i64 %77, 0
  %79 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.2
  %80 = load i32, ptr %79, align 4, !tbaa !5
  br i1 %78, label %85, label %81

81:                                               ; preds = %76
  %82 = getelementptr inbounds i32, ptr %15, i64 %77
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, %80
  br label %85

85:                                               ; preds = %76, %81
  %.sink72 = phi i32 [ %84, %81 ], [ %80, %76 ]
  %86 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.2
  store i32 %.sink72, ptr %86, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %87 = sub nsw i64 %indvars.iv.next.2, %74
  %88 = icmp slt i64 %87, 0
  %89 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next.2
  %90 = load i32, ptr %89, align 4, !tbaa !5
  br i1 %88, label %95, label %91

91:                                               ; preds = %85
  %92 = getelementptr inbounds i32, ptr %15, i64 %87
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, %90
  br label %95

95:                                               ; preds = %91, %85
  %.sink72.1 = phi i32 [ %94, %91 ], [ %90, %85 ]
  %96 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next.2
  store i32 %.sink72.1, ptr %96, align 4, !tbaa !5
  %indvars.iv.next.2.1 = add nuw nsw i64 %indvars.iv.2, 2
  %niter87.next.1 = add i64 %niter87, 2
  %niter87.ncmp.1 = icmp eq i64 %niter87.next.1, %unroll_iter86
  br i1 %niter87.ncmp.1, label %.preheader38.loopexit.unr-lcssa, label %76, !llvm.loop !9

97:                                               ; preds = %116, %.preheader39.preheader.new
  %indvars.iv = phi i64 [ 1, %.preheader39.preheader.new ], [ %indvars.iv.next.177, %116 ]
  %niter = phi i64 [ 0, %.preheader39.preheader.new ], [ %niter.next.1, %116 ]
  %98 = sub nsw i64 %indvars.iv, %17
  %99 = icmp slt i64 %98, 0
  %100 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv
  %101 = load i32, ptr %100, align 4, !tbaa !5
  br i1 %99, label %106, label %102

102:                                              ; preds = %97
  %103 = getelementptr inbounds i32, ptr %13, i64 %98
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 %104, %101
  br label %106

106:                                              ; preds = %97, %102
  %.sink74 = phi i32 [ %105, %102 ], [ %101, %97 ]
  %107 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  store i32 %.sink74, ptr %107, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %108 = sub nsw i64 %indvars.iv.next, %17
  %109 = icmp slt i64 %108, 0
  %110 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv.next
  %111 = load i32, ptr %110, align 4, !tbaa !5
  br i1 %109, label %116, label %112

112:                                              ; preds = %106
  %113 = getelementptr inbounds i32, ptr %13, i64 %108
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, %111
  br label %116

116:                                              ; preds = %112, %106
  %.sink74.1 = phi i32 [ %115, %112 ], [ %111, %106 ]
  %117 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.next
  store i32 %.sink74.1, ptr %117, align 4, !tbaa !5
  %indvars.iv.next.177 = add nuw nsw i64 %indvars.iv, 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_edge.unr-lcssa, label %97, !llvm.loop !9

._crit_edge52:                                    ; preds = %.lr.ph51, %.preheader38
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %119 = load i32, ptr %1, align 4, !tbaa !5
  %.not3649.1 = icmp slt i32 %119, 0
  br i1 %.not3649.1, label %._crit_edge52.1, label %.lr.ph51.1

.lr.ph51.1:                                       ; preds = %._crit_edge52, %.lr.ph51.1
  %indvars.iv62.1 = phi i64 [ %indvars.iv.next63.1, %.lr.ph51.1 ], [ 0, %._crit_edge52 ]
  %120 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv62.1
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %121)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull @.str)
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62.1, 1
  %124 = load i32, ptr %1, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %.not36.not.1 = icmp slt i64 %indvars.iv62.1, %125
  br i1 %.not36.not.1, label %.lr.ph51.1, label %._crit_edge52.1, !llvm.loop !11

._crit_edge52.1:                                  ; preds = %.lr.ph51.1, %._crit_edge52
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %127 = load i32, ptr %1, align 4, !tbaa !5
  %.not3649.2 = icmp slt i32 %127, 0
  br i1 %.not3649.2, label %._crit_edge52.2, label %.lr.ph51.2

.lr.ph51.2:                                       ; preds = %._crit_edge52.1, %.lr.ph51.2
  %indvars.iv62.2 = phi i64 [ %indvars.iv.next63.2, %.lr.ph51.2 ], [ 0, %._crit_edge52.1 ]
  %128 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv62.2
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %129)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef nonnull @.str)
  %indvars.iv.next63.2 = add nuw nsw i64 %indvars.iv62.2, 1
  %132 = load i32, ptr %1, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %.not36.not.2 = icmp slt i64 %indvars.iv62.2, %133
  br i1 %.not36.not.2, label %.lr.ph51.2, label %._crit_edge52.2, !llvm.loop !11

._crit_edge52.2:                                  ; preds = %.lr.ph51.2, %._crit_edge52.1
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %135 = load i32, ptr %1, align 4, !tbaa !5
  %.not3649.3 = icmp slt i32 %135, 0
  br i1 %.not3649.3, label %._crit_edge52.3, label %.lr.ph51.3

.lr.ph51.3:                                       ; preds = %._crit_edge52.2, %.lr.ph51.3
  %indvars.iv62.3 = phi i64 [ %indvars.iv.next63.3, %.lr.ph51.3 ], [ 0, %._crit_edge52.2 ]
  %136 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv62.3
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %137)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef nonnull @.str)
  %indvars.iv.next63.3 = add nuw nsw i64 %indvars.iv62.3, 1
  %140 = load i32, ptr %1, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %.not36.not.3 = icmp slt i64 %indvars.iv62.3, %141
  br i1 %.not36.not.3, label %.lr.ph51.3, label %._crit_edge52.3, !llvm.loop !11

._crit_edge52.3:                                  ; preds = %.lr.ph51.3, %._crit_edge52.2
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %143 = 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)
  %.idx = mul nuw nsw i64 %5, 12
  %144 = getelementptr inbounds i8, ptr %8, i64 %.idx
  %145 = load i32, ptr %1, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i32, ptr %144, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %143, i32 noundef %148)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph51:                                         ; preds = %.preheader38, %.lr.ph51
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph51 ], [ 0, %.preheader38 ]
  %151 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv62
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %152)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef nonnull @.str)
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %155 = load i32, ptr %1, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %.not36.not = icmp slt i64 %indvars.iv62, %156
  br i1 %.not36.not, label %.lr.ph51, label %._crit_edge52, !llvm.loop !11
}

; 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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }

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

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


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