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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

22:                                               ; preds = %32, %0
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

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

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

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

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  %39 = zext i32 %38 to i64
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  %42 = zext i32 %41 to i64
  %43 = mul nuw i64 %39, %42
  %44 = alloca i8, i64 %43, align 16
  store i64 %39, ptr %7, align 8
  store i64 %42, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %70, %35
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %51, label %50

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

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

52:                                               ; preds = %66, %51
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %52
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = mul nsw i64 %60, %42
  %62 = getelementptr inbounds i8, ptr %44, i64 %61
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %62, i64 %64
  store i8 0, ptr %65, align 1, !tbaa !11
  br label %66

66:                                               ; preds = %58
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %11, align 4, !tbaa !5
  br label %52, !llvm.loop !13

69:                                               ; preds = %57
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %9, align 4, !tbaa !5
  br label %45, !llvm.loop !14

73:                                               ; preds = %50
  %74 = mul nsw i64 0, %42
  %75 = getelementptr inbounds i8, ptr %44, i64 %74
  %76 = getelementptr inbounds i8, ptr %75, i64 0
  store i8 1, ptr %76, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %89, %73
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  %81 = icmp slt i32 %78, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %77
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %92

83:                                               ; preds = %77
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = mul nsw i64 %85, %42
  %87 = getelementptr inbounds i8, ptr %44, i64 %86
  %88 = getelementptr inbounds i8, ptr %87, i64 0
  store i8 1, ptr %88, align 1, !tbaa !11
  br label %89

89:                                               ; preds = %83
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %12, align 4, !tbaa !5
  br label %77, !llvm.loop !15

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

93:                                               ; preds = %105, %92
  %94 = load i32, ptr %13, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  %97 = icmp slt i32 %94, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %108

99:                                               ; preds = %93
  %100 = mul nsw i64 0, %42
  %101 = getelementptr inbounds i8, ptr %44, i64 %100
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i8, ptr %101, i64 %103
  store i8 0, ptr %104, align 1, !tbaa !11
  br label %105

105:                                              ; preds = %99
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %13, align 4, !tbaa !5
  br label %93, !llvm.loop !16

108:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %182, %108
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  %113 = icmp slt i32 %110, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %185

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %178, %115
  %117 = load i32, ptr %15, align 4, !tbaa !5
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  %120 = icmp slt i32 %117, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %116
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %181

122:                                              ; preds = %116
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = mul nsw i64 %125, %42
  %127 = getelementptr inbounds i8, ptr %44, i64 %126
  %128 = load i32, ptr %15, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %127, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !11, !range !17, !noundef !18
  %132 = trunc i8 %131 to i1
  %133 = zext i1 %132 to i32
  %134 = icmp eq i32 %133, 1
  br i1 %134, label %135, label %143

135:                                              ; preds = %122
  %136 = load i32, ptr %14, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = mul nsw i64 %137, %42
  %139 = getelementptr inbounds i8, ptr %44, i64 %138
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %139, i64 %141
  store i8 1, ptr %142, align 1, !tbaa !11
  br label %177

143:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i32, ptr %21, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  store i32 %148, ptr %16, align 4, !tbaa !5
  %149 = load i32, ptr %15, align 4, !tbaa !5
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = icmp sge i32 %149, %150
  br i1 %151, label %152, label %176

152:                                              ; preds = %143
  %153 = load i32, ptr %14, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 1
  %155 = sext i32 %154 to i64
  %156 = mul nsw i64 %155, %42
  %157 = getelementptr inbounds i8, ptr %44, i64 %156
  %158 = load i32, ptr %15, align 4, !tbaa !5
  %159 = load i32, ptr %16, align 4, !tbaa !5
  %160 = sub nsw i32 %158, %159
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i8, ptr %157, i64 %161
  %163 = load i8, ptr %162, align 1, !tbaa !11, !range !17, !noundef !18
  %164 = trunc i8 %163 to i1
  %165 = zext i1 %164 to i32
  %166 = icmp eq i32 %165, 1
  br i1 %166, label %167, label %175

167:                                              ; preds = %152
  %168 = load i32, ptr %14, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = mul nsw i64 %169, %42
  %171 = getelementptr inbounds i8, ptr %44, i64 %170
  %172 = load i32, ptr %15, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i8, ptr %171, i64 %173
  store i8 1, ptr %174, align 1, !tbaa !11
  br label %175

175:                                              ; preds = %167, %152
  br label %176

176:                                              ; preds = %175, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %177

177:                                              ; preds = %176, %135
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %15, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %15, align 4, !tbaa !5
  br label %116, !llvm.loop !19

181:                                              ; preds = %121
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %14, align 4, !tbaa !5
  br label %109, !llvm.loop !20

185:                                              ; preds = %114
  %186 = load i32, ptr %2, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = mul nsw i64 %187, %42
  %189 = getelementptr inbounds i8, ptr %44, i64 %188
  %190 = load i32, ptr %6, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds i8, ptr %189, i64 %191
  %193 = load i8, ptr %192, align 1, !tbaa !11, !range !17, !noundef !18
  %194 = trunc i8 %193 to i1
  %195 = zext i1 %194 to i32
  %196 = icmp eq i32 %195, 1
  br i1 %196, label %197, label %200

197:                                              ; preds = %185
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %198, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %203

200:                                              ; preds = %185
  %201 = 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)
  %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_)
  br label %203

203:                                              ; preds = %200, %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %204 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %204)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %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) #1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %10 = 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)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = add i32 %11, 1
  %13 = zext i32 %12 to i64
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add i32 %14, 1
  %16 = zext i32 %15 to i64
  %17 = mul nuw i64 %16, %13
  %18 = alloca i8, i64 %17, align 16
  %.not53 = icmp slt i32 %11, 0
  br i1 %.not53, label %._crit_edge55, label %.preheader47.lr.ph

.preheader47.lr.ph:                               ; preds = %._crit_edge
  %.not4449 = icmp slt i32 %14, 0
  br i1 %.not4449, label %.lr.ph59.preheader, label %.preheader47.preheader

.preheader47.preheader:                           ; preds = %.preheader47.lr.ph
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %18, i8 0, i64 %17, i1 false), !tbaa !9
  br label %.lr.ph59.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %19 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv
  %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) %19)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge55:                                    ; preds = %._crit_edge
  store i8 1, ptr %18, align 16, !tbaa !9
  br label %.preheader46

.lr.ph59.preheader:                               ; preds = %.preheader47.lr.ph, %.preheader47.preheader
  store i8 1, ptr %18, align 16, !tbaa !9
  %xtraiter = and i64 %13, 3
  %24 = icmp ult i32 %12, 4
  br i1 %24, label %.preheader46.loopexit.unr-lcssa, label %.lr.ph59.preheader.new

.lr.ph59.preheader.new:                           ; preds = %.lr.ph59.preheader
  %unroll_iter = and i64 %13, 4294967292
  br label %.lr.ph59

.preheader46.loopexit.unr-lcssa:                  ; preds = %.lr.ph59, %.lr.ph59.preheader
  %indvars.iv77.unr = phi i64 [ 0, %.lr.ph59.preheader ], [ %indvars.iv.next78.3, %.lr.ph59 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader46, label %.lr.ph59.epil

.lr.ph59.epil:                                    ; preds = %.preheader46.loopexit.unr-lcssa, %.lr.ph59.epil
  %indvars.iv77.epil = phi i64 [ %indvars.iv.next78.epil, %.lr.ph59.epil ], [ %indvars.iv77.unr, %.preheader46.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph59.epil ], [ 0, %.preheader46.loopexit.unr-lcssa ]
  %25 = mul nuw nsw i64 %indvars.iv77.epil, %16
  %26 = getelementptr inbounds i8, ptr %18, i64 %25
  store i8 1, ptr %26, align 1, !tbaa !9
  %indvars.iv.next78.epil = add nuw nsw i64 %indvars.iv77.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader46, label %.lr.ph59.epil, !llvm.loop !13

.preheader46:                                     ; preds = %.preheader46.loopexit.unr-lcssa, %.lr.ph59.epil, %._crit_edge55
  %.not4060 = icmp slt i32 %14, 1
  br i1 %.not4060, label %._crit_edge69, label %.preheader45.thread

.lr.ph59:                                         ; preds = %.lr.ph59, %.lr.ph59.preheader.new
  %indvars.iv77 = phi i64 [ 0, %.lr.ph59.preheader.new ], [ %indvars.iv.next78.3, %.lr.ph59 ]
  %niter = phi i64 [ 0, %.lr.ph59.preheader.new ], [ %niter.next.3, %.lr.ph59 ]
  %27 = mul nuw nsw i64 %indvars.iv77, %16
  %28 = getelementptr inbounds i8, ptr %18, i64 %27
  store i8 1, ptr %28, align 4, !tbaa !9
  %indvars.iv.next78 = or disjoint i64 %indvars.iv77, 1
  %29 = mul nuw nsw i64 %indvars.iv.next78, %16
  %30 = getelementptr inbounds i8, ptr %18, i64 %29
  store i8 1, ptr %30, align 1, !tbaa !9
  %indvars.iv.next78.1 = or disjoint i64 %indvars.iv77, 2
  %31 = mul nuw nsw i64 %indvars.iv.next78.1, %16
  %32 = getelementptr inbounds i8, ptr %18, i64 %31
  store i8 1, ptr %32, align 2, !tbaa !9
  %indvars.iv.next78.2 = or disjoint i64 %indvars.iv77, 3
  %33 = mul nuw nsw i64 %indvars.iv.next78.2, %16
  %34 = getelementptr inbounds i8, ptr %18, i64 %33
  store i8 1, ptr %34, align 1, !tbaa !9
  %indvars.iv.next78.3 = add nuw nsw i64 %indvars.iv77, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader46.loopexit.unr-lcssa, label %.lr.ph59, !llvm.loop !15

.preheader45.thread:                              ; preds = %.preheader46
  %scevgep = getelementptr i8, ptr %18, i64 1
  %35 = zext nneg i32 %14 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 0, i64 %35, i1 false), !tbaa !9
  %.not416793 = icmp slt i32 %11, 1
  br i1 %.not416793, label %._crit_edge69, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader45.thread
  %36 = add nsw i64 %16, -1
  %xtraiter94 = and i64 %36, 1
  %37 = icmp eq i32 %15, 2
  %unroll_iter97 = and i64 %36, -2
  %lcmp.mod96.not = icmp eq i64 %xtraiter94, 0
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge66
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %._crit_edge66 ], [ 1, %.preheader.preheader ]
  %38 = add nsw i64 %indvars.iv88, -1
  %39 = mul nuw nsw i64 %38, %16
  %40 = getelementptr inbounds i8, ptr %18, i64 %39
  %41 = getelementptr inbounds i32, ptr %7, i64 %38
  %42 = mul nuw nsw i64 %indvars.iv88, %16
  %43 = getelementptr inbounds i8, ptr %18, i64 %42
  br i1 %37, label %._crit_edge66.unr-lcssa, label %.preheader.new

._crit_edge69:                                    ; preds = %._crit_edge66, %.preheader46, %.preheader45.thread
  %44 = sext i32 %11 to i64
  %45 = mul nsw i64 %16, %44
  %46 = getelementptr inbounds i8, ptr %18, i64 %45
  %47 = sext i32 %14 to i64
  %48 = getelementptr inbounds i8, ptr %46, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !9, !range !16, !noundef !17
  %50 = trunc nuw i8 %49 to i1
  %.str..str.1 = select i1 %50, ptr @.str, ptr @.str.1
  %51 = 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..str.1)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.stackrestore.p0(ptr %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

._crit_edge66.unr-lcssa:                          ; preds = %96, %.preheader
  %indvars.iv83.unr = phi i64 [ 1, %.preheader ], [ %indvars.iv.next84.1, %96 ]
  br i1 %lcmp.mod96.not, label %._crit_edge66, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge66.unr-lcssa
  %53 = getelementptr inbounds i8, ptr %40, i64 %indvars.iv83.unr
  %54 = load i8, ptr %53, align 1, !tbaa !9, !range !16, !noundef !17
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %.sink.split.epil, label %56

56:                                               ; preds = %.epil.preheader
  %57 = load i32, ptr %41, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %.not43.epil = icmp slt i64 %indvars.iv83.unr, %58
  br i1 %.not43.epil, label %._crit_edge66, label %59

59:                                               ; preds = %56
  %60 = trunc nuw nsw i64 %indvars.iv83.unr to i32
  %61 = sub nsw i32 %60, %57
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %40, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !9, !range !16, !noundef !17
  %65 = trunc nuw i8 %64 to i1
  br i1 %65, label %.sink.split.epil, label %._crit_edge66

.sink.split.epil:                                 ; preds = %59, %.epil.preheader
  %66 = getelementptr inbounds i8, ptr %43, i64 %indvars.iv83.unr
  store i8 1, ptr %66, align 1, !tbaa !9
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %56, %59, %.sink.split.epil, %._crit_edge66.unr-lcssa
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %13
  br i1 %exitcond92.not, label %._crit_edge69, label %.preheader, !llvm.loop !18

.preheader.new:                                   ; preds = %.preheader, %96
  %indvars.iv83 = phi i64 [ %indvars.iv.next84.1, %96 ], [ 1, %.preheader ]
  %niter98 = phi i64 [ %niter98.next.1, %96 ], [ 0, %.preheader ]
  %67 = getelementptr inbounds i8, ptr %40, i64 %indvars.iv83
  %68 = load i8, ptr %67, align 1, !tbaa !9, !range !16, !noundef !17
  %69 = trunc nuw i8 %68 to i1
  br i1 %69, label %.sink.split, label %70

70:                                               ; preds = %.preheader.new
  %71 = load i32, ptr %41, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %.not43 = icmp slt i64 %indvars.iv83, %72
  br i1 %.not43, label %81, label %73

73:                                               ; preds = %70
  %74 = trunc nuw nsw i64 %indvars.iv83 to i32
  %75 = sub nsw i32 %74, %71
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %40, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !9, !range !16, !noundef !17
  %79 = trunc nuw i8 %78 to i1
  br i1 %79, label %.sink.split, label %81

.sink.split:                                      ; preds = %73, %.preheader.new
  %80 = getelementptr inbounds i8, ptr %43, i64 %indvars.iv83
  store i8 1, ptr %80, align 1, !tbaa !9
  br label %81

81:                                               ; preds = %.sink.split, %70, %73
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %82 = getelementptr inbounds i8, ptr %40, i64 %indvars.iv.next84
  %83 = load i8, ptr %82, align 1, !tbaa !9, !range !16, !noundef !17
  %84 = trunc nuw i8 %83 to i1
  br i1 %84, label %.sink.split.1, label %85

85:                                               ; preds = %81
  %86 = load i32, ptr %41, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %.not43.1 = icmp slt i64 %indvars.iv.next84, %87
  br i1 %.not43.1, label %96, label %88

88:                                               ; preds = %85
  %89 = trunc nuw nsw i64 %indvars.iv.next84 to i32
  %90 = sub nsw i32 %89, %86
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %40, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !9, !range !16, !noundef !17
  %94 = trunc nuw i8 %93 to i1
  br i1 %94, label %.sink.split.1, label %96

.sink.split.1:                                    ; preds = %88, %81
  %95 = getelementptr inbounds i8, ptr %43, i64 %indvars.iv.next84
  store i8 1, ptr %95, align 1, !tbaa !9
  br label %96

96:                                               ; preds = %.sink.split.1, %88, %85
  %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
  %niter98.next.1 = add i64 %niter98, 2
  %niter98.ncmp.1 = icmp eq i64 %niter98.next.1, %unroll_iter97
  br i1 %niter98.ncmp.1, label %._crit_edge66.unr-lcssa, label %.preheader.new, !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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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