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

; 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.FX_MEDIA_STRUCT = type { i64, ptr, ptr, i64, i32, i64, ptr, ptr, i64, i64, i32, i32, i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i64, i64, i32, i64, i64, ptr, i32, i32, ptr, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i64, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.TX_MUTEX_STRUCT, i32, %struct.FX_DIR_ENTRY_STRUCT, %struct.FX_DIR_ENTRY_STRUCT, [256 x i8], [256 x i8], %struct.FX_PATH_STRUCT, [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], [128 x i8], i64, [1024 x i8], [256 x %struct.FX_CACHED_SECTOR_STRUCT], i64, i64, i64, i64, i8 }
%struct.TX_MUTEX_STRUCT = type { i64, ptr, i32, ptr, i32, i32, ptr, i32, ptr, ptr, i32, ptr, ptr }
%struct.FX_DIR_ENTRY_STRUCT = type { ptr, [13 x i8], i32, i32, i8, i8, i8, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.FX_PATH_STRUCT = type { %struct.FX_DIR_ENTRY_STRUCT, [256 x i8], [256 x i8], i64 }
%struct.FX_FAT_CACHE_ENTRY_STRUCT = type { i64, i64, i64 }
%struct.FX_CACHED_SECTOR_STRUCT = type { ptr, i64, i8, i8, i8, i8, ptr }
%struct.FX_FILE_STRUCT = type { i64, ptr, i64, i8, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, %struct.FX_DIR_ENTRY_STRUCT, [256 x i8], i64, ptr }

@_fx_system_media_opened_count = external global i64, align 8
@_fx_system_media_opened_ptr = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_media_abort(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, 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
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %8, i32 0, i32 84
  %10 = load i64, ptr %9, align 8, !tbaa !9
  %11 = add i64 %10, 1
  store i64 %11, ptr %9, align 8, !tbaa !9
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %12, i32 0, i32 0
  %14 = load i64, ptr %13, align 8, !tbaa !17
  %15 = icmp ne i64 %14, 1296385097
  br i1 %15, label %16, label %17

16:                                               ; preds = %1
  store i32 17, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %93

17:                                               ; preds = %1
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %18, i32 0, i32 0
  %20 = load i64, ptr %19, align 8, !tbaa !17
  %21 = icmp ne i64 %20, 1296385097
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  store i32 17, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %93

23:                                               ; preds = %17
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %24, i32 0, i32 112
  %26 = call i32 @_tx_mutex_get(ptr noundef %25, i64 noundef 4294967295)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  store i32 17, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %93

29:                                               ; preds = %23
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %31, i32 0, i32 49
  %33 = load i64, ptr %32, align 8, !tbaa !18
  store i64 %33, ptr %5, align 8, !tbaa !19
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %34, i32 0, i32 48
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  store ptr %36, ptr %6, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %40, %30
  %38 = load i64, ptr %5, align 8, !tbaa !19
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %48

40:                                               ; preds = %37
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %41, i32 0, i32 0
  store i64 1179208769, ptr %42, align 8, !tbaa !21
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %43, i32 0, i32 17
  %45 = load ptr, ptr %44, align 8, !tbaa !23
  store ptr %45, ptr %6, align 8, !tbaa !5
  %46 = load i64, ptr %5, align 8, !tbaa !19
  %47 = add i64 %46, -1
  store i64 %47, ptr %5, align 8, !tbaa !19
  br label %37, !llvm.loop !24

48:                                               ; preds = %37
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %49, i32 0, i32 32
  store i32 3, ptr %50, align 8, !tbaa !26
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %51, i32 0, i32 33
  store i32 144, ptr %52, align 4, !tbaa !27
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %53, i32 0, i32 45
  %55 = load ptr, ptr %54, align 8, !tbaa !28
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  call void %55(ptr noundef %56)
  %57 = call i32 @__disable_interrupts()
  store i32 %57, ptr %4, align 4, !tbaa !29
  %58 = load i64, ptr @_fx_system_media_opened_count, align 8, !tbaa !19
  %59 = icmp eq i64 %58, 1
  br i1 %59, label %60, label %61

60:                                               ; preds = %48
  store ptr null, ptr @_fx_system_media_opened_ptr, align 8, !tbaa !5
  br label %84

61:                                               ; preds = %48
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %62, i32 0, i32 51
  %64 = load ptr, ptr %63, align 8, !tbaa !30
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %65, i32 0, i32 50
  %67 = load ptr, ptr %66, align 8, !tbaa !31
  %68 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %67, i32 0, i32 51
  store ptr %64, ptr %68, align 8, !tbaa !30
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %69, i32 0, i32 50
  %71 = load ptr, ptr %70, align 8, !tbaa !31
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %72, i32 0, i32 51
  %74 = load ptr, ptr %73, align 8, !tbaa !30
  %75 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %74, i32 0, i32 50
  store ptr %71, ptr %75, align 8, !tbaa !31
  %76 = load ptr, ptr @_fx_system_media_opened_ptr, align 8, !tbaa !5
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = icmp eq ptr %76, %77
  br i1 %78, label %79, label %83

79:                                               ; preds = %61
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %80, i32 0, i32 50
  %82 = load ptr, ptr %81, align 8, !tbaa !31
  store ptr %82, ptr @_fx_system_media_opened_ptr, align 8, !tbaa !5
  br label %83

83:                                               ; preds = %79, %61
  br label %84

84:                                               ; preds = %83, %60
  %85 = load i64, ptr @_fx_system_media_opened_count, align 8, !tbaa !19
  %86 = add i64 %85, -1
  store i64 %86, ptr @_fx_system_media_opened_count, align 8, !tbaa !19
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %87, i32 0, i32 0
  store i64 1296385089, ptr %88, align 8, !tbaa !17
  %89 = load i32, ptr %4, align 4, !tbaa !29
  call void @__restore_interrupt(i32 noundef %89)
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %90, i32 0, i32 112
  %92 = call i32 @_tx_mutex_delete(ptr noundef %91)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %93

93:                                               ; preds = %84, %28, %22, %16
  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 4, ptr %4) #4
  %94 = load i32, ptr %2, align 4
  ret i32 %94
}

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

declare i32 @_tx_mutex_get(ptr noundef, i64 noundef) #2

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

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

declare i32 @_tx_mutex_delete(ptr noundef) #2

; 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 = { "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 = { 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 #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, !11, i64 600}
!10 = !{!"FX_MEDIA_STRUCT", !11, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !12, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 72, !12, i64 80, !12, i64 84, !12, i64 88, !13, i64 96, !11, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !11, i64 152, !12, i64 160, !11, i64 168, !11, i64 176, !12, i64 184, !11, i64 192, !11, i64 200, !6, i64 208, !12, i64 216, !12, i64 220, !6, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !12, i64 256, !12, i64 260, !12, i64 264, !12, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !11, i64 320, !6, i64 328, !6, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !11, i64 576, !11, i64 584, !11, i64 592, !11, i64 600, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !11, i64 640, !11, i64 648, !11, i64 656, !11, i64 664, !11, i64 672, !11, i64 680, !11, i64 688, !11, i64 696, !11, i64 704, !11, i64 712, !11, i64 720, !11, i64 728, !11, i64 736, !11, i64 744, !11, i64 752, !11, i64 760, !11, i64 768, !11, i64 776, !11, i64 784, !11, i64 792, !11, i64 800, !11, i64 808, !11, i64 816, !14, i64 824, !12, i64 920, !15, i64 928, !15, i64 1064, !7, i64 1200, !7, i64 1456, !16, i64 1712, !7, i64 2368, !7, i64 2752, !11, i64 2880, !7, i64 2888, !7, i64 3912, !11, i64 12104, !11, i64 12112, !11, i64 12120, !11, i64 12128, !7, i64 12136}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"TX_MUTEX_STRUCT", !11, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !12, i64 36, !6, i64 40, !12, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !6, i64 88}
!15 = !{!"FX_DIR_ENTRY_STRUCT", !6, i64 0, !7, i64 8, !12, i64 24, !12, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !11, i64 56, !13, i64 64, !13, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !13, i64 112, !11, i64 120, !13, i64 128}
!16 = !{!"FX_PATH_STRUCT", !15, i64 0, !7, i64 136, !7, i64 392, !11, i64 648}
!17 = !{!10, !11, i64 0}
!18 = !{!10, !11, i64 320}
!19 = !{!11, !11, i64 0}
!20 = !{!10, !6, i64 312}
!21 = !{!22, !11, i64 0}
!22 = !{!"FX_FILE_STRUCT", !11, i64 0, !6, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !13, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !15, i64 152, !7, i64 288, !11, i64 544, !6, i64 552}
!23 = !{!22, !6, i64 136}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !12, i64 216}
!27 = !{!10, !12, i64 220}
!28 = !{!10, !6, i64 288}
!29 = !{!12, !12, i64 0}
!30 = !{!10, !6, i64 336}
!31 = !{!10, !6, i64 328}


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

@_fx_system_media_opened_count = external local_unnamed_addr global i64, align 8
@_fx_system_media_opened_ptr = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 18) i32 @_fx_media_abort(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 600
  %3 = load i64, ptr %2, align 8, !tbaa !5
  %4 = add i64 %3, 1
  store i64 %4, ptr %2, align 8, !tbaa !5
  %5 = load i64, ptr %0, align 8, !tbaa !16
  %.not = icmp eq i64 %5, 1296385097
  br i1 %.not, label %6, label %44

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 824
  %8 = tail call i32 @_tx_mutex_get(ptr noundef nonnull %7, i64 noundef 4294967295) #3
  %.not25 = icmp eq i32 %8, 0
  br i1 %.not25, label %9, label %44

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 320
  %11 = load i64, ptr %10, align 8, !tbaa !17
  %.not2627 = icmp eq i64 %11, 0
  br i1 %.not2627, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 312
  %xtraiter = and i64 %11, 7
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %.0.in29.prol = phi ptr [ %13, %.lr.ph.prol ], [ %12, %.lr.ph.preheader ]
  %.02328.prol = phi i64 [ %14, %.lr.ph.prol ], [ %11, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %.0.prol = load ptr, ptr %.0.in29.prol, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.prol, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %.0.prol, i64 136
  %14 = add i64 %.02328.prol, -1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !21

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.0.in29.unr = phi ptr [ %12, %.lr.ph.preheader ], [ %13, %.lr.ph.prol ]
  %.02328.unr = phi i64 [ %11, %.lr.ph.preheader ], [ %14, %.lr.ph.prol ]
  %15 = icmp ult i64 %11, 8
  br i1 %15, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.0.in29 = phi ptr [ %23, %.lr.ph ], [ %.0.in29.unr, %.lr.ph.prol.loopexit ]
  %.02328 = phi i64 [ %24, %.lr.ph ], [ %.02328.unr, %.lr.ph.prol.loopexit ]
  %.0 = load ptr, ptr %.0.in29, align 8, !tbaa !18
  store i64 1179208769, ptr %.0, align 8, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %.0, i64 136
  %.0.1 = load ptr, ptr %16, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.1, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %.0.1, i64 136
  %.0.2 = load ptr, ptr %17, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.2, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %.0.2, i64 136
  %.0.3 = load ptr, ptr %18, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.3, align 8, !tbaa !19
  %19 = getelementptr inbounds i8, ptr %.0.3, i64 136
  %.0.4 = load ptr, ptr %19, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.4, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %.0.4, i64 136
  %.0.5 = load ptr, ptr %20, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.5, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %.0.5, i64 136
  %.0.6 = load ptr, ptr %21, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.6, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %.0.6, i64 136
  %.0.7 = load ptr, ptr %22, align 8, !tbaa !18
  store i64 1179208769, ptr %.0.7, align 8, !tbaa !19
  %23 = getelementptr inbounds i8, ptr %.0.7, i64 136
  %24 = add i64 %.02328, -8
  %.not26.7 = icmp eq i64 %24, 0
  br i1 %.not26.7, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %9
  %25 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 3, ptr %25, align 8, !tbaa !25
  %26 = getelementptr inbounds i8, ptr %0, i64 220
  store i32 144, ptr %26, align 4, !tbaa !26
  %27 = getelementptr inbounds i8, ptr %0, i64 288
  %28 = load ptr, ptr %27, align 8, !tbaa !27
  tail call void %28(ptr noundef nonnull %0) #3
  %29 = tail call i32 @__disable_interrupts()
  %30 = load i64, ptr @_fx_system_media_opened_count, align 8, !tbaa !28
  %31 = icmp eq i64 %30, 1
  br i1 %31, label %.sink.split, label %32

32:                                               ; preds = %._crit_edge
  %33 = getelementptr inbounds i8, ptr %0, i64 336
  %34 = load ptr, ptr %33, align 8, !tbaa !29
  %35 = getelementptr inbounds i8, ptr %0, i64 328
  %36 = load ptr, ptr %35, align 8, !tbaa !30
  %37 = getelementptr inbounds i8, ptr %36, i64 336
  store ptr %34, ptr %37, align 8, !tbaa !29
  %38 = getelementptr inbounds i8, ptr %34, i64 328
  store ptr %36, ptr %38, align 8, !tbaa !30
  %39 = load ptr, ptr @_fx_system_media_opened_ptr, align 8, !tbaa !18
  %40 = icmp eq ptr %39, %0
  br i1 %40, label %.sink.split, label %41

.sink.split:                                      ; preds = %32, %._crit_edge
  %.sink = phi ptr [ null, %._crit_edge ], [ %36, %32 ]
  store ptr %.sink, ptr @_fx_system_media_opened_ptr, align 8, !tbaa !18
  br label %41

41:                                               ; preds = %.sink.split, %32
  %42 = add i64 %30, -1
  store i64 %42, ptr @_fx_system_media_opened_count, align 8, !tbaa !28
  store i64 1296385089, ptr %0, align 8, !tbaa !16
  tail call void @__restore_interrupt(i32 noundef %29)
  %43 = tail call i32 @_tx_mutex_delete(ptr noundef nonnull %7) #3
  br label %44

44:                                               ; preds = %6, %1, %41
  %.024 = phi i32 [ 0, %41 ], [ 17, %1 ], [ 17, %6 ]
  ret i32 %.024
}

declare i32 @_tx_mutex_get(ptr noundef, i64 noundef) local_unnamed_addr #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 i32 @_tx_mutex_delete(ptr noundef) local_unnamed_addr #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 = { "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 = { 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 = { 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 600}
!6 = !{!"FX_MEDIA_STRUCT", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !12, i64 96, !7, i64 104, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !7, i64 152, !11, i64 160, !7, i64 168, !7, i64 176, !11, i64 184, !7, i64 192, !7, i64 200, !10, i64 208, !11, i64 216, !11, i64 220, !10, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !7, i64 320, !10, i64 328, !10, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !7, i64 536, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584, !7, i64 592, !7, i64 600, !7, i64 608, !7, i64 616, !7, i64 624, !7, i64 632, !7, i64 640, !7, i64 648, !7, i64 656, !7, i64 664, !7, i64 672, !7, i64 680, !7, i64 688, !7, i64 696, !7, i64 704, !7, i64 712, !7, i64 720, !7, i64 728, !7, i64 736, !7, i64 744, !7, i64 752, !7, i64 760, !7, i64 768, !7, i64 776, !7, i64 784, !7, i64 792, !7, i64 800, !7, i64 808, !7, i64 816, !13, i64 824, !11, i64 920, !14, i64 928, !14, i64 1064, !8, i64 1200, !8, i64 1456, !15, i64 1712, !8, i64 2368, !8, i64 2752, !7, i64 2880, !8, i64 2888, !8, i64 3912, !7, i64 12104, !7, i64 12112, !7, i64 12120, !7, i64 12128, !8, i64 12136}
!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 = !{!"long long", !8, i64 0}
!13 = !{!"TX_MUTEX_STRUCT", !7, i64 0, !10, i64 8, !11, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !10, i64 40, !11, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !10, i64 80, !10, i64 88}
!14 = !{!"FX_DIR_ENTRY_STRUCT", !10, i64 0, !8, i64 8, !11, i64 24, !11, i64 28, !8, i64 32, !8, i64 33, !8, i64 34, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !7, i64 56, !12, i64 64, !12, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !12, i64 112, !7, i64 120, !12, i64 128}
!15 = !{!"FX_PATH_STRUCT", !14, i64 0, !8, i64 136, !8, i64 392, !7, i64 648}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 320}
!18 = !{!10, !10, i64 0}
!19 = !{!20, !7, i64 0}
!20 = !{!"FX_FILE_STRUCT", !7, i64 0, !10, i64 8, !7, i64 16, !8, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !12, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !14, i64 152, !8, i64 288, !7, i64 544, !10, i64 552}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!6, !11, i64 216}
!26 = !{!6, !11, i64 220}
!27 = !{!6, !10, i64 288}
!28 = !{!7, !7, i64 0}
!29 = !{!6, !10, i64 336}
!30 = !{!6, !10, i64 328}


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