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

; 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] }>

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@.str.36 = external hidden unnamed_addr constant [99 x i8], align 1
@__FUNCTION__._Z8TestMainv = external hidden unnamed_addr constant [9 x i8], align 1
@.str.42 = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: mustprogress uwtable
define dso_local noundef i32 @_Z8TestMainv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 20, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  %7 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %43, %0
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 2
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %46

12:                                               ; preds = %8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %33, %12
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 20
  br i1 %15, label %16, label %36

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %17 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  store i64 %17, ptr %6, align 8, !tbaa !9
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %16
  call void @_Z17LoadThreadsUnloadv()
  br label %22

21:                                               ; preds = %16
  call void @_Z17ThreadsLoadUnloadv()
  br label %22

22:                                               ; preds = %21, %20
  %23 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %24 = load i64, ptr %6, align 8, !tbaa !9
  %25 = sub i64 %23, %24
  store i64 %25, ptr %3, align 8, !tbaa !9
  %26 = load i64, ptr %3, align 8, !tbaa !9
  %27 = icmp eq i64 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %22
  store i32 5, ptr %5, align 4
  br label %30

29:                                               ; preds = %22
  store i32 0, ptr %5, align 4
  br label %30

30:                                               ; preds = %29, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %31 = load i32, ptr %5, align 4
  switch i32 %31, label %47 [
    i32 0, label %32
    i32 5, label %36
  ]

32:                                               ; preds = %30
  br label %33

33:                                               ; preds = %32
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

36:                                               ; preds = %30, %13
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 20
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.36, i64 noundef 158, ptr noundef @__FUNCTION__._Z8TestMainv)
  %41 = load i64, ptr %3, align 8, !tbaa !9
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %40, ptr noundef @.str.42, i64 noundef %41)
  call void @exit(i32 noundef 1) #5
  unreachable

42:                                               ; preds = %36
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %4, align 4, !tbaa !5
  br label %8, !llvm.loop !13

46:                                               ; preds = %11
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret i32 0

47:                                               ; preds = %30
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17LoadThreadsUnloadv() #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17ThreadsLoadUnloadv() #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

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 = { noreturn 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 = { nounwind }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !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] }>

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@.str.36 = external hidden unnamed_addr constant [99 x i8], align 1
@__FUNCTION__._Z8TestMainv = external hidden unnamed_addr constant [9 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [39 x i8], align 1

; 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 #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8TestMainv() local_unnamed_addr #1 {
  %1 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %.preheader

.preheader:                                       ; preds = %0, %.thread
  %.01119 = phi i32 [ 0, %0 ], [ %125, %.thread ]
  %.not = icmp eq i32 %.01119, 0
  %2 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br i1 %.not, label %.preheader.split.us.preheader, label %.preheader.split.preheader

.preheader.split.preheader:                       ; preds = %.preheader
  tail call void @_Z17LoadThreadsUnloadv()
  %3 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %4 = icmp eq i64 %3, %2
  br i1 %4, label %.thread, label %.preheader.split.1

.preheader.split.us.preheader:                    ; preds = %.preheader
  tail call void @_Z17ThreadsLoadUnloadv()
  %5 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %6 = icmp eq i64 %5, %2
  br i1 %6, label %.thread, label %.preheader.split.us.1

.preheader.split.us.1:                            ; preds = %.preheader.split.us.preheader
  %7 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %8 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %9 = icmp eq i64 %8, %7
  br i1 %9, label %.thread, label %.preheader.split.us.2

.preheader.split.us.2:                            ; preds = %.preheader.split.us.1
  %10 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %11 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %12 = icmp eq i64 %11, %10
  br i1 %12, label %.thread, label %.preheader.split.us.3

.preheader.split.us.3:                            ; preds = %.preheader.split.us.2
  %13 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %14 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %15 = icmp eq i64 %14, %13
  br i1 %15, label %.thread, label %.preheader.split.us.4

.preheader.split.us.4:                            ; preds = %.preheader.split.us.3
  %16 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %17 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %18 = icmp eq i64 %17, %16
  br i1 %18, label %.thread, label %.preheader.split.us.5

.preheader.split.us.5:                            ; preds = %.preheader.split.us.4
  %19 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %20 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %21 = icmp eq i64 %20, %19
  br i1 %21, label %.thread, label %.preheader.split.us.6

.preheader.split.us.6:                            ; preds = %.preheader.split.us.5
  %22 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %23 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %24 = icmp eq i64 %23, %22
  br i1 %24, label %.thread, label %.preheader.split.us.7

.preheader.split.us.7:                            ; preds = %.preheader.split.us.6
  %25 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %26 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %27 = icmp eq i64 %26, %25
  br i1 %27, label %.thread, label %.preheader.split.us.8

.preheader.split.us.8:                            ; preds = %.preheader.split.us.7
  %28 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %29 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %30 = icmp eq i64 %29, %28
  br i1 %30, label %.thread, label %.preheader.split.us.9

.preheader.split.us.9:                            ; preds = %.preheader.split.us.8
  %31 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %32 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %33 = icmp eq i64 %32, %31
  br i1 %33, label %.thread, label %.preheader.split.us.10

.preheader.split.us.10:                           ; preds = %.preheader.split.us.9
  %34 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %35 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %36 = icmp eq i64 %35, %34
  br i1 %36, label %.thread, label %.preheader.split.us.11

.preheader.split.us.11:                           ; preds = %.preheader.split.us.10
  %37 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %38 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %39 = icmp eq i64 %38, %37
  br i1 %39, label %.thread, label %.preheader.split.us.12

.preheader.split.us.12:                           ; preds = %.preheader.split.us.11
  %40 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %41 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %42 = icmp eq i64 %41, %40
  br i1 %42, label %.thread, label %.preheader.split.us.13

.preheader.split.us.13:                           ; preds = %.preheader.split.us.12
  %43 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %44 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %45 = icmp eq i64 %44, %43
  br i1 %45, label %.thread, label %.preheader.split.us.14

.preheader.split.us.14:                           ; preds = %.preheader.split.us.13
  %46 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %47 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %48 = icmp eq i64 %47, %46
  br i1 %48, label %.thread, label %.preheader.split.us.15

.preheader.split.us.15:                           ; preds = %.preheader.split.us.14
  %49 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %50 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %51 = icmp eq i64 %50, %49
  br i1 %51, label %.thread, label %.preheader.split.us.16

.preheader.split.us.16:                           ; preds = %.preheader.split.us.15
  %52 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %53 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %54 = icmp eq i64 %53, %52
  br i1 %54, label %.thread, label %.preheader.split.us.17

.preheader.split.us.17:                           ; preds = %.preheader.split.us.16
  %55 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %56 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %57 = icmp eq i64 %56, %55
  br i1 %57, label %.thread, label %.preheader.split.us.18

.preheader.split.us.18:                           ; preds = %.preheader.split.us.17
  %58 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %59 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %60 = icmp eq i64 %59, %58
  br i1 %60, label %.thread, label %.preheader.split.us.19

.preheader.split.us.19:                           ; preds = %.preheader.split.us.18
  %61 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17ThreadsLoadUnloadv()
  %62 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %63 = sub i64 %62, %61
  %64 = icmp eq i64 %63, 0
  br i1 %64, label %.thread, label %.split.us

65:                                               ; preds = %.thread
  ret i32 0

.preheader.split.1:                               ; preds = %.preheader.split.preheader
  %66 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %67 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %68 = icmp eq i64 %67, %66
  br i1 %68, label %.thread, label %.preheader.split.2

.preheader.split.2:                               ; preds = %.preheader.split.1
  %69 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %70 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %71 = icmp eq i64 %70, %69
  br i1 %71, label %.thread, label %.preheader.split.3

.preheader.split.3:                               ; preds = %.preheader.split.2
  %72 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %73 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %74 = icmp eq i64 %73, %72
  br i1 %74, label %.thread, label %.preheader.split.4

.preheader.split.4:                               ; preds = %.preheader.split.3
  %75 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %76 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %77 = icmp eq i64 %76, %75
  br i1 %77, label %.thread, label %.preheader.split.5

.preheader.split.5:                               ; preds = %.preheader.split.4
  %78 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %79 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %80 = icmp eq i64 %79, %78
  br i1 %80, label %.thread, label %.preheader.split.6

.preheader.split.6:                               ; preds = %.preheader.split.5
  %81 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %82 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %83 = icmp eq i64 %82, %81
  br i1 %83, label %.thread, label %.preheader.split.7

.preheader.split.7:                               ; preds = %.preheader.split.6
  %84 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %85 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %86 = icmp eq i64 %85, %84
  br i1 %86, label %.thread, label %.preheader.split.8

.preheader.split.8:                               ; preds = %.preheader.split.7
  %87 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %88 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %89 = icmp eq i64 %88, %87
  br i1 %89, label %.thread, label %.preheader.split.9

.preheader.split.9:                               ; preds = %.preheader.split.8
  %90 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %91 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %92 = icmp eq i64 %91, %90
  br i1 %92, label %.thread, label %.preheader.split.10

.preheader.split.10:                              ; preds = %.preheader.split.9
  %93 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %94 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %95 = icmp eq i64 %94, %93
  br i1 %95, label %.thread, label %.preheader.split.11

.preheader.split.11:                              ; preds = %.preheader.split.10
  %96 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %97 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %98 = icmp eq i64 %97, %96
  br i1 %98, label %.thread, label %.preheader.split.12

.preheader.split.12:                              ; preds = %.preheader.split.11
  %99 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %100 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %101 = icmp eq i64 %100, %99
  br i1 %101, label %.thread, label %.preheader.split.13

.preheader.split.13:                              ; preds = %.preheader.split.12
  %102 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %103 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %104 = icmp eq i64 %103, %102
  br i1 %104, label %.thread, label %.preheader.split.14

.preheader.split.14:                              ; preds = %.preheader.split.13
  %105 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %106 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %107 = icmp eq i64 %106, %105
  br i1 %107, label %.thread, label %.preheader.split.15

.preheader.split.15:                              ; preds = %.preheader.split.14
  %108 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %109 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %110 = icmp eq i64 %109, %108
  br i1 %110, label %.thread, label %.preheader.split.16

.preheader.split.16:                              ; preds = %.preheader.split.15
  %111 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %112 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %113 = icmp eq i64 %112, %111
  br i1 %113, label %.thread, label %.preheader.split.17

.preheader.split.17:                              ; preds = %.preheader.split.16
  %114 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %115 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %116 = icmp eq i64 %115, %114
  br i1 %116, label %.thread, label %.preheader.split.18

.preheader.split.18:                              ; preds = %.preheader.split.17
  %117 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %118 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %119 = icmp eq i64 %118, %117
  br i1 %119, label %.thread, label %.preheader.split.19

.preheader.split.19:                              ; preds = %.preheader.split.18
  %120 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  tail call void @_Z17LoadThreadsUnloadv()
  %121 = tail call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %122 = sub i64 %121, %120
  %123 = icmp eq i64 %122, 0
  br i1 %123, label %.thread, label %.split.us

.split.us:                                        ; preds = %.preheader.split.us.19, %.preheader.split.19
  %.us-phi = phi i64 [ %63, %.preheader.split.us.19 ], [ %122, %.preheader.split.19 ]
  %124 = tail call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.36, i64 noundef 158, ptr noundef nonnull @__FUNCTION__._Z8TestMainv)
  tail call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %124, ptr noundef nonnull @.str.42, i64 noundef %.us-phi)
  tail call void @exit(i32 noundef 1) #3
  unreachable

