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

; 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 }
%"class.__sanitizer::ThreadRegistry" = type { ptr, i32, i32, i32, %"class.__sanitizer::BlockingMutex", i32, i64, i64, i64, i64, ptr, %"struct.__sanitizer::IntrusiveList", %"struct.__sanitizer::IntrusiveList" }
%"class.__sanitizer::BlockingMutex" = type { [10 x i64], i64 }
%"struct.__sanitizer::IntrusiveList" = type { i64, ptr, ptr }
%"class.__sanitizer::ThreadContextBase" = type { ptr, i32, i64, i32, i64, i64, [64 x i8], i32, i8, i32, ptr }

@.str = external hidden unnamed_addr constant [118 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 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(none)
declare i64 @llvm.expect.i64(i64, i64) #1

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

declare i32 @__gxx_personality_v0(...)

; 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__sanitizer17ThreadContextBase7SetDeadEv(ptr noundef nonnull align 8 dereferenceable(136)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer17ThreadContextBase11SetFinishedEv(ptr noundef nonnull align 8 dereferenceable(136)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer14ThreadRegistry14QuarantinePushEPNS_17ThreadContextBaseE(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer14ThreadRegistry12FinishThreadEj(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %19 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %20 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 4
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %20)
  br label %21

21:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %22 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 7
  %23 = load i64, ptr %22, align 8, !tbaa !11
  store i64 %23, ptr %6, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !17
  %24 = load i64, ptr %6, align 8, !tbaa !17
  %25 = load i64, ptr %7, align 8, !tbaa !17
  %26 = icmp ugt i64 %24, %25
  %27 = xor i1 %26, true
  %28 = xor i1 %27, true
  %29 = xor i1 %28, true
  %30 = zext i1 %29 to i64
  %31 = call i64 @llvm.expect.i64(i64 %30, i64 0)
  %32 = icmp ne i64 %31, 0
  br i1 %32, label %33, label %41

33:                                               ; preds = %21
  %34 = load i64, ptr %6, align 8, !tbaa !17
  %35 = load i64, ptr %7, align 8, !tbaa !17
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 254, ptr noundef @.str.16, i64 noundef %34, i64 noundef %35) #6
          to label %36 unwind label %37

36:                                               ; preds = %33
  unreachable

37:                                               ; preds = %33
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %8, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %170

41:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 7
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = add i64 %45, -1
  store i64 %46, ptr %44, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %48 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 9
  %49 = load i64, ptr %48, align 8, !tbaa !18
  store i64 %49, ptr %10, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !17
  %50 = load i64, ptr %10, align 8, !tbaa !17
  %51 = load i64, ptr %11, align 8, !tbaa !17
  %52 = icmp ugt i64 %50, %51
  %53 = xor i1 %52, true
  %54 = xor i1 %53, true
  %55 = xor i1 %54, true
  %56 = zext i1 %55 to i64
  %57 = call i64 @llvm.expect.i64(i64 %56, i64 0)
  %58 = icmp ne i64 %57, 0
  br i1 %58, label %59, label %67

59:                                               ; preds = %47
  %60 = load i64, ptr %10, align 8, !tbaa !17
  %61 = load i64, ptr %11, align 8, !tbaa !17
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 256, ptr noundef @.str.17, i64 noundef %60, i64 noundef %61) #6
          to label %62 unwind label %63

62:                                               ; preds = %59
  unreachable

63:                                               ; preds = %59
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %8, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %170

67:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 9
  %71 = load i64, ptr %70, align 8, !tbaa !18
  %72 = add i64 %71, -1
  store i64 %72, ptr %70, align 8, !tbaa !18
  br label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %74 = load i32, ptr %4, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  store i64 %75, ptr %12, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %76 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 5
  %77 = load i32, ptr %76, align 8, !tbaa !19
  %78 = zext i32 %77 to i64
  store i64 %78, ptr %13, align 8, !tbaa !17
  %79 = load i64, ptr %12, align 8, !tbaa !17
  %80 = load i64, ptr %13, align 8, !tbaa !17
  %81 = icmp ult i64 %79, %80
  %82 = xor i1 %81, true
  %83 = xor i1 %82, true
  %84 = xor i1 %83, true
  %85 = zext i1 %84 to i64
  %86 = call i64 @llvm.expect.i64(i64 %85, i64 0)
  %87 = icmp ne i64 %86, 0
  br i1 %87, label %88, label %96

88:                                               ; preds = %73
  %89 = load i64, ptr %12, align 8, !tbaa !17
  %90 = load i64, ptr %13, align 8, !tbaa !17
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 258, ptr noundef @.str.12, i64 noundef %89, i64 noundef %90) #6
          to label %91 unwind label %92

91:                                               ; preds = %88
  unreachable

92:                                               ; preds = %88
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %8, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %170

96:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %99 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %19, i32 0, i32 10
  %100 = load ptr, ptr %99, align 8, !tbaa !20
  %101 = load i32, ptr %4, align 4, !tbaa !9
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  store ptr %104, ptr %14, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = ptrtoint ptr %106 to i64
  store i64 %107, ptr %15, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !17
  %108 = load i64, ptr %15, align 8, !tbaa !17
  %109 = load i64, ptr %16, align 8, !tbaa !17
  %110 = icmp ne i64 %108, %109
  %111 = xor i1 %110, true
  %112 = xor i1 %111, true
  %113 = xor i1 %112, true
  %114 = zext i1 %113 to i64
  %115 = call i64 @llvm.expect.i64(i64 %114, i64 0)
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %125

117:                                              ; preds = %105
  %118 = load i64, ptr %15, align 8, !tbaa !17
  %119 = load i64, ptr %16, align 8, !tbaa !17
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 260, ptr noundef @.str.7, i64 noundef %118, i64 noundef %119) #6
          to label %120 unwind label %121

120:                                              ; preds = %117
  unreachable

121:                                              ; preds = %117
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %8, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %169

125:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 2, ptr %17, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.__sanitizer::ThreadContextBase", ptr %129, i32 0, i32 7
  %131 = load i32, ptr %130, align 8, !tbaa !21
  %132 = zext i32 %131 to i64
  store i64 %132, ptr %18, align 8, !tbaa !17
  %133 = load i64, ptr %17, align 8, !tbaa !17
  %134 = load i64, ptr %18, align 8, !tbaa !17
  %135 = icmp eq i64 %133, %134
  %136 = xor i1 %135, true
  %137 = xor i1 %136, true
  %138 = xor i1 %137, true
  %139 = zext i1 %138 to i64
  %140 = call i64 @llvm.expect.i64(i64 %139, i64 0)
  %141 = icmp ne i64 %140, 0
  br i1 %141, label %142, label %150

142:                                              ; preds = %128
  %143 = load i64, ptr %17, align 8, !tbaa !17
  %144 = load i64, ptr %18, align 8, !tbaa !17
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 261, ptr noundef @.str.13, i64 noundef %143, i64 noundef %144) #6
          to label %145 unwind label %146

145:                                              ; preds = %142
  unreachable

146:                                              ; preds = %142
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %8, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %169

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

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN11__sanitizer17ThreadContextBase11SetFinishedEv(ptr noundef nonnull align 8 dereferenceable(136) %153)
          to label %154 unwind label %164

154:                                              ; preds = %152
  %155 = load ptr, ptr %14, align 8, !tbaa !5
  %156 = getelementptr inbounds %"class.__sanitizer::ThreadContextBase", ptr %155, i32 0, i32 8
  %157 = load i8, ptr %156, align 4, !tbaa !25, !range !26, !noundef !27
  %158 = trunc i8 %157 to i1
  br i1 %158, label %159, label %168

159:                                              ; preds = %154
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN11__sanitizer17ThreadContextBase7SetDeadEv(ptr noundef nonnull align 8 dereferenceable(136) %160)
          to label %161 unwind label %164

161:                                              ; preds = %159
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN11__sanitizer14ThreadRegistry14QuarantinePushEPNS_17ThreadContextBaseE(ptr noundef nonnull align 8 dereferenceable(208) %19, ptr noundef %162)
          to label %163 unwind label %164

163:                                              ; preds = %161
  br label %168

164:                                              ; preds = %161, %159, %152
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %8, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %9, align 4
  br label %169

168:                                              ; preds = %163, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

169:                                              ; preds = %164, %146, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %170

170:                                              ; preds = %169, %92, %63, %37
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %8, align 8
  %173 = load i32, ptr %9, align 4
  %174 = insertvalue { ptr, i32 } poison, ptr %172, 0
  %175 = insertvalue { ptr, i32 } %174, i32 %173, 1
  resume { ptr, i32 } %175
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !14, i64 128}
!12 = !{!"_ZTSN11__sanitizer14ThreadRegistryE", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 24, !10, i64 112, !15, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !6, i64 152, !16, i64 160, !16, i64 184}
!13 = !{!"_ZTSN11__sanitizer13BlockingMutexE", !7, i64 0, !14, i64 80}
!14 = !{!"long", !7, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_ZTSN11__sanitizer13IntrusiveListINS_17ThreadContextBaseEEE", !14, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!15, !15, i64 0}
!18 = !{!12, !14, i64 144}
!19 = !{!12, !10, i64 112}
!20 = !{!12, !6, i64 152}
!21 = !{!22, !23, i64 112}
!22 = !{!"_ZTSN11__sanitizer17ThreadContextBaseE", !10, i64 8, !15, i64 16, !10, i64 24, !14, i64 32, !14, i64 40, !7, i64 48, !23, i64 112, !24, i64 116, !10, i64 120, !6, i64 128}
!23 = !{!"_ZTSN11__sanitizer12ThreadStatusE", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!22, !24, i64 116}
!26 = !{i8 0, i8 2}
!27 = !{}


; 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 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 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: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; 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__sanitizer17ThreadContextBase7SetDeadEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer17ThreadContextBase11SetFinishedEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer14ThreadRegistry12FinishThreadEj(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 128
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %7, label %11, !prof !15

7:                                                ; preds = %2
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 254, ptr noundef nonnull @.str.16, i64 noundef 0, i64 noundef 0) #5
          to label %8 unwind label %9

8:                                                ; preds = %7
  unreachable

9:                                                ; preds = %7
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %56

11:                                               ; preds = %2
  %12 = add i64 %6, -1
  store i64 %12, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 144
  %14 = load i64, ptr %13, align 8, !tbaa !16
  %.not32 = icmp eq i64 %14, 0
  br i1 %.not32, label %15, label %19, !prof !15

15:                                               ; preds = %11
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 256, ptr noundef nonnull @.str.17, i64 noundef 0, i64 noundef 0) #5
          to label %16 unwind label %17

16:                                               ; preds = %15
  unreachable

17:                                               ; preds = %15
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %56

19:                                               ; preds = %11
  %20 = add i64 %14, -1
  store i64 %20, ptr %13, align 8, !tbaa !16
  %21 = zext i32 %1 to i64
  %22 = getelementptr inbounds i8, ptr %0, i64 112
  %23 = load i32, ptr %22, align 8, !tbaa !17
  %.not33 = icmp ugt i32 %23, %1
  br i1 %.not33, label %29, label %24, !prof !18

24:                                               ; preds = %19
  %25 = zext i32 %23 to i64
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 258, ptr noundef nonnull @.str.12, i64 noundef %21, i64 noundef %25) #5
          to label %26 unwind label %27

26:                                               ; preds = %24
  unreachable

27:                                               ; preds = %24
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %56

29:                                               ; preds = %19
  %30 = getelementptr inbounds i8, ptr %0, i64 152
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds ptr, ptr %31, i64 %21
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %.not34 = icmp eq ptr %33, null
  br i1 %.not34, label %34, label %38, !prof !15

34:                                               ; preds = %29
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 260, ptr noundef nonnull @.str.7, i64 noundef 0, i64 noundef 0) #5
          to label %35 unwind label %36

35:                                               ; preds = %34
  unreachable

36:                                               ; preds = %34
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %56

38:                                               ; preds = %29
  %39 = getelementptr inbounds i8, ptr %33, i64 112
  %40 = load i32, ptr %39, align 8, !tbaa !21
  %.not35 = icmp eq i32 %40, 2
  br i1 %.not35, label %46, label %41, !prof !18

41:                                               ; preds = %38
  %42 = zext i32 %40 to i64
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 261, ptr noundef nonnull @.str.13, i64 noundef 2, i64 noundef %42) #5
          to label %43 unwind label %44

43:                                               ; preds = %41
  unreachable

44:                                               ; preds = %41
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %56

46:                                               ; preds = %38
  invoke void @_ZN11__sanitizer17ThreadContextBase11SetFinishedEv(ptr noundef nonnull align 8 dereferenceable(136) %33)
          to label %47 unwind label %53

47:                                               ; preds = %46
  %48 = getelementptr inbounds i8, ptr %33, i64 116
  %49 = load i8, ptr %48, align 4, !tbaa !25, !range !26, !noundef !27
  %50 = trunc nuw i8 %49 to i1
  br i1 %50, label %51, label %55

51:                                               ; preds = %47
  invoke void @_ZN11__sanitizer17ThreadContextBase7SetDeadEv(ptr noundef nonnull align 8 dereferenceable(136) %33)
          to label %52 unwind label %53

52:                                               ; preds = %51
  invoke void @_ZN11__sanitizer14ThreadRegistry14QuarantinePushEPNS_17ThreadContextBaseE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull %33)
          to label %55 unwind label %53

53:                                               ; preds = %52, %51, %46
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %56

55:                                               ; preds = %52, %47
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void

56:                                               ; preds = %36, %44, %53, %27, %17, %9
  %.pn37 = phi { ptr, i32 } [ %10, %9 ], [ %18, %17 ], [ %28, %27 ], [ %37, %36 ], [ %45, %44 ], [ %54, %53 ]
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn37
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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, !12, i64 128}
!6 = !{!"_ZTSN11__sanitizer14ThreadRegistryE", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 24, !10, i64 112, !13, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !7, i64 152, !14, i64 160, !14, i64 184}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN11__sanitizer13BlockingMutexE", !8, i64 0, !12, i64 80}
!12 = !{!"long", !8, i64 0}
!13 = !{!"long long", !8, i64 0}
!14 = !{!"_ZTSN11__sanitizer13IntrusiveListINS_17ThreadContextBaseEEE", !12, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!16 = !{!6, !12, i64 144}
!17 = !{!6, !10, i64 112}
!18 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!19 = !{!6, !7, i64 152}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !23, i64 112}
!22 = !{!"_ZTSN11__sanitizer17ThreadContextBaseE", !10, i64 8, !13, i64 16, !10, i64 24, !12, i64 32, !12, i64 40, !8, i64 48, !23, i64 112, !24, i64 116, !10, i64 120, !7, i64 128}
!23 = !{!"_ZTSN11__sanitizer12ThreadStatusE", !8, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{!22, !24, i64 116}
!26 = !{i8 0, i8 2}
!27 = !{}


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