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

; 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::task_scheduler_init" = type { ptr }

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@MinBaseDepth = external dso_local global i32, align 4
@MaxBaseDepth = external dso_local global i32, align 4
@BaseDepth = external dso_local global i32, align 4
@TestSwitchBetweenMastersRepeats = external dso_local global i32, align 4
@g_TestFailures = external dso_local global [8 x i32], align 16
@P = external dso_local global i32, align 4
@Low = external dso_local global i32, align 4
@High = external dso_local global i32, align 4
@.str.21 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZL7Verbose = external hidden global i8, align 1
@__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv = external hidden unnamed_addr constant [36 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [54 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 void @_Z14PrepareGlobalsi(i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z35TestPrioritySwitchBetweenTwoMastersv() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::task_scheduler_init", align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = load i32, ptr @P, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 12
  br i1 %8, label %9, label %15

9:                                                ; preds = %0
  %10 = call noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi296EEEbv()
  br i1 %10, label %11, label %12

11:                                               ; preds = %9
  br label %14

12:                                               ; preds = %9
  %13 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.21, i64 noundef 296, ptr noundef @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %13, ptr noundef @.str.25)
  br label %14

14:                                               ; preds = %12, %11
  br label %146

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef -1, i64 noundef 0)
  %16 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %17 = trunc i8 %16 to i1
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  br label %31

19:                                               ; preds = %15
  %20 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.21, i64 noundef 300, ptr noundef @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
          to label %21 unwind label %38

21:                                               ; preds = %19
  %22 = load i32, ptr @Low, align 4, !tbaa !13
  %23 = icmp eq i32 %22, 536870911
  %24 = zext i1 %23 to i64
  %25 = select i1 %23, ptr @.str.27, ptr @.str.28
  %26 = load i32, ptr @High, align 4, !tbaa !13
  %27 = icmp eq i32 %26, 1073741822
  %28 = zext i1 %27 to i64
  %29 = select i1 %27, ptr @.str.28, ptr @.str.29
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %20, ptr noundef @.str.26, ptr noundef %25, ptr noundef %29)
          to label %30 unwind label %38

30:                                               ; preds = %21
  br label %31

31:                                               ; preds = %30, %18
  invoke void @_Z14PrepareGlobalsi(i32 noundef 2)
          to label %32 unwind label %38

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %69, %32
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = load i32, ptr @TestSwitchBetweenMastersRepeats, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %42, label %37

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

38:                                               ; preds = %31, %21, %19
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %2, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %3, align 4
  br label %152

42:                                               ; preds = %33
  %43 = load i32, ptr @MinBaseDepth, align 4, !tbaa !5
  store i32 %43, ptr @BaseDepth, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %65, %42
  %45 = load i32, ptr @BaseDepth, align 4, !tbaa !5
  %46 = load i32, ptr @MaxBaseDepth, align 4, !tbaa !5
  %47 = icmp sle i32 %45, %46
  br i1 %47, label %48, label %68

48:                                               ; preds = %44
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 0, i64 noundef 0)
          to label %49 unwind label %60

49:                                               ; preds = %48
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 1, i64 noundef 1)
          to label %50 unwind label %60

50:                                               ; preds = %49
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 2, i64 noundef 0)
          to label %51 unwind label %60

51:                                               ; preds = %50
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 3, i64 noundef 1)
          to label %52 unwind label %60

52:                                               ; preds = %51
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %64

55:                                               ; preds = %52
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 4, i64 noundef 2)
          to label %56 unwind label %60

56:                                               ; preds = %55
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 5, i64 noundef 2)
          to label %57 unwind label %60

57:                                               ; preds = %56
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NestedGroupNodeTaskEvim(i32 noundef 6, i64 noundef 2)
          to label %58 unwind label %60

58:                                               ; preds = %57
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NestedGroupNodeTaskEvim(i32 noundef 7, i64 noundef 6)
          to label %59 unwind label %60

59:                                               ; preds = %58
  br label %64

60:                                               ; preds = %58, %57, %56, %55, %51, %50, %49, %48
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %2, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %152

64:                                               ; preds = %59, %52
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr @BaseDepth, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr @BaseDepth, align 4, !tbaa !5
  br label %44, !llvm.loop !15

68:                                               ; preds = %44
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %4, align 4, !tbaa !5
  br label %33, !llvm.loop !17

72:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %73 = load i32, ptr @TestSwitchBetweenMastersRepeats, align 4, !tbaa !5
  %74 = load i32, ptr @MaxBaseDepth, align 4, !tbaa !5
  %75 = load i32, ptr @MinBaseDepth, align 4, !tbaa !5
  %76 = sub nsw i32 %74, %75
  %77 = add nsw i32 %76, 1
  %78 = mul nsw i32 %73, %77
  store i32 %78, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %141, %72
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = icmp slt i32 %80, 8
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %144

83:                                               ; preds = %79
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [8 x i32], ptr @g_TestFailures, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %108

89:                                               ; preds = %83
  %90 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %91 = trunc i8 %90 to i1
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  br label %103

93:                                               ; preds = %89
  %94 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.21, i64 noundef 320, ptr noundef @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
          to label %95 unwind label %104

95:                                               ; preds = %93
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [8 x i32], ptr @g_TestFailures, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %5, align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %94, ptr noundef @.str.30, i32 noundef %96, i32 noundef %100, i32 noundef %101)
          to label %102 unwind label %104

102:                                              ; preds = %95
  br label %103

103:                                              ; preds = %102, %92
  br label %108

104:                                              ; preds = %131, %129, %126, %124, %120, %95, %93
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %2, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %151

108:                                              ; preds = %103, %83
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [8 x i32], ptr @g_TestFailures, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = mul nsw i32 %112, 100
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sdiv i32 %113, %114
  %116 = icmp sgt i32 %115, 50
  br i1 %116, label %117, label %140

117:                                              ; preds = %108
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = icmp eq i32 %118, 1
  br i1 %119, label %120, label %129

120:                                              ; preds = %117
  %121 = invoke noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi323EEEbv()
          to label %122 unwind label %104

122:                                              ; preds = %120
  br i1 %121, label %123, label %124

123:                                              ; preds = %122
  br label %128

124:                                              ; preds = %122
  %125 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.21, i64 noundef 323, ptr noundef @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
          to label %126 unwind label %104

126:                                              ; preds = %124
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %125, ptr noundef @.str.31)
          to label %127 unwind label %104

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127, %123
  br label %139

129:                                              ; preds = %117
  %130 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.21, i64 noundef 325, ptr noundef @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
          to label %131 unwind label %104

131:                                              ; preds = %129
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [8 x i32], ptr @g_TestFailures, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %5, align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %130, ptr noundef @.str.32, i32 noundef %132, i32 noundef %136, i32 noundef %137)
          to label %138 unwind label %104

138:                                              ; preds = %131
  br label %139

139:                                              ; preds = %138, %128
  br label %140

140:                                              ; preds = %139, %108
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %6, align 4, !tbaa !5
  br label %79, !llvm.loop !18

144:                                              ; preds = %82
  invoke void @_Z12ClearGlobalsv()
          to label %145 unwind label %147

145:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  br label %146

146:                                              ; preds = %145, %14
  ret void

147:                                              ; preds = %144
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %2, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %3, align 4
  br label %151

151:                                              ; preds = %147, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %152

152:                                              ; preds = %151, %60, %38
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %2, align 8
  %155 = load i32, ptr %3, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi296EEEbv() #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i64 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi323EEEbv() #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN3tbb10priority_tE", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !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.Harness::internal::Tracer" = type <{ i32, [4 x i8], ptr, ptr, i64, [8 x i8] }>
%"class.tbb::task_scheduler_init" = type { ptr }

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@MinBaseDepth = external dso_local local_unnamed_addr global i32, align 4
@MaxBaseDepth = external dso_local local_unnamed_addr global i32, align 4
@BaseDepth = external dso_local local_unnamed_addr global i32, align 4
@TestSwitchBetweenMastersRepeats = external dso_local local_unnamed_addr global i32, align 4
@g_TestFailures = external dso_local local_unnamed_addr global [8 x i32], align 16
@P = external dso_local local_unnamed_addr global i32, align 4
@Low = external dso_local local_unnamed_addr global i32, align 4
@High = external dso_local local_unnamed_addr global i32, align 4
@.str.21 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZL7Verbose = external hidden local_unnamed_addr global i8, align 1
@__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv = external hidden unnamed_addr constant [36 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [54 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 void @_Z14PrepareGlobalsi(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z35TestPrioritySwitchBetweenTwoMastersv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::task_scheduler_init", align 8
  %2 = load i32, ptr @P, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 12
  br i1 %3, label %4, label %8

4:                                                ; preds = %0
  %5 = tail call noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi296EEEbv()
  br i1 %5, label %179, label %6

6:                                                ; preds = %4
  %7 = tail call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 296, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  tail call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %7, ptr noundef nonnull @.str.25)
  br label %179

8:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef -1, i64 noundef 0)
  %9 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %19

11:                                               ; preds = %8
  %12 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 300, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %13 = load i32, ptr @Low, align 4, !tbaa !13
  %14 = icmp eq i32 %13, 536870911
  %15 = select i1 %14, ptr @.str.27, ptr @.str.28
  %16 = load i32, ptr @High, align 4, !tbaa !13
  %17 = icmp eq i32 %16, 1073741822
  %18 = select i1 %17, ptr @.str.28, ptr @.str.29
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %12, ptr noundef nonnull @.str.26, ptr noundef nonnull %15, ptr noundef nonnull %18)
          to label %19 unwind label %59

19:                                               ; preds = %11, %8
  invoke void @_Z14PrepareGlobalsi(i32 noundef 2)
          to label %.preheader unwind label %59

.preheader:                                       ; preds = %19
  %20 = load i32, ptr @TestSwitchBetweenMastersRepeats, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  %.pre = load i32, ptr @MaxBaseDepth, align 4, !tbaa !5
  %.pre43 = load i32, ptr @MinBaseDepth, align 4, !tbaa !5
  br i1 %21, label %.lr.ph28, label %._crit_edge29

.lr.ph28:                                         ; preds = %.preheader
  %22 = icmp sgt i32 %.pre43, %.pre
  br i1 %22, label %.lr.ph28.split.us, label %.lr.ph28.split

.lr.ph28.split.us:                                ; preds = %.lr.ph28
  store i32 %.pre43, ptr @BaseDepth, align 4, !tbaa !5
  br label %._crit_edge29

._crit_edge29.loopexit33:                         ; preds = %._crit_edge
  %.pre42 = load i32, ptr @MinBaseDepth, align 4, !tbaa !5
  br label %._crit_edge29

._crit_edge29:                                    ; preds = %._crit_edge29.loopexit33, %.lr.ph28.split.us, %.preheader
  %23 = phi i32 [ %.pre43, %.preheader ], [ %.pre43, %.lr.ph28.split.us ], [ %.pre42, %._crit_edge29.loopexit33 ]
  %24 = phi i32 [ %.pre, %.preheader ], [ %.pre, %.lr.ph28.split.us ], [ %84, %._crit_edge29.loopexit33 ]
  %.lcssa = phi i32 [ %20, %.preheader ], [ %20, %.lr.ph28.split.us ], [ %86, %._crit_edge29.loopexit33 ]
  %25 = add i32 %24, 1
  %26 = sub i32 %25, %23
  %27 = mul nsw i32 %26, %.lcssa
  %28 = load i32, ptr @g_TestFailures, align 16, !tbaa !5
  %.not.peel = icmp eq i32 %28, 0
  br i1 %.not.peel, label %35, label %29

29:                                               ; preds = %._crit_edge29
  %30 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  %33 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %34 = load i32, ptr @g_TestFailures, align 16, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %33, ptr noundef nonnull @.str.30, i32 noundef 0, i32 noundef %34, i32 noundef %27)
          to label %._crit_edge44 unwind label %.loopexit.split-lp

._crit_edge44:                                    ; preds = %32
  %.pre45 = load i32, ptr @g_TestFailures, align 16, !tbaa !5
  br label %35

35:                                               ; preds = %._crit_edge44, %29, %._crit_edge29
  %36 = phi i32 [ %.pre45, %._crit_edge44 ], [ %28, %29 ], [ 0, %._crit_edge29 ]
  %37 = mul nsw i32 %36, 100
  %38 = sdiv i32 %37, %27
  %39 = icmp sgt i32 %38, 50
  br i1 %39, label %40, label %.peel.next

40:                                               ; preds = %35
  %41 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %42 = load i32, ptr @g_TestFailures, align 16, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %41, ptr noundef nonnull @.str.32, i32 noundef 0, i32 noundef %42, i32 noundef %27)
          to label %.peel.next unwind label %.loopexit.split-lp

.peel.next:                                       ; preds = %35, %40
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 4), align 4, !tbaa !5
  %.not.peel37 = icmp eq i32 %43, 0
  br i1 %.not.peel37, label %50, label %44

44:                                               ; preds = %.peel.next
  %45 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %47, label %50

47:                                               ; preds = %44
  %48 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 4), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %48, ptr noundef nonnull @.str.30, i32 noundef 1, i32 noundef %49, i32 noundef %27)
          to label %._crit_edge49 unwind label %.loopexit.split-lp

._crit_edge49:                                    ; preds = %47
  %.pre50 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 4), align 4, !tbaa !5
  br label %50

50:                                               ; preds = %._crit_edge49, %44, %.peel.next
  %51 = phi i32 [ %.pre50, %._crit_edge49 ], [ %43, %44 ], [ 0, %.peel.next ]
  %52 = mul nsw i32 %51, 100
  %53 = sdiv i32 %52, %27
  %54 = icmp sgt i32 %53, 50
  br i1 %54, label %55, label %.peel.next36

55:                                               ; preds = %50
  %56 = call noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi323EEEbv()
  br i1 %56, label %.peel.next36, label %57

57:                                               ; preds = %55
  %58 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 323, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %58, ptr noundef nonnull @.str.31)
          to label %.peel.next36 unwind label %.loopexit.split-lp

59:                                               ; preds = %19, %11
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %182

.lr.ph28.split:                                   ; preds = %.lr.ph28, %._crit_edge
  %61 = phi i32 [ %84, %._crit_edge ], [ %.pre, %.lr.ph28 ]
  %.01727 = phi i32 [ %85, %._crit_edge ], [ 0, %.lr.ph28 ]
  %62 = load i32, ptr @MinBaseDepth, align 4, !tbaa !5
  store i32 %62, ptr @BaseDepth, align 4, !tbaa !5
  %.not2226 = icmp sgt i32 %62, %61
  br i1 %.not2226, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph28.split
  %63 = icmp eq i32 %.01727, 0
  br i1 %63, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %71
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 0, i64 noundef 0)
          to label %64 unwind label %.split.us

64:                                               ; preds = %.lr.ph.split.us
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 1, i64 noundef 1)
          to label %65 unwind label %.split.us

65:                                               ; preds = %64
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 2, i64 noundef 0)
          to label %66 unwind label %.split.us

66:                                               ; preds = %65
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 3, i64 noundef 1)
          to label %67 unwind label %.split.us

67:                                               ; preds = %66
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 4, i64 noundef 2)
          to label %68 unwind label %.split.us

68:                                               ; preds = %67
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 5, i64 noundef 2)
          to label %69 unwind label %.split.us

69:                                               ; preds = %68
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NestedGroupNodeTaskEvim(i32 noundef 6, i64 noundef 2)
          to label %70 unwind label %.split.us

70:                                               ; preds = %69
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NestedGroupNodeTaskEvim(i32 noundef 7, i64 noundef 6)
          to label %71 unwind label %.split.us

71:                                               ; preds = %70
  %72 = load i32, ptr @BaseDepth, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @BaseDepth, align 4, !tbaa !5
  %74 = load i32, ptr @MaxBaseDepth, align 4, !tbaa !5
  %.not22.us.not = icmp slt i32 %72, %74
  br i1 %.not22.us.not, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !15

.split.us:                                        ; preds = %70, %69, %68, %67, %66, %65, %64, %.lr.ph.split.us
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %182

.lr.ph.split:                                     ; preds = %.lr.ph, %79
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 0, i64 noundef 0)
          to label %76 unwind label %.split

76:                                               ; preds = %.lr.ph.split
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef 1, i64 noundef 1)
          to label %77 unwind label %.split

77:                                               ; preds = %76
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 2, i64 noundef 0)
          to label %78 unwind label %.split

78:                                               ; preds = %77
  invoke void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef 3, i64 noundef 1)
          to label %79 unwind label %.split

79:                                               ; preds = %78
  %80 = load i32, ptr @BaseDepth, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr @BaseDepth, align 4, !tbaa !5
  %82 = load i32, ptr @MaxBaseDepth, align 4, !tbaa !5
  %.not22.not = icmp slt i32 %80, %82
  br i1 %.not22.not, label %.lr.ph.split, label %._crit_edge, !llvm.loop !15

.split:                                           ; preds = %78, %77, %76, %.lr.ph.split
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %182

._crit_edge:                                      ; preds = %79, %71, %.lr.ph28.split
  %84 = phi i32 [ %61, %.lr.ph28.split ], [ %74, %71 ], [ %82, %79 ]
  %85 = add nuw nsw i32 %.01727, 1
  %86 = load i32, ptr @TestSwitchBetweenMastersRepeats, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %.lr.ph28.split, label %._crit_edge29.loopexit33, !llvm.loop !17

.peel.next36:                                     ; preds = %57, %55, %50
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 8), align 8, !tbaa !5
  %.not = icmp eq i32 %88, 0
  br i1 %.not, label %95, label %89

89:                                               ; preds = %.peel.next36
  %90 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %91 = trunc nuw i8 %90 to i1
  br i1 %91, label %92, label %95

92:                                               ; preds = %89
  %93 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %94 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 8), align 8, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %93, ptr noundef nonnull @.str.30, i32 noundef 2, i32 noundef %94, i32 noundef %27)
          to label %._crit_edge53 unwind label %.loopexit

._crit_edge53:                                    ; preds = %92
  %.pre54 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 8), align 8, !tbaa !5
  br label %95

.loopexit:                                        ; preds = %175, %167, %160, %152, %145, %137, %130, %122, %115, %107, %92, %100
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %182

.loopexit.split-lp:                               ; preds = %32, %40, %47, %57
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %182

95:                                               ; preds = %._crit_edge53, %89, %.peel.next36
  %96 = phi i32 [ %.pre54, %._crit_edge53 ], [ %88, %89 ], [ 0, %.peel.next36 ]
  %97 = mul nsw i32 %96, 100
  %98 = sdiv i32 %97, %27
  %99 = icmp sgt i32 %98, 50
  br i1 %99, label %100, label %.peel.next36.1

100:                                              ; preds = %95
  %101 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 8), align 8, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %101, ptr noundef nonnull @.str.32, i32 noundef 2, i32 noundef %102, i32 noundef %27)
          to label %.peel.next36.1 unwind label %.loopexit

.peel.next36.1:                                   ; preds = %95, %100
  %103 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 12), align 4, !tbaa !5
  %.not.1 = icmp eq i32 %103, 0
  br i1 %.not.1, label %110, label %104

104:                                              ; preds = %.peel.next36.1
  %105 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %106 = trunc nuw i8 %105 to i1
  br i1 %106, label %107, label %110

107:                                              ; preds = %104
  %108 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %109 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 12), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %108, ptr noundef nonnull @.str.30, i32 noundef 3, i32 noundef %109, i32 noundef %27)
          to label %._crit_edge53.1 unwind label %.loopexit

._crit_edge53.1:                                  ; preds = %107
  %.pre54.1 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 12), align 4, !tbaa !5
  br label %110

110:                                              ; preds = %._crit_edge53.1, %104, %.peel.next36.1
  %111 = phi i32 [ %.pre54.1, %._crit_edge53.1 ], [ %103, %104 ], [ 0, %.peel.next36.1 ]
  %112 = mul nsw i32 %111, 100
  %113 = sdiv i32 %112, %27
  %114 = icmp sgt i32 %113, 50
  br i1 %114, label %115, label %.peel.next36.2

115:                                              ; preds = %110
  %116 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %117 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 12), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %116, ptr noundef nonnull @.str.32, i32 noundef 3, i32 noundef %117, i32 noundef %27)
          to label %.peel.next36.2 unwind label %.loopexit

.peel.next36.2:                                   ; preds = %115, %110
  %118 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 16), align 16, !tbaa !5
  %.not.2 = icmp eq i32 %118, 0
  br i1 %.not.2, label %125, label %119

119:                                              ; preds = %.peel.next36.2
  %120 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %121 = trunc nuw i8 %120 to i1
  br i1 %121, label %122, label %125

122:                                              ; preds = %119
  %123 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 16), align 16, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %123, ptr noundef nonnull @.str.30, i32 noundef 4, i32 noundef %124, i32 noundef %27)
          to label %._crit_edge53.2 unwind label %.loopexit

._crit_edge53.2:                                  ; preds = %122
  %.pre54.2 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 16), align 16, !tbaa !5
  br label %125

125:                                              ; preds = %._crit_edge53.2, %119, %.peel.next36.2
  %126 = phi i32 [ %.pre54.2, %._crit_edge53.2 ], [ %118, %119 ], [ 0, %.peel.next36.2 ]
  %127 = mul nsw i32 %126, 100
  %128 = sdiv i32 %127, %27
  %129 = icmp sgt i32 %128, 50
  br i1 %129, label %130, label %.peel.next36.3

130:                                              ; preds = %125
  %131 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %132 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 16), align 16, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %131, ptr noundef nonnull @.str.32, i32 noundef 4, i32 noundef %132, i32 noundef %27)
          to label %.peel.next36.3 unwind label %.loopexit

.peel.next36.3:                                   ; preds = %130, %125
  %133 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 20), align 4, !tbaa !5
  %.not.3 = icmp eq i32 %133, 0
  br i1 %.not.3, label %140, label %134

134:                                              ; preds = %.peel.next36.3
  %135 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %136 = trunc nuw i8 %135 to i1
  br i1 %136, label %137, label %140

137:                                              ; preds = %134
  %138 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %139 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 20), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %138, ptr noundef nonnull @.str.30, i32 noundef 5, i32 noundef %139, i32 noundef %27)
          to label %._crit_edge53.3 unwind label %.loopexit

._crit_edge53.3:                                  ; preds = %137
  %.pre54.3 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 20), align 4, !tbaa !5
  br label %140

140:                                              ; preds = %._crit_edge53.3, %134, %.peel.next36.3
  %141 = phi i32 [ %.pre54.3, %._crit_edge53.3 ], [ %133, %134 ], [ 0, %.peel.next36.3 ]
  %142 = mul nsw i32 %141, 100
  %143 = sdiv i32 %142, %27
  %144 = icmp sgt i32 %143, 50
  br i1 %144, label %145, label %.peel.next36.4

145:                                              ; preds = %140
  %146 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %147 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 20), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %146, ptr noundef nonnull @.str.32, i32 noundef 5, i32 noundef %147, i32 noundef %27)
          to label %.peel.next36.4 unwind label %.loopexit

.peel.next36.4:                                   ; preds = %145, %140
  %148 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 24), align 8, !tbaa !5
  %.not.4 = icmp eq i32 %148, 0
  br i1 %.not.4, label %155, label %149

149:                                              ; preds = %.peel.next36.4
  %150 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %151 = trunc nuw i8 %150 to i1
  br i1 %151, label %152, label %155

152:                                              ; preds = %149
  %153 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %154 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 24), align 8, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %153, ptr noundef nonnull @.str.30, i32 noundef 6, i32 noundef %154, i32 noundef %27)
          to label %._crit_edge53.4 unwind label %.loopexit

._crit_edge53.4:                                  ; preds = %152
  %.pre54.4 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 24), align 8, !tbaa !5
  br label %155

155:                                              ; preds = %._crit_edge53.4, %149, %.peel.next36.4
  %156 = phi i32 [ %.pre54.4, %._crit_edge53.4 ], [ %148, %149 ], [ 0, %.peel.next36.4 ]
  %157 = mul nsw i32 %156, 100
  %158 = sdiv i32 %157, %27
  %159 = icmp sgt i32 %158, 50
  br i1 %159, label %160, label %.peel.next36.5

160:                                              ; preds = %155
  %161 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 24), align 8, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %161, ptr noundef nonnull @.str.32, i32 noundef 6, i32 noundef %162, i32 noundef %27)
          to label %.peel.next36.5 unwind label %.loopexit

.peel.next36.5:                                   ; preds = %160, %155
  %163 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 28), align 4, !tbaa !5
  %.not.5 = icmp eq i32 %163, 0
  br i1 %.not.5, label %170, label %164

164:                                              ; preds = %.peel.next36.5
  %165 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %166 = trunc nuw i8 %165 to i1
  br i1 %166, label %167, label %170

167:                                              ; preds = %164
  %168 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 320, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %169 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 28), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %168, ptr noundef nonnull @.str.30, i32 noundef 7, i32 noundef %169, i32 noundef %27)
          to label %._crit_edge53.5 unwind label %.loopexit

._crit_edge53.5:                                  ; preds = %167
  %.pre54.5 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 28), align 4, !tbaa !5
  br label %170

170:                                              ; preds = %._crit_edge53.5, %164, %.peel.next36.5
  %171 = phi i32 [ %.pre54.5, %._crit_edge53.5 ], [ %163, %164 ], [ 0, %.peel.next36.5 ]
  %172 = mul nsw i32 %171, 100
  %173 = sdiv i32 %172, %27
  %174 = icmp sgt i32 %173, 50
  br i1 %174, label %175, label %.loopexit41

175:                                              ; preds = %170
  %176 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.21, i64 noundef 325, ptr noundef nonnull @__FUNCTION__._Z35TestPrioritySwitchBetweenTwoMastersv)
  %177 = load i32, ptr getelementptr inbounds (i8, ptr @g_TestFailures, i64 28), align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %176, ptr noundef nonnull @.str.32, i32 noundef 7, i32 noundef %177, i32 noundef %27)
          to label %.loopexit41 unwind label %.loopexit

.loopexit41:                                      ; preds = %175, %170
  invoke void @_Z12ClearGlobalsv()
          to label %178 unwind label %180

178:                                              ; preds = %.loopexit41
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  br label %179

179:                                              ; preds = %6, %4, %178
  ret void

180:                                              ; preds = %.loopexit41
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %182

182:                                              ; preds = %.loopexit, %.loopexit.split-lp, %.split, %.split.us, %180, %59
  %.pn23 = phi { ptr, i32 } [ %60, %59 ], [ %181, %180 ], [ %83, %.split ], [ %75, %.split.us ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  resume { ptr, i32 } %.pn23
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi296EEEbv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i64 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z34RunPrioritySwitchBetweenTwoMastersI16BlockingNodeTaskEvim(i32 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z34RunPrioritySwitchBetweenTwoMastersI19NonblockingNodeTaskEvim(i32 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z34RunPrioritySwitchBetweenTwoMastersI19NestedGroupNodeTaskEvim(i32 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7Harness8internal18not_the_first_callILi323EEEbv() local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN3tbb10priority_tE", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass