; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/test/test_ScalableAllocator.ll (Z22TestSmallFixedSizePoolv)

; 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.tbb::interface6::fixed_pool" = type { %"class.tbb::interface6::internal::pool_base", ptr, i64 }
%"class.tbb::interface6::internal::pool_base" = type { ptr }

@.str.20 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [48 x i8], align 1

; 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
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22TestSmallFixedSizePoolv() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca ptr, align 8
  %2 = alloca i8, align 1
  %3 = alloca i64, align 8
  %4 = alloca %"class.tbb::interface6::fixed_pool", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.tbb::interface6::fixed_pool", align 8
  %9 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #8
  store i8 0, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %61, %0
  %11 = load i64, ptr %3, align 8, !tbaa !9
  %12 = icmp ult i64 %11, 65536
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %78

14:                                               ; preds = %10
  %15 = load i64, ptr %3, align 8, !tbaa !9
  %16 = call noalias ptr @malloc(i64 noundef %15) #9
  store ptr %16, ptr %1, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #8
  %17 = load ptr, ptr %1, align 8, !tbaa !11
  %18 = load i64, ptr %3, align 8, !tbaa !9
  invoke void @_ZN3tbb10interface610fixed_poolC2EPvm(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef %17, i64 noundef %18)
          to label %19 unwind label %30

19:                                               ; preds = %14
  %20 = invoke noundef ptr @_ZN3tbb10interface68internal9pool_base6mallocEm(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 16)
          to label %21 unwind label %34

21:                                               ; preds = %19
  %22 = icmp ne ptr %20, null
  br i1 %22, label %27, label %23

23:                                               ; preds = %21
  %24 = invoke noundef ptr @_ZN3tbb10interface68internal9pool_base6mallocEm(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 9216)
          to label %25 unwind label %34

25:                                               ; preds = %23
  %26 = icmp ne ptr %24, null
  br label %27

27:                                               ; preds = %25, %21
  %28 = phi i1 [ true, %21 ], [ %26, %25 ]
  %29 = zext i1 %28 to i8
  store i8 %29, ptr %2, align 1, !tbaa !5
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  br label %52

30:                                               ; preds = %14
  %31 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %5, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %6, align 4
  br label %38

34:                                               ; preds = %23, %19
  %35 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %5, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %6, align 4
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  br label %38

38:                                               ; preds = %34, %30
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %6, align 4
  %41 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt16invalid_argument) #8
  %42 = icmp eq i32 %40, %41
  br i1 %42, label %43, label %63

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %44 = load ptr, ptr %5, align 8
  %45 = call ptr @__cxa_begin_catch(ptr %44) #8
  store ptr %45, ptr %7, align 8
  %46 = load i64, ptr %3, align 8, !tbaa !9
  %47 = icmp ne i64 %46, 0
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  br label %51

49:                                               ; preds = %43
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.20, i32 noundef 125, ptr noundef @.str.25, ptr noundef @.str.26)
          to label %50 unwind label %72

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50, %48
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %52

52:                                               ; preds = %66, %51, %27
  %53 = load ptr, ptr %1, align 8, !tbaa !11
  call void @free(ptr noundef %53) #8
  br label %54

54:                                               ; preds = %52
  %55 = load i64, ptr %3, align 8, !tbaa !9
  %56 = icmp ne i64 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %54
  %58 = load i64, ptr %3, align 8, !tbaa !9
  %59 = mul i64 3, %58
  br label %61

60:                                               ; preds = %54
  br label %61

61:                                               ; preds = %60, %57
  %62 = phi i64 [ %59, %57 ], [ 3, %60 ]
  store i64 %62, ptr %3, align 8, !tbaa !9
  br label %10, !llvm.loop !13

63:                                               ; preds = %39
  %64 = load ptr, ptr %5, align 8
  %65 = call ptr @__cxa_begin_catch(ptr %64) #8
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.20, i32 noundef 127, ptr noundef @.str.23, ptr noundef @.str.24)
          to label %66 unwind label %67

66:                                               ; preds = %63
  call void @__cxa_end_catch()
  br label %52

67:                                               ; preds = %63
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %5, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %6, align 4
  invoke void @__cxa_end_catch()
          to label %71 unwind label %118

71:                                               ; preds = %67
  br label %77

72:                                               ; preds = %49
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %5, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %6, align 4
  invoke void @__cxa_end_catch()
          to label %76 unwind label %118

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %77

77:                                               ; preds = %76, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %112

78:                                               ; preds = %13
  %79 = load i8, ptr %2, align 1, !tbaa !5, !range !15, !noundef !16
  %80 = trunc i8 %79 to i1
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  br label %83

82:                                               ; preds = %78
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.20, i32 noundef 150, ptr noundef @.str.27, ptr noundef @.str.28)
  br label %83

83:                                               ; preds = %82, %81
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #8
  invoke void @_ZN3tbb10interface610fixed_poolC2EPvm(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef null, i64 noundef 10485760)
          to label %84 unwind label %86

84:                                               ; preds = %83
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.20, i32 noundef 154, ptr noundef @.str.23, ptr noundef @.str.29)
          to label %85 unwind label %90

85:                                               ; preds = %84
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #8
  br label %102

86:                                               ; preds = %83
  %87 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %5, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %6, align 4
  br label %94

90:                                               ; preds = %84
  %91 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %5, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %6, align 4
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  br label %94

94:                                               ; preds = %90, %86
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #8
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %6, align 4
  %97 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt16invalid_argument) #8
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %103

99:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %100 = load ptr, ptr %5, align 8
  %101 = call ptr @__cxa_begin_catch(ptr %100) #8
  store ptr %101, ptr %9, align 8
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %102

102:                                              ; preds = %106, %99, %85
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  ret void

103:                                              ; preds = %95
  %104 = load ptr, ptr %5, align 8
  %105 = call ptr @__cxa_begin_catch(ptr %104) #8
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.20, i32 noundef 157, ptr noundef @.str.23, ptr noundef @.str.30)
          to label %106 unwind label %107

106:                                              ; preds = %103
  call void @__cxa_end_catch()
  br label %102

107:                                              ; preds = %103
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %5, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %6, align 4
  invoke void @__cxa_end_catch()
          to label %111 unwind label %118

111:                                              ; preds = %107
  br label %112

112:                                              ; preds = %111, %77
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %5, align 8
  %115 = load i32, ptr %6, align 4
  %116 = insertvalue { ptr, i32 } poison, ptr %114, 0
  %117 = insertvalue { ptr, i32 } %116, i32 %115, 1
  resume { ptr, i32 } %117

118:                                              ; preds = %107, %72, %67
  %119 = landingpad { ptr, i32 }
          catch ptr null
  %120 = extractvalue { ptr, i32 } %119, 0
  call void @__clang_call_terminate(ptr %120) #10
  unreachable
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb10interface610fixed_poolC2EPvm(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i64 noundef) unnamed_addr #3 align 2

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

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #5

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #6

; Function Attrs: nounwind
declare void @free(ptr noundef) #7

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 = { nounwind allocsize(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 #3 = { 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 #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 = { nounwind memory(none) }
attributes #6 = { noinline noreturn nounwind uwtable "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 #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { noreturn 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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}


; 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.tbb::interface6::fixed_pool" = type { %"class.tbb::interface6::internal::pool_base", ptr, i64 }
%"class.tbb::interface6::internal::pool_base" = type { ptr }

@.str.20 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [48 x i8], align 1

; 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
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22TestSmallFixedSizePoolv() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::interface6::fixed_pool", align 8
  %2 = alloca %"class.tbb::interface6::fixed_pool", align 8
  br label %4

3:                                                ; preds = %select.unfold
  br i1 %.1, label %35, label %34

4:                                                ; preds = %0, %select.unfold
  %.034 = phi i1 [ false, %0 ], [ %.1, %select.unfold ]
  %.01633 = phi i64 [ 0, %0 ], [ %spec.select, %select.unfold ]
  %5 = call noalias ptr @malloc(i64 noundef %.01633) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #9
  invoke void @_ZN3tbb10interface610fixed_poolC2EPvm(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef %5, i64 noundef %.01633)
          to label %6 unwind label %15

6:                                                ; preds = %4
  %7 = invoke noundef ptr @_ZN3tbb10interface68internal9pool_base6mallocEm(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef 16)
          to label %8 unwind label %17

8:                                                ; preds = %6
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %9, label %13

9:                                                ; preds = %8
  %10 = invoke noundef ptr @_ZN3tbb10interface68internal9pool_base6mallocEm(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef 9216)
          to label %11 unwind label %17

11:                                               ; preds = %9
  %12 = icmp ne ptr %10, null
  br label %13

13:                                               ; preds = %11, %8
  %14 = phi i1 [ true, %8 ], [ %12, %11 ]
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #9
  br label %select.unfold

15:                                               ; preds = %4
  %16 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  br label %19

17:                                               ; preds = %9, %6
  %18 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  br label %19

19:                                               ; preds = %17, %15
  %.pn24 = phi { ptr, i32 } [ %18, %17 ], [ %16, %15 ]
  %.017 = extractvalue { ptr, i32 } %.pn24, 1
  %.019 = extractvalue { ptr, i32 } %.pn24, 0
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #9
  %20 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt16invalid_argument) #9
  %21 = icmp eq i32 %.017, %20
  %22 = call ptr @__cxa_begin_catch(ptr %.019) #9
  br i1 %21, label %23, label %28

23:                                               ; preds = %19
  %.not26 = icmp eq i64 %.01633, 0
  br i1 %.not26, label %25, label %24

24:                                               ; preds = %23
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.20, i32 noundef 125, ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.26)
          to label %25 unwind label %32

