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

; 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.Harness::internal::Tracer" = type <{ i32, [4 x i8], ptr, ptr, i64, [8 x i8] }>
%"class.tbb::scalable_allocator" = type { i8 }
%class.minimalAllocFree = type { i8 }

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@.str.29 = external hidden unnamed_addr constant [98 x i8], align 1
@__FUNCTION__._Z17TestBootstrapLeakv = external hidden unnamed_addr constant [18 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [39 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef, i64 noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, ...) #2 align 2

; 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 noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z17TestBootstrapLeakv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.tbb::scalable_allocator", align 1
  %4 = alloca [930 x ptr], align 16
  %5 = alloca i32, align 4
  %6 = alloca %class.minimalAllocFree, align 1
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %class.minimalAllocFree, align 1
  %15 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 1024, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 930, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  call void @_ZN3tbb18scalable_allocatorIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  call void @llvm.lifetime.start.p0(i64 7440, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %25, %0
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = icmp slt i32 %17, 930
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %16
  %21 = call noundef ptr @_ZN3tbb18scalable_allocatorIcE8allocateEmPKv(ptr noundef nonnull align 1 dereferenceable(1) %3, i64 noundef 1024, ptr noundef null)
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [930 x ptr], ptr %4, i64 0, i64 %23
  store ptr %21, ptr %24, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %5, align 4, !tbaa !5
  br label %16, !llvm.loop !11

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  call void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1) %6, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %29 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  store i64 %29, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %41, %28
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 1000
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %44

34:                                               ; preds = %30
  %35 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %36 = load i64, ptr %7, align 8, !tbaa !13
  %37 = icmp ne i64 %35, %36
  br i1 %37, label %38, label %40

38:                                               ; preds = %34
  %39 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  store i64 %39, ptr %7, align 8, !tbaa !13
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %38, %34
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %8, align 4, !tbaa !5
  br label %30, !llvm.loop !15

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i64 0, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 200, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %67, %44
  %46 = load i32, ptr %11, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 3
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  store i32 8, ptr %12, align 4
  br label %70

49:                                               ; preds = %45
  %50 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  store i64 %50, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %56, %49
  %52 = load i32, ptr %13, align 4, !tbaa !5
  %53 = icmp slt i32 %52, 200
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %59

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  call void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1) %14, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %13, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %13, align 4, !tbaa !5
  br label %51, !llvm.loop !16

59:                                               ; preds = %54
  %60 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %61 = load i64, ptr %7, align 8, !tbaa !13
  %62 = sub i64 %60, %61
  store i64 %62, ptr %9, align 8, !tbaa !13
  %63 = load i64, ptr %9, align 8, !tbaa !13
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %66, label %65

65:                                               ; preds = %59
  store i32 8, ptr %12, align 4
  br label %70

66:                                               ; preds = %59
  br label %67

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

70:                                               ; preds = %65, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %71

71:                                               ; preds = %70
  %72 = load i64, ptr %9, align 8, !tbaa !13
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %74, label %77

74:                                               ; preds = %71
  %75 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.29, i64 noundef 83, ptr noundef @__FUNCTION__._Z17TestBootstrapLeakv)
  %76 = load i64, ptr %9, align 8, !tbaa !13
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %75, ptr noundef @.str.30, i64 noundef %76)
  br label %77

77:                                               ; preds = %74, %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %87, %77
  %79 = load i32, ptr %15, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 930
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %90

82:                                               ; preds = %78
  %83 = load i32, ptr %15, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [930 x ptr], ptr %4, i64 0, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  call void @_ZN3tbb18scalable_allocatorIcE10deallocateEPcm(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef %86, i64 noundef 1024)
  br label %87

87:                                               ; preds = %82
  %88 = load i32, ptr %15, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %15, align 4, !tbaa !5
  br label %78, !llvm.loop !18

