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

; 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_EVENT_FLAGS_GROUP_STRUCT = type { i64, ptr, i64, i32, ptr, i32, ptr, ptr, i64, 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_event_flags_get(ptr noundef %0, i64 noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i64 %4, ptr %10, align 8, !tbaa !9
  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 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %23 = call i32 @__disable_interrupts()
  store i32 %23, ptr %11, align 4, !tbaa !11
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %24, i32 0, i32 2
  %26 = load i64, ptr %25, align 8, !tbaa !13
  store i64 %26, ptr %15, align 8, !tbaa !9
  %27 = load i64, ptr %15, align 8, !tbaa !9
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %28, i32 0, i32 8
  %30 = load i64, ptr %29, align 8, !tbaa !15
  %31 = xor i64 %30, -1
  %32 = and i64 %27, %31
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %32, ptr %33, align 8, !tbaa !9
  %34 = load i32, ptr %8, align 4, !tbaa !11
  %35 = and i32 %34, 2
  store i32 %35, ptr %13, align 4, !tbaa !11
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %36, i32 0, i32 8
  %38 = load i64, ptr %37, align 8, !tbaa !15
  store i64 %38, ptr %17, align 8, !tbaa !9
  %39 = load i64, ptr %17, align 8, !tbaa !9
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %46

41:                                               ; preds = %5
  %42 = load i64, ptr %15, align 8, !tbaa !9
  %43 = load i64, ptr %17, align 8, !tbaa !9
  %44 = xor i64 %43, -1
  %45 = and i64 %42, %44
  store i64 %45, ptr %15, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %41, %5
  %47 = load i32, ptr %13, align 4, !tbaa !11
  %48 = icmp eq i32 %47, 2
  br i1 %48, label %49, label %58

49:                                               ; preds = %46
  %50 = load i64, ptr %15, align 8, !tbaa !9
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = and i64 %50, %51
  store i64 %52, ptr %16, align 8, !tbaa !9
  %53 = load i64, ptr %16, align 8, !tbaa !9
  %54 = load i64, ptr %7, align 8, !tbaa !9
  %55 = icmp ne i64 %53, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %49
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %56, %49
  br label %62

58:                                               ; preds = %46
  %59 = load i64, ptr %15, align 8, !tbaa !9
  %60 = load i64, ptr %7, align 8, !tbaa !9
  %61 = and i64 %59, %60
  store i64 %61, ptr %16, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %58, %57
  %63 = load i64, ptr %16, align 8, !tbaa !9
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %65, label %104

65:                                               ; preds = %62
  %66 = load i32, ptr %8, align 4, !tbaa !11
  %67 = and i32 %66, 1
  store i32 %67, ptr %14, align 4, !tbaa !11
  %68 = load i32, ptr %14, align 4, !tbaa !11
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %103

70:                                               ; preds = %65
  store i32 0, ptr %22, align 4, !tbaa !11
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %71, i32 0, i32 5
  %73 = load i32, ptr %72, align 8, !tbaa !16
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %82

75:                                               ; preds = %70
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %81

80:                                               ; preds = %75
  store i32 1, ptr %22, align 4, !tbaa !11
  br label %81

81:                                               ; preds = %80, %75
  br label %82

82:                                               ; preds = %81, %70
  %83 = load i32, ptr %22, align 4, !tbaa !11
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %85, label %93

85:                                               ; preds = %82
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %86, i32 0, i32 8
  %88 = load i64, ptr %87, align 8, !tbaa !15
  %89 = load i64, ptr %7, align 8, !tbaa !9
  %90 = or i64 %88, %89
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %91, i32 0, i32 8
  store i64 %90, ptr %92, align 8, !tbaa !15
  br label %102

93:                                               ; preds = %82
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %94, i32 0, i32 2
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = load i64, ptr %7, align 8, !tbaa !9
  %98 = xor i64 %97, -1
  %99 = and i64 %96, %98
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %100, i32 0, i32 2
  store i64 %99, ptr %101, align 8, !tbaa !13
  br label %102

102:                                              ; preds = %93, %85
  br label %103

103:                                              ; preds = %102, %65
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %192

104:                                              ; preds = %62
  %105 = load i64, ptr %10, align 8, !tbaa !9
  %106 = icmp ne i64 %105, 0
  br i1 %106, label %107, label %190

107:                                              ; preds = %104
  %108 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %113, label %110

110:                                              ; preds = %107
  %111 = load i64, ptr %7, align 8, !tbaa !9
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %110, %107
  store i32 7, ptr %12, align 4, !tbaa !11
  br label %189

114:                                              ; preds = %110
  %115 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !5
  store ptr %115, ptr %19, align 8, !tbaa !5
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %116, i32 0, i32 20
  store ptr @_tx_event_flags_cleanup, ptr %117, align 8, !tbaa !18
  %118 = load i64, ptr %7, align 8, !tbaa !9
  %119 = load ptr, ptr %19, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %119, i32 0, i32 24
  store i64 %118, ptr %120, align 8, !tbaa !21
  %121 = load i32, ptr %8, align 4, !tbaa !11
  %122 = load ptr, ptr %19, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %122, i32 0, i32 26
  store i32 %121, ptr %123, align 8, !tbaa !22
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = load ptr, ptr %19, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %125, i32 0, i32 25
  store ptr %124, ptr %126, align 8, !tbaa !23
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %128, i32 0, i32 21
  store ptr %127, ptr %129, align 8, !tbaa !24
  %130 = load ptr, ptr %19, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %130, i32 0, i32 39
  %132 = load i64, ptr %131, align 8, !tbaa !25
  %133 = add i64 %132, 1
  store i64 %133, ptr %131, align 8, !tbaa !25
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %134, i32 0, i32 5
  %136 = load i32, ptr %135, align 8, !tbaa !16
  store i32 %136, ptr %18, align 4, !tbaa !11
  %137 = load i32, ptr %18, align 4, !tbaa !11
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %149

139:                                              ; preds = %114
  %140 = load ptr, ptr %19, align 8, !tbaa !5
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %141, i32 0, i32 4
  store ptr %140, ptr %142, align 8, !tbaa !17
  %143 = load ptr, ptr %19, align 8, !tbaa !5
  %144 = load ptr, ptr %19, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %144, i32 0, i32 22
  store ptr %143, ptr %145, align 8, !tbaa !26
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %147, i32 0, i32 23
  store ptr %146, ptr %148, align 8, !tbaa !27
  br label %168

149:                                              ; preds = %114
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %150, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !17
  store ptr %152, ptr %20, align 8, !tbaa !5
  %153 = load ptr, ptr %20, align 8, !tbaa !5
  %154 = load ptr, ptr %19, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %154, i32 0, i32 22
  store ptr %153, ptr %155, align 8, !tbaa !26
  %156 = load ptr, ptr %20, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %156, i32 0, i32 23
  %158 = load ptr, ptr %157, align 8, !tbaa !27
  store ptr %158, ptr %21, align 8, !tbaa !5
  %159 = load ptr, ptr %21, align 8, !tbaa !5
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %160, i32 0, i32 23
  store ptr %159, ptr %161, align 8, !tbaa !27
  %162 = load ptr, ptr %19, align 8, !tbaa !5
  %163 = load ptr, ptr %21, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %163, i32 0, i32 22
  store ptr %162, ptr %164, align 8, !tbaa !26
  %165 = load ptr, ptr %19, align 8, !tbaa !5
  %166 = load ptr, ptr %20, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %166, i32 0, i32 23
  store ptr %165, ptr %167, align 8, !tbaa !27
  br label %168

168:                                              ; preds = %149, %139
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.TX_EVENT_FLAGS_GROUP_STRUCT, ptr %169, i32 0, i32 5
  %171 = load i32, ptr %170, align 8, !tbaa !16
  %172 = add i32 %171, 1
  store i32 %172, ptr %170, align 8, !tbaa !16
  %173 = load ptr, ptr %19, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %173, i32 0, i32 12
  store i32 7, ptr %174, align 4, !tbaa !28
  %175 = load ptr, ptr %19, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %175, i32 0, i32 14
  store i32 1, ptr %176, align 4, !tbaa !29
  %177 = load i64, ptr %10, align 8, !tbaa !9
  %178 = load ptr, ptr %19, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %178, i32 0, i32 19
  %180 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %179, i32 0, i32 0
  store i64 %177, ptr %180, align 8, !tbaa !30
  %181 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %182 = add i32 %181, 1
  store volatile i32 %182, ptr @_tx_thread_preempt_disable, align 4, !tbaa !11
  %183 = load i32, ptr %11, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %183)
  %184 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_tx_thread_system_suspend(ptr noundef %184)
  %185 = call i32 @__disable_interrupts()
  store i32 %185, ptr %11, align 4, !tbaa !11
  %186 = load ptr, ptr %19, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %186, i32 0, i32 27
  %188 = load i32, ptr %187, align 4, !tbaa !31
  store i32 %188, ptr %12, align 4, !tbaa !11
  br label %189

189:                                              ; preds = %168, %113
  br label %191

190:                                              ; preds = %104
  store i32 7, ptr %12, align 4, !tbaa !11
  br label %191

191:                                              ; preds = %190, %189
  br label %192

192:                                              ; preds = %191, %103
  %193 = load i32, ptr %11, align 4, !tbaa !11
  call void @__restore_interrupt(i32 noundef %193)
  %194 = load i32, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret i32 %194
}

; 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

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

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

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, !10, i64 16}
!14 = !{!"TX_EVENT_FLAGS_GROUP_STRUCT", !10, i64 0, !6, i64 8, !10, i64 16, !12, i64 24, !6, i64 32, !12, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !6, i64 72}
!15 = !{!14, !10, i64 64}
!16 = !{!14, !12, i64 40}
!17 = !{!14, !6, i64 32}
!18 = !{!19, !6, i64 192}
!19 = !{!"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, !20, 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}
!20 = !{!"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}
!21 = !{!19, !10, i64 224}
!22 = !{!19, !12, i64 240}
!23 = !{!19, !6, i64 232}
!24 = !{!19, !6, i64 200}
!25 = !{!19, !10, i64 320}
!26 = !{!19, !6, i64 208}
!27 = !{!19, !6, i64 216}
!28 = !{!19, !12, i64 92}
!29 = !{!19, !12, i64 100}
!30 = !{!19, !10, i64 136}
!31 = !{!19, !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_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_event_flags_get(ptr noundef %0, i64 noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #0 {
  %6 = tail call i32 @__disable_interrupts()
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  %10 = load i64, ptr %9, align 8, !tbaa !12
  %11 = xor i64 %10, -1
  %12 = and i64 %8, %11
  store i64 %12, ptr %3, align 8, !tbaa !13
  %13 = and i32 %2, 2
  %14 = load i64, ptr %9, align 8, !tbaa !12
  %15 = xor i64 %14, -1
  %.not75 = icmp ne i32 %13, 0
  %16 = and i64 %15, %1
  %17 = and i64 %16, %8
  %.not76 = icmp ne i64 %17, %1
  %.not = select i1 %.not75, i1 %.not76, i1 false
  %.not7781 = icmp eq i64 %17, 0
  %.not77 = select i1 %.not, i1 true, i1 %.not7781
  br i1 %.not77, label %32, label %18

18:                                               ; preds = %5
  %19 = and i32 %2, 1
  %.not79 = icmp eq i32 %19, 0
  br i1 %.not79, label %70, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = load i32, ptr %21, align 8, !tbaa !14
  %.not80 = icmp eq i32 %22, 0
  br i1 %.not80, label %.critedge, label %23

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %.critedge

27:                                               ; preds = %23
  %28 = or i64 %14, %1
  store i64 %28, ptr %9, align 8, !tbaa !12
  br label %70

.critedge:                                        ; preds = %20, %23
  %29 = load i64, ptr %7, align 8, !tbaa !5
  %30 = xor i64 %1, -1
  %31 = and i64 %29, %30
  store i64 %31, ptr %7, align 8, !tbaa !5
  br label %70

32:                                               ; preds = %5
  %.not78 = icmp eq i64 %4, 0
  br i1 %.not78, label %70, label %33

33:                                               ; preds = %32
  %34 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !16
  %35 = icmp ne i32 %34, 0
  %36 = icmp eq i64 %1, 0
  %or.cond = or i1 %36, %35
  br i1 %or.cond, label %70, label %37

37:                                               ; preds = %33
  %38 = load ptr, ptr @_tx_thread_current_ptr, align 8, !tbaa !17
  %39 = getelementptr inbounds i8, ptr %38, i64 192
  store ptr @_tx_event_flags_cleanup, ptr %39, align 8, !tbaa !18
  %40 = getelementptr inbounds i8, ptr %38, i64 224
  store i64 %1, ptr %40, align 8, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %38, i64 240
  store i32 %2, ptr %41, align 8, !tbaa !22
  %42 = getelementptr inbounds i8, ptr %38, i64 232
  store ptr %3, ptr %42, align 8, !tbaa !23
  %43 = getelementptr inbounds i8, ptr %38, i64 200
  store ptr %0, ptr %43, align 8, !tbaa !24
  %44 = getelementptr inbounds i8, ptr %38, i64 320
  %45 = load i64, ptr %44, align 8, !tbaa !25
  %46 = add i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %0, i64 40
  %48 = load i32, ptr %47, align 8, !tbaa !14
  %49 = icmp eq i32 %48, 0
  %50 = getelementptr inbounds i8, ptr %0, i64 32
  %51 = getelementptr inbounds i8, ptr %38, i64 208
  br i1 %49, label %52, label %54

52:                                               ; preds = %37
  store ptr %38, ptr %50, align 8, !tbaa !15
  store ptr %38, ptr %51, align 8, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %38, i64 216
  br label %60

54:                                               ; preds = %37
  %55 = load ptr, ptr %50, align 8, !tbaa !15
  store ptr %55, ptr %51, align 8, !tbaa !26
  %56 = getelementptr inbounds i8, ptr %55, i64 216
  %57 = load ptr, ptr %56, align 8, !tbaa !27
  %58 = getelementptr inbounds i8, ptr %38, i64 216
  store ptr %57, ptr %58, align 8, !tbaa !27
  %59 = getelementptr inbounds i8, ptr %57, i64 208
  store ptr %38, ptr %59, align 8, !tbaa !26
  br label %60

60:                                               ; preds = %54, %52
  %.sink = phi ptr [ %56, %54 ], [ %53, %52 ]
  store ptr %38, ptr %.sink, align 8, !tbaa !27
  %61 = add i32 %48, 1
  store i32 %61, ptr %47, align 8, !tbaa !14
  %62 = getelementptr inbounds i8, ptr %38, i64 92
  store i32 7, ptr %62, align 4, !tbaa !28
  %63 = getelementptr inbounds i8, ptr %38, i64 100
  store i32 1, ptr %63, align 4, !tbaa !29
  %64 = getelementptr inbounds i8, ptr %38, i64 136
  store i64 %4, ptr %64, align 8, !tbaa !30
  %65 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !16
  %66 = add i32 %65, 1
  store volatile i32 %66, ptr @_tx_thread_preempt_disable, align 4, !tbaa !16
  tail call void @__restore_interrupt(i32 noundef %6)
  tail call void @_tx_thread_system_suspend(ptr noundef nonnull %38) #3
  %67 = tail call i32 @__disable_interrupts()
  %68 = getelementptr inbounds i8, ptr %38, i64 244
  %69 = load i32, ptr %68, align 4, !tbaa !31
  br label %70

70:                                               ; preds = %32, %33, %18, %.critedge, %27, %60
  %.069 = phi i32 [ %69, %60 ], [ 0, %27 ], [ 0, %.critedge ], [ 0, %18 ], [ 7, %33 ], [ 7, %32 ]
  %.068 = phi i32 [ %67, %60 ], [ %6, %27 ], [ %6, %.critedge ], [ %6, %18 ], [ %6, %33 ], [ %6, %32 ]
  tail call void @__restore_interrupt(i32 noundef %.068)
  ret i32 %.069
}

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

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

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

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, !7, i64 16}
!6 = !{!"TX_EVENT_FLAGS_GROUP_STRUCT", !7, i64 0, !10, i64 8, !7, i64 16, !11, i64 24, !10, i64 32, !11, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72}
!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, !7, i64 64}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !11, i64 40}
!15 = !{!6, !10, i64 32}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !10, i64 0}
!18 = !{!19, !10, i64 192}
!19 = !{!"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, !20, 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}
!20 = !{!"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}
!21 = !{!19, !7, i64 224}
!22 = !{!19, !11, i64 240}
!23 = !{!19, !10, i64 232}
!24 = !{!19, !10, i64 200}
!25 = !{!19, !7, i64 320}
!26 = !{!19, !10, i64 208}
!27 = !{!19, !10, i64 216}
!28 = !{!19, !11, i64 92}
!29 = !{!19, !11, i64 100}
!30 = !{!19, !7, i64 136}
!31 = !{!19, !11, i64 244}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass