; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/threadx/common/src/tx_mutex_put.ll (tx_mutex_put)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TX_MUTEX_STRUCT = type { i64, ptr, i32, ptr, i32, i32, ptr, i32, ptr, ptr, i32, ptr, ptr }
%struct.TX_THREAD_STRUCT = type { i64, i64, ptr, ptr, ptr, i64, i64, i64, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, i64, %struct.TX_TIMER_INTERNAL_STRUCT, ptr, ptr, ptr, ptr, i64, ptr, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, ptr, ptr, ptr, i64 }
%struct.TX_TIMER_INTERNAL_STRUCT = type { i64, i64, ptr, i64, ptr, ptr, ptr }

@_tx_thread_current_ptr = external global ptr, align 8
@_tx_thread_preempt_disable = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @_tx_mutex_put(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 32, ptr %7, align 4, !tbaa !9
  %17 = call i32 @__disable_interrupts()
  store i32 %17, ptr %3, align 4, !tbaa !9
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %18, i32 0, i32 2
  %20 = load i32, ptr %19, align 8, !tbaa !11
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %361

22:                                               ; preds = %1
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %23, i32 0, i32 3
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  store ptr %25, ptr %4, align 8, !tbaa !5
  %26 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !5
  store ptr %26, ptr %12, align 8, !tbaa !5
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = icmp ne ptr %29, %30
  br i1 %31, label %32, label %38

32:                                               ; preds = %22
  %33 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %32
  %36 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %36)
  store i32 30, ptr %7, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %35, %32
  br label %38

38:                                               ; preds = %37, %22
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = icmp eq i32 %39, 32
  br i1 %40, label %41, label %360

41:                                               ; preds = %38
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !11
  %45 = add i32 %44, -1
  store i32 %45, ptr %43, align 8, !tbaa !11
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 8, !tbaa !11
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %41
  %51 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %51)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %359

52:                                               ; preds = %41
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %57

55:                                               ; preds = %52
  %56 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %56)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %358

57:                                               ; preds = %52
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %58, i32 0, i32 35
  %60 = load i32, ptr %59, align 4, !tbaa !15
  %61 = add i32 %60, -1
  store i32 %61, ptr %59, align 4, !tbaa !15
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %62, i32 0, i32 35
  %64 = load i32, ptr %63, align 4, !tbaa !15
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %57
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %67, i32 0, i32 36
  store ptr null, ptr %68, align 8, !tbaa !18
  br label %92

69:                                               ; preds = %57
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %70, i32 0, i32 11
  %72 = load ptr, ptr %71, align 8, !tbaa !19
  store ptr %72, ptr %8, align 8, !tbaa !5
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %73, i32 0, i32 12
  %75 = load ptr, ptr %74, align 8, !tbaa !20
  store ptr %75, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %77, i32 0, i32 12
  store ptr %76, ptr %78, align 8, !tbaa !20
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %80, i32 0, i32 11
  store ptr %79, ptr %81, align 8, !tbaa !19
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %82, i32 0, i32 36
  %84 = load ptr, ptr %83, align 8, !tbaa !18
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = icmp eq ptr %84, %85
  br i1 %86, label %87, label %91

87:                                               ; preds = %69
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %89, i32 0, i32 36
  store ptr %88, ptr %90, align 8, !tbaa !18
  br label %91

91:                                               ; preds = %87, %69
  br label %92

92:                                               ; preds = %91, %66
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %94, align 8, !tbaa !21
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %107

97:                                               ; preds = %92
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %98, i32 0, i32 4
  %100 = load i32, ptr %99, align 8, !tbaa !22
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %97
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %103, i32 0, i32 3
  store ptr null, ptr %104, align 8, !tbaa !14
  %105 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %105)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %102, %97
  br label %107

107:                                              ; preds = %106, %92
  %108 = load i32, ptr %7, align 4, !tbaa !9
  %109 = icmp eq i32 %108, 32
  br i1 %109, label %110, label %357

110:                                              ; preds = %107
  store ptr null, ptr %5, align 8, !tbaa !5
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %111, i32 0, i32 32
  %113 = load i32, ptr %112, align 8, !tbaa !23
  store i32 %113, ptr %6, align 4, !tbaa !9
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %114, i32 0, i32 4
  %116 = load i32, ptr %115, align 8, !tbaa !22
  %117 = icmp eq i32 %116, 1
  br i1 %117, label %118, label %168

118:                                              ; preds = %110
  %119 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %120 = add i32 %119, 1
  store volatile i32 %120, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %121 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %121)
  store i32 32, ptr %16, align 4, !tbaa !9
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %122, i32 0, i32 36
  %124 = load ptr, ptr %123, align 8, !tbaa !18
  store ptr %124, ptr %8, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %154, %118
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %155

128:                                              ; preds = %125
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %129, i32 0, i32 4
  %131 = load i32, ptr %130, align 8, !tbaa !22
  %132 = icmp eq i32 %131, 1
  br i1 %132, label %133, label %144

133:                                              ; preds = %128
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %134, i32 0, i32 10
  %136 = load i32, ptr %135, align 8, !tbaa !24
  %137 = load i32, ptr %16, align 4, !tbaa !9
  %138 = icmp ult i32 %136, %137
  br i1 %138, label %139, label %143

139:                                              ; preds = %133
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %140, i32 0, i32 10
  %142 = load i32, ptr %141, align 8, !tbaa !24
  store i32 %142, ptr %16, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %139, %133
  br label %144

144:                                              ; preds = %143, %128
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %145, i32 0, i32 11
  %147 = load ptr, ptr %146, align 8, !tbaa !19
  store ptr %147, ptr %8, align 8, !tbaa !5
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %149, i32 0, i32 36
  %151 = load ptr, ptr %150, align 8, !tbaa !18
  %152 = icmp eq ptr %148, %151
  br i1 %152, label %153, label %154

153:                                              ; preds = %144
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %154

154:                                              ; preds = %153, %144
  br label %125, !llvm.loop !25

155:                                              ; preds = %125
  %156 = call i32 @__disable_interrupts()
  store i32 %156, ptr %3, align 4, !tbaa !9
  %157 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %158 = add i32 %157, -1
  store volatile i32 %158, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %159 = load i32, ptr %16, align 4, !tbaa !9
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %160, i32 0, i32 34
  store i32 %159, ptr %161, align 8, !tbaa !27
  %162 = load i32, ptr %16, align 4, !tbaa !9
  %163 = load i32, ptr %6, align 4, !tbaa !9
  %164 = icmp ult i32 %162, %163
  br i1 %164, label %165, label %167

165:                                              ; preds = %155
  %166 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %166, ptr %6, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %165, %155
  br label %168

168:                                              ; preds = %167, %110
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %169, i32 0, i32 7
  %171 = load i32, ptr %170, align 8, !tbaa !28
  %172 = icmp ugt i32 %171, 1
  br i1 %172, label %173, label %188

173:                                              ; preds = %168
  %174 = load ptr, ptr %2, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %174, i32 0, i32 4
  %176 = load i32, ptr %175, align 8, !tbaa !22
  %177 = icmp eq i32 %176, 1
  br i1 %177, label %178, label %187

178:                                              ; preds = %173
  %179 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %180 = add i32 %179, 1
  store volatile i32 %180, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %181 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %181)
  %182 = load ptr, ptr %2, align 8, !tbaa !5
  %183 = call i32 @_tx_mutex_prioritize(ptr noundef %182)
  %184 = call i32 @__disable_interrupts()
  store i32 %184, ptr %3, align 4, !tbaa !9
  %185 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %186 = add i32 %185, -1
  store volatile i32 %186, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %178, %173
  br label %188

188:                                              ; preds = %187, %168
  %189 = load ptr, ptr %2, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %189, i32 0, i32 6
  %191 = load ptr, ptr %190, align 8, !tbaa !21
  %192 = icmp eq ptr %191, null
  br i1 %192, label %193, label %218

193:                                              ; preds = %188
  %194 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %195 = add i32 %194, 1
  store volatile i32 %195, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %196 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %196)
  %197 = load ptr, ptr %2, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %197, i32 0, i32 10
  store i32 32, ptr %198, align 8, !tbaa !24
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %199, i32 0, i32 3
  %201 = load ptr, ptr %200, align 8, !tbaa !14
  %202 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %201, i32 0, i32 11
  %203 = load i32, ptr %202, align 8, !tbaa !29
  %204 = load i32, ptr %6, align 4, !tbaa !9
  %205 = icmp ne i32 %203, %204
  br i1 %205, label %206, label %211

206:                                              ; preds = %193
  %207 = load ptr, ptr %2, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %207, i32 0, i32 3
  %209 = load ptr, ptr %208, align 8, !tbaa !14
  %210 = load i32, ptr %6, align 4, !tbaa !9
  call void @_tx_mutex_priority_change(ptr noundef %209, i32 noundef %210)
  br label %211

211:                                              ; preds = %206, %193
  %212 = call i32 @__disable_interrupts()
  store i32 %212, ptr %3, align 4, !tbaa !9
  %213 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %214 = add i32 %213, -1
  store volatile i32 %214, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %215 = load ptr, ptr %2, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %215, i32 0, i32 3
  store ptr null, ptr %216, align 8, !tbaa !14
  %217 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %217)
  call void @_tx_thread_system_preempt_check()
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %356

218:                                              ; preds = %188
  %219 = load ptr, ptr %2, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %219, i32 0, i32 6
  %221 = load ptr, ptr %220, align 8, !tbaa !21
  store ptr %221, ptr %4, align 8, !tbaa !5
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %222, i32 0, i32 4
  %224 = load i32, ptr %223, align 8, !tbaa !22
  %225 = icmp eq i32 %224, 1
  br i1 %225, label %226, label %237

226:                                              ; preds = %218
  %227 = load ptr, ptr %2, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %227, i32 0, i32 3
  %229 = load ptr, ptr %228, align 8, !tbaa !14
  store ptr %229, ptr %5, align 8, !tbaa !5
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %230, i32 0, i32 11
  %232 = load i32, ptr %231, align 8, !tbaa !29
  %233 = load ptr, ptr %2, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %233, i32 0, i32 5
  store i32 %232, ptr %234, align 4, !tbaa !30
  %235 = load ptr, ptr %2, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %235, i32 0, i32 10
  store i32 32, ptr %236, align 8, !tbaa !24
  br label %237

237:                                              ; preds = %226, %218
  %238 = load ptr, ptr %4, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %238, i32 0, i32 35
  %240 = load i32, ptr %239, align 4, !tbaa !15
  store i32 %240, ptr %10, align 4, !tbaa !9
  %241 = load i32, ptr %10, align 4, !tbaa !9
  %242 = icmp eq i32 %241, 0
  br i1 %242, label %243, label %253

243:                                              ; preds = %237
  %244 = load ptr, ptr %2, align 8, !tbaa !5
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %245, i32 0, i32 36
  store ptr %244, ptr %246, align 8, !tbaa !18
  %247 = load ptr, ptr %2, align 8, !tbaa !5
  %248 = load ptr, ptr %2, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %248, i32 0, i32 11
  store ptr %247, ptr %249, align 8, !tbaa !19
  %250 = load ptr, ptr %2, align 8, !tbaa !5
  %251 = load ptr, ptr %2, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %251, i32 0, i32 12
  store ptr %250, ptr %252, align 8, !tbaa !20
  br label %272

253:                                              ; preds = %237
  %254 = load ptr, ptr %4, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %254, i32 0, i32 36
  %256 = load ptr, ptr %255, align 8, !tbaa !18
  store ptr %256, ptr %8, align 8, !tbaa !5
  %257 = load ptr, ptr %8, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %257, i32 0, i32 12
  %259 = load ptr, ptr %258, align 8, !tbaa !20
  store ptr %259, ptr %9, align 8, !tbaa !5
  %260 = load ptr, ptr %2, align 8, !tbaa !5
  %261 = load ptr, ptr %8, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %261, i32 0, i32 12
  store ptr %260, ptr %262, align 8, !tbaa !20
  %263 = load ptr, ptr %2, align 8, !tbaa !5
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %264, i32 0, i32 11
  store ptr %263, ptr %265, align 8, !tbaa !19
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = load ptr, ptr %2, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %267, i32 0, i32 12
  store ptr %266, ptr %268, align 8, !tbaa !20
  %269 = load ptr, ptr %8, align 8, !tbaa !5
  %270 = load ptr, ptr %2, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %270, i32 0, i32 11
  store ptr %269, ptr %271, align 8, !tbaa !19
  br label %272

272:                                              ; preds = %253, %243
  %273 = load i32, ptr %10, align 4, !tbaa !9
  %274 = add i32 %273, 1
  %275 = load ptr, ptr %4, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %275, i32 0, i32 35
  store i32 %274, ptr %276, align 4, !tbaa !15
  %277 = load ptr, ptr %2, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %277, i32 0, i32 2
  store i32 1, ptr %278, align 8, !tbaa !11
  %279 = load ptr, ptr %4, align 8, !tbaa !5
  %280 = load ptr, ptr %2, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %280, i32 0, i32 3
  store ptr %279, ptr %281, align 8, !tbaa !14
  %282 = load ptr, ptr %2, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %282, i32 0, i32 7
  %284 = load i32, ptr %283, align 8, !tbaa !28
  %285 = add i32 %284, -1
  store i32 %285, ptr %283, align 8, !tbaa !28
  %286 = load ptr, ptr %2, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %286, i32 0, i32 7
  %288 = load i32, ptr %287, align 8, !tbaa !28
  store i32 %288, ptr %11, align 4, !tbaa !9
  %289 = load i32, ptr %11, align 4, !tbaa !9
  %290 = icmp eq i32 %289, 0
  br i1 %290, label %291, label %294

291:                                              ; preds = %272
  %292 = load ptr, ptr %2, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %292, i32 0, i32 6
  store ptr null, ptr %293, align 8, !tbaa !21
  br label %310

294:                                              ; preds = %272
  %295 = load ptr, ptr %4, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %295, i32 0, i32 22
  %297 = load ptr, ptr %296, align 8, !tbaa !31
  store ptr %297, ptr %13, align 8, !tbaa !5
  %298 = load ptr, ptr %13, align 8, !tbaa !5
  %299 = load ptr, ptr %2, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %299, i32 0, i32 6
  store ptr %298, ptr %300, align 8, !tbaa !21
  %301 = load ptr, ptr %4, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %301, i32 0, i32 23
  %303 = load ptr, ptr %302, align 8, !tbaa !32
  store ptr %303, ptr %14, align 8, !tbaa !5
  %304 = load ptr, ptr %14, align 8, !tbaa !5
  %305 = load ptr, ptr %13, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %305, i32 0, i32 23
  store ptr %304, ptr %306, align 8, !tbaa !32
  %307 = load ptr, ptr %13, align 8, !tbaa !5
  %308 = load ptr, ptr %14, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %308, i32 0, i32 22
  store ptr %307, ptr %309, align 8, !tbaa !31
  br label %310

310:                                              ; preds = %294, %291
  %311 = load ptr, ptr %4, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %311, i32 0, i32 20
  store ptr null, ptr %312, align 8, !tbaa !33
  %313 = load ptr, ptr %4, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %313, i32 0, i32 27
  store i32 0, ptr %314, align 4, !tbaa !34
  %315 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %316 = add i32 %315, 1
  store volatile i32 %316, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %317 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %317)
  %318 = load ptr, ptr %2, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %318, i32 0, i32 4
  %320 = load i32, ptr %319, align 8, !tbaa !22
  %321 = icmp eq i32 %320, 1
  br i1 %321, label %322, label %354

322:                                              ; preds = %310
  %323 = load ptr, ptr %2, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %323, i32 0, i32 7
  %325 = load i32, ptr %324, align 8, !tbaa !28
  %326 = icmp ne i32 %325, 0
  br i1 %326, label %327, label %344

327:                                              ; preds = %322
  %328 = load ptr, ptr %2, align 8, !tbaa !5
  %329 = call i32 @_tx_mutex_prioritize(ptr noundef %328)
  %330 = call i32 @__disable_interrupts()
  store i32 %330, ptr %3, align 4, !tbaa !9
  %331 = load ptr, ptr %2, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %331, i32 0, i32 6
  %333 = load ptr, ptr %332, align 8, !tbaa !21
  store ptr %333, ptr %15, align 8, !tbaa !5
  %334 = load ptr, ptr %15, align 8, !tbaa !5
  %335 = icmp ne ptr %334, null
  br i1 %335, label %336, label %342

336:                                              ; preds = %327
  %337 = load ptr, ptr %15, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %337, i32 0, i32 11
  %339 = load i32, ptr %338, align 8, !tbaa !29
  %340 = load ptr, ptr %2, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.TX_MUTEX_STRUCT, ptr %340, i32 0, i32 10
  store i32 %339, ptr %341, align 8, !tbaa !24
  br label %342

342:                                              ; preds = %336, %327
  %343 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %343)
  br label %344

344:                                              ; preds = %342, %322
  %345 = load ptr, ptr %5, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %345, i32 0, i32 11
  %347 = load i32, ptr %346, align 8, !tbaa !29
  %348 = load i32, ptr %6, align 4, !tbaa !9
  %349 = icmp ne i32 %347, %348
  br i1 %349, label %350, label %353

350:                                              ; preds = %344
  %351 = load ptr, ptr %5, align 8, !tbaa !5
  %352 = load i32, ptr %6, align 4, !tbaa !9
  call void @_tx_mutex_priority_change(ptr noundef %351, i32 noundef %352)
  br label %353

353:                                              ; preds = %350, %344
  br label %354

354:                                              ; preds = %353, %310
  %355 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_tx_thread_system_resume(ptr noundef %355)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %356

356:                                              ; preds = %354, %211
  br label %357

357:                                              ; preds = %356, %107
  br label %358

358:                                              ; preds = %357, %55
  br label %359

359:                                              ; preds = %358, %50
  br label %360

360:                                              ; preds = %359, %38
  br label %363

361:                                              ; preds = %1
  %362 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %362)
  store i32 30, ptr %7, align 4, !tbaa !9
  br label %363

363:                                              ; preds = %361, %360
  %364 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret i32 %364
}

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @__disable_interrupts() #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @__restore_interrupt(i32 noundef) #2

declare i32 @_tx_mutex_prioritize(ptr noundef) #3

declare void @_tx_mutex_priority_change(ptr noundef, i32 noundef) #3

declare void @_tx_thread_system_preempt_check() #3

declare void @_tx_thread_system_resume(ptr noundef) #3

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"TX_MUTEX_STRUCT", !13, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !6, i64 40, !10, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !6, i64 88}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 24}
!15 = !{!16, !10, i64 292}
!16 = !{!"TX_THREAD_STRUCT", !13, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !17, i64 136, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !13, i64 224, !6, i64 232, !10, i64 240, !10, i64 244, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !10, i64 280, !10, i64 284, !10, i64 288, !10, i64 292, !6, i64 296, !6, i64 304, !6, i64 312, !13, i64 320}
!17 = !{!"TX_TIMER_INTERNAL_STRUCT", !13, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!18 = !{!16, !6, i64 296}
!19 = !{!12, !6, i64 80}
!20 = !{!12, !6, i64 88}
!21 = !{!12, !6, i64 40}
!22 = !{!12, !10, i64 32}
!23 = !{!16, !10, i64 280}
!24 = !{!12, !10, i64 72}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!16, !10, i64 288}
!28 = !{!12, !10, i64 48}
!29 = !{!16, !10, i64 88}
!30 = !{!12, !10, i64 36}
!31 = !{!16, !6, i64 208}
!32 = !{!16, !6, i64 216}
!33 = !{!16, !6, i64 192}
!34 = !{!16, !10, i64 244}


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

@_tx_thread_current_ptr = external local_unnamed_addr global ptr, align 8
@_tx_thread_preempt_disable = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 32) i32 @_tx_mutex_put(ptr noundef %0) local_unnamed_addr #0 {
  %2 = tail call i32 @__disable_interrupts()
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %152, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %8 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !13
  %.not129 = icmp eq ptr %7, %8
  br i1 %.not129, label %13, label %9

9:                                                ; preds = %5
  %10 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %13

12:                                               ; preds = %9
  tail call void @__restore_interrupt(i32 noundef %2)
  br label %153

13:                                               ; preds = %9, %5
  %14 = add i32 %4, -1
  store i32 %14, ptr %3, align 8, !tbaa !5
  %.not130 = icmp eq i32 %14, 0
  br i1 %.not130, label %16, label %15

15:                                               ; preds = %13
  tail call void @__restore_interrupt(i32 noundef %2)
  br label %153

16:                                               ; preds = %13
  %17 = icmp eq ptr %7, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %16
  tail call void @__restore_interrupt(i32 noundef %2)
  br label %153

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %7, i64 292
  %21 = load i32, ptr %20, align 4, !tbaa !15
  %22 = add i32 %21, -1
  store i32 %22, ptr %20, align 4, !tbaa !15
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %26

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %7, i64 296
  store ptr null, ptr %25, align 8, !tbaa !18
  br label %37

26:                                               ; preds = %19
  %27 = getelementptr inbounds i8, ptr %0, i64 80
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %0, i64 88
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = getelementptr inbounds i8, ptr %28, i64 88
  store ptr %30, ptr %31, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %30, i64 80
  store ptr %28, ptr %32, align 8, !tbaa !19
  %33 = getelementptr inbounds i8, ptr %7, i64 296
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = icmp eq ptr %34, %0
  br i1 %35, label %36, label %37

36:                                               ; preds = %26
  store ptr %28, ptr %33, align 8, !tbaa !18
  br label %37

37:                                               ; preds = %26, %36, %24
  %38 = getelementptr inbounds i8, ptr %0, i64 40
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  %40 = icmp eq ptr %39, null
  %41 = getelementptr inbounds i8, ptr %0, i64 32
  %42 = load i32, ptr %41, align 8, !tbaa !22
  %43 = icmp eq i32 %42, 0
  %or.cond = select i1 %40, i1 %43, i1 false
  br i1 %or.cond, label %44, label %._crit_edge

44:                                               ; preds = %37
  store ptr null, ptr %6, align 8, !tbaa !12
  tail call void @__restore_interrupt(i32 noundef %2)
  br label %153

._crit_edge:                                      ; preds = %37
  %45 = getelementptr inbounds i8, ptr %7, i64 280
  %46 = load i32, ptr %45, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %0, i64 32
  %48 = icmp eq i32 %42, 1
  br i1 %48, label %49, label %67

49:                                               ; preds = %._crit_edge
  %50 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %51 = add i32 %50, 1
  store volatile i32 %51, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  tail call void @__restore_interrupt(i32 noundef %2)
  %52 = getelementptr inbounds i8, ptr %7, i64 296
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %.not131142 = icmp eq ptr %53, null
  br i1 %.not131142, label %select.unfold._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %49, %select.unfold
  %.0144 = phi i32 [ %.1, %select.unfold ], [ 32, %49 ]
  %.0123143 = phi ptr [ %61, %select.unfold ], [ %53, %49 ]
  %54 = getelementptr inbounds i8, ptr %.0123143, i64 32
  %55 = load i32, ptr %54, align 8, !tbaa !22
  %56 = icmp eq i32 %55, 1
  br i1 %56, label %57, label %select.unfold

57:                                               ; preds = %.lr.ph
  %58 = getelementptr inbounds i8, ptr %.0123143, i64 72
  %59 = load i32, ptr %58, align 8, !tbaa !24
  %spec.select = tail call i32 @llvm.umin.i32(i32 %59, i32 %.0144)
  br label %select.unfold

select.unfold:                                    ; preds = %57, %.lr.ph
  %.1 = phi i32 [ %.0144, %.lr.ph ], [ %spec.select, %57 ]
  %60 = getelementptr inbounds i8, ptr %.0123143, i64 80
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = icmp eq ptr %61, %53
  %.not131148 = icmp eq ptr %61, null
  %.not131 = or i1 %62, %.not131148
  br i1 %.not131, label %select.unfold._crit_edge, label %.lr.ph

select.unfold._crit_edge:                         ; preds = %select.unfold, %49
  %.0.lcssa = phi i32 [ 32, %49 ], [ %.1, %select.unfold ]
  %63 = tail call i32 @__disable_interrupts()
  %64 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %65 = add i32 %64, -1
  store volatile i32 %65, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %7, i64 288
  store i32 %.0.lcssa, ptr %66, align 8, !tbaa !25
  %spec.select136 = tail call i32 @llvm.umin.i32(i32 %.0.lcssa, i32 %46)
  br label %67

67:                                               ; preds = %select.unfold._crit_edge, %._crit_edge
  %.0120 = phi i32 [ %46, %._crit_edge ], [ %spec.select136, %select.unfold._crit_edge ]
  %.0117 = phi i32 [ %2, %._crit_edge ], [ %63, %select.unfold._crit_edge ]
  %68 = getelementptr inbounds i8, ptr %0, i64 48
  %69 = load i32, ptr %68, align 8, !tbaa !26
  %70 = icmp ugt i32 %69, 1
  br i1 %70, label %71, label %81

71:                                               ; preds = %67
  %72 = load i32, ptr %47, align 8, !tbaa !22
  %73 = icmp eq i32 %72, 1
  br i1 %73, label %74, label %81

74:                                               ; preds = %71
  %75 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %76 = add i32 %75, 1
  store volatile i32 %76, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  tail call void @__restore_interrupt(i32 noundef %.0117)
  %77 = tail call i32 @_tx_mutex_prioritize(ptr noundef nonnull %0) #4
  %78 = tail call i32 @__disable_interrupts()
  %79 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %80 = add i32 %79, -1
  store volatile i32 %80, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  br label %81

81:                                               ; preds = %71, %74, %67
  %.1118 = phi i32 [ %78, %74 ], [ %.0117, %71 ], [ %.0117, %67 ]
  %82 = load ptr, ptr %38, align 8, !tbaa !21
  %83 = icmp eq ptr %82, null
  br i1 %83, label %84, label %96

84:                                               ; preds = %81
  %85 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %86 = add i32 %85, 1
  store volatile i32 %86, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  tail call void @__restore_interrupt(i32 noundef %.1118)
  %87 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 32, ptr %87, align 8, !tbaa !24
  %88 = load ptr, ptr %6, align 8, !tbaa !12
  %89 = getelementptr inbounds i8, ptr %88, i64 88
  %90 = load i32, ptr %89, align 8, !tbaa !27
  %.not135 = icmp eq i32 %90, %.0120
  br i1 %.not135, label %92, label %91

91:                                               ; preds = %84
  tail call void @_tx_mutex_priority_change(ptr noundef nonnull %88, i32 noundef %.0120) #4
  br label %92

92:                                               ; preds = %91, %84
  %93 = tail call i32 @__disable_interrupts()
  %94 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %95 = add i32 %94, -1
  store volatile i32 %95, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  store ptr null, ptr %6, align 8, !tbaa !12
  tail call void @__restore_interrupt(i32 noundef %93)
  tail call void @_tx_thread_system_preempt_check() #4
  br label %153

96:                                               ; preds = %81
  %97 = load i32, ptr %47, align 8, !tbaa !22
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %105

99:                                               ; preds = %96
  %100 = load ptr, ptr %6, align 8, !tbaa !12
  %101 = getelementptr inbounds i8, ptr %82, i64 88
  %102 = load i32, ptr %101, align 8, !tbaa !27
  %103 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %102, ptr %103, align 4, !tbaa !28
  %104 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 32, ptr %104, align 8, !tbaa !24
  br label %105

105:                                              ; preds = %99, %96
  %.0119 = phi ptr [ %100, %99 ], [ null, %96 ]
  %106 = getelementptr inbounds i8, ptr %82, i64 292
  %107 = load i32, ptr %106, align 4, !tbaa !15
  %108 = icmp eq i32 %107, 0
  %109 = getelementptr inbounds i8, ptr %82, i64 296
  br i1 %108, label %115, label %110

110:                                              ; preds = %105
  %111 = load ptr, ptr %109, align 8, !tbaa !18
  %112 = getelementptr inbounds i8, ptr %111, i64 88
  %113 = load ptr, ptr %112, align 8, !tbaa !20
  store ptr %0, ptr %112, align 8, !tbaa !20
  %114 = getelementptr inbounds i8, ptr %113, i64 80
  br label %115

115:                                              ; preds = %105, %110
  %.sink147 = phi ptr [ %114, %110 ], [ %109, %105 ]
  %.sink145 = phi ptr [ %111, %110 ], [ %0, %105 ]
  %.sink = phi ptr [ %113, %110 ], [ %0, %105 ]
  store ptr %0, ptr %.sink147, align 8, !tbaa !13
  %116 = getelementptr inbounds i8, ptr %0, i64 80
  store ptr %.sink145, ptr %116, align 8
  %117 = getelementptr inbounds i8, ptr %0, i64 88
  store ptr %.sink, ptr %117, align 8
  %118 = add i32 %107, 1
  store i32 %118, ptr %106, align 4, !tbaa !15
  store i32 1, ptr %3, align 8, !tbaa !5
  store ptr %82, ptr %6, align 8, !tbaa !12
  %119 = load i32, ptr %68, align 8, !tbaa !26
  %120 = add i32 %119, -1
  store i32 %120, ptr %68, align 8, !tbaa !26
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %129, label %122

122:                                              ; preds = %115
  %123 = getelementptr inbounds i8, ptr %82, i64 208
  %124 = load ptr, ptr %123, align 8, !tbaa !29
  %125 = getelementptr inbounds i8, ptr %82, i64 216
  %126 = load ptr, ptr %125, align 8, !tbaa !30
  %127 = getelementptr inbounds i8, ptr %124, i64 216
  store ptr %126, ptr %127, align 8, !tbaa !30
  %128 = getelementptr inbounds i8, ptr %126, i64 208
  store ptr %124, ptr %128, align 8, !tbaa !29
  br label %129

129:                                              ; preds = %115, %122
  %.sink146 = phi ptr [ %124, %122 ], [ null, %115 ]
  store ptr %.sink146, ptr %38, align 8
  %130 = getelementptr inbounds i8, ptr %82, i64 192
  store ptr null, ptr %130, align 8, !tbaa !31
  %131 = getelementptr inbounds i8, ptr %82, i64 244
  store i32 0, ptr %131, align 4, !tbaa !32
  %132 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  %133 = add i32 %132, 1
  store volatile i32 %133, ptr @_tx_thread_preempt_disable, align 4, !tbaa !14
  tail call void @__restore_interrupt(i32 noundef %.1118)
  %134 = load i32, ptr %47, align 8, !tbaa !22
  %135 = icmp eq i32 %134, 1
  br i1 %135, label %136, label %151

136:                                              ; preds = %129
  %137 = load i32, ptr %68, align 8, !tbaa !26
  %.not132 = icmp eq i32 %137, 0
  br i1 %.not132, label %147, label %138

138:                                              ; preds = %136
  %139 = tail call i32 @_tx_mutex_prioritize(ptr noundef nonnull %0) #4
  %140 = tail call i32 @__disable_interrupts()
  %141 = load ptr, ptr %38, align 8, !tbaa !21
  %.not133 = icmp eq ptr %141, null
  br i1 %.not133, label %146, label %142

142:                                              ; preds = %138
  %143 = getelementptr inbounds i8, ptr %141, i64 88
  %144 = load i32, ptr %143, align 8, !tbaa !27
  %145 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %144, ptr %145, align 8, !tbaa !24
  br label %146

146:                                              ; preds = %142, %138
  tail call void @__restore_interrupt(i32 noundef %140)
  br label %147

147:                                              ; preds = %146, %136
  %148 = getelementptr inbounds i8, ptr %.0119, i64 88
  %149 = load i32, ptr %148, align 8, !tbaa !27
  %.not134 = icmp eq i32 %149, %.0120
  br i1 %.not134, label %151, label %150

150:                                              ; preds = %147
  tail call void @_tx_mutex_priority_change(ptr noundef nonnull %.0119, i32 noundef %.0120) #4
  br label %151

151:                                              ; preds = %147, %150, %129
  tail call void @_tx_thread_system_resume(ptr noundef nonnull %82) #4
  br label %153

152:                                              ; preds = %1
  tail call void @__restore_interrupt(i32 noundef %2)
  br label %153

153:                                              ; preds = %44, %12, %18, %92, %151, %15, %152
  %.2 = phi i32 [ 0, %15 ], [ 0, %18 ], [ 0, %92 ], [ 0, %151 ], [ 0, %44 ], [ 30, %12 ], [ 30, %152 ]
  ret i32 %.2
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @__disable_interrupts() local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @__restore_interrupt(i32 noundef) local_unnamed_addr #1

declare i32 @_tx_mutex_prioritize(ptr noundef) local_unnamed_addr #2

declare void @_tx_mutex_priority_change(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @_tx_thread_system_preempt_check() local_unnamed_addr #2

declare void @_tx_thread_system_resume(ptr noundef) local_unnamed_addr #2

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 16}
!6 = !{!"TX_MUTEX_STRUCT", !7, i64 0, !10, i64 8, !11, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !10, i64 40, !11, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !10, i64 80, !10, i64 88}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !10, i64 24}
!13 = !{!10, !10, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !11, i64 292}
!16 = !{!"TX_THREAD_STRUCT", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !10, i64 112, !10, i64 120, !7, i64 128, !17, i64 136, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !7, i64 224, !10, i64 232, !11, i64 240, !11, i64 244, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !11, i64 280, !11, i64 284, !11, i64 288, !11, i64 292, !10, i64 296, !10, i64 304, !10, i64 312, !7, i64 320}
!17 = !{!"TX_TIMER_INTERNAL_STRUCT", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!18 = !{!16, !10, i64 296}
!19 = !{!6, !10, i64 80}
!20 = !{!6, !10, i64 88}
!21 = !{!6, !10, i64 40}
!22 = !{!6, !11, i64 32}
!23 = !{!16, !11, i64 280}
!24 = !{!6, !11, i64 72}
!25 = !{!16, !11, i64 288}
!26 = !{!6, !11, i64 48}
!27 = !{!16, !11, i64 88}
!28 = !{!6, !11, i64 36}
!29 = !{!16, !10, i64 208}
!30 = !{!16, !10, i64 216}
!31 = !{!16, !10, i64 192}
!32 = !{!16, !11, i64 244}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass