; LLVM IR from flashlight/flashlight :: flashlight/fl/dataset/Utils.ll (ZN2fl21partitionByRoundRobinEllllb)

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

@.str = external hidden unnamed_addr constant [61 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl21partitionByRoundRobinEllllb(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i1 noundef zeroext %5) #1 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i8, align 1
  %18 = alloca i1, align 1
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  store ptr %0, ptr %7, align 8
  store i64 %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !5
  store i64 %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !5
  %26 = zext i1 %5 to i8
  store i8 %26, ptr %12, align 1, !tbaa !9
  %27 = load i64, ptr %9, align 8, !tbaa !5
  %28 = icmp slt i64 %27, 0
  br i1 %28, label %33, label %29

29:                                               ; preds = %6
  %30 = load i64, ptr %9, align 8, !tbaa !5
  %31 = load i64, ptr %10, align 8, !tbaa !5
  %32 = icmp sge i64 %30, %31
  br i1 %32, label %33, label %40

33:                                               ; preds = %29, %6
  %34 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef @.str)
          to label %35 unwind label %36

35:                                               ; preds = %33
  call void @__cxa_throw(ptr %34, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #7
  unreachable

36:                                               ; preds = %33
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %13, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %14, align 4
  call void @__cxa_free_exception(ptr %34) #6
  br label %160

40:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %41 = load i64, ptr %10, align 8, !tbaa !5
  %42 = load i64, ptr %11, align 8, !tbaa !5
  %43 = mul nsw i64 %41, %42
  store i64 %43, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %44 = load i64, ptr %8, align 8, !tbaa !5
  %45 = load i64, ptr %15, align 8, !tbaa !5
  %46 = sdiv i64 %44, %45
  store i64 %46, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  %47 = load i64, ptr %8, align 8, !tbaa !5
  %48 = load i64, ptr %15, align 8, !tbaa !5
  %49 = srem i64 %47, %48
  %50 = load i64, ptr %10, align 8, !tbaa !5
  %51 = icmp sge i64 %49, %50
  %52 = zext i1 %51 to i8
  store i8 %52, ptr %17, align 1, !tbaa !9
  %53 = load i8, ptr %12, align 1, !tbaa !9, !range !11, !noundef !12
  %54 = trunc i8 %53 to i1
  br i1 %54, label %55, label %61

55:                                               ; preds = %40
  %56 = load i64, ptr %8, align 8, !tbaa !5
  %57 = load i64, ptr %15, align 8, !tbaa !5
  %58 = srem i64 %56, %57
  %59 = icmp sgt i64 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  store i8 1, ptr %17, align 1, !tbaa !9
  br label %61

61:                                               ; preds = %60, %55, %40
  %62 = load i8, ptr %17, align 1, !tbaa !9, !range !11, !noundef !12
  %63 = trunc i8 %62 to i1
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = load i64, ptr %16, align 8, !tbaa !5
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %16, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %64, %61
  store i1 false, ptr %18, align 1
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %68 = load i64, ptr %16, align 8, !tbaa !5
  %69 = load i64, ptr %11, align 8, !tbaa !5
  %70 = mul nsw i64 %68, %69
  invoke void @_ZNSt6vectorIlSaIlEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %70)
          to label %71 unwind label %77

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %151, %71
  %73 = load i64, ptr %19, align 8, !tbaa !5
  %74 = load i64, ptr %16, align 8, !tbaa !5
  %75 = icmp ult i64 %73, %74
  br i1 %75, label %81, label %76

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

77:                                               ; preds = %67
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %13, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %14, align 4
  br label %159

81:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %82 = load i64, ptr %19, align 8, !tbaa !5
  %83 = load i64, ptr %15, align 8, !tbaa !5
  %84 = mul i64 %82, %83
  store i64 %84, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %85 = load i8, ptr %17, align 1, !tbaa !9, !range !11, !noundef !12
  %86 = trunc i8 %85 to i1
  br i1 %86, label %87, label %124

87:                                               ; preds = %81
  %88 = load i64, ptr %19, align 8, !tbaa !5
  %89 = load i64, ptr %16, align 8, !tbaa !5
  %90 = sub nsw i64 %89, 1
  %91 = icmp eq i64 %88, %90
  br i1 %91, label %92, label %124

92:                                               ; preds = %87
  %93 = load i64, ptr %8, align 8, !tbaa !5
  %94 = load i64, ptr %21, align 8, !tbaa !5
  %95 = sub i64 %93, %94
  %96 = load i64, ptr %10, align 8, !tbaa !5
  %97 = udiv i64 %95, %96
  store i64 %97, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %98 = load i64, ptr %8, align 8, !tbaa !5
  %99 = load i64, ptr %21, align 8, !tbaa !5
  %100 = sub i64 %98, %99
  %101 = load i64, ptr %10, align 8, !tbaa !5
  %102 = urem i64 %100, %101
  store i64 %102, ptr %23, align 8, !tbaa !5
  %103 = load i64, ptr %22, align 8, !tbaa !5
  %104 = load i64, ptr %9, align 8, !tbaa !5
  %105 = mul nsw i64 %103, %104
  %106 = load i64, ptr %21, align 8, !tbaa !5
  %107 = add i64 %106, %105
  store i64 %107, ptr %21, align 8, !tbaa !5
  %108 = load i64, ptr %9, align 8, !tbaa !5
  %109 = load i64, ptr %23, align 8, !tbaa !5
  %110 = icmp slt i64 %108, %109
  br i1 %110, label %111, label %114

111:                                              ; preds = %92
  %112 = load i64, ptr %22, align 8, !tbaa !5
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %22, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %111, %92
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %116 unwind label %120

116:                                              ; preds = %114
  %117 = load i64, ptr %115, align 8, !tbaa !5
  %118 = load i64, ptr %21, align 8, !tbaa !5
  %119 = add i64 %118, %117
  store i64 %119, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %131

120:                                              ; preds = %114
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %13, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %154

124:                                              ; preds = %87, %81
  %125 = load i64, ptr %11, align 8, !tbaa !5
  %126 = load i64, ptr %9, align 8, !tbaa !5
  %127 = mul nsw i64 %125, %126
  %128 = load i64, ptr %21, align 8, !tbaa !5
  %129 = add i64 %128, %127
  store i64 %129, ptr %21, align 8, !tbaa !5
  %130 = load i64, ptr %11, align 8, !tbaa !5
  store i64 %130, ptr %22, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %124, %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store i64 0, ptr %24, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %143, %131
  %133 = load i64, ptr %24, align 8, !tbaa !5
  %134 = load i64, ptr %22, align 8, !tbaa !5
  %135 = icmp slt i64 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %150

137:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %138 = load i64, ptr %24, align 8, !tbaa !5
  %139 = load i64, ptr %21, align 8, !tbaa !5
  %140 = add i64 %138, %139
  store i64 %140, ptr %25, align 8, !tbaa !5
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE12emplace_backIJmEEERlDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %142 unwind label %146

142:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %143

143:                                              ; preds = %142
  %144 = load i64, ptr %24, align 8, !tbaa !5
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %24, align 8, !tbaa !5
  br label %132, !llvm.loop !13

146:                                              ; preds = %137
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %13, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %154

150:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %151

151:                                              ; preds = %150
  %152 = load i64, ptr %19, align 8, !tbaa !5
  %153 = add i64 %152, 1
  store i64 %153, ptr %19, align 8, !tbaa !5
  br label %72, !llvm.loop !15

154:                                              ; preds = %146, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %159

155:                                              ; preds = %76
  store i1 true, ptr %18, align 1
  store i32 1, ptr %20, align 4
  %156 = load i1, ptr %18, align 1
  br i1 %156, label %158, label %157

157:                                              ; preds = %155
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %158

158:                                              ; preds = %157, %155
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  ret void

159:                                              ; preds = %154, %77
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %160

160:                                              ; preds = %159, %36
  %161 = load ptr, ptr %13, align 8
  %162 = load i32, ptr %14, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE12emplace_backIJmEEERlDpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !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<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [61 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2fl21partitionByRoundRobinEllllb(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i1 noundef zeroext %5) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i64 %2, ptr %7, align 8, !tbaa !5
  %10 = icmp sgt i64 %2, -1
  %.not = icmp slt i64 %2, %3
  %or.cond = and i1 %10, %.not
  br i1 %or.cond, label %16, label %11

11:                                               ; preds = %6
  %12 = tail call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull @.str)
          to label %13 unwind label %14

13:                                               ; preds = %11
  tail call void @__cxa_throw(ptr nonnull %12, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #7
  unreachable

14:                                               ; preds = %11
  %15 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %12) #6
  br label %66

16:                                               ; preds = %6
  %17 = mul nsw i64 %4, %3
  %18 = sdiv i64 %1, %17
  %19 = srem i64 %1, %17
  %20 = icmp sge i64 %19, %3
  %21 = icmp sgt i64 %19, 0
  %or.cond57 = and i1 %21, %5
  %spec.select61 = or i1 %20, %or.cond57
  %spec.select61.fr = freeze i1 %spec.select61
  %22 = zext i1 %spec.select61.fr to i64
  %spec.select = add i64 %18, %22
  tail call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %23 = mul nsw i64 %spec.select, %4
  invoke void @_ZNSt6vectorIlSaIlEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %23)
          to label %.preheader unwind label %36

.preheader:                                       ; preds = %16
  %.not67 = icmp eq i64 %spec.select, 0
  br i1 %.not67, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %.preheader
  %24 = add nsw i64 %spec.select, -1
  br i1 %spec.select61.fr, label %.lr.ph64.split, label %.lr.ph64.split.us

.lr.ph64.split.us:                                ; preds = %.lr.ph64
  %25 = icmp sgt i64 %4, 0
  br i1 %25, label %.lr.ph.us.us.preheader, label %._crit_edge65

.lr.ph.us.us.preheader:                           ; preds = %.lr.ph64.split.us
  %26 = mul nuw nsw i64 %2, %4
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %._crit_edge.us.us
  %.04563.us.us = phi i64 [ %34, %._crit_edge.us.us ], [ 0, %.lr.ph.us.us.preheader ]
  %27 = mul i64 %.04563.us.us, %17
  %28 = add i64 %26, %27
  br label %29

29:                                               ; preds = %.lr.ph.us.us, %32
  %.062.us.us = phi i64 [ 0, %.lr.ph.us.us ], [ %33, %32 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %30 = add i64 %.062.us.us, %28
  store i64 %30, ptr %9, align 8, !tbaa !5
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE12emplace_backIJmEEERlDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %32 unwind label %.split.us.split.us

32:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %33 = add nuw nsw i64 %.062.us.us, 1
  %exitcond.not = icmp eq i64 %33, %4
  br i1 %exitcond.not, label %._crit_edge.us.us, label %29, !llvm.loop !9

._crit_edge.us.us:                                ; preds = %32
  %34 = add nuw i64 %.04563.us.us, 1
  %exitcond70.not = icmp eq i64 %34, %spec.select
  br i1 %exitcond70.not, label %._crit_edge65, label %.lr.ph.us.us, !llvm.loop !11

.split.us.split.us:                               ; preds = %29
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %64

36:                                               ; preds = %16
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %65

.lr.ph64.split:                                   ; preds = %.lr.ph64, %._crit_edge
  %.04563 = phi i64 [ %58, %._crit_edge ], [ 0, %.lr.ph64 ]
  %38 = mul i64 %.04563, %17
  %39 = icmp eq i64 %.04563, %24
  br i1 %39, label %40, label %52

40:                                               ; preds = %.lr.ph64.split
  %41 = sub i64 %1, %38
  %42 = udiv i64 %41, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %43 = urem i64 %41, %3
  store i64 %43, ptr %8, align 8, !tbaa !5
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = mul nsw i64 %44, %42
  %46 = add i64 %45, %38
  %47 = icmp slt i64 %44, %43
  %48 = zext i1 %47 to i64
  %spec.select60 = add nsw i64 %42, %48
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = add i64 %46, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %56

52:                                               ; preds = %.lr.ph64.split
  %53 = load i64, ptr %7, align 8, !tbaa !5
  %54 = mul nsw i64 %53, %4
  %55 = add i64 %54, %38
  br label %56

56:                                               ; preds = %52, %40
  %.044 = phi i64 [ %51, %40 ], [ %55, %52 ]
  %.1 = phi i64 [ %spec.select60, %40 ], [ %4, %52 ]
  %57 = icmp sgt i64 %.1, 0
  br i1 %57, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %61, %56
  %58 = add nuw i64 %.04563, 1
  %exitcond72.not = icmp eq i64 %58, %spec.select
  br i1 %exitcond72.not, label %._crit_edge65, label %.lr.ph64.split, !llvm.loop !11

.lr.ph:                                           ; preds = %56, %61
  %.062 = phi i64 [ %62, %61 ], [ 0, %56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %59 = add i64 %.062, %.044
  store i64 %59, ptr %9, align 8, !tbaa !5
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE12emplace_backIJmEEERlDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %61 unwind label %.split

61:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %62 = add nuw nsw i64 %.062, 1
  %exitcond71.not = icmp eq i64 %62, %.1
  br i1 %exitcond71.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

.split:                                           ; preds = %.lr.ph
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %64

64:                                               ; preds = %.split.us.split.us, %.split
  %.us-phi = phi { ptr, i32 } [ %63, %.split ], [ %35, %.split.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %65

._crit_edge65:                                    ; preds = %._crit_edge.us.us, %._crit_edge, %.lr.ph64.split.us, %.preheader
  ret void

65:                                               ; preds = %64, %36
  %.pn = phi { ptr, i32 } [ %.us-phi, %64 ], [ %37, %36 ]
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %66

66:                                               ; preds = %65, %14
  %.pn55 = phi { ptr, i32 } [ %15, %14 ], [ %.pn, %65 ]
  resume { ptr, i32 } %.pn55
}

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE12emplace_backIJmEEERlDpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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 = !{!"long", !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,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass