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

; 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_BYTE_POOL_STRUCT = type { i64, ptr, i64, i32, ptr, ptr, ptr, i64, 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_byte_allocate(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i64 %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, 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
  %17 = load i64, ptr %7, align 8, !tbaa !9
  %18 = add i64 %17, 8
  %19 = sub i64 %18, 1
  %20 = udiv i64 %19, 8
  %21 = mul i64 %20, 8
  store i64 %21, ptr %7, align 8, !tbaa !9
  %22 = call i32 @__disable_interrupts()
  store i32 %22, ptr %9, align 4, !tbaa !11
  %23 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !5
  store ptr %23, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %24

24:                                               ; preds = %45, %4
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.TX_BYTE_POOL_STRUCT, ptr %26, i32 0, i32 8
  store ptr %25, ptr %27, align 8, !tbaa !13
  %28 = load i32, ptr %9, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %28)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = call ptr @_tx_byte_pool_search(ptr noundef %29, i64 noundef %30)
  store ptr %31, ptr %12, align 8, !tbaa !5
  %32 = call i32 @__disable_interrupts()
  store i32 %32, ptr %9, align 4, !tbaa !11
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %24
  store i32 1, ptr %16, align 4, !tbaa !11
  br label %44

36:                                               ; preds = %24
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.TX_BYTE_POOL_STRUCT, ptr %37, i32 0, i32 8
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = icmp eq ptr %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  store i32 1, ptr %16, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %42, %36
  br label %44

44:                                               ; preds = %43, %35
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %16, align 4, !tbaa !11
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %24, label %48, !llvm.loop !15

48:                                               ; preds = %45
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %49, ptr %50, align 8, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %55

53:                                               ; preds = %48
  %54 = load i32, ptr %9, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %54)
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %137

55:                                               ; preds = %48
  %56 = load i64, ptr %8, align 8, !tbaa !9
  %57 = icmp ne i64 %56, 0
  br i1 %57, label %58, label %134

58:                                               ; preds = %55
  %59 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  store i32 16, ptr %10, align 4, !tbaa !11
  %62 = load i32, ptr %9, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %62)
  br label %133

63:                                               ; preds = %58
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %64, i32 0, i32 20
  store ptr @_tx_byte_pool_cleanup, ptr %65, align 8, !tbaa !17
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %67, i32 0, i32 21
  store ptr %66, ptr %68, align 8, !tbaa !20
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %70, i32 0, i32 25
  store ptr %69, ptr %71, align 8, !tbaa !21
  %72 = load i64, ptr %7, align 8, !tbaa !9
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %73, i32 0, i32 24
  store i64 %72, ptr %74, align 8, !tbaa !22
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %75, i32 0, i32 39
  %77 = load i64, ptr %76, align 8, !tbaa !23
  %78 = add i64 %77, 1
  store i64 %78, ptr %76, align 8, !tbaa !23
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.TX_BYTE_POOL_STRUCT, ptr %79, i32 0, i32 10
  %81 = load i32, ptr %80, align 8, !tbaa !24
  store i32 %81, ptr %13, align 4, !tbaa !11
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.TX_BYTE_POOL_STRUCT, ptr %82, i32 0, i32 10
  %84 = load i32, ptr %83, align 8, !tbaa !24
  %85 = add i32 %84, 1
  store i32 %85, ptr %83, align 8, !tbaa !24
  %86 = load i32, ptr %13, align 4, !tbaa !11
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %98

88:                                               ; preds = %63
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.TX_BYTE_POOL_STRUCT, ptr %90, i32 0, i32 9
  store ptr %89, ptr %91, align 8, !tbaa !25
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %93, i32 0, i32 22
  store ptr %92, ptr %94, align 8, !tbaa !26
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %96, i32 0, i32 23
  store ptr %95, ptr %97, align 8, !tbaa !27
  br label %117

98:                                               ; preds = %63
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.TX_BYTE_POOL_STRUCT, ptr %99, i32 0, i32 9
  %101 = load ptr, ptr %100, align 8, !tbaa !25
  store ptr %101, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %103, i32 0, i32 22
  store ptr %102, ptr %104, align 8, !tbaa !26
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %105, i32 0, i32 23
  %107 = load ptr, ptr %106, align 8, !tbaa !27
  store ptr %107, ptr %15, align 8, !tbaa !5
  %108 = load ptr, ptr %15, align 8, !tbaa !5
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %109, i32 0, i32 23
  store ptr %108, ptr %110, align 8, !tbaa !27
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %112, i32 0, i32 22
  store ptr %111, ptr %113, align 8, !tbaa !26
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %115, i32 0, i32 23
  store ptr %114, ptr %116, align 8, !tbaa !27
  br label %117

117:                                              ; preds = %98, %88
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %118, i32 0, i32 12
  store i32 9, ptr %119, align 4, !tbaa !28
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %120, i32 0, i32 14
  store i32 1, ptr %121, align 4, !tbaa !29
  %122 = load i64, ptr %8, align 8, !tbaa !9
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %123, i32 0, i32 19
  %125 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %124, i32 0, i32 0
  store i64 %122, ptr %125, align 8, !tbaa !30
  %126 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %127 = add i32 %126, 1
  store volatile i32 %127, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %128 = load i32, ptr %9, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %128)
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_tx_thread_system_suspend(ptr noundef %129)
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %130, i32 0, i32 27
  %132 = load i32, ptr %131, align 4, !tbaa !31
  store i32 %132, ptr %10, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %117, %61
  br label %136

134:                                              ; preds = %55
  %135 = load i32, ptr %9, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %135)
  store i32 16, ptr %10, align 4, !tbaa !11
  br label %136

136:                                              ; preds = %134, %133
  br label %137

137:                                              ; preds = %136, %53
  %138 = load i32, ptr %10, align 4, !tbaa !11
  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 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret i32 %138
}

; 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 ptr @_tx_byte_pool_search(ptr noundef, i64 noundef) #3

declare void @_tx_byte_pool_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, !6, i64 64}
!14 = !{!"TX_BYTE_POOL_STRUCT", !10, i64 0, !6, i64 8, !10, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !6, i64 88, !6, i64 96}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !6, i64 192}
!18 = !{!"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, !19, 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}
!19 = !{!"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}
!20 = !{!18, !6, i64 200}
!21 = !{!18, !6, i64 232}
!22 = !{!18, !10, i64 224}
!23 = !{!18, !10, i64 320}
!24 = !{!14, !12, i64 80}
!25 = !{!14, !6, i64 72}
!26 = !{!18, !6, i64 208}
!27 = !{!18, !6, i64 216}
!28 = !{!18, !12, i64 92}
!29 = !{!18, !12, i64 100}
!30 = !{!18, !10, i64 136}
!31 = !{!18, !12, 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 i32 @_tx_byte_allocate(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #0 {
  %5 = add i64 %2, 7
  %6 = and i64 %5, -8
  %7 = tail call i32 @__disable_interrupts()
  %8 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  br label %10

10:                                               ; preds = %13, %4
  %.051 = phi i32 [ %7, %4 ], [ %12, %13 ]
  store ptr %8, ptr %9, align 8, !tbaa !9
  tail call void @__restore_interrupt(i32 noundef %.051)
  %11 = tail call ptr @_tx_byte_pool_search(ptr noundef %0, i64 noundef %6) #3
  %12 = tail call i32 @__disable_interrupts()
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %13, label %15

13:                                               ; preds = %10
  %14 = load ptr, ptr %9, align 8, !tbaa !9
  %.not57 = icmp eq ptr %14, %8
  br i1 %.not57, label %16, label %10, !llvm.loop !13

15:                                               ; preds = %10
  store ptr %11, ptr %1, align 8, !tbaa !5
  tail call void @__restore_interrupt(i32 noundef %12)
  br label %51

16:                                               ; preds = %13
  store ptr null, ptr %1, align 8, !tbaa !5
  %.not54 = icmp eq i64 %3, 0
  br i1 %.not54, label %50, label %17

17:                                               ; preds = %16
  %18 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !15
  %.not55 = icmp eq i32 %18, 0
  br i1 %.not55, label %20, label %19

19:                                               ; preds = %17
  tail call void @__restore_interrupt(i32 noundef %12)
  br label %51

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %8, i64 192
  store ptr @_tx_byte_pool_cleanup, ptr %21, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %8, i64 200
  store ptr %0, ptr %22, align 8, !tbaa !19
  %23 = getelementptr inbounds i8, ptr %8, i64 232
  store ptr %1, ptr %23, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %8, i64 224
  store i64 %6, ptr %24, align 8, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %8, i64 320
  %26 = load i64, ptr %25, align 8, !tbaa !22
  %27 = add i64 %26, 1
  store i64 %27, ptr %25, align 8, !tbaa !22
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  %29 = load i32, ptr %28, align 8, !tbaa !23
  %30 = add i32 %29, 1
  store i32 %30, ptr %28, align 8, !tbaa !23
  %31 = icmp eq i32 %29, 0
  %32 = getelementptr inbounds i8, ptr %0, i64 72
  %33 = getelementptr inbounds i8, ptr %8, i64 208
  br i1 %31, label %34, label %36

34:                                               ; preds = %20
  store ptr %8, ptr %32, align 8, !tbaa !24
  store ptr %8, ptr %33, align 8, !tbaa !25
  %35 = getelementptr inbounds i8, ptr %8, i64 216
  br label %42

36:                                               ; preds = %20
  %37 = load ptr, ptr %32, align 8, !tbaa !24
  store ptr %37, ptr %33, align 8, !tbaa !25
  %38 = getelementptr inbounds i8, ptr %37, i64 216
  %39 = load ptr, ptr %38, align 8, !tbaa !26
  %40 = getelementptr inbounds i8, ptr %8, i64 216
  store ptr %39, ptr %40, align 8, !tbaa !26
  %41 = getelementptr inbounds i8, ptr %39, i64 208
  store ptr %8, ptr %41, align 8, !tbaa !25
  br label %42

42:                                               ; preds = %36, %34
  %.sink = phi ptr [ %38, %36 ], [ %35, %34 ]
  store ptr %8, ptr %.sink, align 8, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %8, i64 92
  store i32 9, ptr %43, align 4, !tbaa !27
  %44 = getelementptr inbounds i8, ptr %8, i64 100
  store i32 1, ptr %44, align 4, !tbaa !28
  %45 = getelementptr inbounds i8, ptr %8, i64 136
  store i64 %3, ptr %45, align 8, !tbaa !29
  %46 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !15
  %47 = add i32 %46, 1
  store volatile i32 %47, ptr @_tx_thread_preempt_disable, align 4, !tbaa !15
  tail call void @__restore_interrupt(i32 noundef %12)
  tail call void @_tx_thread_system_suspend(ptr noundef nonnull %8) #3
  %48 = getelementptr inbounds i8, ptr %8, i64 244
  %49 = load i32, ptr %48, align 4, !tbaa !30
  br label %51

50:                                               ; preds = %16
  tail call void @__restore_interrupt(i32 noundef %12)
  br label %51

51:                                               ; preds = %50, %42, %19, %15
  %.052 = phi i32 [ 0, %15 ], [ 16, %19 ], [ %49, %42 ], [ 16, %50 ]
  ret i32 %.052
}

; 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 ptr @_tx_byte_pool_search(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @_tx_byte_pool_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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 64}
!10 = !{!"TX_BYTE_POOL_STRUCT", !11, i64 0, !6, i64 8, !11, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !6, i64 88, !6, i64 96}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !6, i64 192}
!17 = !{!"TX_THREAD_STRUCT", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 48, !11, 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, !11, i64 128, !18, i64 136, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !11, 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, !11, i64 320}
!18 = !{!"TX_TIMER_INTERNAL_STRUCT", !11, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!19 = !{!17, !6, i64 200}
!20 = !{!17, !6, i64 232}
!21 = !{!17, !11, i64 224}
!22 = !{!17, !11, i64 320}
!23 = !{!10, !12, i64 80}
!24 = !{!10, !6, i64 72}
!25 = !{!17, !6, i64 208}
!26 = !{!17, !6, i64 216}
!27 = !{!17, !12, i64 92}
!28 = !{!17, !12, i64 100}
!29 = !{!17, !11, i64 136}
!30 = !{!17, !12, i64 244}


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