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

; 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_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_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_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 }

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_file_attributes_set(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 136, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %14, i32 0, i32 71
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = add i64 %16, 1
  store i64 %17, ptr %15, align 8, !tbaa !11
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %18, i32 0, i32 122
  %20 = getelementptr inbounds [1024 x i8], ptr %19, i64 0, i64 0
  %21 = getelementptr inbounds i8, ptr %20, i64 256
  %22 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 0
  store ptr %21, ptr %22, align 8, !tbaa !18
  %23 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 1
  %24 = getelementptr inbounds [13 x i8], ptr %23, i64 0, i64 0
  store i8 0, ptr %24, align 8, !tbaa !19
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %25, i32 0, i32 0
  %27 = load i64, ptr %26, align 8, !tbaa !20
  %28 = icmp ne i64 %27, 1296385097
  br i1 %28, label %29, label %30

29:                                               ; preds = %3
  store i32 17, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

30:                                               ; preds = %3
  store i8 24, ptr %12, align 1, !tbaa !19
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %31, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !20
  %34 = icmp ne i64 %33, 1296385097
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  store i32 17, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

36:                                               ; preds = %30
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %37, i32 0, i32 112
  %39 = call i32 @_tx_mutex_get(ptr noundef %38, i64 noundef 4294967295)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %36
  store i32 17, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

42:                                               ; preds = %36
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %44, i32 0, i32 40
  %46 = load i32, ptr %45, align 8, !tbaa !21
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %52

48:                                               ; preds = %43
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %49, i32 0, i32 112
  %51 = call i32 @_tx_mutex_put(ptr noundef %50)
  store i32 35, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

52:                                               ; preds = %43
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call i32 @_fx_directory_search(ptr noundef %53, ptr noundef %54, ptr noundef %11, ptr noundef null, ptr noundef null)
  store i32 %55, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %63

58:                                               ; preds = %52
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %59, i32 0, i32 112
  %61 = call i32 @_tx_mutex_put(ptr noundef %60)
  %62 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %62, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

63:                                               ; preds = %52
  %64 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 4
  %65 = load i8, ptr %64, align 8, !tbaa !22
  %66 = zext i8 %65 to i32
  %67 = load i8, ptr %12, align 1, !tbaa !19
  %68 = zext i8 %67 to i32
  %69 = and i32 %66, %68
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %63
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %72, i32 0, i32 112
  %74 = call i32 @_tx_mutex_put(ptr noundef %73)
  store i32 5, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

75:                                               ; preds = %63
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %76, i32 0, i32 49
  %78 = load i64, ptr %77, align 8, !tbaa !23
  store i64 %78, ptr %9, align 8, !tbaa !24
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %79, i32 0, i32 48
  %81 = load ptr, ptr %80, align 8, !tbaa !25
  store ptr %81, ptr %10, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %105, %75
  %83 = load i64, ptr %9, align 8, !tbaa !24
  %84 = icmp ne i64 %83, 0
  br i1 %84, label %85, label %111

85:                                               ; preds = %82
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %86, i32 0, i32 19
  %88 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %87, i32 0, i32 14
  %89 = load i64, ptr %88, align 8, !tbaa !26
  %90 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 14
  %91 = load i64, ptr %90, align 8, !tbaa !28
  %92 = icmp eq i64 %89, %91
  br i1 %92, label %93, label %105

93:                                               ; preds = %85
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %94, i32 0, i32 19
  %96 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %95, i32 0, i32 15
  %97 = load i64, ptr %96, align 8, !tbaa !29
  %98 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 15
  %99 = load i64, ptr %98, align 8, !tbaa !30
  %100 = icmp eq i64 %97, %99
  br i1 %100, label %101, label %105

101:                                              ; preds = %93
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %102, i32 0, i32 112
  %104 = call i32 @_tx_mutex_put(ptr noundef %103)
  store i32 6, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

105:                                              ; preds = %93, %85
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %106, i32 0, i32 17
  %108 = load ptr, ptr %107, align 8, !tbaa !31
  store ptr %108, ptr %10, align 8, !tbaa !5
  %109 = load i64, ptr %9, align 8, !tbaa !24
  %110 = add i64 %109, -1
  store i64 %110, ptr %9, align 8, !tbaa !24
  br label %82, !llvm.loop !32

111:                                              ; preds = %82
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = trunc i32 %112 to i8
  %114 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 4
  store i8 %113, ptr %114, align 8, !tbaa !22
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = call i32 @_fx_directory_entry_write(ptr noundef %115, ptr noundef %11)
  store i32 %116, ptr %8, align 4, !tbaa !9
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %117, i32 0, i32 112
  %119 = call i32 @_tx_mutex_put(ptr noundef %118)
  %120 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %120, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %121

121:                                              ; preds = %111, %101, %71, %58, %48, %41, %35, %29
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 136, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %122 = load i32, ptr %4, align 4
  ret i32 %122
}

; 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

declare i32 @_tx_mutex_put(ptr noundef) #2

declare i32 @_fx_directory_search(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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


; 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.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 }

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_file_attributes_set(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 496
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = add i64 %6, 1
  store i64 %7, ptr %5, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 3144
  store ptr %8, ptr %4, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  store i8 0, ptr %9, align 8, !tbaa !17
  %10 = load i64, ptr %0, align 8, !tbaa !18
  %.not = icmp eq i64 %10, 1296385097
  br i1 %.not, label %11, label %53

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 824
  %13 = tail call i32 @_tx_mutex_get(ptr noundef nonnull %12, i64 noundef 4294967295) #3
  %.not29 = icmp eq i32 %13, 0
  br i1 %.not29, label %14, label %53

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 264
  %16 = load i32, ptr %15, align 8, !tbaa !19
  %.not30 = icmp eq i32 %16, 0
  br i1 %.not30, label %19, label %17

17:                                               ; preds = %14
  %18 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %53

19:                                               ; preds = %14
  %20 = call i32 @_fx_directory_search(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4, ptr noundef null, ptr noundef null) #3
  %.not31 = icmp eq i32 %20, 0
  br i1 %.not31, label %23, label %21

21:                                               ; preds = %19
  %22 = call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %53

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %4, i64 32
  %25 = load i8, ptr %24, align 8, !tbaa !20
  %26 = and i8 %25, 24
  %.not32 = icmp eq i8 %26, 0
  br i1 %.not32, label %29, label %27

27:                                               ; preds = %23
  %28 = call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %53

29:                                               ; preds = %23
  %30 = getelementptr inbounds i8, ptr %0, i64 320
  %31 = load i64, ptr %30, align 8, !tbaa !21
  %.not3335 = icmp eq i64 %31, 0
  br i1 %.not3335, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %29
  %32 = getelementptr inbounds i8, ptr %0, i64 312
  %33 = getelementptr inbounds i8, ptr %4, i64 72
  %34 = load i64, ptr %33, align 8, !tbaa !22
  %35 = getelementptr inbounds i8, ptr %4, i64 80
  %36 = load i64, ptr %35, align 8
  br label %37

37:                                               ; preds = %.lr.ph, %47
  %.02637.in = phi ptr [ %32, %.lr.ph ], [ %48, %47 ]
  %.02736 = phi i64 [ %31, %.lr.ph ], [ %49, %47 ]
  %.02637 = load ptr, ptr %.02637.in, align 8, !tbaa !23
  %38 = getelementptr inbounds i8, ptr %.02637, i64 224
  %39 = load i64, ptr %38, align 8, !tbaa !24
  %40 = icmp eq i64 %39, %34
  br i1 %40, label %41, label %47

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %.02637, i64 232
  %43 = load i64, ptr %42, align 8, !tbaa !26
  %44 = icmp eq i64 %43, %36
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  %46 = call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %53

47:                                               ; preds = %41, %37
  %48 = getelementptr inbounds i8, ptr %.02637, i64 136
  %49 = add i64 %.02736, -1
  %.not33 = icmp eq i64 %49, 0
  br i1 %.not33, label %._crit_edge, label %37, !llvm.loop !27

._crit_edge:                                      ; preds = %47, %29
  %50 = trunc i32 %2 to i8
  store i8 %50, ptr %24, align 8, !tbaa !20
  %51 = call i32 @_fx_directory_entry_write(ptr noundef nonnull %0, ptr noundef nonnull %4) #3
  %52 = call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %53

53:                                               ; preds = %11, %3, %._crit_edge, %45, %27, %21, %17
  %.0 = phi i32 [ 35, %17 ], [ %20, %21 ], [ 5, %27 ], [ 6, %45 ], [ %51, %._crit_edge ], [ 17, %3 ], [ 17, %11 ]
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #3
  ret i32 %.0
}

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

declare i32 @_tx_mutex_put(ptr noundef) local_unnamed_addr #2

declare i32 @_fx_directory_search(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @_fx_directory_entry_write(ptr noundef, ptr noundef) local_unnamed_addr #2

; 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 = { "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 496}
!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 = !{!14, !10, i64 0}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !7, i64 0}
!19 = !{!6, !11, i64 264}
!20 = !{!14, !8, i64 32}
!21 = !{!6, !7, i64 320}
!22 = !{!14, !12, i64 72}
!23 = !{!10, !10, i64 0}
!24 = !{!25, !12, i64 224}
!25 = !{!"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}
!26 = !{!25, !7, i64 232}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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