90:                                               ; preds = %81
  %91 = load i64, ptr %9, align 8, !tbaa !13
  %92 = icmp sle i64 %91, 0
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 7440, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret i1 %92
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #3 = { 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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; 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.Harness::internal::Tracer" = type <{ i32, [4 x i8], ptr, ptr, i64, [8 x i8] }>
%"class.tbb::scalable_allocator" = type { i8 }
%class.minimalAllocFree = type { i8 }

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@.str.29 = external hidden unnamed_addr constant [98 x i8], align 1
@__FUNCTION__._Z17TestBootstrapLeakv = external hidden unnamed_addr constant [18 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [39 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 nounwind uwtable
declare dso_local noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, ...) local_unnamed_addr #2 align 2

; 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 noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z17TestBootstrapLeakv() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.tbb::scalable_allocator", align 1
  %3 = alloca [930 x ptr], align 16
  %4 = alloca %class.minimalAllocFree, align 1
  %5 = alloca %class.minimalAllocFree, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  store i32 1024, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #3
  call void @_ZN3tbb18scalable_allocatorIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #3
  call void @llvm.lifetime.start.p0(i64 7440, ptr nonnull %3) #3
  br label %8

6:                                                ; preds = %8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  call void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  %7 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %11

8:                                                ; preds = %0, %8
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %8 ]
  %9 = call noundef ptr @_ZN3tbb18scalable_allocatorIcE8allocateEmPKv(ptr noundef nonnull align 1 dereferenceable(1) %2, i64 noundef 1024, ptr noundef null)
  %10 = getelementptr inbounds [930 x ptr], ptr %3, i64 0, i64 %indvars.iv
  store ptr %9, ptr %10, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 930
  br i1 %exitcond.not, label %6, label %8, !llvm.loop !11

11:                                               ; preds = %6, %15
  %.02234 = phi i32 [ 0, %6 ], [ %16, %15 ]
  %.02433 = phi i64 [ %7, %6 ], [ %.125, %15 ]
  %12 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %.not28 = icmp eq i64 %12, %.02433
  br i1 %.not28, label %15, label %13

13:                                               ; preds = %11
  %14 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %15

15:                                               ; preds = %11, %13
  %.125 = phi i64 [ %14, %13 ], [ %.02433, %11 ]
  %.123 = phi i32 [ -1, %13 ], [ %.02234, %11 ]
  %16 = add nsw i32 %.123, 1
  %17 = icmp slt i32 %.123, 999
  br i1 %17, label %11, label %.preheader.preheader, !llvm.loop !13

.preheader.preheader:                             ; preds = %15
  %18 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %33

.preheader.1:                                     ; preds = %31
  %19 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %20

20:                                               ; preds = %20, %.preheader.1
  %.01835.1 = phi i32 [ 0, %.preheader.1 ], [ %21, %20 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  %21 = add nuw nsw i32 %.01835.1, 1
  %exitcond40.1.not = icmp eq i32 %21, 200
  br i1 %exitcond40.1.not, label %22, label %20, !llvm.loop !14

22:                                               ; preds = %20
  %23 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %.not.1 = icmp eq i64 %23, %19
  br i1 %.not.1, label %.thread, label %.preheader.2

.preheader.2:                                     ; preds = %22
  %24 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %25

25:                                               ; preds = %25, %.preheader.2
  %.01835.2 = phi i32 [ 0, %.preheader.2 ], [ %26, %25 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  %26 = add nuw nsw i32 %.01835.2, 1
  %exitcond40.2.not = icmp eq i32 %26, 200
  br i1 %exitcond40.2.not, label %27, label %25, !llvm.loop !14

27:                                               ; preds = %25
  %28 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %29 = sub i64 %28, %24
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %35, label %.thread

31:                                               ; preds = %33
  %32 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %.not = icmp eq i64 %32, %18
  br i1 %.not, label %.thread, label %.preheader.1

33:                                               ; preds = %.preheader.preheader, %33
  %.01835 = phi i32 [ 0, %.preheader.preheader ], [ %34, %33 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  %34 = add nuw nsw i32 %.01835, 1
  %exitcond40.not = icmp eq i32 %34, 200
  br i1 %exitcond40.not, label %31, label %33, !llvm.loop !14

35:                                               ; preds = %27
  %36 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.29, i64 noundef 83, ptr noundef nonnull @__FUNCTION__._Z17TestBootstrapLeakv)
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %36, ptr noundef nonnull @.str.30, i64 noundef %29)
  br label %.thread

.thread:                                          ; preds = %31, %22, %27, %35
  %.130 = phi i1 [ false, %35 ], [ true, %27 ], [ true, %22 ], [ true, %31 ]
  br label %38

37:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 7440, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  ret i1 %.130

38:                                               ; preds = %.thread, %38
  %indvars.iv42 = phi i64 [ 0, %.thread ], [ %indvars.iv.next43, %38 ]
  %39 = getelementptr inbounds [930 x ptr], ptr %3, i64 0, i64 %indvars.iv42
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  call void @_ZN3tbb18scalable_allocatorIcE10deallocateEPcm(ptr noundef nonnull align 1 dereferenceable(1) %2, ptr noundef %40, i64 noundef 1024)
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next43, 930
  br i1 %exitcond45.not, label %37, label %38, !llvm.loop !15
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9RunThreadI16minimalAllocFreeiEvRKT_RKT0_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #3 = { 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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass