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

; 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_QUEUE_STRUCT = type { i64, ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, 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_preempt_disable = external global i32, align 4
@_tx_thread_current_ptr = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @_tx_queue_front_send(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  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 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, 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 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i32 0, ptr %15, align 4, !tbaa !11
  %17 = call i32 @__disable_interrupts()
  store i32 %17, ptr %7, align 4, !tbaa !11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %18, i32 0, i32 11
  %20 = load i32, ptr %19, align 8, !tbaa !13
  store i32 %20, ptr %12, align 4, !tbaa !11
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %21, i32 0, i32 5
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %187

25:                                               ; preds = %3
  %26 = load i32, ptr %12, align 4, !tbaa !11
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %106

28:                                               ; preds = %25
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %29, i32 0, i32 8
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %32, i32 0, i32 6
  %34 = load ptr, ptr %33, align 8, !tbaa !17
  %35 = icmp eq ptr %31, %34
  br i1 %35, label %36, label %48

36:                                               ; preds = %28
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %37, i32 0, i32 7
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !19
  %43 = zext i32 %42 to i64
  %44 = sub i64 0, %43
  %45 = getelementptr inbounds i64, ptr %39, i64 %44
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %46, i32 0, i32 8
  store ptr %45, ptr %47, align 8, !tbaa !16
  br label %60

48:                                               ; preds = %28
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %49, i32 0, i32 8
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %52, i32 0, i32 2
  %54 = load i32, ptr %53, align 8, !tbaa !19
  %55 = zext i32 %54 to i64
  %56 = sub i64 0, %55
  %57 = getelementptr inbounds i64, ptr %51, i64 %56
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %58, i32 0, i32 8
  store ptr %57, ptr %59, align 8, !tbaa !16
  br label %60

60:                                               ; preds = %48, %36
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %61, i32 0, i32 5
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %64 = add i32 %63, -1
  store i32 %64, ptr %62, align 4, !tbaa !15
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %66, align 8, !tbaa !20
  %68 = add i32 %67, 1
  store i32 %68, ptr %66, align 8, !tbaa !20
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %69, ptr %9, align 8, !tbaa !5
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %70, i32 0, i32 8
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  store ptr %72, ptr %10, align 8, !tbaa !5
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %73, i32 0, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !19
  store i32 %75, ptr %11, align 4, !tbaa !11
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds i64, ptr %76, i32 1
  store ptr %77, ptr %9, align 8, !tbaa !5
  %78 = load i64, ptr %76, align 8, !tbaa !9
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds i64, ptr %79, i32 1
  store ptr %80, ptr %10, align 8, !tbaa !5
  store i64 %78, ptr %79, align 8, !tbaa !9
  %81 = load i32, ptr %11, align 4, !tbaa !11
  %82 = icmp ugt i32 %81, 1
  br i1 %82, label %83, label %95

83:                                               ; preds = %60
  br label %84

84:                                               ; preds = %88, %83
  %85 = load i32, ptr %11, align 4, !tbaa !11
  %86 = add i32 %85, -1
  store i32 %86, ptr %11, align 4, !tbaa !11
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %94

88:                                               ; preds = %84
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds i64, ptr %89, i32 1
  store ptr %90, ptr %9, align 8, !tbaa !5
  %91 = load i64, ptr %89, align 8, !tbaa !9
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds i64, ptr %92, i32 1
  store ptr %93, ptr %10, align 8, !tbaa !5
  store i64 %91, ptr %92, align 8, !tbaa !9
  br label %84, !llvm.loop !21

94:                                               ; preds = %84
  br label %95

95:                                               ; preds = %94, %60
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %96, i32 0, i32 14
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  store ptr %98, ptr %16, align 8, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %99)
  %100 = load ptr, ptr %16, align 8, !tbaa !5
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %105

102:                                              ; preds = %95
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  call void %103(ptr noundef %104)
  br label %105

105:                                              ; preds = %102, %95
  br label %186

106:                                              ; preds = %25
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %107, i32 0, i32 10
  %109 = load ptr, ptr %108, align 8, !tbaa !24
  store ptr %109, ptr %8, align 8, !tbaa !5
  %110 = load i32, ptr %12, align 4, !tbaa !11
  %111 = add i32 %110, -1
  store i32 %111, ptr %12, align 4, !tbaa !11
  %112 = load i32, ptr %12, align 4, !tbaa !11
  %113 = icmp eq i32 %112, 0
  br i1 %113, label %114, label %117

114:                                              ; preds = %106
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %115, i32 0, i32 10
  store ptr null, ptr %116, align 8, !tbaa !24
  br label %138

117:                                              ; preds = %106
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %118, i32 0, i32 22
  %120 = load ptr, ptr %119, align 8, !tbaa !25
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %121, i32 0, i32 10
  store ptr %120, ptr %122, align 8, !tbaa !24
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %123, i32 0, i32 22
  %125 = load ptr, ptr %124, align 8, !tbaa !25
  store ptr %125, ptr %13, align 8, !tbaa !5
  %126 = load ptr, ptr %13, align 8, !tbaa !5
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %127, i32 0, i32 10
  store ptr %126, ptr %128, align 8, !tbaa !24
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %129, i32 0, i32 23
  %131 = load ptr, ptr %130, align 8, !tbaa !28
  store ptr %131, ptr %14, align 8, !tbaa !5
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %133, i32 0, i32 23
  store ptr %132, ptr %134, align 8, !tbaa !28
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %136, i32 0, i32 22
  store ptr %135, ptr %137, align 8, !tbaa !25
  br label %138

138:                                              ; preds = %117, %114
  %139 = load i32, ptr %12, align 4, !tbaa !11
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %140, i32 0, i32 11
  store i32 %139, ptr %141, align 8, !tbaa !13
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %142, i32 0, i32 20
  store ptr null, ptr %143, align 8, !tbaa !29
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %144, i32 0, i32 14
  %146 = load ptr, ptr %145, align 8, !tbaa !23
  store ptr %146, ptr %16, align 8, !tbaa !5
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %147, ptr %9, align 8, !tbaa !5
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %148, i32 0, i32 25
  %150 = load ptr, ptr %149, align 8, !tbaa !30
  store ptr %150, ptr %10, align 8, !tbaa !5
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %151, i32 0, i32 2
  %153 = load i32, ptr %152, align 8, !tbaa !19
  store i32 %153, ptr %11, align 4, !tbaa !11
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = getelementptr inbounds i64, ptr %154, i32 1
  store ptr %155, ptr %9, align 8, !tbaa !5
  %156 = load i64, ptr %154, align 8, !tbaa !9
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = getelementptr inbounds i64, ptr %157, i32 1
  store ptr %158, ptr %10, align 8, !tbaa !5
  store i64 %156, ptr %157, align 8, !tbaa !9
  %159 = load i32, ptr %11, align 4, !tbaa !11
  %160 = icmp ugt i32 %159, 1
  br i1 %160, label %161, label %173

161:                                              ; preds = %138
  br label %162

162:                                              ; preds = %166, %161
  %163 = load i32, ptr %11, align 4, !tbaa !11
  %164 = add i32 %163, -1
  store i32 %164, ptr %11, align 4, !tbaa !11
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %172

166:                                              ; preds = %162
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds i64, ptr %167, i32 1
  store ptr %168, ptr %9, align 8, !tbaa !5
  %169 = load i64, ptr %167, align 8, !tbaa !9
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds i64, ptr %170, i32 1
  store ptr %171, ptr %10, align 8, !tbaa !5
  store i64 %169, ptr %170, align 8, !tbaa !9
  br label %162, !llvm.loop !31

172:                                              ; preds = %162
  br label %173

173:                                              ; preds = %172, %138
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %174, i32 0, i32 27
  store i32 0, ptr %175, align 4, !tbaa !32
  %176 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %177 = add i32 %176, 1
  store volatile i32 %177, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %178 = load i32, ptr %7, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %178)
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_tx_thread_system_resume(ptr noundef %179)
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %185

182:                                              ; preds = %173
  %183 = load ptr, ptr %16, align 8, !tbaa !5
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  call void %183(ptr noundef %184)
  br label %185

185:                                              ; preds = %182, %173
  br label %186

186:                                              ; preds = %185, %105
  br label %284

187:                                              ; preds = %3
  %188 = load i64, ptr %6, align 8, !tbaa !9
  %189 = icmp ne i64 %188, 0
  br i1 %189, label %190, label %281

190:                                              ; preds = %187
  %191 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %195

193:                                              ; preds = %190
  %194 = load i32, ptr %7, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %194)
  store i32 11, ptr %15, align 4, !tbaa !11
  br label %280

195:                                              ; preds = %190
  %196 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !5
  store ptr %196, ptr %8, align 8, !tbaa !5
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %197, i32 0, i32 20
  store ptr @_tx_queue_cleanup, ptr %198, align 8, !tbaa !29
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %200, i32 0, i32 21
  store ptr %199, ptr %201, align 8, !tbaa !33
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  %203 = load ptr, ptr %8, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %203, i32 0, i32 25
  store ptr %202, ptr %204, align 8, !tbaa !30
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %205, i32 0, i32 26
  store i32 1, ptr %206, align 8, !tbaa !34
  %207 = load ptr, ptr %8, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %207, i32 0, i32 39
  %209 = load i64, ptr %208, align 8, !tbaa !35
  %210 = add i64 %209, 1
  store i64 %210, ptr %208, align 8, !tbaa !35
  %211 = load i32, ptr %12, align 4, !tbaa !11
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %223

213:                                              ; preds = %195
  %214 = load ptr, ptr %8, align 8, !tbaa !5
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %215, i32 0, i32 10
  store ptr %214, ptr %216, align 8, !tbaa !24
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %218, i32 0, i32 22
  store ptr %217, ptr %219, align 8, !tbaa !25
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = load ptr, ptr %8, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %221, i32 0, i32 23
  store ptr %220, ptr %222, align 8, !tbaa !28
  br label %245

223:                                              ; preds = %195
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %224, i32 0, i32 10
  %226 = load ptr, ptr %225, align 8, !tbaa !24
  store ptr %226, ptr %13, align 8, !tbaa !5
  %227 = load ptr, ptr %13, align 8, !tbaa !5
  %228 = load ptr, ptr %8, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %228, i32 0, i32 22
  store ptr %227, ptr %229, align 8, !tbaa !25
  %230 = load ptr, ptr %13, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %230, i32 0, i32 23
  %232 = load ptr, ptr %231, align 8, !tbaa !28
  store ptr %232, ptr %14, align 8, !tbaa !5
  %233 = load ptr, ptr %14, align 8, !tbaa !5
  %234 = load ptr, ptr %8, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %234, i32 0, i32 23
  store ptr %233, ptr %235, align 8, !tbaa !28
  %236 = load ptr, ptr %8, align 8, !tbaa !5
  %237 = load ptr, ptr %14, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %237, i32 0, i32 22
  store ptr %236, ptr %238, align 8, !tbaa !25
  %239 = load ptr, ptr %8, align 8, !tbaa !5
  %240 = load ptr, ptr %13, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %240, i32 0, i32 23
  store ptr %239, ptr %241, align 8, !tbaa !28
  %242 = load ptr, ptr %8, align 8, !tbaa !5
  %243 = load ptr, ptr %4, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %243, i32 0, i32 10
  store ptr %242, ptr %244, align 8, !tbaa !24
  br label %245

245:                                              ; preds = %223, %213
  %246 = load i32, ptr %12, align 4, !tbaa !11
  %247 = add i32 %246, 1
  %248 = load ptr, ptr %4, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %248, i32 0, i32 11
  store i32 %247, ptr %249, align 8, !tbaa !13
  %250 = load ptr, ptr %8, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %250, i32 0, i32 12
  store i32 5, ptr %251, align 4, !tbaa !36
  %252 = load ptr, ptr %4, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.TX_QUEUE_STRUCT, ptr %252, i32 0, i32 14
  %254 = load ptr, ptr %253, align 8, !tbaa !23
  store ptr %254, ptr %16, align 8, !tbaa !5
  %255 = load ptr, ptr %8, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %255, i32 0, i32 14
  store i32 1, ptr %256, align 4, !tbaa !37
  %257 = load i64, ptr %6, align 8, !tbaa !9
  %258 = load ptr, ptr %8, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %258, i32 0, i32 19
  %260 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %259, i32 0, i32 0
  store i64 %257, ptr %260, align 8, !tbaa !38
  %261 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %262 = add i32 %261, 1
  store volatile i32 %262, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %263 = load i32, ptr %7, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %263)
  %264 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_tx_thread_system_suspend(ptr noundef %264)
  %265 = load ptr, ptr %8, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %265, i32 0, i32 27
  %267 = load i32, ptr %266, align 4, !tbaa !32
  %268 = icmp eq i32 %267, 0
  br i1 %268, label %269, label %276

269:                                              ; preds = %245
  %270 = load ptr, ptr %16, align 8, !tbaa !5
  %271 = icmp ne ptr %270, null
  br i1 %271, label %272, label %275

272:                                              ; preds = %269
  %273 = load ptr, ptr %16, align 8, !tbaa !5
  %274 = load ptr, ptr %4, align 8, !tbaa !5
  call void %273(ptr noundef %274)
  br label %275

275:                                              ; preds = %272, %269
  br label %276

276:                                              ; preds = %275, %245
  %277 = load ptr, ptr %8, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %277, i32 0, i32 27
  %279 = load i32, ptr %278, align 4, !tbaa !32
  store i32 %279, ptr %15, align 4, !tbaa !11
  br label %280

280:                                              ; preds = %276, %193
  br label %283

281:                                              ; preds = %187
  %282 = load i32, ptr %7, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %282)
  store i32 11, ptr %15, align 4, !tbaa !11
  br label %283

283:                                              ; preds = %281, %280
  br label %284

284:                                              ; preds = %283, %186
  %285 = load i32, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, 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 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, 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
  ret i32 %285
}

; 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 void @_tx_thread_system_resume(ptr noundef) #3

declare void @_tx_queue_cleanup(ptr noundef, i64 noundef) #3

declare void @_tx_thread_system_suspend(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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 72}
!14 = !{!"TX_QUEUE_STRUCT", !10, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!15 = !{!14, !12, i64 28}
!16 = !{!14, !6, i64 48}
!17 = !{!14, !6, i64 32}
!18 = !{!14, !6, i64 40}
!19 = !{!14, !12, i64 16}
!20 = !{!14, !12, i64 24}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!14, !6, i64 96}
!24 = !{!14, !6, i64 64}
!25 = !{!26, !6, i64 208}
!26 = !{!"TX_THREAD_STRUCT", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !27, i64 136, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !6, i64 232, !12, i64 240, !12, i64 244, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !12, i64 280, !12, i64 284, !12, i64 288, !12, i64 292, !6, i64 296, !6, i64 304, !6, i64 312, !10, i64 320}
!27 = !{!"TX_TIMER_INTERNAL_STRUCT", !10, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!28 = !{!26, !6, i64 216}
!29 = !{!26, !6, i64 192}
!30 = !{!26, !6, i64 232}
!31 = distinct !{!31, !22}
!32 = !{!26, !12, i64 244}
!33 = !{!26, !6, i64 200}
!34 = !{!26, !12, i64 240}
!35 = !{!26, !10, i64 320}
!36 = !{!26, !12, i64 92}
!37 = !{!26, !12, i64 100}
!38 = !{!26, !10, i64 136}


; 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_preempt_disable = external global i32, align 4
@_tx_thread_current_ptr = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @_tx_queue_front_send(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = ptrtoint ptr %1 to i64
  %5 = tail call i32 @__disable_interrupts()
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 28
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %113, label %10

10:                                               ; preds = %3
  %11 = icmp eq i32 %7, 0
  br i1 %11, label %12, label %62

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = icmp eq ptr %14, %16
  br i1 %17, label %18, label %21

18:                                               ; preds = %12
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  br label %21

21:                                               ; preds = %12, %18
  %.sink141 = phi ptr [ %20, %18 ], [ %14, %12 ]
  %.sink141157 = ptrtoint ptr %.sink141 to i64
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load i32, ptr %22, align 8, !tbaa !16
  %24 = zext i32 %23 to i64
  %25 = sub nsw i64 0, %24
  %26 = getelementptr inbounds i64, ptr %.sink141, i64 %25
  store ptr %26, ptr %13, align 8, !tbaa !13
  %27 = add i32 %9, -1
  store i32 %27, ptr %8, align 4, !tbaa !12
  %28 = getelementptr inbounds i8, ptr %0, i64 24
  %29 = load i32, ptr %28, align 8, !tbaa !17
  %30 = add i32 %29, 1
  store i32 %30, ptr %28, align 8, !tbaa !17
  %31 = load i64, ptr %1, align 8, !tbaa !18
  store i64 %31, ptr %26, align 8, !tbaa !18
  %or.cond137 = icmp ult i32 %23, 2
  br i1 %or.cond137, label %.loopexit, label %.lr.ph136.preheader

.lr.ph136.preheader:                              ; preds = %21
  %32 = add i32 %23, -1
  %33 = zext i32 %32 to i64
  %min.iters.check161 = icmp ult i32 %23, 11
  br i1 %min.iters.check161, label %.lr.ph136.preheader185, label %vector.memcheck156

vector.memcheck156:                               ; preds = %.lr.ph136.preheader
  %34 = shl nuw nsw i64 %24, 3
  %35 = add i64 %34, %4
  %36 = sub i64 %.sink141157, %35
  %diff.check158 = icmp ult i64 %36, 32
  br i1 %diff.check158, label %.lr.ph136.preheader185, label %vector.ph162

vector.ph162:                                     ; preds = %vector.memcheck156
  %n.vec164 = and i64 %33, 4294967292
  %.cast165 = trunc nuw i64 %n.vec164 to i32
  %ind.end166 = sub i32 %32, %.cast165
  %37 = shl nuw nsw i64 %n.vec164, 3
  %ind.end168 = getelementptr i8, ptr %26, i64 %37
  %38 = shl nuw nsw i64 %n.vec164, 3
  %ind.end170 = getelementptr i8, ptr %1, i64 %38
  br label %vector.body172

vector.body172:                                   ; preds = %vector.body172, %vector.ph162
  %index173 = phi i64 [ 0, %vector.ph162 ], [ %index.next182, %vector.body172 ]
  %offset.idx174 = shl i64 %index173, 3
  %next.gep175 = getelementptr i8, ptr %26, i64 %offset.idx174
  %offset.idx177 = shl i64 %index173, 3
  %next.gep178 = getelementptr i8, ptr %1, i64 %offset.idx177
  %39 = getelementptr inbounds i8, ptr %next.gep175, i64 8
  %40 = getelementptr inbounds i8, ptr %next.gep178, i64 8
  %41 = getelementptr inbounds i8, ptr %next.gep178, i64 24
  %wide.load180 = load <2 x i64>, ptr %40, align 8, !tbaa !18
  %wide.load181 = load <2 x i64>, ptr %41, align 8, !tbaa !18
  %42 = getelementptr inbounds i8, ptr %next.gep175, i64 24
  store <2 x i64> %wide.load180, ptr %39, align 8, !tbaa !18
  store <2 x i64> %wide.load181, ptr %42, align 8, !tbaa !18
  %index.next182 = add nuw i64 %index173, 4
  %43 = icmp eq i64 %index.next182, %n.vec164
  br i1 %43, label %middle.block159, label %vector.body172, !llvm.loop !19

middle.block159:                                  ; preds = %vector.body172
  %cmp.n183 = icmp eq i64 %n.vec164, %33
  br i1 %cmp.n183, label %.loopexit, label %.lr.ph136.preheader185

.lr.ph136.preheader185:                           ; preds = %middle.block159, %vector.memcheck156, %.lr.ph136.preheader
  %.ph = phi i32 [ %32, %vector.memcheck156 ], [ %32, %.lr.ph136.preheader ], [ %ind.end166, %middle.block159 ]
  %.pn127135.ph = phi ptr [ %26, %vector.memcheck156 ], [ %26, %.lr.ph136.preheader ], [ %ind.end168, %middle.block159 ]
  %.pn126134.ph = phi ptr [ %1, %vector.memcheck156 ], [ %1, %.lr.ph136.preheader ], [ %ind.end170, %middle.block159 ]
  %44 = add i32 %.ph, -1
  %xtraiter188 = and i32 %.ph, 7
  %lcmp.mod189.not = icmp eq i32 %xtraiter188, 0
  br i1 %lcmp.mod189.not, label %.lr.ph136.prol.loopexit, label %.lr.ph136.prol

.lr.ph136.prol:                                   ; preds = %.lr.ph136.preheader185, %.lr.ph136.prol
  %45 = phi i32 [ %47, %.lr.ph136.prol ], [ %.ph, %.lr.ph136.preheader185 ]
  %.pn127135.prol = phi ptr [ %.0105.prol, %.lr.ph136.prol ], [ %.pn127135.ph, %.lr.ph136.preheader185 ]
  %.pn126134.prol = phi ptr [ %.0107.prol, %.lr.ph136.prol ], [ %.pn126134.ph, %.lr.ph136.preheader185 ]
  %prol.iter190 = phi i32 [ %prol.iter190.next, %.lr.ph136.prol ], [ 0, %.lr.ph136.preheader185 ]
  %.0105.prol = getelementptr inbounds i8, ptr %.pn127135.prol, i64 8
  %.0107.prol = getelementptr inbounds i8, ptr %.pn126134.prol, i64 8
  %46 = load i64, ptr %.0107.prol, align 8, !tbaa !18
  store i64 %46, ptr %.0105.prol, align 8, !tbaa !18
  %47 = add i32 %45, -1
  %prol.iter190.next = add i32 %prol.iter190, 1
  %prol.iter190.cmp.not = icmp eq i32 %prol.iter190.next, %xtraiter188
  br i1 %prol.iter190.cmp.not, label %.lr.ph136.prol.loopexit, label %.lr.ph136.prol, !llvm.loop !23

.lr.ph136.prol.loopexit:                          ; preds = %.lr.ph136.prol, %.lr.ph136.preheader185
  %.unr191 = phi i32 [ %.ph, %.lr.ph136.preheader185 ], [ %47, %.lr.ph136.prol ]
  %.pn127135.unr = phi ptr [ %.pn127135.ph, %.lr.ph136.preheader185 ], [ %.0105.prol, %.lr.ph136.prol ]
  %.pn126134.unr = phi ptr [ %.pn126134.ph, %.lr.ph136.preheader185 ], [ %.0107.prol, %.lr.ph136.prol ]
  %48 = icmp ult i32 %44, 7
  br i1 %48, label %.loopexit, label %.lr.ph136

.lr.ph136:                                        ; preds = %.lr.ph136.prol.loopexit, %.lr.ph136
  %49 = phi i32 [ %58, %.lr.ph136 ], [ %.unr191, %.lr.ph136.prol.loopexit ]
  %.pn127135 = phi ptr [ %.0105.7, %.lr.ph136 ], [ %.pn127135.unr, %.lr.ph136.prol.loopexit ]
  %.pn126134 = phi ptr [ %.0107.7, %.lr.ph136 ], [ %.pn126134.unr, %.lr.ph136.prol.loopexit ]
  %.0105 = getelementptr inbounds i8, ptr %.pn127135, i64 8
  %.0107 = getelementptr inbounds i8, ptr %.pn126134, i64 8
  %50 = load i64, ptr %.0107, align 8, !tbaa !18
  store i64 %50, ptr %.0105, align 8, !tbaa !18
  %.0105.1 = getelementptr inbounds i8, ptr %.pn127135, i64 16
  %.0107.1 = getelementptr inbounds i8, ptr %.pn126134, i64 16
  %51 = load i64, ptr %.0107.1, align 8, !tbaa !18
  store i64 %51, ptr %.0105.1, align 8, !tbaa !18
  %.0105.2 = getelementptr inbounds i8, ptr %.pn127135, i64 24
  %.0107.2 = getelementptr inbounds i8, ptr %.pn126134, i64 24
  %52 = load i64, ptr %.0107.2, align 8, !tbaa !18
  store i64 %52, ptr %.0105.2, align 8, !tbaa !18
  %.0105.3 = getelementptr inbounds i8, ptr %.pn127135, i64 32
  %.0107.3 = getelementptr inbounds i8, ptr %.pn126134, i64 32
  %53 = load i64, ptr %.0107.3, align 8, !tbaa !18
  store i64 %53, ptr %.0105.3, align 8, !tbaa !18
  %.0105.4 = getelementptr inbounds i8, ptr %.pn127135, i64 40
  %.0107.4 = getelementptr inbounds i8, ptr %.pn126134, i64 40
  %54 = load i64, ptr %.0107.4, align 8, !tbaa !18
  store i64 %54, ptr %.0105.4, align 8, !tbaa !18
  %.0105.5 = getelementptr inbounds i8, ptr %.pn127135, i64 48
  %.0107.5 = getelementptr inbounds i8, ptr %.pn126134, i64 48
  %55 = load i64, ptr %.0107.5, align 8, !tbaa !18
  store i64 %55, ptr %.0105.5, align 8, !tbaa !18
  %.0105.6 = getelementptr inbounds i8, ptr %.pn127135, i64 56
  %.0107.6 = getelementptr inbounds i8, ptr %.pn126134, i64 56
  %56 = load i64, ptr %.0107.6, align 8, !tbaa !18
  store i64 %56, ptr %.0105.6, align 8, !tbaa !18
  %.0105.7 = getelementptr inbounds i8, ptr %.pn127135, i64 64
  %.0107.7 = getelementptr inbounds i8, ptr %.pn126134, i64 64
  %57 = load i64, ptr %.0107.7, align 8, !tbaa !18
  store i64 %57, ptr %.0105.7, align 8, !tbaa !18
  %58 = add i32 %49, -8
  %.not124.7 = icmp eq i32 %58, 0
  br i1 %.not124.7, label %.loopexit, label %.lr.ph136, !llvm.loop !25

.loopexit:                                        ; preds = %.lr.ph136.prol.loopexit, %.lr.ph136, %middle.block159, %21
  %59 = getelementptr inbounds i8, ptr %0, i64 96
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  tail call void @__restore_interrupt(i32 noundef %5)
  %.not125 = icmp eq ptr %60, null
  br i1 %.not125, label %152, label %61

61:                                               ; preds = %.loopexit
  tail call void %60(ptr noundef nonnull %0) #3
  br label %152

62:                                               ; preds = %10
  %63 = getelementptr inbounds i8, ptr %0, i64 64
  %64 = load ptr, ptr %63, align 8, !tbaa !27
  %65 = add i32 %7, -1
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %74, label %67

67:                                               ; preds = %62
  %68 = getelementptr inbounds i8, ptr %64, i64 208
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  %70 = getelementptr inbounds i8, ptr %64, i64 216
  %71 = load ptr, ptr %70, align 8, !tbaa !31
  %72 = getelementptr inbounds i8, ptr %69, i64 216
  store ptr %71, ptr %72, align 8, !tbaa !31
  %73 = getelementptr inbounds i8, ptr %71, i64 208
  store ptr %69, ptr %73, align 8, !tbaa !28
  br label %74

74:                                               ; preds = %62, %67
  %.sink = phi ptr [ %69, %67 ], [ null, %62 ]
  store ptr %.sink, ptr %63, align 8
  store i32 %65, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %64, i64 192
  store ptr null, ptr %75, align 8, !tbaa !32
  %76 = getelementptr inbounds i8, ptr %0, i64 96
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  %78 = getelementptr inbounds i8, ptr %64, i64 232
  %79 = load ptr, ptr %78, align 8, !tbaa !33
  %80 = getelementptr inbounds i8, ptr %0, i64 16
  %81 = load i32, ptr %80, align 8, !tbaa !16
  %82 = load i64, ptr %1, align 8, !tbaa !18
  store i64 %82, ptr %79, align 8, !tbaa !18
  %or.cond138 = icmp ult i32 %81, 2
  br i1 %or.cond138, label %.loopexit129, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %74
  %83 = ptrtoint ptr %79 to i64
  %84 = add i32 %81, -1
  %85 = zext i32 %84 to i64
  %min.iters.check = icmp ult i32 %81, 7
  %86 = sub i64 %83, %4
  %diff.check = icmp ult i64 %86, 32
  %or.cond184 = or i1 %min.iters.check, %diff.check
  br i1 %or.cond184, label %.lr.ph.preheader186, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %85, 4294967292
  %.cast = trunc nuw i64 %n.vec to i32
  %ind.end = sub i32 %84, %.cast
  %87 = shl nuw nsw i64 %n.vec, 3
  %ind.end147 = getelementptr i8, ptr %79, i64 %87
  %88 = shl nuw nsw i64 %n.vec, 3
  %ind.end149 = getelementptr i8, ptr %1, i64 %88
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 3
  %next.gep = getelementptr i8, ptr %79, i64 %offset.idx
  %offset.idx152 = shl i64 %index, 3
  %next.gep153 = getelementptr i8, ptr %1, i64 %offset.idx152
  %89 = getelementptr inbounds i8, ptr %next.gep, i64 8
  %90 = getelementptr inbounds i8, ptr %next.gep153, i64 8
  %91 = getelementptr inbounds i8, ptr %next.gep153, i64 24
  %wide.load = load <2 x i64>, ptr %90, align 8, !tbaa !18
  %wide.load155 = load <2 x i64>, ptr %91, align 8, !tbaa !18
  %92 = getelementptr inbounds i8, ptr %next.gep, i64 24
  store <2 x i64> %wide.load, ptr %89, align 8, !tbaa !18
  store <2 x i64> %wide.load155, ptr %92, align 8, !tbaa !18
  %index.next = add nuw i64 %index, 4
  %93 = icmp eq i64 %index.next, %n.vec
  br i1 %93, label %middle.block, label %vector.body, !llvm.loop !34

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %85
  br i1 %cmp.n, label %.loopexit129, label %.lr.ph.preheader186

.lr.ph.preheader186:                              ; preds = %middle.block, %.lr.ph.preheader
  %.ph187 = phi i32 [ %84, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.pn123132.ph = phi ptr [ %79, %.lr.ph.preheader ], [ %ind.end147, %middle.block ]
  %.pn131.ph = phi ptr [ %1, %.lr.ph.preheader ], [ %ind.end149, %middle.block ]
  %94 = add i32 %.ph187, -1
  %xtraiter = and i32 %.ph187, 7
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader186, %.lr.ph.prol
  %95 = phi i32 [ %97, %.lr.ph.prol ], [ %.ph187, %.lr.ph.preheader186 ]
  %.pn123132.prol = phi ptr [ %.1106.prol, %.lr.ph.prol ], [ %.pn123132.ph, %.lr.ph.preheader186 ]
  %.pn131.prol = phi ptr [ %.1108.prol, %.lr.ph.prol ], [ %.pn131.ph, %.lr.ph.preheader186 ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader186 ]
  %.1106.prol = getelementptr inbounds i8, ptr %.pn123132.prol, i64 8
  %.1108.prol = getelementptr inbounds i8, ptr %.pn131.prol, i64 8
  %96 = load i64, ptr %.1108.prol, align 8, !tbaa !18
  store i64 %96, ptr %.1106.prol, align 8, !tbaa !18
  %97 = add i32 %95, -1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !35

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader186
  %.unr = phi i32 [ %.ph187, %.lr.ph.preheader186 ], [ %97, %.lr.ph.prol ]
  %.pn123132.unr = phi ptr [ %.pn123132.ph, %.lr.ph.preheader186 ], [ %.1106.prol, %.lr.ph.prol ]
  %.pn131.unr = phi ptr [ %.pn131.ph, %.lr.ph.preheader186 ], [ %.1108.prol, %.lr.ph.prol ]
  %98 = icmp ult i32 %94, 7
  br i1 %98, label %.loopexit129, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %99 = phi i32 [ %108, %.lr.ph ], [ %.unr, %.lr.ph.prol.loopexit ]
  %.pn123132 = phi ptr [ %.1106.7, %.lr.ph ], [ %.pn123132.unr, %.lr.ph.prol.loopexit ]
  %.pn131 = phi ptr [ %.1108.7, %.lr.ph ], [ %.pn131.unr, %.lr.ph.prol.loopexit ]
  %.1106 = getelementptr inbounds i8, ptr %.pn123132, i64 8
  %.1108 = getelementptr inbounds i8, ptr %.pn131, i64 8
  %100 = load i64, ptr %.1108, align 8, !tbaa !18
  store i64 %100, ptr %.1106, align 8, !tbaa !18
  %.1106.1 = getelementptr inbounds i8, ptr %.pn123132, i64 16
  %.1108.1 = getelementptr inbounds i8, ptr %.pn131, i64 16
  %101 = load i64, ptr %.1108.1, align 8, !tbaa !18
  store i64 %101, ptr %.1106.1, align 8, !tbaa !18
  %.1106.2 = getelementptr inbounds i8, ptr %.pn123132, i64 24
  %.1108.2 = getelementptr inbounds i8, ptr %.pn131, i64 24
  %102 = load i64, ptr %.1108.2, align 8, !tbaa !18
  store i64 %102, ptr %.1106.2, align 8, !tbaa !18
  %.1106.3 = getelementptr inbounds i8, ptr %.pn123132, i64 32
  %.1108.3 = getelementptr inbounds i8, ptr %.pn131, i64 32
  %103 = load i64, ptr %.1108.3, align 8, !tbaa !18
  store i64 %103, ptr %.1106.3, align 8, !tbaa !18
  %.1106.4 = getelementptr inbounds i8, ptr %.pn123132, i64 40
  %.1108.4 = getelementptr inbounds i8, ptr %.pn131, i64 40
  %104 = load i64, ptr %.1108.4, align 8, !tbaa !18
  store i64 %104, ptr %.1106.4, align 8, !tbaa !18
  %.1106.5 = getelementptr inbounds i8, ptr %.pn123132, i64 48
  %.1108.5 = getelementptr inbounds i8, ptr %.pn131, i64 48
  %105 = load i64, ptr %.1108.5, align 8, !tbaa !18
  store i64 %105, ptr %.1106.5, align 8, !tbaa !18
  %.1106.6 = getelementptr inbounds i8, ptr %.pn123132, i64 56
  %.1108.6 = getelementptr inbounds i8, ptr %.pn131, i64 56
  %106 = load i64, ptr %.1108.6, align 8, !tbaa !18
  store i64 %106, ptr %.1106.6, align 8, !tbaa !18
  %.1106.7 = getelementptr inbounds i8, ptr %.pn123132, i64 64
  %.1108.7 = getelementptr inbounds i8, ptr %.pn131, i64 64
  %107 = load i64, ptr %.1108.7, align 8, !tbaa !18
  store i64 %107, ptr %.1106.7, align 8, !tbaa !18
  %108 = add i32 %99, -8
  %.not121.7 = icmp eq i32 %108, 0
  br i1 %.not121.7, label %.loopexit129, label %.lr.ph, !llvm.loop !36

.loopexit129:                                     ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %74
  %109 = getelementptr inbounds i8, ptr %64, i64 244
  store i32 0, ptr %109, align 4, !tbaa !37
  %110 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !38
  %111 = add i32 %110, 1
  store volatile i32 %111, ptr @_tx_thread_preempt_disable, align 4, !tbaa !38
  tail call void @__restore_interrupt(i32 noundef %5)
  tail call void @_tx_thread_system_resume(ptr noundef %64) #3
  %.not122 = icmp eq ptr %77, null
  br i1 %.not122, label %152, label %112

112:                                              ; preds = %.loopexit129
  tail call void %77(ptr noundef %0) #3
  br label %152

113:                                              ; preds = %3
  %.not119 = icmp eq i64 %2, 0
  br i1 %.not119, label %151, label %114

114:                                              ; preds = %113
  %115 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !38
  %.not120 = icmp eq i32 %115, 0
  br i1 %.not120, label %117, label %116

116:                                              ; preds = %114
  tail call void @__restore_interrupt(i32 noundef %5)
  br label %152

117:                                              ; preds = %114
  %118 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !39
  %119 = getelementptr inbounds i8, ptr %118, i64 192
  store ptr @_tx_queue_cleanup, ptr %119, align 8, !tbaa !32
  %120 = getelementptr inbounds i8, ptr %118, i64 200
  store ptr %0, ptr %120, align 8, !tbaa !40
  %121 = getelementptr inbounds i8, ptr %118, i64 232
  store ptr %1, ptr %121, align 8, !tbaa !33
  %122 = getelementptr inbounds i8, ptr %118, i64 240
  store i32 1, ptr %122, align 8, !tbaa !41
  %123 = getelementptr inbounds i8, ptr %118, i64 320
  %124 = load i64, ptr %123, align 8, !tbaa !42
  %125 = add i64 %124, 1
  store i64 %125, ptr %123, align 8, !tbaa !42
  %126 = icmp eq i32 %7, 0
  %127 = getelementptr inbounds i8, ptr %0, i64 64
  %128 = getelementptr inbounds i8, ptr %118, i64 208
  br i1 %126, label %129, label %131

129:                                              ; preds = %117
  store ptr %118, ptr %127, align 8, !tbaa !27
  store ptr %118, ptr %128, align 8, !tbaa !28
  %130 = getelementptr inbounds i8, ptr %118, i64 216
  br label %137

131:                                              ; preds = %117
  %132 = load ptr, ptr %127, align 8, !tbaa !27
  store ptr %132, ptr %128, align 8, !tbaa !28
  %133 = getelementptr inbounds i8, ptr %132, i64 216
  %134 = load ptr, ptr %133, align 8, !tbaa !31
  %135 = getelementptr inbounds i8, ptr %118, i64 216
  store ptr %134, ptr %135, align 8, !tbaa !31
  %136 = getelementptr inbounds i8, ptr %134, i64 208
  store ptr %118, ptr %136, align 8, !tbaa !28
  store ptr %118, ptr %133, align 8, !tbaa !31
  br label %137

137:                                              ; preds = %131, %129
  %.sink146 = phi ptr [ %127, %131 ], [ %130, %129 ]
  store ptr %118, ptr %.sink146, align 8, !tbaa !39
  %138 = add i32 %7, 1
  store i32 %138, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %118, i64 92
  store i32 5, ptr %139, align 4, !tbaa !43
  %140 = getelementptr inbounds i8, ptr %0, i64 96
  %141 = load ptr, ptr %140, align 8, !tbaa !26
  %142 = getelementptr inbounds i8, ptr %118, i64 100
  store i32 1, ptr %142, align 4, !tbaa !44
  %143 = getelementptr inbounds i8, ptr %118, i64 136
  store i64 %2, ptr %143, align 8, !tbaa !45
  %144 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !38
  %145 = add i32 %144, 1
  store volatile i32 %145, ptr @_tx_thread_preempt_disable, align 4, !tbaa !38
  tail call void @__restore_interrupt(i32 noundef %5)
  tail call void @_tx_thread_system_suspend(ptr noundef nonnull %118) #3
  %146 = getelementptr inbounds i8, ptr %118, i64 244
  %147 = load i32, ptr %146, align 4, !tbaa !37
  %148 = icmp eq i32 %147, 0
  %149 = icmp ne ptr %141, null
  %or.cond = select i1 %148, i1 %149, i1 false
  br i1 %or.cond, label %150, label %152

150:                                              ; preds = %137
  tail call void %141(ptr noundef nonnull %0) #3
  %.pre = load i32, ptr %146, align 4, !tbaa !37
  br label %152

151:                                              ; preds = %113
  tail call void @__restore_interrupt(i32 noundef %5)
  br label %152

152:                                              ; preds = %137, %150, %151, %116, %61, %.loopexit, %112, %.loopexit129
  %.0 = phi i32 [ 0, %61 ], [ 0, %.loopexit ], [ 0, %112 ], [ 0, %.loopexit129 ], [ 11, %116 ], [ 11, %151 ], [ %.pre, %150 ], [ %147, %137 ]
  ret i32 %.0
}

; 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 void @_tx_thread_system_resume(ptr noundef) local_unnamed_addr #2

declare void @_tx_queue_cleanup(ptr noundef, i64 noundef) #2

declare void @_tx_thread_system_suspend(ptr noundef) local_unnamed_addr #2

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 = { 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 72}
!6 = !{!"TX_QUEUE_STRUCT", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!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, !11, i64 28}
!13 = !{!6, !10, i64 48}
!14 = !{!6, !10, i64 32}
!15 = !{!6, !10, i64 40}
!16 = !{!6, !11, i64 16}
!17 = !{!6, !11, i64 24}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20, !21, !22}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !20, !21}
!26 = !{!6, !10, i64 96}
!27 = !{!6, !10, i64 64}
!28 = !{!29, !10, i64 208}
!29 = !{!"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, !30, 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}
!30 = !{!"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}
!31 = !{!29, !10, i64 216}
!32 = !{!29, !10, i64 192}
!33 = !{!29, !10, i64 232}
!34 = distinct !{!34, !20, !21, !22}
!35 = distinct !{!35, !24}
!36 = distinct !{!36, !20, !21}
!37 = !{!29, !11, i64 244}
!38 = !{!11, !11, i64 0}
!39 = !{!10, !10, i64 0}
!40 = !{!29, !10, i64 200}
!41 = !{!29, !11, i64 240}
!42 = !{!29, !7, i64 320}
!43 = !{!29, !11, i64 92}
!44 = !{!29, !11, i64 100}
!45 = !{!29, !7, i64 136}


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