; 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.6 = external hidden unnamed_addr constant [48 x i8], align 1
@_ZN11__sanitizer17SanitizerToolNameE = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [45 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__sanitizer17ThreadContextBase10SetCreatedEmybjPv(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef, i64 noundef, i1 noundef zeroext, i32 noundef, ptr noundef) #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
define dso_local noundef i32 @_ZN11__sanitizer14ThreadRegistry12CreateThreadEmbjPv(ptr noundef nonnull align 8 dereferenceable(208) %0, i64 noundef %1, i1 noundef zeroext %2, i32 noundef %3, ptr noundef %4) #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  %26 = zext i1 %2 to i8
  store i8 %26, ptr %8, align 1, !tbaa !11
  store i32 %3, ptr %9, align 4, !tbaa !13
  store ptr %4, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %28 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 4
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %29 = invoke noundef ptr @_ZN11__sanitizer14ThreadRegistry13QuarantinePopEv(ptr noundef nonnull align 8 dereferenceable(208) %27)
          to label %30 unwind label %37

30:                                               ; preds = %5
  store ptr %29, ptr %13, align 8, !tbaa !5
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %41

33:                                               ; preds = %30
  %34 = load ptr, ptr %13, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.__sanitizer::ThreadContextBase", ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !15
  store i32 %36, ptr %12, align 4, !tbaa !13
  br label %69

37:                                               ; preds = %204, %66, %62, %47, %5
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %14, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %15, align 4
  br label %216

41:                                               ; preds = %30
  %42 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 5
  %43 = load i32, ptr %42, align 8, !tbaa !19
  %44 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 1
  %45 = load i32, ptr %44, align 8, !tbaa !23
  %46 = icmp ult i32 %43, %45
  br i1 %46, label %47, label %62

47:                                               ; preds = %41
  %48 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 5
  %49 = load i32, ptr %48, align 8, !tbaa !19
  %50 = add i32 %49, 1
  store i32 %50, ptr %48, align 8, !tbaa !19
  store i32 %49, ptr %12, align 4, !tbaa !13
  %51 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  %53 = load i32, ptr %12, align 4, !tbaa !13
  %54 = invoke noundef ptr %52(i32 noundef %53)
          to label %55 unwind label %37

55:                                               ; preds = %47
  store ptr %54, ptr %13, align 8, !tbaa !5
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 10
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = load i32, ptr %12, align 4, !tbaa !13
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %58, i64 %60
  store ptr %56, ptr %61, align 8, !tbaa !5
  br label %68

62:                                               ; preds = %41
  %63 = load ptr, ptr @_ZN11__sanitizer17SanitizerToolNameE, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !23
  invoke void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.6, ptr noundef %63, i32 noundef %65)
          to label %66 unwind label %37

66:                                               ; preds = %62
  invoke void @_ZN11__sanitizer3DieEv() #7
          to label %67 unwind label %37

67:                                               ; preds = %66
  unreachable

68:                                               ; preds = %55
  br label %69

69:                                               ; preds = %68, %33
  br label %70

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

82:                                               ; preds = %70
  %83 = load i64, ptr %16, align 8, !tbaa !26
  %84 = load i64, ptr %17, align 8, !tbaa !26
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 143, ptr noundef @.str.7, i64 noundef %83, i64 noundef %84) #7
          to label %85 unwind label %86

85:                                               ; preds = %82
  unreachable

86:                                               ; preds = %82
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %14, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %216

90:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %94 = load i32, ptr %12, align 4, !tbaa !13
  %95 = zext i32 %94 to i64
  store i64 %95, ptr %18, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 4294967295, ptr %19, align 8, !tbaa !26
  %96 = load i64, ptr %18, align 8, !tbaa !26
  %97 = load i64, ptr %19, align 8, !tbaa !26
  %98 = icmp ne i64 %96, %97
  %99 = xor i1 %98, true
  %100 = xor i1 %99, true
  %101 = xor i1 %100, true
  %102 = zext i1 %101 to i64
  %103 = call i64 @llvm.expect.i64(i64 %102, i64 0)
  %104 = icmp ne i64 %103, 0
  br i1 %104, label %105, label %113

105:                                              ; preds = %93
  %106 = load i64, ptr %18, align 8, !tbaa !26
  %107 = load i64, ptr %19, align 8, !tbaa !26
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 144, ptr noundef @.str.8, i64 noundef %106, i64 noundef %107) #7
          to label %108 unwind label %109

108:                                              ; preds = %105
  unreachable

109:                                              ; preds = %105
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %14, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %216

113:                                              ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %117 = load i32, ptr %12, align 4, !tbaa !13
  %118 = zext i32 %117 to i64
  store i64 %118, ptr %20, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %119 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 1
  %120 = load i32, ptr %119, align 8, !tbaa !23
  %121 = zext i32 %120 to i64
  store i64 %121, ptr %21, align 8, !tbaa !26
  %122 = load i64, ptr %20, align 8, !tbaa !26
  %123 = load i64, ptr %21, align 8, !tbaa !26
  %124 = icmp ult i64 %122, %123
  %125 = xor i1 %124, true
  %126 = xor i1 %125, true
  %127 = xor i1 %126, true
  %128 = zext i1 %127 to i64
  %129 = call i64 @llvm.expect.i64(i64 %128, i64 0)
  %130 = icmp ne i64 %129, 0
  br i1 %130, label %131, label %139

131:                                              ; preds = %116
  %132 = load i64, ptr %20, align 8, !tbaa !26
  %133 = load i64, ptr %21, align 8, !tbaa !26
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 145, ptr noundef @.str.9, i64 noundef %132, i64 noundef %133) #7
          to label %134 unwind label %135

134:                                              ; preds = %131
  unreachable

135:                                              ; preds = %131
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %14, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %216

139:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.__sanitizer::ThreadContextBase", ptr %143, i32 0, i32 7
  %145 = load i32, ptr %144, align 8, !tbaa !27
  %146 = zext i32 %145 to i64
  store i64 %146, ptr %22, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !26
  %147 = load i64, ptr %22, align 8, !tbaa !26
  %148 = load i64, ptr %23, align 8, !tbaa !26
  %149 = icmp eq i64 %147, %148
  %150 = xor i1 %149, true
  %151 = xor i1 %150, true
  %152 = xor i1 %151, true
  %153 = zext i1 %152 to i64
  %154 = call i64 @llvm.expect.i64(i64 %153, i64 0)
  %155 = icmp ne i64 %154, 0
  br i1 %155, label %156, label %164

156:                                              ; preds = %142
  %157 = load i64, ptr %22, align 8, !tbaa !26
  %158 = load i64, ptr %23, align 8, !tbaa !26
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 146, ptr noundef @.str.10, i64 noundef %157, i64 noundef %158) #7
          to label %159 unwind label %160

159:                                              ; preds = %156
  unreachable

160:                                              ; preds = %156
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %14, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %216

164:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 7
  %168 = load i64, ptr %167, align 8, !tbaa !28
  %169 = add i64 %168, 1
  store i64 %169, ptr %167, align 8, !tbaa !28
  %170 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 8
  %171 = load i64, ptr %170, align 8, !tbaa !29
  %172 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 7
  %173 = load i64, ptr %172, align 8, !tbaa !28
  %174 = icmp ult i64 %171, %173
  br i1 %174, label %175, label %204

175:                                              ; preds = %166
  %176 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 8
  %177 = load i64, ptr %176, align 8, !tbaa !29
  %178 = add i64 %177, 1
  store i64 %178, ptr %176, align 8, !tbaa !29
  br label %179

179:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %180 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 7
  %181 = load i64, ptr %180, align 8, !tbaa !28
  store i64 %181, ptr %24, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %182 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 8
  %183 = load i64, ptr %182, align 8, !tbaa !29
  store i64 %183, ptr %25, align 8, !tbaa !26
  %184 = load i64, ptr %24, align 8, !tbaa !26
  %185 = load i64, ptr %25, align 8, !tbaa !26
  %186 = icmp eq i64 %184, %185
  %187 = xor i1 %186, true
  %188 = xor i1 %187, true
  %189 = xor i1 %188, true
  %190 = zext i1 %189 to i64
  %191 = call i64 @llvm.expect.i64(i64 %190, i64 0)
  %192 = icmp ne i64 %191, 0
  br i1 %192, label %193, label %201

193:                                              ; preds = %179
  %194 = load i64, ptr %24, align 8, !tbaa !26
  %195 = load i64, ptr %25, align 8, !tbaa !26
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 150, ptr noundef @.str.11, i64 noundef %194, i64 noundef %195) #7
          to label %196 unwind label %197

196:                                              ; preds = %193
  unreachable

197:                                              ; preds = %193
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %14, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %216

201:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203, %166
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  %206 = load i64, ptr %7, align 8, !tbaa !9
  %207 = getelementptr inbounds %"class.__sanitizer::ThreadRegistry", ptr %27, i32 0, i32 6
  %208 = load i64, ptr %207, align 8, !tbaa !30
  %209 = add i64 %208, 1
  store i64 %209, ptr %207, align 8, !tbaa !30
  %210 = load i8, ptr %8, align 1, !tbaa !11, !range !31, !noundef !32
  %211 = trunc i8 %210 to i1
  %212 = load i32, ptr %9, align 4, !tbaa !13
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN11__sanitizer17ThreadContextBase10SetCreatedEmybjPv(ptr noundef nonnull align 8 dereferenceable(136) %205, i64 noundef %206, i64 noundef %208, i1 noundef zeroext %211, i32 noundef %212, ptr noundef %213)
          to label %214 unwind label %37

214:                                              ; preds = %204
  %215 = load i32, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  ret i32 %215

216:                                              ; preds = %197, %160, %135, %109, %86, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %217

217:                                              ; preds = %216
  %218 = load ptr, ptr %14, align 8
  %219 = load i32, ptr %15, align 4
  %220 = insertvalue { ptr, i32 } poison, ptr %218, 0
  %221 = insertvalue { ptr, i32 } %220, i32 %219, 1
  resume { ptr, i32 } %221
}

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

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) #5

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() #2

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 = { "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 #6 = { nounwind }
attributes #7 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 8}
!16 = !{!"_ZTSN11__sanitizer17ThreadContextBaseE", !14, i64 8, !17, i64 16, !14, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !18, i64 112, !12, i64 116, !14, i64 120, !6, i64 128}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"_ZTSN11__sanitizer12ThreadStatusE", !7, i64 0}
!19 = !{!20, !14, i64 112}
!20 = !{!"_ZTSN11__sanitizer14ThreadRegistryE", !6, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !21, i64 24, !14, i64 112, !17, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !6, i64 152, !22, i64 160, !22, i64 184}
!21 = !{!"_ZTSN11__sanitizer13BlockingMutexE", !7, i64 0, !10, i64 80}
!22 = !{!"_ZTSN11__sanitizer13IntrusiveListINS_17ThreadContextBaseEEE", !10, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!20, !14, i64 8}
!24 = !{!20, !6, i64 0}
!25 = !{!20, !6, i64 152}
!26 = !{!17, !17, i64 0}
!27 = !{!16, !18, i64 112}
!28 = !{!20, !10, i64 128}
!29 = !{!20, !10, i64 136}
!30 = !{!20, !17, i64 120}
!31 = !{i8 0, i8 2}
!32 = !{}


; 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.6 = external hidden unnamed_addr constant [48 x i8], align 1
@_ZN11__sanitizer17SanitizerToolNameE = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [45 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__sanitizer17ThreadContextBase10SetCreatedEmybjPv(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef, i64 noundef, i1 noundef zeroext, i32 noundef, ptr noundef) 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
define dso_local noundef i32 @_ZN11__sanitizer14ThreadRegistry12CreateThreadEmbjPv(ptr noundef nonnull align 8 dereferenceable(208) %0, i64 noundef %1, i1 noundef zeroext %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %7)
  %8 = invoke noundef ptr @_ZN11__sanitizer14ThreadRegistry13QuarantinePopEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
          to label %9 unwind label %10

9:                                                ; preds = %5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %12, label %35

10:                                               ; preds = %72, %24, %22, %18, %5
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %77

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 112
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !15
  %17 = icmp ult i32 %14, %16
  br i1 %17, label %18, label %22

18:                                               ; preds = %12
  %19 = add nuw i32 %14, 1
  store i32 %19, ptr %13, align 8, !tbaa !5
  %20 = load ptr, ptr %0, align 8, !tbaa !16
  %21 = invoke noundef ptr %20(i32 noundef %14)
          to label %26 unwind label %10

22:                                               ; preds = %12
  %23 = load ptr, ptr @_ZN11__sanitizer17SanitizerToolNameE, align 8, !tbaa !17
  invoke void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.6, ptr noundef %23, i32 noundef %16)
          to label %24 unwind label %10

24:                                               ; preds = %22
  invoke void @_ZN11__sanitizer3DieEv() #6
          to label %25 unwind label %10

25:                                               ; preds = %24
  unreachable

26:                                               ; preds = %18
  %27 = getelementptr inbounds i8, ptr %0, i64 152
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = zext i32 %14 to i64
  %30 = getelementptr inbounds ptr, ptr %28, i64 %29
  store ptr %21, ptr %30, align 8, !tbaa !17
  %.not44 = icmp eq ptr %21, null
  br i1 %.not44, label %31, label %.thread55, !prof !19

31:                                               ; preds = %26
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 143, ptr noundef nonnull @.str.7, i64 noundef 0, i64 noundef 0) #6
          to label %32 unwind label %33

32:                                               ; preds = %31
  unreachable

33:                                               ; preds = %31
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %77

35:                                               ; preds = %9
  %36 = getelementptr inbounds i8, ptr %8, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !20
  %38 = zext i32 %37 to i64
  %.not45 = icmp eq i32 %37, -1
  br i1 %.not45, label %39, label %.thread55, !prof !24

39:                                               ; preds = %35
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 144, ptr noundef nonnull @.str.8, i64 noundef %38, i64 noundef 4294967295) #6
          to label %40 unwind label %41

40:                                               ; preds = %39
  unreachable

41:                                               ; preds = %39
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %77

.thread55:                                        ; preds = %26, %35
  %43 = phi i64 [ %38, %35 ], [ %29, %26 ]
  %.0375360 = phi ptr [ %8, %35 ], [ %21, %26 ]
  %.05459 = phi i32 [ %37, %35 ], [ %14, %26 ]
  %44 = getelementptr inbounds i8, ptr %0, i64 8
  %45 = load i32, ptr %44, align 8, !tbaa !15
  %.not46 = icmp ult i32 %.05459, %45
  br i1 %.not46, label %51, label %46, !prof !25

46:                                               ; preds = %.thread55
  %47 = zext i32 %45 to i64
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 145, ptr noundef nonnull @.str.9, i64 noundef %43, i64 noundef %47) #6
          to label %48 unwind label %49

48:                                               ; preds = %46
  unreachable

49:                                               ; preds = %46
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %77

51:                                               ; preds = %.thread55
  %52 = getelementptr inbounds i8, ptr %.0375360, i64 112
  %53 = load i32, ptr %52, align 8, !tbaa !26
  %.not47 = icmp eq i32 %53, 0
  br i1 %.not47, label %59, label %54, !prof !25

54:                                               ; preds = %51
  %55 = zext i32 %53 to i64
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 146, ptr noundef nonnull @.str.10, i64 noundef %55, i64 noundef 0) #6
          to label %56 unwind label %57

56:                                               ; preds = %54
  unreachable

57:                                               ; preds = %54
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %77

59:                                               ; preds = %51
  %60 = getelementptr inbounds i8, ptr %0, i64 128
  %61 = load i64, ptr %60, align 8, !tbaa !27
  %62 = add i64 %61, 1
  store i64 %62, ptr %60, align 8, !tbaa !27
  %63 = getelementptr inbounds i8, ptr %0, i64 136
  %64 = load i64, ptr %63, align 8, !tbaa !28
  %65 = icmp ult i64 %64, %62
  br i1 %65, label %66, label %72

66:                                               ; preds = %59
  %67 = add nuw i64 %64, 1
  store i64 %67, ptr %63, align 8, !tbaa !28
  %.not48 = icmp eq i64 %61, %64
  br i1 %.not48, label %72, label %68, !prof !25

68:                                               ; preds = %66
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 150, ptr noundef nonnull @.str.11, i64 noundef %62, i64 noundef %67) #6
          to label %69 unwind label %70

69:                                               ; preds = %68
  unreachable

70:                                               ; preds = %68
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %77

72:                                               ; preds = %66, %59
  %73 = getelementptr inbounds i8, ptr %0, i64 120
  %74 = load i64, ptr %73, align 8, !tbaa !29
  %75 = add i64 %74, 1
  store i64 %75, ptr %73, align 8, !tbaa !29
  invoke void @_ZN11__sanitizer17ThreadContextBase10SetCreatedEmybjPv(ptr noundef nonnull align 8 dereferenceable(136) %.0375360, i64 noundef %1, i64 noundef %74, i1 noundef zeroext %2, i32 noundef %3, ptr noundef %4)
          to label %76 unwind label %10

76:                                               ; preds = %72
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  ret i32 %.05459

77:                                               ; preds = %70, %57, %49, %41, %33, %10
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %42, %41 ], [ %50, %49 ], [ %58, %57 ], [ %71, %70 ], [ %11, %10 ]
  call void @_ZN11__sanitizer17GenericScopedLockINS_13BlockingMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  resume { ptr, i32 } %.pn
}

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

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() local_unnamed_addr #1

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 = { "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, !10, i64 112}
!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 = !{!6, !10, i64 8}
!16 = !{!6, !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!6, !7, i64 152}
!19 = !{!"branch_weights", !"expected", i32 2861883, i32 2144621765}
!20 = !{!21, !10, i64 8}
!21 = !{!"_ZTSN11__sanitizer17ThreadContextBaseE", !10, i64 8, !13, i64 16, !10, i64 24, !12, i64 32, !12, i64 40, !8, i64 48, !22, i64 112, !23, i64 116, !10, i64 120, !7, i64 128}
!22 = !{!"_ZTSN11__sanitizer12ThreadStatusE", !8, i64 0}
!23 = !{!"bool", !8, i64 0}
!24 = !{!"branch_weights", !"expected", i32 1716268, i32 2145767380}
!25 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!26 = !{!21, !22, i64 112}
!27 = !{!6, !12, i64 128}
!28 = !{!6, !12, i64 136}
!29 = !{!6, !13, i64 120}


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