; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/filex/common/src/fx_file_create.ll (fx_file_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_system_time = external global i32, align 4
@_fx_system_date = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_file_create(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  %12 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 136, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 136, ptr %12) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %14, i32 0, i32 74
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = add i64 %16, 1
  store i64 %17, ptr %15, align 8, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !17
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %18, ptr %10, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %46, %2
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = load i8, ptr %20, align 1, !tbaa !18
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %23, label %49

23:                                               ; preds = %19
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = load i8, ptr %24, align 1, !tbaa !18
  %26 = sext i8 %25 to i32
  %27 = icmp eq i32 %26, 92
  br i1 %27, label %33, label %28

28:                                               ; preds = %23
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = load i8, ptr %29, align 1, !tbaa !18
  %31 = sext i8 %30 to i32
  %32 = icmp eq i32 %31, 47
  br i1 %32, label %33, label %34

33:                                               ; preds = %28, %23
  store i32 0, ptr %9, align 4, !tbaa !17
  br label %46

34:                                               ; preds = %28
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = load i8, ptr %35, align 1, !tbaa !18
  %37 = sext i8 %36 to i32
  %38 = icmp ne i32 %37, 32
  br i1 %38, label %42, label %39

39:                                               ; preds = %34
  %40 = load i32, ptr %9, align 4, !tbaa !17
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %39, %34
  %43 = load i32, ptr %9, align 4, !tbaa !17
  %44 = add i32 %43, 1
  store i32 %44, ptr %9, align 4, !tbaa !17
  br label %45

45:                                               ; preds = %42, %39
  br label %46

46:                                               ; preds = %45, %33
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i32 1
  store ptr %48, ptr %10, align 8, !tbaa !5
  br label %19, !llvm.loop !19

49:                                               ; preds = %19
  %50 = load i32, ptr %9, align 4, !tbaa !17
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %55, label %52

52:                                               ; preds = %49
  %53 = load i32, ptr %9, align 4, !tbaa !17
  %54 = icmp uge i32 %53, 256
  br i1 %54, label %55, label %56

55:                                               ; preds = %52, %49
  store i32 12, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

56:                                               ; preds = %52
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %57, i32 0, i32 122
  %59 = getelementptr inbounds [1024 x i8], ptr %58, i64 0, i64 0
  %60 = getelementptr inbounds i8, ptr %59, i64 256
  %61 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 0
  store ptr %60, ptr %61, align 8, !tbaa !21
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %62, i32 0, i32 122
  %64 = getelementptr inbounds [1024 x i8], ptr %63, i64 0, i64 0
  %65 = getelementptr inbounds i8, ptr %64, i64 512
  %66 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %12, i32 0, i32 0
  store ptr %65, ptr %66, align 8, !tbaa !21
  %67 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 1
  %68 = getelementptr inbounds [13 x i8], ptr %67, i64 0, i64 0
  store i8 0, ptr %68, align 8, !tbaa !18
  %69 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %12, i32 0, i32 1
  %70 = getelementptr inbounds [13 x i8], ptr %69, i64 0, i64 0
  store i8 0, ptr %70, align 8, !tbaa !18
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %71, i32 0, i32 0
  %73 = load i64, ptr %72, align 8, !tbaa !22
  %74 = icmp ne i64 %73, 1296385097
  br i1 %74, label %75, label %76

75:                                               ; preds = %56
  store i32 17, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

76:                                               ; preds = %56
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %77, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !22
  %80 = icmp ne i64 %79, 1296385097
  br i1 %80, label %81, label %82

81:                                               ; preds = %76
  store i32 17, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

82:                                               ; preds = %76
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %83, i32 0, i32 112
  %85 = call i32 @_tx_mutex_get(ptr noundef %84, i64 noundef 4294967295)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %82
  store i32 17, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

88:                                               ; preds = %82
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %90, i32 0, i32 40
  %92 = load i32, ptr %91, align 8, !tbaa !23
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %98

94:                                               ; preds = %89
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %95, i32 0, i32 112
  %97 = call i32 @_tx_mutex_put(ptr noundef %96)
  store i32 35, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

98:                                               ; preds = %89
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = call i32 @_fx_directory_search(ptr noundef %99, ptr noundef %100, ptr noundef %11, ptr noundef %12, ptr noundef %8)
  store i32 %101, ptr %7, align 4, !tbaa !17
  %102 = load i32, ptr %7, align 4, !tbaa !17
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %108

104:                                              ; preds = %98
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %105, i32 0, i32 112
  %107 = call i32 @_tx_mutex_put(ptr noundef %106)
  store i32 11, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

108:                                              ; preds = %98
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !21
  %112 = getelementptr inbounds i8, ptr %111, i64 0
  %113 = call ptr @_fx_directory_name_extract(ptr noundef %109, ptr noundef %112)
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %119

115:                                              ; preds = %108
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %116, i32 0, i32 112
  %118 = call i32 @_tx_mutex_put(ptr noundef %117)
  store i32 13, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

119:                                              ; preds = %108
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = call i32 @_fx_directory_free_search(ptr noundef %120, ptr noundef %12, ptr noundef %11)
  store i32 %121, ptr %7, align 4, !tbaa !17
  %122 = load i32, ptr %7, align 4, !tbaa !17
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %129

124:                                              ; preds = %119
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %125, i32 0, i32 112
  %127 = call i32 @_tx_mutex_put(ptr noundef %126)
  %128 = load i32, ptr %7, align 4, !tbaa !17
  store i32 %128, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

129:                                              ; preds = %119
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !21
  %133 = getelementptr inbounds i8, ptr %132, i64 0
  %134 = call ptr @_fx_directory_name_extract(ptr noundef %130, ptr noundef %133)
  %135 = call i32 @__disable_interrupts()
  store i32 %135, ptr %6, align 4, !tbaa !17
  %136 = load i32, ptr @_fx_system_time, align 4, !tbaa !17
  %137 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 10
  store i32 %136, ptr %137, align 8, !tbaa !24
  %138 = load i32, ptr @_fx_system_date, align 4, !tbaa !17
  %139 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 11
  store i32 %138, ptr %139, align 4, !tbaa !25
  %140 = load i32, ptr %6, align 4, !tbaa !17
  call void @__restore_interrupt(i32 noundef %140)
  %141 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 4
  store i8 32, ptr %141, align 8, !tbaa !26
  %142 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 13
  store i64 0, ptr %142, align 8, !tbaa !27
  %143 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 12
  store i64 0, ptr %143, align 8, !tbaa !28
  %144 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !21
  %146 = getelementptr inbounds i8, ptr %145, i64 0
  %147 = load i8, ptr %146, align 1, !tbaa !18
  %148 = sext i8 %147 to i32
  %149 = icmp eq i32 %148, 46
  br i1 %149, label %150, label %156

150:                                              ; preds = %129
  %151 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %11, i32 0, i32 4
  %152 = load i8, ptr %151, align 8, !tbaa !26
  %153 = zext i8 %152 to i32
  %154 = or i32 %153, 2
  %155 = trunc i32 %154 to i8
  store i8 %155, ptr %151, align 8, !tbaa !26
  br label %156

156:                                              ; preds = %150, %129
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = call i32 @_fx_directory_entry_write(ptr noundef %157, ptr noundef %11)
  store i32 %158, ptr %7, align 4, !tbaa !17
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %159, i32 0, i32 112
  %161 = call i32 @_tx_mutex_put(ptr noundef %160)
  %162 = load i32, ptr %7, align 4, !tbaa !17
  store i32 %162, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %163

163:                                              ; preds = %156, %124, %115, %104, %94, %87, %81, %75, %55
  call void @llvm.lifetime.end.p0(i64 136, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 136, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %164 = load i32, ptr %3, align 4
  ret i32 %164
}

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

declare i32 @_fx_directory_free_search(ptr noundef, ptr noundef, ptr 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 @_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 = { 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 520}
!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 = !{!12, !12, i64 0}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!15, !6, i64 0}
!22 = !{!10, !11, i64 0}
!23 = !{!10, !12, i64 264}
!24 = !{!15, !12, i64 48}
!25 = !{!15, !12, i64 52}
!26 = !{!15, !7, i64 32}
!27 = !{!15, !13, i64 64}
!28 = !{!15, !11, i64 56}


; 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_system_time = external local_unnamed_addr global i32, align 4
@_fx_system_date = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_file_create(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  %5 = alloca %struct.FX_DIR_ENTRY_STRUCT, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 520
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = add i64 %7, 1
  store i64 %8, ptr %6, align 8, !tbaa !5
  br label %9

9:                                                ; preds = %15, %2
  %.034 = phi i32 [ 0, %2 ], [ %.1, %15 ]
  %.0 = phi ptr [ %1, %2 ], [ %16, %15 ]
  %10 = load i8, ptr %.0, align 1, !tbaa !16
  switch i8 %10, label %11 [
    i8 0, label %17
    i8 92, label %15
    i8 47, label %15
  ]

11:                                               ; preds = %9
  %12 = icmp ne i8 %10, 32
  %13 = icmp ne i32 %.034, 0
  %or.cond = select i1 %12, i1 true, i1 %13
  %14 = add i32 %.034, 1
  %spec.select = select i1 %or.cond, i32 %14, i32 0
  br label %15

15:                                               ; preds = %11, %9, %9
  %.1 = phi i32 [ 0, %9 ], [ 0, %9 ], [ %spec.select, %11 ]
  %16 = getelementptr inbounds i8, ptr %.0, i64 1
  br label %9, !llvm.loop !17

17:                                               ; preds = %9
  %18 = add i32 %.034, -256
  %or.cond3 = icmp ult i32 %18, -255
  br i1 %or.cond3, label %66, label %19

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %0, i64 3144
  store ptr %20, ptr %4, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %0, i64 3400
  store ptr %21, ptr %5, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %4, i64 8
  store i8 0, ptr %22, align 8, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %5, i64 8
  store i8 0, ptr %23, align 8, !tbaa !16
  %24 = load i64, ptr %0, align 8, !tbaa !20
  %.not39 = icmp eq i64 %24, 1296385097
  br i1 %.not39, label %25, label %66

25:                                               ; preds = %19
  %26 = getelementptr inbounds i8, ptr %0, i64 824
  %27 = tail call i32 @_tx_mutex_get(ptr noundef nonnull %26, i64 noundef 4294967295) #5
  %.not40 = icmp eq i32 %27, 0
  br i1 %.not40, label %28, label %66

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 264
  %30 = load i32, ptr %29, align 8, !tbaa !21
  %.not41 = icmp eq i32 %30, 0
  br i1 %.not41, label %33, label %31

31:                                               ; preds = %28
  %32 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %26) #5
  br label %66

33:                                               ; preds = %28
  %34 = call i32 @_fx_directory_search(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %3) #5
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %33
  %37 = call i32 @_tx_mutex_put(ptr noundef nonnull %26) #5
  br label %66

38:                                               ; preds = %33
  %39 = load ptr, ptr %3, align 8, !tbaa !22
  %40 = load ptr, ptr %4, align 8, !tbaa !19
  %41 = call ptr @_fx_directory_name_extract(ptr noundef %39, ptr noundef %40) #5
  %.not42 = icmp eq ptr %41, null
  br i1 %.not42, label %44, label %42

42:                                               ; preds = %38
  %43 = call i32 @_tx_mutex_put(ptr noundef nonnull %26) #5
  br label %66

44:                                               ; preds = %38
  %45 = call i32 @_fx_directory_free_search(ptr noundef nonnull %0, ptr noundef nonnull %5, ptr noundef nonnull %4) #5
  %.not43 = icmp eq i32 %45, 0
  br i1 %.not43, label %48, label %46

46:                                               ; preds = %44
  %47 = call i32 @_tx_mutex_put(ptr noundef nonnull %26) #5
  br label %66

48:                                               ; preds = %44
  %49 = load ptr, ptr %3, align 8, !tbaa !22
  %50 = load ptr, ptr %4, align 8, !tbaa !19
  %51 = call ptr @_fx_directory_name_extract(ptr noundef %49, ptr noundef %50) #5
  %52 = call i32 @__disable_interrupts()
  %53 = load i32, ptr @_fx_system_time, align 4, !tbaa !23
  %54 = getelementptr inbounds i8, ptr %4, i64 48
  store i32 %53, ptr %54, align 8, !tbaa !24
  %55 = load i32, ptr @_fx_system_date, align 4, !tbaa !23
  %56 = getelementptr inbounds i8, ptr %4, i64 52
  store i32 %55, ptr %56, align 4, !tbaa !25
  call void @__restore_interrupt(i32 noundef %52)
  %57 = getelementptr inbounds i8, ptr %4, i64 32
  store i8 32, ptr %57, align 8, !tbaa !26
  %58 = getelementptr inbounds i8, ptr %4, i64 56
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %58, i8 0, i64 16, i1 false)
  %59 = load ptr, ptr %4, align 8, !tbaa !19
  %60 = load i8, ptr %59, align 1, !tbaa !16
  %61 = icmp eq i8 %60, 46
  br i1 %61, label %62, label %63

62:                                               ; preds = %48
  store i8 34, ptr %57, align 8, !tbaa !26
  br label %63

63:                                               ; preds = %62, %48
  %64 = call i32 @_fx_directory_entry_write(ptr noundef nonnull %0, ptr noundef nonnull %4) #5
  %65 = call i32 @_tx_mutex_put(ptr noundef nonnull %26) #5
  br label %66

66:                                               ; preds = %25, %19, %17, %63, %46, %42, %36, %31
  %.035 = phi i32 [ 35, %31 ], [ 11, %36 ], [ 13, %42 ], [ %45, %46 ], [ %64, %63 ], [ 12, %17 ], [ 17, %19 ], [ 17, %25 ]
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 %.035
}

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 520}
!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 = !{!8, !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!14, !10, i64 0}
!20 = !{!6, !7, i64 0}
!21 = !{!6, !11, i64 264}
!22 = !{!10, !10, i64 0}
!23 = !{!11, !11, i64 0}
!24 = !{!14, !11, i64 48}
!25 = !{!14, !11, i64 52}
!26 = !{!14, !8, i64 32}


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