.thread:                                          ; preds = %.preheader.split.preheader, %.preheader.split.1, %.preheader.split.2, %.preheader.split.3, %.preheader.split.4, %.preheader.split.5, %.preheader.split.6, %.preheader.split.7, %.preheader.split.8, %.preheader.split.9, %.preheader.split.10, %.preheader.split.11, %.preheader.split.12, %.preheader.split.13, %.preheader.split.14, %.preheader.split.15, %.preheader.split.16, %.preheader.split.17, %.preheader.split.18, %.preheader.split.19, %.preheader.split.us.preheader, %.preheader.split.us.1, %.preheader.split.us.2, %.preheader.split.us.3, %.preheader.split.us.4, %.preheader.split.us.5, %.preheader.split.us.6, %.preheader.split.us.7, %.preheader.split.us.8, %.preheader.split.us.9, %.preheader.split.us.10, %.preheader.split.us.11, %.preheader.split.us.12, %.preheader.split.us.13, %.preheader.split.us.14, %.preheader.split.us.15, %.preheader.split.us.16, %.preheader.split.us.17, %.preheader.split.us.18, %.preheader.split.us.19
  %125 = add nuw nsw i32 %.01119, 1
  %exitcond.not = icmp eq i32 %125, 2
  br i1 %exitcond.not, label %65, label %.preheader, !llvm.loop !5
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17LoadThreadsUnloadv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17ThreadsLoadUnloadv() local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { noreturn 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 #3 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass