; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common (sanitizer_deadlock_detector1)

; 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.__sanitizer::GenericScopedLock" = type { ptr }
%"struct.__sanitizer::DDCallback" = type { ptr, ptr, ptr }
%"struct.__sanitizer::DD" = type <{ %"struct.__sanitizer::DDetector", %"class.__sanitizer::SpinMutex", [7 x i8], %"class.__sanitizer::DeadlockDetector", %"struct.__sanitizer::DDFlags", [7 x i8] }>
%"struct.__sanitizer::DDetector" = type { ptr }
%"class.__sanitizer::SpinMutex" = type { %"class.__sanitizer::StaticSpinMutex" }
%"class.__sanitizer::StaticSpinMutex" = type { %"struct.__sanitizer::atomic_uint8_t" }
%"struct.__sanitizer::atomic_uint8_t" = type { i8 }
%"class.__sanitizer::DeadlockDetector" = type { i64, %"class.__sanitizer::TwoLevelBitVector", %"class.__sanitizer::TwoLevelBitVector", %"class.__sanitizer::TwoLevelBitVector", %"class.__sanitizer::BVGraph", [4096 x i64], [131072 x %"struct.__sanitizer::DeadlockDetector<__sanitizer::TwoLevelBitVector<>>::Edge"], i64 }
%"class.__sanitizer::TwoLevelBitVector" = type { [1 x %"class.__sanitizer::BasicBitVector"], [1 x [64 x %"class.__sanitizer::BasicBitVector"]] }
%"class.__sanitizer::BasicBitVector" = type { i64 }
%"class.__sanitizer::BVGraph" = type { [4096 x %"class.__sanitizer::TwoLevelBitVector"], %"class.__sanitizer::TwoLevelBitVector", %"class.__sanitizer::TwoLevelBitVector" }
%"struct.__sanitizer::DeadlockDetector<__sanitizer::TwoLevelBitVector<>>::Edge" = type { i16, i16, i32, i32, i32 }
%"struct.__sanitizer::DDFlags" = type { i8 }
%"struct.__sanitizer::DDLogicalThread" = type <{ i64, %"class.__sanitizer::DeadlockDetectorTLS", %"struct.__sanitizer::DDReport", i8, [7 x i8] }>
%"class.__sanitizer::DeadlockDetectorTLS" = type { %"class.__sanitizer::TwoLevelBitVector", i64, [64 x i64], i64, [64 x %"struct.__sanitizer::DeadlockDetectorTLS<__sanitizer::TwoLevelBitVector<>>::LockWithContext"], i64 }
%"struct.__sanitizer::DeadlockDetectorTLS<__sanitizer::TwoLevelBitVector<>>::LockWithContext" = type { i32, i32 }
%"struct.__sanitizer::DDReport" = type { i32, [20 x %struct.anon] }
%struct.anon = type { i64, i64, i64, [2 x i32] }
%"struct.__sanitizer::DDMutex" = type { i64, i32, i64 }

@.str.2 = external hidden unnamed_addr constant [121 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer2DD14MutexAfterLockEPNS_10DDCallbackEPNS_7DDMutexEbb(ptr noundef nonnull align 8 dereferenceable(4262473) %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3, i1 noundef zeroext %4) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %9, align 1, !tbaa !9
  %20 = zext i1 %4 to i8
  store i8 %20, ptr %10, align 1, !tbaa !9
  %21 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.__sanitizer::DDCallback", ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  store ptr %24, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !13
  %25 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 4
  %26 = getelementptr inbounds %"struct.__sanitizer::DDFlags", ptr %25, i32 0, i32 0
  %27 = load i8, ptr %26, align 8, !tbaa !15, !range !26, !noundef !27
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %35

29:                                               ; preds = %5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load ptr, ptr %30, align 8, !tbaa !28
  %32 = getelementptr inbounds ptr, ptr %31, i64 0
  %33 = load ptr, ptr %32, align 8
  %34 = call noundef i32 %33(ptr noundef nonnull align 8 dereferenceable(24) %30)
  store i32 %34, ptr %12, align 4, !tbaa !13
  br label %35

35:                                               ; preds = %29, %5
  %36 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 3
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.__sanitizer::DDLogicalThread", ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.__sanitizer::DDMutex", ptr %39, i32 0, i32 0
  %41 = load i64, ptr %40, align 8, !tbaa !30
  %42 = load i32, ptr %12, align 4, !tbaa !13
  %43 = call noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE11onFirstLockEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456) %36, ptr noundef %38, i64 noundef %41, i32 noundef %42)
  br i1 %43, label %44, label %45

44:                                               ; preds = %35
  store i32 1, ptr %13, align 4
  br label %143

45:                                               ; preds = %35
  %46 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 3
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.__sanitizer::DDLogicalThread", ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.__sanitizer::DDMutex", ptr %49, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !30
  %52 = load i32, ptr %12, align 4, !tbaa !13
  %53 = call noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE10onLockFastEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456) %46, ptr noundef %48, i64 noundef %51, i32 noundef %52)
  br i1 %53, label %54, label %55

54:                                               ; preds = %45
  store i32 1, ptr %13, align 4
  br label %143

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %56 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 1
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef %56)
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN11__sanitizer2DD13MutexEnsureIDEPNS_15DDLogicalThreadEPNS_7DDMutexE(ptr noundef nonnull align 8 dereferenceable(4262473) %21, ptr noundef %57, ptr noundef %58)
          to label %59 unwind label %87

59:                                               ; preds = %55
  %60 = load i8, ptr %9, align 1, !tbaa !9, !range !26, !noundef !27
  %61 = trunc i8 %60 to i1
  br i1 %61, label %62, label %103

62:                                               ; preds = %59
  br label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %64 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 3
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.__sanitizer::DDLogicalThread", ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.__sanitizer::DDMutex", ptr %67, i32 0, i32 0
  %69 = load i64, ptr %68, align 8, !tbaa !30
  %70 = invoke noundef zeroext i1 @_ZNK11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE6isHeldEPNS_19DeadlockDetectorTLSIS4_EEm(ptr noundef nonnull align 8 dereferenceable(4262456) %64, ptr noundef %66, i64 noundef %69)
          to label %71 unwind label %91

71:                                               ; preds = %63
  %72 = xor i1 %70, true
  %73 = zext i1 %72 to i64
  store i64 %73, ptr %17, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store i64 0, ptr %18, align 8, !tbaa !33
  %74 = load i64, ptr %17, align 8, !tbaa !33
  %75 = load i64, ptr %18, align 8, !tbaa !33
  %76 = icmp ne i64 %74, %75
  %77 = xor i1 %76, true
  %78 = xor i1 %77, true
  %79 = xor i1 %78, true
  %80 = zext i1 %79 to i64
  %81 = call i64 @llvm.expect.i64(i64 %80, i64 0)
  %82 = icmp ne i64 %81, 0
  br i1 %82, label %83, label %99

83:                                               ; preds = %71
  %84 = load i64, ptr %17, align 8, !tbaa !33
  %85 = load i64, ptr %18, align 8, !tbaa !33
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.2, i32 noundef 167, ptr noundef @.str.4, i64 noundef %84, i64 noundef %85) #6
          to label %86 unwind label %95

86:                                               ; preds = %83
  unreachable

87:                                               ; preds = %134, %131, %124, %117, %55
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %15, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %16, align 4
  br label %146

91:                                               ; preds = %63
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %15, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %16, align 4
  br label %102

95:                                               ; preds = %83
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %15, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %102

99:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  br label %103

102:                                              ; preds = %95, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %146

103:                                              ; preds = %101, %59
  %104 = load i8, ptr %10, align 1, !tbaa !9, !range !26, !noundef !27
  %105 = trunc i8 %104 to i1
  br i1 %105, label %134, label %106

106:                                              ; preds = %103
  %107 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 3
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.__sanitizer::DDLogicalThread", ptr %108, i32 0, i32 1
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.__sanitizer::DDMutex", ptr %110, i32 0, i32 0
  %112 = load i64, ptr %111, align 8, !tbaa !30
  %113 = load i32, ptr %12, align 4, !tbaa !13
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %117

115:                                              ; preds = %106
  %116 = load i32, ptr %12, align 4, !tbaa !13
  br label %124

117:                                              ; preds = %106
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %118, align 8, !tbaa !28
  %120 = getelementptr inbounds ptr, ptr %119, i64 0
  %121 = load ptr, ptr %120, align 8
  %122 = invoke noundef i32 %121(ptr noundef nonnull align 8 dereferenceable(24) %118)
          to label %123 unwind label %87

123:                                              ; preds = %117
  br label %124

124:                                              ; preds = %123, %115
  %125 = phi i32 [ %116, %115 ], [ %122, %123 ]
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = load ptr, ptr %126, align 8, !tbaa !28
  %128 = getelementptr inbounds ptr, ptr %127, i64 1
  %129 = load ptr, ptr %128, align 8
  %130 = invoke noundef i32 %129(ptr noundef nonnull align 8 dereferenceable(24) %126)
          to label %131 unwind label %87

131:                                              ; preds = %124
  %132 = invoke noundef i64 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE8addEdgesEPNS_19DeadlockDetectorTLSIS4_EEmji(ptr noundef nonnull align 8 dereferenceable(4262456) %107, ptr noundef %109, i64 noundef %112, i32 noundef %125, i32 noundef %130)
          to label %133 unwind label %87

133:                                              ; preds = %131
  br label %134

134:                                              ; preds = %133, %103
  %135 = getelementptr inbounds %"struct.__sanitizer::DD", ptr %21, i32 0, i32 3
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.__sanitizer::DDLogicalThread", ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.__sanitizer::DDMutex", ptr %138, i32 0, i32 0
  %140 = load i64, ptr %139, align 8, !tbaa !30
  %141 = load i32, ptr %12, align 4, !tbaa !13
  invoke void @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE11onLockAfterEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456) %135, ptr noundef %137, i64 noundef %140, i32 noundef %141)
          to label %142 unwind label %87

142:                                              ; preds = %134
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  store i32 0, ptr %13, align 4
  br label %143

143:                                              ; preds = %142, %54, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %144 = load i32, ptr %13, align 4
  switch i32 %144, label %152 [
    i32 0, label %145
    i32 1, label %145
  ]

145:                                              ; preds = %143, %143
  ret void

146:                                              ; preds = %102, %87
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %15, align 8
  %149 = load i32, ptr %16, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151

152:                                              ; preds = %143
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE11onFirstLockEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456), ptr noundef, i64 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE10onLockFastEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456), ptr noundef, i64 noundef, i32 noundef) #1 align 2

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

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_ZTSN11__sanitizer10DDCallbackE", !6, i64 8, !6, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !10, i64 4262472}
!16 = !{!"_ZTSN11__sanitizer2DDE", !17, i64 0, !18, i64 8, !21, i64 16, !25, i64 4262472}
!17 = !{!"_ZTSN11__sanitizer9DDetectorE"}
!18 = !{!"_ZTSN11__sanitizer9SpinMutexE", !19, i64 0}
!19 = !{!"_ZTSN11__sanitizer15StaticSpinMutexE", !20, i64 0}
!20 = !{!"_ZTSN11__sanitizer14atomic_uint8_tE", !7, i64 0}
!21 = !{!"_ZTSN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEEE", !22, i64 0, !23, i64 8, !23, i64 528, !23, i64 1048, !24, i64 1568, !7, i64 2132528, !7, i64 2165296, !22, i64 4262448}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN11__sanitizer17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEE", !7, i64 0, !7, i64 8}
!24 = !{!"_ZTSN11__sanitizer7BVGraphINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEEE", !7, i64 0, !23, i64 2129920, !23, i64 2130440}
!25 = !{!"_ZTSN11__sanitizer7DDFlagsE", !10, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !8, i64 0}
!30 = !{!31, !22, i64 0}
!31 = !{!"_ZTSN11__sanitizer7DDMutexE", !22, i64 0, !14, i64 8, !32, i64 16}
!32 = !{!"long long", !7, i64 0}
!33 = !{!32, !32, i64 0}


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

@.str.2 = external hidden unnamed_addr constant [121 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer2DD14MutexAfterLockEPNS_10DDCallbackEPNS_7DDMutexEbb(ptr noundef nonnull align 8 dereferenceable(4262473) %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3, i1 noundef zeroext %4) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 4262472
  %10 = load i8, ptr %9, align 8, !tbaa !10, !range !22, !noundef !23
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %12, label %16

12:                                               ; preds = %5
  %13 = load ptr, ptr %1, align 8, !tbaa !24
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef i32 %14(ptr noundef nonnull align 8 dereferenceable(24) %1)
  br label %16

16:                                               ; preds = %12, %5
  %.0 = phi i32 [ %15, %12 ], [ 0, %5 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = getelementptr inbounds i8, ptr %8, i64 8
  %19 = load i64, ptr %2, align 8, !tbaa !26
  %20 = tail call noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE11onFirstLockEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456) %17, ptr noundef nonnull %18, i64 noundef %19, i32 noundef %.0)
  br i1 %20, label %57, label %21

21:                                               ; preds = %16
  %22 = load i64, ptr %2, align 8, !tbaa !26
  %23 = tail call noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE10onLockFastEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456) %17, ptr noundef nonnull %18, i64 noundef %22, i32 noundef %.0)
  br i1 %23, label %57, label %24

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %25)
  invoke void @_ZN11__sanitizer2DD13MutexEnsureIDEPNS_15DDLogicalThreadEPNS_7DDMutexE(ptr noundef nonnull align 8 dereferenceable(4262473) %0, ptr noundef %8, ptr noundef nonnull %2)
          to label %26 unwind label %33

26:                                               ; preds = %24
  br i1 %3, label %27, label %39

27:                                               ; preds = %26
  %28 = load i64, ptr %2, align 8, !tbaa !26
  %29 = invoke noundef zeroext i1 @_ZNK11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE6isHeldEPNS_19DeadlockDetectorTLSIS4_EEm(ptr noundef nonnull align 8 dereferenceable(4262456) %17, ptr noundef nonnull %18, i64 noundef %28)
          to label %30 unwind label %35

30:                                               ; preds = %27
  br i1 %29, label %31, label %39, !prof !30

31:                                               ; preds = %30
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.2, i32 noundef 167, ptr noundef nonnull @.str.4, i64 noundef 0, i64 noundef 0) #5
          to label %32 unwind label %37

32:                                               ; preds = %31
  unreachable

33:                                               ; preds = %54, %52, %46, %42, %24
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %58

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %58

37:                                               ; preds = %31
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %58

39:                                               ; preds = %30, %26
  br i1 %4, label %54, label %40

40:                                               ; preds = %39
  %41 = load i64, ptr %2, align 8, !tbaa !26
  %.not = icmp eq i32 %.0, 0
  br i1 %.not, label %42, label %46

42:                                               ; preds = %40
  %43 = load ptr, ptr %1, align 8, !tbaa !24
  %44 = load ptr, ptr %43, align 8
  %45 = invoke noundef i32 %44(ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %46 unwind label %33

46:                                               ; preds = %40, %42
  %47 = phi i32 [ %45, %42 ], [ %.0, %40 ]
  %48 = load ptr, ptr %1, align 8, !tbaa !24
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8
  %51 = invoke noundef i32 %50(ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %52 unwind label %33

52:                                               ; preds = %46
  %53 = invoke noundef i64 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE8addEdgesEPNS_19DeadlockDetectorTLSIS4_EEmji(ptr noundef nonnull align 8 dereferenceable(4262456) %17, ptr noundef nonnull %18, i64 noundef %41, i32 noundef %47, i32 noundef %51)
          to label %54 unwind label %33

54:                                               ; preds = %52, %39
  %55 = load i64, ptr %2, align 8, !tbaa !26
  invoke void @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE11onLockAfterEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456) %17, ptr noundef nonnull %18, i64 noundef %55, i32 noundef %.0)
          to label %56 unwind label %33

56:                                               ; preds = %54
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %57

57:                                               ; preds = %21, %16, %56
  ret void

58:                                               ; preds = %35, %37, %33
  %.pn.pn = phi { ptr, i32 } [ %34, %33 ], [ %38, %37 ], [ %36, %35 ]
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE11onFirstLockEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456), ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEE10onLockFastEPNS_19DeadlockDetectorTLSIS4_EEmj(ptr noundef nonnull align 8 dereferenceable(4262456), ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

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

!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, !7, i64 16}
!6 = !{!"_ZTSN11__sanitizer10DDCallbackE", !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !21, i64 4262472}
!11 = !{!"_ZTSN11__sanitizer2DDE", !12, i64 0, !13, i64 8, !16, i64 16, !20, i64 4262472}
!12 = !{!"_ZTSN11__sanitizer9DDetectorE"}
!13 = !{!"_ZTSN11__sanitizer9SpinMutexE", !14, i64 0}
!14 = !{!"_ZTSN11__sanitizer15StaticSpinMutexE", !15, i64 0}
!15 = !{!"_ZTSN11__sanitizer14atomic_uint8_tE", !8, i64 0}
!16 = !{!"_ZTSN11__sanitizer16DeadlockDetectorINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEEE", !17, i64 0, !18, i64 8, !18, i64 528, !18, i64 1048, !19, i64 1568, !8, i64 2132528, !8, i64 2165296, !17, i64 4262448}
!17 = !{!"long", !8, i64 0}
!18 = !{!"_ZTSN11__sanitizer17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEE", !8, i64 0, !8, i64 8}
!19 = !{!"_ZTSN11__sanitizer7BVGraphINS_17TwoLevelBitVectorILm1ENS_14BasicBitVectorImEEEEEE", !8, i64 0, !18, i64 2129920, !18, i64 2130440}
!20 = !{!"_ZTSN11__sanitizer7DDFlagsE", !21, i64 0}
!21 = !{!"bool", !8, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !9, i64 0}
!26 = !{!27, !17, i64 0}
!27 = !{!"_ZTSN11__sanitizer7DDMutexE", !17, i64 0, !28, i64 8, !29, i64 16}
!28 = !{!"int", !8, i64 0}
!29 = !{!"long long", !8, i64 0}
!30 = !{!"branch_weights", !"expected", i32 1, i32 2000}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass