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

; 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_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_timer_current_ptr = external global ptr, align 8
@_tx_timer_list_end = external global ptr, align 8
@_tx_timer_list_start = external global ptr, align 8
@_tx_timer_expired = external global i32, align 4
@_tx_timer_expired_timer_ptr = external global ptr, align 8
@_tx_timer_thread = external global %struct.TX_THREAD_STRUCT, align 8
@_tx_thread_preempt_disable = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @_tx_timer_thread_entry(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, 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
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = icmp eq i64 %12, 1096042829
  br i1 %13, label %14, label %142

14:                                               ; preds = %1
  br label %15

15:                                               ; preds = %141, %14
  br label %16

16:                                               ; preds = %15
  %17 = call i32 @__disable_interrupts()
  store i32 %17, ptr %3, align 4, !tbaa !9
  %18 = load ptr, ptr @_tx_timer_current_ptr, align 8, !tbaa !11
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  store ptr %19, ptr %4, align 8, !tbaa !11
  %20 = load ptr, ptr %4, align 8, !tbaa !11
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %16
  %23 = load ptr, ptr %4, align 8, !tbaa !11
  %24 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %23, i32 0, i32 6
  store ptr %4, ptr %24, align 8, !tbaa !13
  br label %25

25:                                               ; preds = %22, %16
  %26 = load ptr, ptr @_tx_timer_current_ptr, align 8, !tbaa !11
  store ptr null, ptr %26, align 8, !tbaa !11
  %27 = load ptr, ptr @_tx_timer_current_ptr, align 8, !tbaa !11
  %28 = getelementptr inbounds ptr, ptr %27, i64 1
  store ptr %28, ptr @_tx_timer_current_ptr, align 8, !tbaa !11
  %29 = load ptr, ptr @_tx_timer_current_ptr, align 8, !tbaa !11
  %30 = load ptr, ptr @_tx_timer_list_end, align 8, !tbaa !11
  %31 = icmp eq ptr %29, %30
  br i1 %31, label %32, label %34

32:                                               ; preds = %25
  %33 = load ptr, ptr @_tx_timer_list_start, align 8, !tbaa !11
  store ptr %33, ptr @_tx_timer_current_ptr, align 8, !tbaa !11
  br label %34

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

37:                                               ; preds = %124, %34
  %38 = load ptr, ptr %4, align 8, !tbaa !11
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %127

40:                                               ; preds = %37
  %41 = load ptr, ptr %4, align 8, !tbaa !11
  store ptr %41, ptr %8, align 8, !tbaa !11
  %42 = load ptr, ptr %4, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %42, i32 0, i32 4
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  store ptr %44, ptr %6, align 8, !tbaa !11
  store ptr null, ptr %5, align 8, !tbaa !11
  %45 = load ptr, ptr %8, align 8, !tbaa !11
  %46 = load ptr, ptr %6, align 8, !tbaa !11
  %47 = icmp eq ptr %45, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %40
  store ptr null, ptr %4, align 8, !tbaa !11
  br label %62

49:                                               ; preds = %40
  %50 = load ptr, ptr %8, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %50, i32 0, i32 5
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  store ptr %52, ptr %7, align 8, !tbaa !11
  %53 = load ptr, ptr %7, align 8, !tbaa !11
  %54 = load ptr, ptr %6, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %54, i32 0, i32 5
  store ptr %53, ptr %55, align 8, !tbaa !16
  %56 = load ptr, ptr %6, align 8, !tbaa !11
  %57 = load ptr, ptr %7, align 8, !tbaa !11
  %58 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %57, i32 0, i32 4
  store ptr %56, ptr %58, align 8, !tbaa !15
  %59 = load ptr, ptr %6, align 8, !tbaa !11
  %60 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %59, i32 0, i32 6
  store ptr %4, ptr %60, align 8, !tbaa !13
  %61 = load ptr, ptr %6, align 8, !tbaa !11
  store ptr %61, ptr %4, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %49, %48
  %63 = load ptr, ptr %8, align 8, !tbaa !11
  %64 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %63, i32 0, i32 0
  %65 = load i64, ptr %64, align 8, !tbaa !17
  %66 = icmp ugt i64 %65, 32
  br i1 %66, label %67, label %80

67:                                               ; preds = %62
  %68 = load ptr, ptr %8, align 8, !tbaa !11
  %69 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %68, i32 0, i32 0
  %70 = load i64, ptr %69, align 8, !tbaa !17
  %71 = sub i64 %70, 32
  %72 = load ptr, ptr %8, align 8, !tbaa !11
  %73 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %72, i32 0, i32 0
  store i64 %71, ptr %73, align 8, !tbaa !17
  store ptr null, ptr %9, align 8, !tbaa !11
  %74 = load ptr, ptr %8, align 8, !tbaa !11
  %75 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %74, i32 0, i32 6
  store ptr %5, ptr %75, align 8, !tbaa !13
  %76 = load ptr, ptr %8, align 8, !tbaa !11
  %77 = load ptr, ptr %8, align 8, !tbaa !11
  %78 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %77, i32 0, i32 4
  store ptr %76, ptr %78, align 8, !tbaa !15
  %79 = load ptr, ptr %8, align 8, !tbaa !11
  store ptr %79, ptr %5, align 8, !tbaa !11
  br label %107

80:                                               ; preds = %62
  %81 = load ptr, ptr %8, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %81, i32 0, i32 2
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  store ptr %83, ptr %9, align 8, !tbaa !11
  %84 = load ptr, ptr %8, align 8, !tbaa !11
  %85 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %84, i32 0, i32 3
  %86 = load i64, ptr %85, align 8, !tbaa !19
  store i64 %86, ptr %10, align 8, !tbaa !5
  %87 = load ptr, ptr %8, align 8, !tbaa !11
  %88 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %87, i32 0, i32 1
  %89 = load i64, ptr %88, align 8, !tbaa !20
  %90 = load ptr, ptr %8, align 8, !tbaa !11
  %91 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %90, i32 0, i32 0
  store i64 %89, ptr %91, align 8, !tbaa !17
  %92 = load ptr, ptr %8, align 8, !tbaa !11
  %93 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %92, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !17
  %95 = icmp ne i64 %94, 0
  br i1 %95, label %96, label %103

96:                                               ; preds = %80
  %97 = load ptr, ptr %8, align 8, !tbaa !11
  %98 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %97, i32 0, i32 6
  store ptr %5, ptr %98, align 8, !tbaa !13
  %99 = load ptr, ptr %8, align 8, !tbaa !11
  %100 = load ptr, ptr %8, align 8, !tbaa !11
  %101 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %100, i32 0, i32 4
  store ptr %99, ptr %101, align 8, !tbaa !15
  %102 = load ptr, ptr %8, align 8, !tbaa !11
  store ptr %102, ptr %5, align 8, !tbaa !11
  br label %106

103:                                              ; preds = %80
  %104 = load ptr, ptr %8, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %104, i32 0, i32 6
  store ptr null, ptr %105, align 8, !tbaa !13
  br label %106

106:                                              ; preds = %103, %96
  br label %107

107:                                              ; preds = %106, %67
  %108 = load ptr, ptr %8, align 8, !tbaa !11
  store ptr %108, ptr @_tx_timer_expired_timer_ptr, align 8, !tbaa !11
  %109 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %109)
  %110 = load ptr, ptr %9, align 8, !tbaa !11
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %115

112:                                              ; preds = %107
  %113 = load ptr, ptr %9, align 8, !tbaa !11
  %114 = load i64, ptr %10, align 8, !tbaa !5
  call void %113(i64 noundef %114)
  br label %115

115:                                              ; preds = %112, %107
  %116 = call i32 @__disable_interrupts()
  store i32 %116, ptr %3, align 4, !tbaa !9
  store ptr null, ptr @_tx_timer_expired_timer_ptr, align 8, !tbaa !11
  %117 = load ptr, ptr %5, align 8, !tbaa !11
  %118 = load ptr, ptr %8, align 8, !tbaa !11
  %119 = icmp eq ptr %117, %118
  br i1 %119, label %120, label %124

120:                                              ; preds = %115
  %121 = load ptr, ptr %8, align 8, !tbaa !11
  %122 = getelementptr inbounds %struct.TX_TIMER_INTERNAL_STRUCT, ptr %121, i32 0, i32 6
  store ptr null, ptr %122, align 8, !tbaa !13
  %123 = load ptr, ptr %8, align 8, !tbaa !11
  call void @_tx_timer_system_activate(ptr noundef %123)
  br label %124

124:                                              ; preds = %120, %115
  %125 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %125)
  %126 = call i32 @__disable_interrupts()
  store i32 %126, ptr %3, align 4, !tbaa !9
  br label %37, !llvm.loop !21

127:                                              ; preds = %37
  %128 = load i32, ptr @_tx_timer_expired, align 4, !tbaa !9
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %139

130:                                              ; preds = %127
  store ptr @_tx_timer_thread, ptr %11, align 8, !tbaa !11
  %131 = load ptr, ptr %11, align 8, !tbaa !11
  %132 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %131, i32 0, i32 12
  store i32 3, ptr %132, align 4, !tbaa !23
  %133 = load ptr, ptr %11, align 8, !tbaa !11
  %134 = getelementptr inbounds %struct.TX_THREAD_STRUCT, ptr %133, i32 0, i32 14
  store i32 1, ptr %134, align 4, !tbaa !25
  %135 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %136 = add i32 %135, 1
  store volatile i32 %136, ptr @_tx_thread_preempt_disable, align 4, !tbaa !9
  %137 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %137)
  %138 = load ptr, ptr %11, align 8, !tbaa !11
  call void @_tx_thread_system_suspend(ptr noundef %138)
  br label %141

139:                                              ; preds = %127
  %140 = load i32, ptr %3, align 4, !tbaa !9
  call void @__restore_interrupt(i32 noundef %140)
  br label %141

141:                                              ; preds = %139, %130
  br label %15

142:                                              ; preds = %1
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

; 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_timer_system_activate(ptr 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 48}
!14 = !{!"TX_TIMER_INTERNAL_STRUCT", !6, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !12, i64 40, !12, i64 48}
!15 = !{!14, !12, i64 32}
!16 = !{!14, !12, i64 40}
!17 = !{!14, !6, i64 0}
!18 = !{!14, !12, i64 16}
!19 = !{!14, !6, i64 24}
!20 = !{!14, !6, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !10, i64 92}
!24 = !{!"TX_THREAD_STRUCT", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !12, i64 112, !12, i64 120, !6, i64 128, !14, i64 136, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !6, i64 224, !12, i64 232, !10, i64 240, !10, i64 244, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !10, i64 280, !10, i64 284, !10, i64 288, !10, i64 292, !12, i64 296, !12, i64 304, !12, i64 312, !6, i64 320}
!25 = !{!24, !10, i64 100}


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

%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_timer_current_ptr = external local_unnamed_addr global ptr, align 8
@_tx_timer_list_end = external local_unnamed_addr global ptr, align 8
@_tx_timer_list_start = external local_unnamed_addr global ptr, align 8
@_tx_timer_expired = external local_unnamed_addr global i32, align 4
@_tx_timer_expired_timer_ptr = external local_unnamed_addr global ptr, align 8
@_tx_timer_thread = external global %struct.TX_THREAD_STRUCT, align 8
@_tx_thread_preempt_disable = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @_tx_timer_thread_entry(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %4 = icmp eq i64 %0, 1096042829
  br i1 %4, label %.preheader, label %61

.preheader:                                       ; preds = %1, %.preheader.backedge
  %5 = call i32 @__disable_interrupts()
  %6 = load ptr, ptr @_tx_timer_current_ptr, align 8, !tbaa !5
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %7, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %10, label %8

8:                                                ; preds = %.preheader
  %9 = getelementptr inbounds i8, ptr %7, i64 48
  store ptr %2, ptr %9, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %8, %.preheader
  store ptr null, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr @_tx_timer_current_ptr, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %12, ptr @_tx_timer_current_ptr, align 8, !tbaa !5
  %13 = load ptr, ptr @_tx_timer_list_end, align 8, !tbaa !5
  %14 = icmp eq ptr %12, %13
  br i1 %14, label %15, label %17

15:                                               ; preds = %10
  %16 = load ptr, ptr @_tx_timer_list_start, align 8, !tbaa !5
  store ptr %16, ptr @_tx_timer_current_ptr, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %15, %10
  store i32 0, ptr @_tx_timer_expired, align 4, !tbaa !12
  call void @__restore_interrupt(i32 noundef %5)
  %18 = call i32 @__disable_interrupts()
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %.not4754 = icmp eq ptr %19, null
  br i1 %.not4754, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17, %52
  %20 = phi ptr [ %54, %52 ], [ %19, %17 ]
  %.056 = phi i32 [ %53, %52 ], [ %18, %17 ]
  %21 = getelementptr inbounds i8, ptr %20, i64 32
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  store ptr null, ptr %3, align 8, !tbaa !5
  %23 = icmp eq ptr %20, %22
  br i1 %23, label %30, label %24

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds i8, ptr %20, i64 40
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %22, i64 40
  store ptr %26, ptr %27, align 8, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %26, i64 32
  store ptr %22, ptr %28, align 8, !tbaa !14
  %29 = getelementptr inbounds i8, ptr %22, i64 48
  store ptr %2, ptr %29, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %.lr.ph, %24
  %storemerge = phi ptr [ %22, %24 ], [ null, %.lr.ph ]
  store ptr %storemerge, ptr %2, align 8, !tbaa !5
  %31 = load i64, ptr %20, align 8, !tbaa !16
  %32 = icmp ugt i64 %31, 32
  br i1 %32, label %.thread, label %35

.thread:                                          ; preds = %30
  %33 = add i64 %31, -32
  store i64 %33, ptr %20, align 8, !tbaa !16
  %34 = getelementptr inbounds i8, ptr %20, i64 48
  store ptr %3, ptr %34, align 8, !tbaa !9
  store ptr %20, ptr %21, align 8, !tbaa !14
  store ptr %20, ptr %3, align 8, !tbaa !5
  store ptr %20, ptr @_tx_timer_expired_timer_ptr, align 8, !tbaa !5
  call void @__restore_interrupt(i32 noundef %.056)
  br label %46

35:                                               ; preds = %30
  %36 = getelementptr inbounds i8, ptr %20, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds i8, ptr %20, i64 24
  %39 = load i64, ptr %38, align 8, !tbaa !18
  %40 = getelementptr inbounds i8, ptr %20, i64 8
  %41 = load i64, ptr %40, align 8, !tbaa !19
  store i64 %41, ptr %20, align 8, !tbaa !16
  %.not48 = icmp eq i64 %41, 0
  br i1 %.not48, label %43, label %42

42:                                               ; preds = %35
  store ptr %20, ptr %21, align 8, !tbaa !14
  store ptr %20, ptr %3, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %35, %42
  %.sink = phi ptr [ %3, %42 ], [ null, %35 ]
  %44 = getelementptr inbounds i8, ptr %20, i64 48
  store ptr %.sink, ptr %44, align 8
  store ptr %20, ptr @_tx_timer_expired_timer_ptr, align 8, !tbaa !5
  call void @__restore_interrupt(i32 noundef %.056)
  %.not49 = icmp eq ptr %37, null
  br i1 %.not49, label %46, label %45

45:                                               ; preds = %43
  call void %37(i64 noundef %39) #4
  br label %46

46:                                               ; preds = %.thread, %45, %43
  %47 = call i32 @__disable_interrupts()
  store ptr null, ptr @_tx_timer_expired_timer_ptr, align 8, !tbaa !5
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = icmp eq ptr %48, %20
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = getelementptr inbounds i8, ptr %20, i64 48
  store ptr null, ptr %51, align 8, !tbaa !9
  call void @_tx_timer_system_activate(ptr noundef nonnull %20) #4
  br label %52

52:                                               ; preds = %50, %46
  call void @__restore_interrupt(i32 noundef %47)
  %53 = call i32 @__disable_interrupts()
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %.not47 = icmp eq ptr %54, null
  br i1 %.not47, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %52, %17
  %.0.lcssa = phi i32 [ %18, %17 ], [ %53, %52 ]
  %55 = load i32, ptr @_tx_timer_expired, align 4, !tbaa !12
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %._crit_edge
  store i32 3, ptr getelementptr inbounds (i8, ptr @_tx_timer_thread, i64 92), align 4, !tbaa !22
  store i32 1, ptr getelementptr inbounds (i8, ptr @_tx_timer_thread, i64 100), align 4, !tbaa !24
  %58 = load volatile i32, ptr @_tx_thread_preempt_disable, align 4, !tbaa !12
  %59 = add i32 %58, 1
  store volatile i32 %59, ptr @_tx_thread_preempt_disable, align 4, !tbaa !12
  call void @__restore_interrupt(i32 noundef %.0.lcssa)
  call void @_tx_thread_system_suspend(ptr noundef nonnull @_tx_timer_thread) #4
  br label %.preheader.backedge

60:                                               ; preds = %._crit_edge
  call void @__restore_interrupt(i32 noundef %.0.lcssa)
  br label %.preheader.backedge

.preheader.backedge:                              ; preds = %60, %57
  br label %.preheader

61:                                               ; preds = %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret void
}

; Function Attrs: mustprogress 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() local_unnamed_addr #2

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

declare void @_tx_timer_system_activate(ptr noundef) local_unnamed_addr #3

declare void @_tx_thread_system_suspend(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress 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 = { mustprogress 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, !6, i64 48}
!10 = !{!"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}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !11, i64 0}
!17 = !{!10, !6, i64 16}
!18 = !{!10, !11, i64 24}
!19 = !{!10, !11, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !13, i64 92}
!23 = !{!"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, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !6, i64 112, !6, i64 120, !11, i64 128, !10, i64 136, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !11, i64 224, !6, i64 232, !13, i64 240, !13, i64 244, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !13, i64 280, !13, i64 284, !13, i64 288, !13, i64 292, !6, i64 296, !6, i64 304, !6, i64 312, !11, i64 320}
!24 = !{!23, !13, i64 100}


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