25:                                               ; preds = %24, %23
  call void @__cxa_end_catch()
  br label %select.unfold

select.unfold:                                    ; preds = %29, %25, %13
  %.1 = phi i1 [ %14, %13 ], [ %.034, %25 ], [ %.034, %29 ]
  call void @free(ptr noundef %5) #9
  %.not30 = icmp eq i64 %.01633, 0
  %26 = mul nuw nsw i64 %.01633, 3
  %spec.select = select i1 %.not30, i64 3, i64 %26
  %27 = icmp ult i64 %spec.select, 65536
  br i1 %27, label %4, label %3

28:                                               ; preds = %19
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.20, i32 noundef 127, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.24)
          to label %29 unwind label %30

29:                                               ; preds = %28
  call void @__cxa_end_catch()
  br label %select.unfold

30:                                               ; preds = %28
  %31 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %52 unwind label %53

32:                                               ; preds = %24
  %33 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %52 unwind label %53

34:                                               ; preds = %3
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.20, i32 noundef 150, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28)
  br label %35

35:                                               ; preds = %3, %34
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #9
  invoke void @_ZN3tbb10interface610fixed_poolC2EPvm(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef null, i64 noundef 10485760)
          to label %36 unwind label %38

36:                                               ; preds = %35
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.20, i32 noundef 154, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.29)
          to label %37 unwind label %40

37:                                               ; preds = %36
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  br label %47

38:                                               ; preds = %35
  %39 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  br label %42

40:                                               ; preds = %36
  %41 = landingpad { ptr, i32 }
          catch ptr @_ZTISt16invalid_argument
          catch ptr null
  call void @_ZN3tbb10interface610fixed_poolD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  %.2 = extractvalue { ptr, i32 } %.pn, 1
  %.221 = extractvalue { ptr, i32 } %.pn, 0
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  %43 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt16invalid_argument) #9
  %44 = icmp eq i32 %.2, %43
  %45 = call ptr @__cxa_begin_catch(ptr %.221) #9
  br i1 %44, label %46, label %48

46:                                               ; preds = %42
  call void @__cxa_end_catch()
  br label %47

47:                                               ; preds = %49, %46, %37
  ret void

48:                                               ; preds = %42
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.20, i32 noundef 157, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.30)
          to label %49 unwind label %50

49:                                               ; preds = %48
  call void @__cxa_end_catch()
  br label %47

50:                                               ; preds = %48
  %51 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %52 unwind label %53

52:                                               ; preds = %30, %32, %50
  %.pn27.pn = phi { ptr, i32 } [ %51, %50 ], [ %31, %30 ], [ %33, %32 ]
  resume { ptr, i32 } %.pn27.pn

53:                                               ; preds = %50, %32, %30
  %54 = landingpad { ptr, i32 }
          catch ptr null
  %55 = extractvalue { ptr, i32 } %54, 0
  call void @__clang_call_terminate(ptr %55) #10
  unreachable
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb10interface610fixed_poolC2EPvm(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i64 noundef) unnamed_addr #3 align 2

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

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #5

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7

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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #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 = { nofree nosync nounwind memory(none) }
attributes #6 = { noinline noreturn nounwind uwtable "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 #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { noreturn 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)"}


; Effective O3 passes: AggressiveInstCombinePass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass