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

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

@_fx_unicode_temp_long_file_name = external global [256 x i8], align 16

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

30:                                               ; preds = %4
  store i32 17, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

31:                                               ; preds = %4
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !16
  %35 = icmp ne i64 %34, 1296385097
  br i1 %35, label %36, label %37

36:                                               ; preds = %31
  store i32 17, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

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

42:                                               ; preds = %37
  store i32 17, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

43:                                               ; preds = %37
  br label %44

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

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

53:                                               ; preds = %44
  %54 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %54, ptr %13, align 8, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds [13 x i8], ptr %14, i64 0, i64 0
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = call i32 @_fx_unicode_directory_search(ptr noundef %55, ptr noundef %10, ptr noundef %56, i64 noundef 13, ptr noundef %57, ptr noundef %13, i64 noundef 0)
  store i32 %58, ptr %12, align 4, !tbaa !21
  %59 = load i32, ptr %12, align 4, !tbaa !21
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %53
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %62, i32 0, i32 112
  %64 = call i32 @_tx_mutex_put(ptr noundef %63)
  store i32 11, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

65:                                               ; preds = %53
  store i8 122, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !15
  store i32 1, ptr %11, align 4, !tbaa !21
  br label %66

66:                                               ; preds = %79, %65
  %67 = load i32, ptr %11, align 4, !tbaa !21
  %68 = zext i32 %67 to i64
  %69 = load i64, ptr %8, align 8, !tbaa !9
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %71, label %82

71:                                               ; preds = %66
  %72 = load i32, ptr %11, align 4, !tbaa !21
  %73 = urem i32 %72, 9
  %74 = add i32 48, %73
  %75 = trunc i32 %74 to i8
  %76 = load i32, ptr %11, align 4, !tbaa !21
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [256 x i8], ptr @_fx_unicode_temp_long_file_name, i64 0, i64 %77
  store i8 %75, ptr %78, align 1, !tbaa !15
  br label %79

79:                                               ; preds = %71
  %80 = load i32, ptr %11, align 4, !tbaa !21
  %81 = add i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !21
  br label %66, !llvm.loop !22

82:                                               ; preds = %66
  %83 = load i32, ptr %11, align 4, !tbaa !21
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds [256 x i8], ptr @_fx_unicode_temp_long_file_name, i64 0, i64 %84
  store i8 0, ptr %85, align 1, !tbaa !15
  br label %86

86:                                               ; preds = %100, %82
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = call i32 @_fx_directory_create(ptr noundef %87, ptr noundef @_fx_unicode_temp_long_file_name)
  store i32 %88, ptr %12, align 4, !tbaa !21
  %89 = load i32, ptr %12, align 4, !tbaa !21
  %90 = icmp eq i32 %89, 11
  br i1 %90, label %91, label %99

91:                                               ; preds = %86
  %92 = load i8, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !15
  %93 = add i8 %92, -1
  store i8 %93, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !15
  %94 = load i8, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !15
  %95 = zext i8 %94 to i32
  %96 = icmp slt i32 %95, 97
  br i1 %96, label %97, label %98

97:                                               ; preds = %91
  br label %103

98:                                               ; preds = %91
  br label %99

99:                                               ; preds = %98, %86
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %12, align 4, !tbaa !21
  %102 = icmp eq i32 %101, 11
  br i1 %102, label %86, label %103, !llvm.loop !24

103:                                              ; preds = %100, %97
  %104 = load i32, ptr %12, align 4, !tbaa !21
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %111

106:                                              ; preds = %103
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %107, i32 0, i32 112
  %109 = call i32 @_tx_mutex_put(ptr noundef %108)
  %110 = load i32, ptr %12, align 4, !tbaa !21
  store i32 %110, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

111:                                              ; preds = %103
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %112, i32 0, i32 122
  %114 = getelementptr inbounds [1024 x i8], ptr %113, i64 0, i64 0
  %115 = getelementptr inbounds i8, ptr %114, i64 256
  %116 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %10, i32 0, i32 0
  store ptr %115, ptr %116, align 8, !tbaa !11
  %117 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %10, i32 0, i32 1
  %118 = getelementptr inbounds [13 x i8], ptr %117, i64 0, i64 0
  store i8 0, ptr %118, align 8, !tbaa !15
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = call i32 @_fx_directory_search(ptr noundef %119, ptr noundef @_fx_unicode_temp_long_file_name, ptr noundef %10, ptr noundef null, ptr noundef null)
  store i32 %120, ptr %12, align 4, !tbaa !21
  %121 = load i32, ptr %12, align 4, !tbaa !21
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %128

123:                                              ; preds = %111
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %124, i32 0, i32 112
  %126 = call i32 @_tx_mutex_put(ptr noundef %125)
  %127 = load i32, ptr %12, align 4, !tbaa !21
  store i32 %127, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

128:                                              ; preds = %111
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = load i64, ptr %8, align 8, !tbaa !9
  %132 = call i32 @_fx_unicode_directory_entry_change(ptr noundef %129, ptr noundef %10, ptr noundef %130, i64 noundef %131)
  store i32 %132, ptr %12, align 4, !tbaa !21
  %133 = load i32, ptr %12, align 4, !tbaa !21
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %162

135:                                              ; preds = %128
  store i32 0, ptr %11, align 4, !tbaa !21
  br label %136

136:                                              ; preds = %158, %135
  %137 = load i32, ptr %11, align 4, !tbaa !21
  %138 = icmp ult i32 %137, 8
  br i1 %138, label %139, label %161

139:                                              ; preds = %136
  %140 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %10, i32 0, i32 1
  %141 = load i32, ptr %11, align 4, !tbaa !21
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds [13 x i8], ptr %140, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !15
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = load i32, ptr %11, align 4, !tbaa !21
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds i8, ptr %145, i64 %147
  store i8 %144, ptr %148, align 1, !tbaa !15
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = load i32, ptr %11, align 4, !tbaa !21
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i8, ptr %149, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !15
  %154 = sext i8 %153 to i32
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %139
  br label %161

157:                                              ; preds = %139
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %11, align 4, !tbaa !21
  %160 = add i32 %159, 1
  store i32 %160, ptr %11, align 4, !tbaa !21
  br label %136, !llvm.loop !25

161:                                              ; preds = %156, %136
  br label %162

162:                                              ; preds = %161, %128
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %163, i32 0, i32 112
  %165 = call i32 @_tx_mutex_put(ptr noundef %164)
  %166 = load i32, ptr %12, align 4, !tbaa !21
  store i32 %166, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %167

167:                                              ; preds = %162, %123, %106, %61, %49, %42, %36, %30
  call void @llvm.lifetime.end.p0(i64 13, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 136, ptr %10) #3
  %168 = load i32, ptr %5, align 4
  ret i32 %168
}

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

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

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

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


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

@_fx_unicode_temp_long_file_name = external global [256 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_unicode_directory_create(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  %6 = alloca i64, align 8
  %7 = alloca [13 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %7) #3
  %8 = getelementptr inbounds i8, ptr %0, i64 3144
  store ptr %8, ptr %5, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  store i8 0, ptr %9, align 8, !tbaa !13
  store i8 0, ptr %7, align 1, !tbaa !13
  store i8 0, ptr %3, align 1, !tbaa !13
  %10 = load i64, ptr %0, align 8, !tbaa !14
  %.not = icmp eq i64 %10, 1296385097
  br i1 %.not, label %11, label %80

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

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

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

19:                                               ; preds = %14
  store i64 %2, ptr %6, align 8, !tbaa !19
  %20 = call i32 @_fx_unicode_directory_search(ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull %7, i64 noundef 13, ptr noundef %1, ptr noundef nonnull %6, i64 noundef 0) #3
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %24

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

24:                                               ; preds = %19
  store i8 122, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !13
  %25 = icmp ugt i64 %2, 1
  br i1 %25, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %24, %.lr.ph
  %26 = phi i64 [ %32, %.lr.ph ], [ 1, %24 ]
  %.056 = phi i32 [ %31, %.lr.ph ], [ 1, %24 ]
  %27 = urem i32 %.056, 9
  %28 = trunc nuw nsw i32 %27 to i8
  %29 = or disjoint i8 %28, 48
  %30 = getelementptr inbounds [256 x i8], ptr @_fx_unicode_temp_long_file_name, i64 0, i64 %26
  store i8 %29, ptr %30, align 1, !tbaa !13
  %31 = add i32 %.056, 1
  %32 = zext i32 %31 to i64
  %33 = icmp ult i64 %32, %2
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %24
  %.lcssa55 = phi i64 [ 1, %24 ], [ %32, %.lr.ph ]
  %34 = getelementptr inbounds [256 x i8], ptr @_fx_unicode_temp_long_file_name, i64 0, i64 %.lcssa55
  store i8 0, ptr %34, align 1, !tbaa !13
  br label %35

35:                                               ; preds = %37, %._crit_edge
  %36 = call i32 @_fx_directory_create(ptr noundef nonnull %0, ptr noundef nonnull @_fx_unicode_temp_long_file_name) #3
  switch i32 %36, label %41 [
    i32 11, label %37
    i32 0, label %43
  ]

37:                                               ; preds = %35
  %38 = load i8, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !13
  %39 = add i8 %38, -1
  store i8 %39, ptr @_fx_unicode_temp_long_file_name, align 16, !tbaa !13
  %40 = icmp ugt i8 %39, 96
  br i1 %40, label %35, label %41, !llvm.loop !22

41:                                               ; preds = %37, %35
  %42 = call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %80

43:                                               ; preds = %35
  store ptr %8, ptr %5, align 8, !tbaa !5
  store i8 0, ptr %9, align 8, !tbaa !13
  %44 = call i32 @_fx_directory_search(ptr noundef nonnull %0, ptr noundef nonnull @_fx_unicode_temp_long_file_name, ptr noundef nonnull %5, ptr noundef null, ptr noundef null) #3
  %.not53 = icmp eq i32 %44, 0
  br i1 %.not53, label %47, label %45

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

47:                                               ; preds = %43
  %48 = call i32 @_fx_unicode_directory_entry_change(ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef %1, i64 noundef %2) #3
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %47
  %50 = load i8, ptr %9, align 8, !tbaa !13
  store i8 %50, ptr %3, align 1, !tbaa !13
  %51 = icmp eq i8 %50, 0
  br i1 %51, label %.loopexit, label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader
  %52 = getelementptr inbounds i8, ptr %5, i64 9
  %53 = load i8, ptr %52, align 1, !tbaa !13
  %54 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 %53, ptr %54, align 1, !tbaa !13
  %55 = icmp eq i8 %53, 0
  br i1 %55, label %.loopexit, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %56 = getelementptr inbounds i8, ptr %5, i64 10
  %57 = load i8, ptr %56, align 2, !tbaa !13
  %58 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 %57, ptr %58, align 1, !tbaa !13
  %59 = icmp eq i8 %57, 0
  br i1 %59, label %.loopexit, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  %60 = getelementptr inbounds i8, ptr %5, i64 11
  %61 = load i8, ptr %60, align 1, !tbaa !13
  %62 = getelementptr inbounds i8, ptr %3, i64 3
  store i8 %61, ptr %62, align 1, !tbaa !13
  %63 = icmp eq i8 %61, 0
  br i1 %63, label %.loopexit, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  %64 = getelementptr inbounds i8, ptr %5, i64 12
  %65 = load i8, ptr %64, align 4, !tbaa !13
  %66 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 %65, ptr %66, align 1, !tbaa !13
  %67 = icmp eq i8 %65, 0
  br i1 %67, label %.loopexit, label %.preheader.5

.preheader.5:                                     ; preds = %.preheader.4
  %68 = getelementptr inbounds i8, ptr %5, i64 13
  %69 = load i8, ptr %68, align 1, !tbaa !13
  %70 = getelementptr inbounds i8, ptr %3, i64 5
  store i8 %69, ptr %70, align 1, !tbaa !13
  %71 = icmp eq i8 %69, 0
  br i1 %71, label %.loopexit, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  %72 = getelementptr inbounds i8, ptr %5, i64 14
  %73 = load i8, ptr %72, align 2, !tbaa !13
  %74 = getelementptr inbounds i8, ptr %3, i64 6
  store i8 %73, ptr %74, align 1, !tbaa !13
  %75 = icmp eq i8 %73, 0
  br i1 %75, label %.loopexit, label %.preheader.7

.preheader.7:                                     ; preds = %.preheader.6
  %76 = getelementptr inbounds i8, ptr %5, i64 15
  %77 = load i8, ptr %76, align 1, !tbaa !13
  %78 = getelementptr inbounds i8, ptr %3, i64 7
  store i8 %77, ptr %78, align 1, !tbaa !13
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.7, %.preheader.preheader, %.preheader.1, %.preheader.2, %.preheader.3, %.preheader.4, %.preheader.5, %.preheader.6, %47
  %79 = call i32 @_tx_mutex_put(ptr noundef nonnull %12) #3
  br label %80

80:                                               ; preds = %11, %4, %.loopexit, %45, %41, %22, %17
  %.044 = phi i32 [ 35, %17 ], [ 11, %22 ], [ %36, %41 ], [ %44, %45 ], [ %48, %.loopexit ], [ 17, %4 ], [ 17, %11 ]
  call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %5) #3
  ret i32 %.044
}

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

declare i32 @_fx_directory_create(ptr noundef, 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_unicode_directory_entry_change(ptr noundef, ptr noundef, ptr noundef, i64 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 0}
!6 = !{!"FX_DIR_ENTRY_STRUCT", !7, i64 0, !8, i64 8, !10, i64 24, !10, i64 28, !8, i64 32, !8, i64 33, !8, i64 34, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !11, i64 56, !12, i64 64, !12, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !12, i64 112, !11, i64 120, !12, i64 128}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"FX_MEDIA_STRUCT", !11, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !10, i64 32, !11, i64 40, !7, i64 48, !7, i64 56, !11, i64 64, !11, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !12, i64 96, !11, 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, !11, i64 152, !10, i64 160, !11, i64 168, !11, i64 176, !10, i64 184, !11, i64 192, !11, i64 200, !7, i64 208, !10, i64 216, !10, i64 220, !7, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !10, i64 256, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !11, i64 320, !7, i64 328, !7, 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, !16, i64 824, !10, i64 920, !6, i64 928, !6, i64 1064, !8, i64 1200, !8, i64 1456, !17, i64 1712, !8, i64 2368, !8, i64 2752, !11, i64 2880, !8, i64 2888, !8, i64 3912, !11, i64 12104, !11, i64 12112, !11, i64 12120, !11, i64 12128, !8, i64 12136}
!16 = !{!"TX_MUTEX_STRUCT", !11, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !7, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !7, i64 80, !7, i64 88}
!17 = !{!"FX_PATH_STRUCT", !6, i64 0, !8, i64 136, !8, i64 392, !11, i64 648}
!18 = !{!15, !10, i64 264}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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