; LLVM IR from carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico :: src/ff15/source (ff)

; 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.DIR = type { %struct.FFOBJID, i32, i32, i64, ptr, [12 x i8], i32, ptr }
%struct.FFOBJID = type { ptr, i16, i8, i8, i32, i64, i32, i32, i32, i32, i32, i32 }
%struct.FATFS = type { i8, i8, i8, i8, i8, i8, i16, i16, i16, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, [512 x i8] }

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

; Function Attrs: nounwind uwtable
declare hidden i32 @mount_volume(ptr noundef, ptr noundef, i8 noundef zeroext) #1

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

declare ptr @ff_memalloc(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @follow_path(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @chk_share(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @init_alloc_info(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @remove_chain(ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @ld_clust(ptr noundef, ptr noundef) #1

declare void @ff_memfree(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @sync_fs(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_sdi(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_read(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @f_unlink(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.DIR, align 8
  %7 = alloca %struct.DIR, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.FFOBJID, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %12 = call i32 @mount_volume(ptr noundef %3, ptr noundef %5, i8 noundef zeroext 2)
  store i32 %12, ptr %4, align 4, !tbaa !9
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %164

15:                                               ; preds = %1
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %18 = getelementptr inbounds %struct.FFOBJID, ptr %17, i32 0, i32 0
  store ptr %16, ptr %18, align 8, !tbaa !11
  %19 = call ptr @ff_memalloc(i32 noundef 1120)
  store ptr %19, ptr %10, align 8, !tbaa !5
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %15
  store i32 17, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %166

23:                                               ; preds = %15
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.FATFS, ptr %25, i32 0, i32 9
  store ptr %24, ptr %26, align 8, !tbaa !16
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = getelementptr inbounds i16, ptr %27, i64 255
  %29 = getelementptr inbounds i16, ptr %28, i64 1
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.FATFS, ptr %30, i32 0, i32 10
  store ptr %29, ptr %31, align 8, !tbaa !18
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = call i32 @follow_path(ptr noundef %6, ptr noundef %32)
  store i32 %33, ptr %4, align 4, !tbaa !9
  %34 = load i32, ptr %4, align 4, !tbaa !9
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %44

36:                                               ; preds = %23
  %37 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 5
  %38 = getelementptr inbounds [12 x i8], ptr %37, i64 0, i64 11
  %39 = load i8, ptr %38, align 1, !tbaa !19
  %40 = zext i8 %39 to i32
  %41 = and i32 %40, 32
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %36
  store i32 6, ptr %4, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %43, %36, %23
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = call i32 @chk_share(ptr noundef %6, i32 noundef 2)
  store i32 %48, ptr %4, align 4, !tbaa !9
  br label %49

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

52:                                               ; preds = %49
  %53 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 5
  %54 = getelementptr inbounds [12 x i8], ptr %53, i64 0, i64 11
  %55 = load i8, ptr %54, align 1, !tbaa !19
  %56 = zext i8 %55 to i32
  %57 = and i32 %56, 128
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %52
  store i32 6, ptr %4, align 4, !tbaa !9
  br label %69

60:                                               ; preds = %52
  %61 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %62 = getelementptr inbounds %struct.FFOBJID, ptr %61, i32 0, i32 2
  %63 = load i8, ptr %62, align 2, !tbaa !20
  %64 = zext i8 %63 to i32
  %65 = and i32 %64, 1
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %60
  store i32 7, ptr %4, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %67, %60
  br label %69

69:                                               ; preds = %68, %59
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %141

72:                                               ; preds = %69
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.FFOBJID, ptr %9, i32 0, i32 0
  store ptr %73, ptr %74, align 8, !tbaa !21
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.FATFS, ptr %75, i32 0, i32 0
  %77 = load i8, ptr %76, align 8, !tbaa !22
  %78 = zext i8 %77 to i32
  %79 = icmp eq i32 %78, 4
  br i1 %79, label %80, label %84

80:                                               ; preds = %72
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  call void @init_alloc_info(ptr noundef %81, ptr noundef %9)
  %82 = getelementptr inbounds %struct.FFOBJID, ptr %9, i32 0, i32 4
  %83 = load i32, ptr %82, align 4, !tbaa !23
  store i32 %83, ptr %8, align 4, !tbaa !9
  br label %89

84:                                               ; preds = %72
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 4
  %87 = load ptr, ptr %86, align 8, !tbaa !24
  %88 = call i32 @ld_clust(ptr noundef %85, ptr noundef %87)
  store i32 %88, ptr %8, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %84, %80
  %90 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %91 = getelementptr inbounds %struct.FFOBJID, ptr %90, i32 0, i32 2
  %92 = load i8, ptr %91, align 2, !tbaa !20
  %93 = zext i8 %92 to i32
  %94 = and i32 %93, 16
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %140

96:                                               ; preds = %89
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.FATFS, ptr %98, i32 0, i32 13
  %100 = load i32, ptr %99, align 8, !tbaa !25
  %101 = icmp eq i32 %97, %100
  br i1 %101, label %102, label %103

102:                                              ; preds = %96
  store i32 7, ptr %4, align 4, !tbaa !9
  br label %139

103:                                              ; preds = %96
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.DIR, ptr %7, i32 0, i32 0
  %106 = getelementptr inbounds %struct.FFOBJID, ptr %105, i32 0, i32 0
  store ptr %104, ptr %106, align 8, !tbaa !11
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = getelementptr inbounds %struct.DIR, ptr %7, i32 0, i32 0
  %109 = getelementptr inbounds %struct.FFOBJID, ptr %108, i32 0, i32 4
  store i32 %107, ptr %109, align 4, !tbaa !26
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.FATFS, ptr %110, i32 0, i32 0
  %112 = load i8, ptr %111, align 8, !tbaa !22
  %113 = zext i8 %112 to i32
  %114 = icmp eq i32 %113, 4
  br i1 %114, label %115, label %124

115:                                              ; preds = %103
  %116 = getelementptr inbounds %struct.FFOBJID, ptr %9, i32 0, i32 5
  %117 = load i64, ptr %116, align 8, !tbaa !27
  %118 = getelementptr inbounds %struct.DIR, ptr %7, i32 0, i32 0
  %119 = getelementptr inbounds %struct.FFOBJID, ptr %118, i32 0, i32 5
  store i64 %117, ptr %119, align 8, !tbaa !28
  %120 = getelementptr inbounds %struct.FFOBJID, ptr %9, i32 0, i32 3
  %121 = load i8, ptr %120, align 1, !tbaa !29
  %122 = getelementptr inbounds %struct.DIR, ptr %7, i32 0, i32 0
  %123 = getelementptr inbounds %struct.FFOBJID, ptr %122, i32 0, i32 3
  store i8 %121, ptr %123, align 1, !tbaa !30
  br label %124

124:                                              ; preds = %115, %103
  %125 = call i32 @dir_sdi(ptr noundef %7, i32 noundef 0)
  store i32 %125, ptr %4, align 4, !tbaa !9
  %126 = load i32, ptr %4, align 4, !tbaa !9
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %138

128:                                              ; preds = %124
  %129 = call i32 @dir_read(ptr noundef %7, i32 noundef 0)
  store i32 %129, ptr %4, align 4, !tbaa !9
  %130 = load i32, ptr %4, align 4, !tbaa !9
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %133

132:                                              ; preds = %128
  store i32 7, ptr %4, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %132, %128
  %134 = load i32, ptr %4, align 4, !tbaa !9
  %135 = icmp eq i32 %134, 4
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %137

137:                                              ; preds = %136, %133
  br label %138

138:                                              ; preds = %137, %124
  br label %139

139:                                              ; preds = %138, %102
  br label %140

140:                                              ; preds = %139, %89
  br label %141

141:                                              ; preds = %140, %69
  %142 = load i32, ptr %4, align 4, !tbaa !9
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %161

144:                                              ; preds = %141
  %145 = call i32 @dir_remove(ptr noundef %6)
  store i32 %145, ptr %4, align 4, !tbaa !9
  %146 = load i32, ptr %4, align 4, !tbaa !9
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %148, label %154

148:                                              ; preds = %144
  %149 = load i32, ptr %8, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %154

151:                                              ; preds = %148
  %152 = load i32, ptr %8, align 4, !tbaa !9
  %153 = call i32 @remove_chain(ptr noundef %9, i32 noundef %152, i32 noundef 0)
  store i32 %153, ptr %4, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %151, %148, %144
  %155 = load i32, ptr %4, align 4, !tbaa !9
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %160

157:                                              ; preds = %154
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = call i32 @sync_fs(ptr noundef %158)
  store i32 %159, ptr %4, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %157, %154
  br label %161

161:                                              ; preds = %160, %141
  br label %162

162:                                              ; preds = %161, %49
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  call void @ff_memfree(ptr noundef %163)
  br label %164

164:                                              ; preds = %162, %1
  %165 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %165, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %166

166:                                              ; preds = %164, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %167 = load i32, ptr %2, align 4
  ret i32 %167
}

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_remove(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !6, i64 0}
!12 = !{!"", !13, i64 0, !10, i64 48, !10, i64 52, !15, i64 56, !6, i64 64, !7, i64 72, !10, i64 84, !6, i64 88}
!13 = !{!"", !6, i64 0, !14, i64 8, !7, i64 10, !7, i64 11, !10, i64 12, !15, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !6, i64 16}
!17 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !14, i64 6, !14, i64 8, !14, i64 10, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !7, i64 112}
!18 = !{!17, !6, i64 24}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !7, i64 10}
!21 = !{!13, !6, i64 0}
!22 = !{!17, !7, i64 0}
!23 = !{!13, !10, i64 12}
!24 = !{!12, !6, i64 64}
!25 = !{!17, !10, i64 40}
!26 = !{!12, !10, i64 12}
!27 = !{!13, !15, i64 16}
!28 = !{!12, !15, i64 16}
!29 = !{!13, !7, i64 11}
!30 = !{!12, !7, i64 11}


; 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.DIR = type { %struct.FFOBJID, i32, i32, i64, ptr, [12 x i8], i32, ptr }
%struct.FFOBJID = type { ptr, i16, i8, i8, i32, i64, i32, i32, i32, i32, i32, i32 }

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

; Function Attrs: nounwind uwtable
declare hidden i32 @mount_volume(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

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

declare ptr @ff_memalloc(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @follow_path(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @chk_share(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @init_alloc_info(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @remove_chain(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @ld_clust(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ff_memfree(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @sync_fs(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_sdi(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_read(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @f_unlink(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.DIR, align 8
  %5 = alloca %struct.DIR, align 8
  %6 = alloca %struct.FFOBJID, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #3
  %7 = call i32 @mount_volume(ptr noundef nonnull %2, ptr noundef nonnull %3, i8 noundef zeroext 2)
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %9, label %80

9:                                                ; preds = %1
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %10, ptr %4, align 8, !tbaa !9
  %11 = call ptr @ff_memalloc(i32 noundef 1120) #3
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %80, label %12

12:                                               ; preds = %9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  store ptr %11, ptr %14, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %11, i64 512
  %16 = getelementptr inbounds i8, ptr %13, i64 24
  store ptr %15, ptr %16, align 8, !tbaa !17
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = call i32 @follow_path(ptr noundef nonnull %4, ptr noundef %17)
  %19 = icmp eq i32 %18, 0
  %20 = getelementptr inbounds i8, ptr %4, i64 83
  %21 = load i8, ptr %20, align 1
  %22 = and i8 %21, 32
  %.not30 = icmp eq i8 %22, 0
  %spec.select = select i1 %.not30, i32 0, i32 6
  %.023 = select i1 %19, i32 %spec.select, i32 %18
  %23 = select i1 %19, i1 %.not30, i1 false
  br i1 %23, label %24, label %.thread

24:                                               ; preds = %12
  %25 = call i32 @chk_share(ptr noundef nonnull %4, i32 noundef 2)
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %.thread

27:                                               ; preds = %24
  %28 = load i8, ptr %20, align 1, !tbaa !18
  %.not31 = icmp sgt i8 %28, -1
  br i1 %.not31, label %29, label %.thread

29:                                               ; preds = %27
  %30 = getelementptr inbounds i8, ptr %4, i64 10
  %31 = load i8, ptr %30, align 2, !tbaa !19
  %32 = and i8 %31, 1
  %.not32 = icmp eq i8 %32, 0
  br i1 %.not32, label %33, label %.thread

33:                                               ; preds = %29
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %34, ptr %6, align 8, !tbaa !20
  %35 = load i8, ptr %34, align 8, !tbaa !21
  %36 = icmp eq i8 %35, 4
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  call void @init_alloc_info(ptr noundef nonnull %34, ptr noundef nonnull %6)
  %38 = getelementptr inbounds i8, ptr %6, i64 12
  %39 = load i32, ptr %38, align 4, !tbaa !22
  br label %44

40:                                               ; preds = %33
  %41 = getelementptr inbounds i8, ptr %4, i64 64
  %42 = load ptr, ptr %41, align 8, !tbaa !23
  %43 = call i32 @ld_clust(ptr noundef nonnull %34, ptr noundef %42)
  br label %44

44:                                               ; preds = %40, %37
  %.022 = phi i32 [ %39, %37 ], [ %43, %40 ]
  %45 = load i8, ptr %30, align 2, !tbaa !19
  %46 = and i8 %45, 16
  %.not33 = icmp eq i8 %46, 0
  br i1 %.not33, label %.thread43, label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load i32, ptr %49, align 8, !tbaa !24
  %51 = icmp eq i32 %.022, %50
  br i1 %51, label %.thread, label %52

52:                                               ; preds = %47
  store ptr %48, ptr %5, align 8, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %5, i64 12
  store i32 %.022, ptr %53, align 4, !tbaa !25
  %54 = load i8, ptr %48, align 8, !tbaa !21
  %55 = icmp eq i8 %54, 4
  br i1 %55, label %56, label %63

56:                                               ; preds = %52
  %57 = getelementptr inbounds i8, ptr %6, i64 16
  %58 = load i64, ptr %57, align 8, !tbaa !26
  %59 = getelementptr inbounds i8, ptr %5, i64 16
  store i64 %58, ptr %59, align 8, !tbaa !27
  %60 = getelementptr inbounds i8, ptr %6, i64 11
  %61 = load i8, ptr %60, align 1, !tbaa !28
  %62 = getelementptr inbounds i8, ptr %5, i64 11
  store i8 %61, ptr %62, align 1, !tbaa !29
  br label %63

63:                                               ; preds = %56, %52
  %64 = call i32 @dir_sdi(ptr noundef nonnull %5, i32 noundef 0)
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %.thread

66:                                               ; preds = %63
  %67 = call i32 @dir_read(ptr noundef nonnull %5, i32 noundef 0)
  %68 = icmp eq i32 %67, 0
  %spec.store.select = select i1 %68, i32 7, i32 %67
  %69 = icmp eq i32 %spec.store.select, 4
  br i1 %69, label %.thread43, label %.thread

.thread43:                                        ; preds = %66, %44
  %70 = call i32 @dir_remove(ptr noundef nonnull %4)
  %71 = icmp eq i32 %70, 0
  %72 = icmp ne i32 %.022, 0
  %or.cond = select i1 %71, i1 %72, i1 false
  br i1 %or.cond, label %73, label %75

73:                                               ; preds = %.thread43
  %74 = call i32 @remove_chain(ptr noundef nonnull %6, i32 noundef %.022, i32 noundef 0)
  br label %75

75:                                               ; preds = %73, %.thread43
  %.4 = phi i32 [ %74, %73 ], [ %70, %.thread43 ]
  %76 = icmp eq i32 %.4, 0
  br i1 %76, label %77, label %.thread

77:                                               ; preds = %75
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = call i32 @sync_fs(ptr noundef %78)
  br label %.thread

.thread:                                          ; preds = %29, %27, %47, %63, %66, %12, %77, %75, %24
  %.5 = phi i32 [ %79, %77 ], [ %.4, %75 ], [ %25, %24 ], [ %.023, %12 ], [ 7, %47 ], [ %64, %63 ], [ %spec.store.select, %66 ], [ 6, %27 ], [ 7, %29 ]
  call void @ff_memfree(ptr noundef nonnull %11) #3
  br label %80

80:                                               ; preds = %1, %.thread, %9
  %.0 = phi i32 [ 17, %9 ], [ %.5, %.thread ], [ %7, %1 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_remove(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !6, i64 0}
!10 = !{!"", !11, i64 0, !13, i64 48, !13, i64 52, !14, i64 56, !6, i64 64, !7, i64 72, !13, i64 84, !6, i64 88}
!11 = !{!"", !6, i64 0, !12, i64 8, !7, i64 10, !7, i64 11, !13, i64 12, !14, i64 16, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !12, i64 6, !12, i64 8, !12, i64 10, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !7, i64 112}
!17 = !{!16, !6, i64 24}
!18 = !{!7, !7, i64 0}
!19 = !{!10, !7, i64 10}
!20 = !{!11, !6, i64 0}
!21 = !{!16, !7, i64 0}
!22 = !{!11, !13, i64 12}
!23 = !{!10, !6, i64 64}
!24 = !{!16, !13, i64 40}
!25 = !{!10, !13, i64 12}
!26 = !{!11, !14, i64 16}
!27 = !{!10, !14, i64 16}
!28 = !{!11, !7, i64 11}
!29 = !{!10, !7, i64 11}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass