; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 20. Dynamic Programming/minimumSubsetSumDifference.ll (Z9subsetSumPiii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9subsetSumPiii(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i1, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  store i1 false, ptr %9, align 1
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = add nsw i32 %17, 1
  %19 = zext i32 %18 to i64
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = add nsw i32 %20, 1
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  store ptr %23, ptr %12, align 8
  %24 = mul nuw i64 %19, %22
  %25 = alloca i8, i64 %24, align 16
  store i64 %19, ptr %13, align 8
  store i64 %22, ptr %14, align 8
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %64, %4
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  %30 = icmp slt i32 %27, %29
  br i1 %30, label %31, label %67

31:                                               ; preds = %26
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %60, %31
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %37, label %63

37:                                               ; preds = %32
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %48

40:                                               ; preds = %37
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %42, %22
  %44 = getelementptr inbounds i8, ptr %25, i64 %43
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %44, i64 %46
  store i8 0, ptr %47, align 1, !tbaa !11
  br label %48

48:                                               ; preds = %40, %37
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %59

51:                                               ; preds = %48
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %53, %22
  %55 = getelementptr inbounds i8, ptr %25, i64 %54
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %55, i64 %57
  store i8 1, ptr %58, align 1, !tbaa !11
  br label %59

59:                                               ; preds = %51, %48
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %11, align 4, !tbaa !9
  br label %32, !llvm.loop !13

63:                                               ; preds = %32
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %10, align 4, !tbaa !9
  br label %26, !llvm.loop !15

67:                                               ; preds = %26
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %151, %67
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  %72 = icmp slt i32 %69, %71
  br i1 %72, label %73, label %154

73:                                               ; preds = %68
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %147, %73
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  %78 = icmp slt i32 %75, %77
  br i1 %78, label %79, label %150

79:                                               ; preds = %74
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %80, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %88, label %127

88:                                               ; preds = %79
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %91, %22
  %93 = getelementptr inbounds i8, ptr %25, i64 %92
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = sub nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %95, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = sub nsw i32 %94, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %93, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !11, !range !16, !noundef !17
  %105 = trunc i8 %104 to i1
  br i1 %105, label %117, label %106

106:                                              ; preds = %88
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %109, %22
  %111 = getelementptr inbounds i8, ptr %25, i64 %110
  %112 = load i32, ptr %11, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i8, ptr %111, i64 %113
  %115 = load i8, ptr %114, align 1, !tbaa !11, !range !16, !noundef !17
  %116 = trunc i8 %115 to i1
  br label %117

117:                                              ; preds = %106, %88
  %118 = phi i1 [ true, %88 ], [ %116, %106 ]
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = mul nsw i64 %120, %22
  %122 = getelementptr inbounds i8, ptr %25, i64 %121
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %122, i64 %124
  %126 = zext i1 %118 to i8
  store i8 %126, ptr %125, align 1, !tbaa !11
  br label %146

127:                                              ; preds = %79
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = mul nsw i64 %130, %22
  %132 = getelementptr inbounds i8, ptr %25, i64 %131
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i8, ptr %132, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !11, !range !16, !noundef !17
  %137 = trunc i8 %136 to i1
  %138 = load i32, ptr %10, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = mul nsw i64 %139, %22
  %141 = getelementptr inbounds i8, ptr %25, i64 %140
  %142 = load i32, ptr %11, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i8, ptr %141, i64 %143
  %145 = zext i1 %137 to i8
  store i8 %145, ptr %144, align 1, !tbaa !11
  br label %146

146:                                              ; preds = %127, %117
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %11, align 4, !tbaa !9
  br label %74, !llvm.loop !18

150:                                              ; preds = %74
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %10, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %10, align 4, !tbaa !9
  br label %68, !llvm.loop !19

154:                                              ; preds = %68
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %179, %154
  %156 = load i32, ptr %11, align 4, !tbaa !9
  %157 = load i32, ptr %7, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  %159 = icmp slt i32 %156, %158
  br i1 %159, label %160, label %182

160:                                              ; preds = %155
  %161 = load i32, ptr %8, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = mul nsw i64 %162, %22
  %164 = getelementptr inbounds i8, ptr %25, i64 %163
  %165 = load i32, ptr %11, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i8, ptr %164, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !11, !range !16, !noundef !17
  %169 = trunc i8 %168 to i1
  %170 = zext i1 %169 to i32
  %171 = icmp eq i32 %170, 1
  br i1 %171, label %172, label %178

172:                                              ; preds = %160
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %173 unwind label %174

173:                                              ; preds = %172
  br label %178

174:                                              ; preds = %172
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %15, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %187

178:                                              ; preds = %173, %160
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %11, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %11, align 4, !tbaa !9
  br label %155, !llvm.loop !20

182:                                              ; preds = %155
  store i1 true, ptr %9, align 1
  %183 = load ptr, ptr %12, align 8
  call void @llvm.stackrestore.p0(ptr %183)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %184 = load i1, ptr %9, align 1
  br i1 %184, label %186, label %185

185:                                              ; preds = %182
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %186

186:                                              ; preds = %185, %182
  ret void

187:                                              ; preds = %174
  %188 = load ptr, ptr %15, align 8
  %189 = load i32, ptr %16, align 4
  %190 = insertvalue { ptr, i32 } poison, ptr %188, 0
  %191 = insertvalue { ptr, i32 } %190, i32 %189, 1
  resume { ptr, i32 } %191
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9subsetSumPiii(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  tail call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %6 = add i32 %3, 1
  %7 = zext i32 %6 to i64
  %8 = add i32 %2, 1
  %9 = zext i32 %8 to i64
  %10 = tail call ptr @llvm.stacksave.p0()
  %11 = mul nuw i64 %7, %9
  %12 = alloca i8, i64 %11, align 16
  %.not46 = icmp slt i32 %3, 0
  br i1 %.not46, label %.preheader, label %.preheader42.lr.ph

.preheader42.lr.ph:                               ; preds = %4
  %.not3943 = icmp slt i32 %2, 0
  br i1 %.not3943, label %.preheader41, label %.preheader42.preheader

.preheader42.preheader:                           ; preds = %.preheader42.lr.ph
  %exitcond69.peel.not = icmp eq i32 %2, 0
  %13 = add nsw i64 %9, -1
  %min.iters.check = icmp ult i32 %8, 9
  %min.iters.check94 = icmp ult i32 %8, 33
  %n.vec = and i64 %13, -32
  %cmp.n = icmp eq i64 %13, %n.vec
  %ind.end97 = or disjoint i64 %n.vec, 1
  %n.vec.remaining = and i64 %13, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  %n.vec96 = and i64 %13, -8
  %ind.end = or disjoint i64 %n.vec96, 1
  %cmp.n101 = icmp eq i64 %13, %n.vec96
  br label %.preheader42

.preheader42:                                     ; preds = %.preheader42.preheader, %._crit_edge
  %indvars.iv71 = phi i64 [ 0, %.preheader42.preheader ], [ %indvars.iv.next72, %._crit_edge ]
  %14 = icmp eq i64 %indvars.iv71, 0
  %15 = mul nuw nsw i64 %indvars.iv71, %9
  %16 = getelementptr inbounds i8, ptr %12, i64 %15
  br i1 %14, label %18, label %17

17:                                               ; preds = %.preheader42
  store i8 1, ptr %16, align 1, !tbaa !5
  br label %._crit_edge

18:                                               ; preds = %.preheader42
  store i8 0, ptr %12, align 16, !tbaa !5
  store i8 1, ptr %16, align 1, !tbaa !5
  br i1 %exitcond69.peel.not, label %._crit_edge, label %iter.check

iter.check:                                       ; preds = %18
  br i1 %min.iters.check, label %.lr.ph.split.us.peel.next.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  br i1 %min.iters.check94, label %vec.epilog.ph, label %vector.body

vector.body:                                      ; preds = %vector.main.loop.iter.check, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
  %offset.idx = or disjoint i64 %index, 1
  %19 = getelementptr inbounds i8, ptr %12, i64 %offset.idx
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  store <16 x i8> zeroinitializer, ptr %19, align 1, !tbaa !5
  store <16 x i8> zeroinitializer, ptr %20, align 1, !tbaa !5
  %index.next = add nuw i64 %index, 32
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  br i1 %min.epilog.iters.check, label %.lr.ph.split.us.peel.next.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index98 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next100, %vec.epilog.vector.body ]
  %offset.idx99 = or disjoint i64 %index98, 1
  %22 = getelementptr inbounds i8, ptr %12, i64 %offset.idx99
  store <8 x i8> zeroinitializer, ptr %22, align 1, !tbaa !5
  %index.next100 = add nuw i64 %index98, 8
  %23 = icmp eq i64 %index.next100, %n.vec96
  br i1 %23, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  br i1 %cmp.n101, label %._crit_edge, label %.lr.ph.split.us.peel.next.preheader

.lr.ph.split.us.peel.next.preheader:              ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 1, %iter.check ], [ %ind.end97, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  br label %.lr.ph.split.us.peel.next

.lr.ph.split.us.peel.next:                        ; preds = %.lr.ph.split.us.peel.next.preheader, %.lr.ph.split.us.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.split.us.peel.next ], [ %indvars.iv.ph, %.lr.ph.split.us.peel.next.preheader ]
  %24 = getelementptr inbounds i8, ptr %12, i64 %indvars.iv
  store i8 0, ptr %24, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next, %9
  br i1 %exitcond69.not, label %._crit_edge, label %.lr.ph.split.us.peel.next, !llvm.loop !15

.preheader41:                                     ; preds = %._crit_edge, %.preheader42.lr.ph
  %.not3356 = icmp eq i32 %3, 0
  br i1 %.not3356, label %.preheader, label %.preheader40.lr.ph

.preheader40.lr.ph:                               ; preds = %.preheader41
  %.not3650 = icmp slt i32 %2, 0
  br i1 %.not3650, label %.preheader.thread, label %.preheader40.preheader

.preheader40.preheader:                           ; preds = %.preheader40.lr.ph
  %xtraiter = and i64 %9, 1
  %25 = icmp eq i32 %2, 0
  %unroll_iter = and i64 %9, 4294967294
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader40

.preheader.thread:                                ; preds = %.preheader40.lr.ph
  store i32 0, ptr %5, align 4, !tbaa !16
  br label %._crit_edge62

._crit_edge:                                      ; preds = %.lr.ph.split.us.peel.next, %17, %middle.block, %vec.epilog.middle.block, %18
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %7
  br i1 %exitcond75.not, label %.preheader41, label %.preheader42, !llvm.loop !18

.preheader40:                                     ; preds = %.preheader40.preheader, %._crit_edge52
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %._crit_edge52 ], [ 1, %.preheader40.preheader ]
  %26 = add nsw i64 %indvars.iv81, -1
  %27 = getelementptr inbounds i32, ptr %1, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !16
  %29 = mul nuw nsw i64 %26, %9
  %30 = getelementptr inbounds i8, ptr %12, i64 %29
  %31 = mul nuw nsw i64 %indvars.iv81, %9
  %32 = getelementptr inbounds i8, ptr %12, i64 %31
  %33 = sext i32 %28 to i64
  br i1 %25, label %._crit_edge52.unr-lcssa, label %.preheader40.new

.preheader:                                       ; preds = %._crit_edge52, %4, %.preheader41
  store i32 0, ptr %5, align 4, !tbaa !16
  %.not3460 = icmp slt i32 %2, 0
  br i1 %.not3460, label %._crit_edge62, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %34 = sext i32 %3 to i64
  %35 = mul nsw i64 %34, %9
  %36 = getelementptr inbounds i8, ptr %12, i64 %35
  br label %63

.preheader40.new:                                 ; preds = %.preheader40, %53
  %indvars.iv76 = phi i64 [ %indvars.iv.next77.1, %53 ], [ 0, %.preheader40 ]
  %niter = phi i64 [ %niter.next.1, %53 ], [ 0, %.preheader40 ]
  %.not37 = icmp slt i64 %indvars.iv76, %33
  br i1 %.not37, label %.sink.split, label %37

37:                                               ; preds = %.preheader40.new
  %38 = sub nsw i64 %indvars.iv76, %33
  %39 = getelementptr inbounds i8, ptr %30, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !5, !range !19, !noundef !20
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %44, label %.sink.split

.sink.split:                                      ; preds = %.preheader40.new, %37
  %42 = getelementptr inbounds i8, ptr %30, i64 %indvars.iv76
  %43 = load i8, ptr %42, align 1, !tbaa !5, !range !19, !noundef !20
  br label %44

44:                                               ; preds = %.sink.split, %37
  %.sink = phi i8 [ 1, %37 ], [ %43, %.sink.split ]
  %45 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv76
  store i8 %.sink, ptr %45, align 1, !tbaa !5
  %indvars.iv.next77 = or disjoint i64 %indvars.iv76, 1
  %.not37.1 = icmp slt i64 %indvars.iv.next77, %33
  br i1 %.not37.1, label %.sink.split.1, label %46

46:                                               ; preds = %44
  %47 = sub nsw i64 %indvars.iv.next77, %33
  %48 = getelementptr inbounds i8, ptr %30, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !5, !range !19, !noundef !20
  %50 = trunc nuw i8 %49 to i1
  br i1 %50, label %53, label %.sink.split.1

.sink.split.1:                                    ; preds = %46, %44
  %51 = getelementptr inbounds i8, ptr %30, i64 %indvars.iv.next77
  %52 = load i8, ptr %51, align 1, !tbaa !5, !range !19, !noundef !20
  br label %53

53:                                               ; preds = %.sink.split.1, %46
  %.sink.1 = phi i8 [ 1, %46 ], [ %52, %.sink.split.1 ]
  %54 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv.next77
  store i8 %.sink.1, ptr %54, align 1, !tbaa !5
  %indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 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_edge52.unr-lcssa, label %.preheader40.new, !llvm.loop !21

._crit_edge52.unr-lcssa:                          ; preds = %53, %.preheader40
  %indvars.iv76.unr = phi i64 [ 0, %.preheader40 ], [ %indvars.iv.next77.1, %53 ]
  br i1 %lcmp.mod.not, label %._crit_edge52, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge52.unr-lcssa
  %.not37.epil = icmp slt i64 %indvars.iv76.unr, %33
  br i1 %.not37.epil, label %.sink.split.epil, label %55

55:                                               ; preds = %.epil.preheader
  %56 = sub nsw i64 %indvars.iv76.unr, %33
  %57 = getelementptr inbounds i8, ptr %30, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !5, !range !19, !noundef !20
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %._crit_edge52.epilog-lcssa, label %.sink.split.epil

.sink.split.epil:                                 ; preds = %55, %.epil.preheader
  %60 = getelementptr inbounds i8, ptr %30, i64 %indvars.iv76.unr
  %61 = load i8, ptr %60, align 1, !tbaa !5, !range !19, !noundef !20
  br label %._crit_edge52.epilog-lcssa

._crit_edge52.epilog-lcssa:                       ; preds = %.sink.split.epil, %55
  %.sink.epil = phi i8 [ 1, %55 ], [ %61, %.sink.split.epil ]
  %62 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv76.unr
  store i8 %.sink.epil, ptr %62, align 1, !tbaa !5
  br label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge52.unr-lcssa, %._crit_edge52.epilog-lcssa
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %7
  br i1 %exitcond85.not, label %.preheader, label %.preheader40, !llvm.loop !22

63:                                               ; preds = %.lr.ph, %71
  %storemerge61 = phi i32 [ 0, %.lr.ph ], [ %73, %71 ]
  %64 = sext i32 %storemerge61 to i64
  %65 = getelementptr inbounds i8, ptr %36, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !5, !range !19, !noundef !20
  %67 = trunc nuw i8 %66 to i1
  br i1 %67, label %68, label %71

68:                                               ; preds = %63
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %._crit_edge86 unwind label %69

._crit_edge86:                                    ; preds = %68
  %.pre = load i32, ptr %5, align 4, !tbaa !16
  br label %71

69:                                               ; preds = %68
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %70

71:                                               ; preds = %._crit_edge86, %63
  %72 = phi i32 [ %.pre, %._crit_edge86 ], [ %storemerge61, %63 ]
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %5, align 4, !tbaa !16
  %.not34.not = icmp slt i32 %72, %2
  br i1 %.not34.not, label %63, label %._crit_edge62, !llvm.loop !23

._crit_edge62:                                    ; preds = %71, %.preheader.thread, %.preheader
  call void @llvm.stackrestore.p0(ptr %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12, !13}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !11, !12, !13}
!15 = distinct !{!15, !10, !11, !13, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = distinct !{!18, !10}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass