; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/tbb/tools_api/ittnotify_static.ll_ (itt_fini_ittlib)

; 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"

%struct.___itt_global = type { [8 x i8], i64, i64, i64, i64, i64, i64, %union.pthread_mutex_t, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_mutexattr_t = type { i32 }

@__itt__ittapi_global = external dso_local global %struct.___itt_global, align 8
@__itt_fini_ittlib.current_thread = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @__itt_fini_ittlib() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca %union.pthread_mutexattr_t, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  store ptr null, ptr %1, align 8, !tbaa !5
  %4 = load volatile i64, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 4), align 8, !tbaa !9
  %5 = icmp ne i64 %4, 0
  br i1 %5, label %6, label %122

6:                                                ; preds = %0
  %7 = icmp ne ptr @pthread_mutex_init, null
  br i1 %7, label %8, label %64

8:                                                ; preds = %6
  %9 = icmp ne ptr @pthread_mutex_lock, null
  br i1 %9, label %10, label %64

10:                                               ; preds = %8
  %11 = icmp ne ptr @pthread_mutex_unlock, null
  br i1 %11, label %12, label %64

12:                                               ; preds = %10
  %13 = icmp ne ptr @pthread_mutex_destroy, null
  br i1 %13, label %14, label %64

14:                                               ; preds = %12
  %15 = icmp ne ptr @pthread_mutexattr_init, null
  br i1 %15, label %16, label %64

16:                                               ; preds = %14
  %17 = icmp ne ptr @pthread_mutexattr_settype, null
  br i1 %17, label %18, label %64

18:                                               ; preds = %16
  %19 = icmp ne ptr @pthread_mutexattr_destroy, null
  br i1 %19, label %20, label %64

20:                                               ; preds = %18
  %21 = icmp ne ptr @pthread_self, null
  br i1 %21, label %22, label %64

22:                                               ; preds = %20
  %23 = load volatile i64, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 5), align 8, !tbaa !13
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %62, label %25

25:                                               ; preds = %22
  %26 = call i64 @__itt_interlocked_increment(ptr noundef getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 6))
  %27 = icmp eq i64 %26, 1
  br i1 %27, label %28, label %53

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %29 = call i32 @pthread_mutexattr_init(ptr noundef %2) #5
  store i32 %29, ptr %3, align 4, !tbaa !14
  %30 = load i32, ptr %3, align 4, !tbaa !14
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %28
  %33 = load i32, ptr %3, align 4, !tbaa !14
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef @.str, i32 noundef %33)
  br label %34

34:                                               ; preds = %32, %28
  %35 = call i32 @pthread_mutexattr_settype(ptr noundef %2, i32 noundef 1) #5
  store i32 %35, ptr %3, align 4, !tbaa !14
  %36 = load i32, ptr %3, align 4, !tbaa !14
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %34
  %39 = load i32, ptr %3, align 4, !tbaa !14
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef @.str.1, i32 noundef %39)
  br label %40

40:                                               ; preds = %38, %34
  %41 = call i32 @pthread_mutex_init(ptr noundef getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 7), ptr noundef %2) #5
  store i32 %41, ptr %3, align 4, !tbaa !14
  %42 = load i32, ptr %3, align 4, !tbaa !14
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %40
  %45 = load i32, ptr %3, align 4, !tbaa !14
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef @.str.2, i32 noundef %45)
  br label %46

46:                                               ; preds = %44, %40
  %47 = call i32 @pthread_mutexattr_destroy(ptr noundef %2) #5
  store i32 %47, ptr %3, align 4, !tbaa !14
  %48 = load i32, ptr %3, align 4, !tbaa !14
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = load i32, ptr %3, align 4, !tbaa !14
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef @.str.3, i32 noundef %51)
  br label %52

52:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  store volatile i64 1, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 5), align 8, !tbaa !13
  br label %61

53:                                               ; preds = %25
  br label %54

54:                                               ; preds = %58, %53
  %55 = load volatile i64, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 5), align 8, !tbaa !13
  %56 = icmp ne i64 %55, 0
  %57 = xor i1 %56, true
  br i1 %57, label %58, label %60

58:                                               ; preds = %54
  %59 = call i32 @sched_yield() #5
  br label %54, !llvm.loop !15

60:                                               ; preds = %54
  br label %61

61:                                               ; preds = %60, %52
  br label %62

62:                                               ; preds = %61, %22
  %63 = call i32 @pthread_mutex_lock(ptr noundef getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 7)) #5
  br label %64

64:                                               ; preds = %62, %20, %18, %16, %14, %12, %10, %8, %6
  %65 = load volatile i64, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 4), align 8, !tbaa !9
  %66 = icmp ne i64 %65, 0
  br i1 %66, label %67, label %103

67:                                               ; preds = %64
  %68 = load volatile i64, ptr @__itt_fini_ittlib.current_thread, align 8, !tbaa !17
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %70, label %102

70:                                               ; preds = %67
  %71 = icmp ne ptr @pthread_mutex_init, null
  br i1 %71, label %72, label %88

72:                                               ; preds = %70
  %73 = icmp ne ptr @pthread_mutex_lock, null
  br i1 %73, label %74, label %88

74:                                               ; preds = %72
  %75 = icmp ne ptr @pthread_mutex_unlock, null
  br i1 %75, label %76, label %88

76:                                               ; preds = %74
  %77 = icmp ne ptr @pthread_mutex_destroy, null
  br i1 %77, label %78, label %88

78:                                               ; preds = %76
  %79 = icmp ne ptr @pthread_mutexattr_init, null
  br i1 %79, label %80, label %88

80:                                               ; preds = %78
  %81 = icmp ne ptr @pthread_mutexattr_settype, null
  br i1 %81, label %82, label %88

82:                                               ; preds = %80
  %83 = icmp ne ptr @pthread_mutexattr_destroy, null
  br i1 %83, label %84, label %88

84:                                               ; preds = %82
  %85 = icmp ne ptr @pthread_self, null
  br i1 %85, label %86, label %88

86:                                               ; preds = %84
  %87 = call i64 @pthread_self() #6
  store volatile i64 %87, ptr @__itt_fini_ittlib.current_thread, align 8, !tbaa !17
  br label %88

88:                                               ; preds = %86, %84, %82, %80, %78, %76, %74, %72, %70
  %89 = load ptr, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 8), align 8, !tbaa !18
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %96

91:                                               ; preds = %88
  %92 = load ptr, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 8), align 8, !tbaa !18
  %93 = call ptr @dlsym(ptr noundef %92, ptr noundef @.str.4) #5
  %94 = ptrtoint ptr %93 to i64
  %95 = inttoptr i64 %94 to ptr
  store ptr %95, ptr %1, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %91, %88
  %97 = load ptr, ptr %1, align 8, !tbaa !5
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %101

99:                                               ; preds = %96
  %100 = load ptr, ptr %1, align 8, !tbaa !5
  call void %100(ptr noundef @__itt__ittapi_global)
  br label %101

101:                                              ; preds = %99, %96
  call void @__itt_nullify_all_pointers()
  store volatile i64 0, ptr getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 4), align 8, !tbaa !9
  store volatile i64 0, ptr @__itt_fini_ittlib.current_thread, align 8, !tbaa !17
  br label %102

102:                                              ; preds = %101, %67
  br label %103

103:                                              ; preds = %102, %64
  %104 = icmp ne ptr @pthread_mutex_init, null
  br i1 %104, label %105, label %121

105:                                              ; preds = %103
  %106 = icmp ne ptr @pthread_mutex_lock, null
  br i1 %106, label %107, label %121

107:                                              ; preds = %105
  %108 = icmp ne ptr @pthread_mutex_unlock, null
  br i1 %108, label %109, label %121

109:                                              ; preds = %107
  %110 = icmp ne ptr @pthread_mutex_destroy, null
  br i1 %110, label %111, label %121

111:                                              ; preds = %109
  %112 = icmp ne ptr @pthread_mutexattr_init, null
  br i1 %112, label %113, label %121

113:                                              ; preds = %111
  %114 = icmp ne ptr @pthread_mutexattr_settype, null
  br i1 %114, label %115, label %121

115:                                              ; preds = %113
  %116 = icmp ne ptr @pthread_mutexattr_destroy, null
  br i1 %116, label %117, label %121

117:                                              ; preds = %115
  %118 = icmp ne ptr @pthread_self, null
  br i1 %118, label %119, label %121

119:                                              ; preds = %117
  %120 = call i32 @pthread_mutex_unlock(ptr noundef getelementptr inbounds (%struct.___itt_global, ptr @__itt__ittapi_global, i32 0, i32 7)) #5
  br label %121

121:                                              ; preds = %119, %117, %115, %113, %111, %109, %107, %105, %103
  br label %122

122:                                              ; preds = %121, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

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

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_init(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_lock(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_unlock(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_destroy(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutexattr_init(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutexattr_settype(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutexattr_destroy(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare extern_weak i64 @pthread_self() #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @__itt_interlocked_increment(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @__itt_report_error_impl(i32 noundef, ...) #0

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

; Function Attrs: nounwind
declare i32 @sched_yield() #2

; Function Attrs: nounwind
declare extern_weak ptr @dlsym(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @__itt_nullify_all_pointers() #0

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

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 32}
!10 = !{!"___itt_global", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !7, i64 56, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !12, i64 160, !6, i64 168, !12, i64 176}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 40}
!14 = !{!12, !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !6, i64 96}


; 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"

%struct.___itt_global = type { [8 x i8], i64, i64, i64, i64, i64, i64, %union.pthread_mutex_t, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_mutexattr_t = type { i32 }

@__itt__ittapi_global = external dso_local global %struct.___itt_global, align 8
@__itt_fini_ittlib.current_thread = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @__itt_fini_ittlib() local_unnamed_addr #0 {
  %1 = alloca %union.pthread_mutexattr_t, align 4
  %2 = load volatile i64, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 32), align 8, !tbaa !5
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %45, label %3

3:                                                ; preds = %0
  %4 = icmp eq <8 x ptr> <ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr @pthread_self>, <ptr @pthread_mutex_init, ptr @pthread_mutex_lock, ptr @pthread_mutex_unlock, ptr @pthread_mutex_destroy, ptr @pthread_mutexattr_init, ptr @pthread_mutexattr_settype, ptr @pthread_mutexattr_destroy, ptr null>
  %5 = bitcast <8 x i1> %4 to i8
  %6 = icmp eq i8 %5, 0
  br i1 %6, label %7, label %29

7:                                                ; preds = %3
  %8 = load volatile i64, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 40), align 8, !tbaa !12
  %.not34 = icmp eq i64 %8, 0
  br i1 %.not34, label %9, label %.loopexit

9:                                                ; preds = %7
  %10 = tail call i64 @__itt_interlocked_increment(ptr noundef nonnull getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 48))
  %11 = icmp eq i64 %10, 1
  br i1 %11, label %13, label %.preheader

.preheader:                                       ; preds = %9
  %12 = load volatile i64, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 40), align 8, !tbaa !12
  %.not3545 = icmp eq i64 %12, 0
  br i1 %.not3545, label %.lr.ph, label %.loopexit

13:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %14 = call i32 @pthread_mutexattr_init(ptr noundef nonnull %1) #5
  %.not36 = icmp eq i32 %14, 0
  br i1 %.not36, label %16, label %15

15:                                               ; preds = %13
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef nonnull @.str, i32 noundef %14)
  br label %16

16:                                               ; preds = %15, %13
  %17 = call i32 @pthread_mutexattr_settype(ptr noundef nonnull %1, i32 noundef 1) #5
  %.not37 = icmp eq i32 %17, 0
  br i1 %.not37, label %19, label %18

18:                                               ; preds = %16
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef nonnull @.str.1, i32 noundef %17)
  br label %19

19:                                               ; preds = %18, %16
  %20 = call i32 @pthread_mutex_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 56), ptr noundef nonnull %1) #5
  %.not38 = icmp eq i32 %20, 0
  br i1 %.not38, label %22, label %21

21:                                               ; preds = %19
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef nonnull @.str.2, i32 noundef %20)
  br label %22

22:                                               ; preds = %21, %19
  %23 = call i32 @pthread_mutexattr_destroy(ptr noundef nonnull %1) #5
  %.not39 = icmp eq i32 %23, 0
  br i1 %.not39, label %25, label %24

24:                                               ; preds = %22
  call void (i32, ...) @__itt_report_error_impl(i32 noundef 6, ptr noundef nonnull @.str.3, i32 noundef %23)
  br label %25

25:                                               ; preds = %24, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  store volatile i64 1, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 40), align 8, !tbaa !12
  br label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %26 = tail call i32 @sched_yield() #5
  %27 = load volatile i64, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 40), align 8, !tbaa !12
  %.not35 = icmp eq i64 %27, 0
  br i1 %.not35, label %.lr.ph, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %.lr.ph, %.preheader, %25, %7
  %28 = call i32 @pthread_mutex_lock(ptr noundef nonnull getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 56)) #5
  br label %29

29:                                               ; preds = %.loopexit, %3
  %30 = load volatile i64, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 32), align 8, !tbaa !5
  %.not40 = icmp eq i64 %30, 0
  br i1 %.not40, label %42, label %31

31:                                               ; preds = %29
  %32 = load volatile i64, ptr @__itt_fini_ittlib.current_thread, align 8, !tbaa !15
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %34, label %42

34:                                               ; preds = %31
  br i1 %6, label %35, label %37

35:                                               ; preds = %34
  %36 = tail call i64 @pthread_self() #6
  store volatile i64 %36, ptr @__itt_fini_ittlib.current_thread, align 8, !tbaa !15
  br label %37

37:                                               ; preds = %35, %34
  %38 = load ptr, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 96), align 8, !tbaa !16
  %.not41 = icmp eq ptr %38, null
  br i1 %.not41, label %.thread, label %39

39:                                               ; preds = %37
  %40 = call ptr @dlsym(ptr noundef nonnull %38, ptr noundef nonnull @.str.4) #5
  %.not42 = icmp eq ptr %40, null
  br i1 %.not42, label %.thread, label %41

41:                                               ; preds = %39
  call void %40(ptr noundef nonnull @__itt__ittapi_global) #5
  br label %.thread

.thread:                                          ; preds = %37, %41, %39
  call void @__itt_nullify_all_pointers()
  store volatile i64 0, ptr getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 32), align 8, !tbaa !5
  store volatile i64 0, ptr @__itt_fini_ittlib.current_thread, align 8, !tbaa !15
  br label %42

42:                                               ; preds = %31, %.thread, %29
  br i1 %6, label %43, label %45

43:                                               ; preds = %42
  %44 = call i32 @pthread_mutex_unlock(ptr noundef nonnull getelementptr inbounds (i8, ptr @__itt__ittapi_global, i64 56)) #5
  br label %45

45:                                               ; preds = %42, %43, %0
  ret void
}

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

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_init(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_lock(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_unlock(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutex_destroy(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutexattr_init(ptr noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutexattr_settype(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare extern_weak i32 @pthread_mutexattr_destroy(ptr noundef) #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare extern_weak i64 @pthread_self() #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @__itt_interlocked_increment(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @__itt_report_error_impl(i32 noundef, ...) local_unnamed_addr #0

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

; Function Attrs: nounwind
declare i32 @sched_yield() local_unnamed_addr #2

; Function Attrs: nounwind
declare extern_weak ptr @dlsym(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @__itt_nullify_all_pointers() local_unnamed_addr #0

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

!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, !9, i64 32}
!6 = !{!"___itt_global", !7, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !9, i64 48, !7, i64 56, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !11, i64 160, !10, i64 168, !11, i64 176}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"long", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!6, !9, i64 40}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!9, !9, i64 0}
!16 = !{!6, !10, i64 96}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass