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

@FatFs = external hidden global [4 x ptr], align 16
@CurrVol = external hidden global i8, align 1

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

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

declare void @ff_memfree(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @f_chdir(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.DIR, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = 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 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 96, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %10 = call i32 @mount_volume(ptr noundef %3, ptr noundef %7, i8 noundef zeroext 0)
  store i32 %10, ptr %5, align 4, !tbaa !9
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %151

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

20:                                               ; preds = %13
  store i32 17, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %153

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

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

41:                                               ; preds = %34
  %42 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %43 = getelementptr inbounds %struct.FFOBJID, ptr %42, i32 0, i32 4
  %44 = load i32, ptr %43, align 4, !tbaa !20
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.FATFS, ptr %45, i32 0, i32 13
  store i32 %44, ptr %46, align 8, !tbaa !21
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.FATFS, ptr %47, i32 0, i32 0
  %49 = load i8, ptr %48, align 8, !tbaa !22
  %50 = zext i8 %49 to i32
  %51 = icmp eq i32 %50, 4
  br i1 %51, label %52, label %68

52:                                               ; preds = %41
  %53 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %54 = getelementptr inbounds %struct.FFOBJID, ptr %53, i32 0, i32 8
  %55 = load i32, ptr %54, align 8, !tbaa !23
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.FATFS, ptr %56, i32 0, i32 14
  store i32 %55, ptr %57, align 4, !tbaa !24
  %58 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %59 = getelementptr inbounds %struct.FFOBJID, ptr %58, i32 0, i32 9
  %60 = load i32, ptr %59, align 4, !tbaa !25
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.FATFS, ptr %61, i32 0, i32 15
  store i32 %60, ptr %62, align 8, !tbaa !26
  %63 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %64 = getelementptr inbounds %struct.FFOBJID, ptr %63, i32 0, i32 10
  %65 = load i32, ptr %64, align 8, !tbaa !27
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.FATFS, ptr %66, i32 0, i32 16
  store i32 %65, ptr %67, align 4, !tbaa !28
  br label %68

68:                                               ; preds = %52, %41
  br label %121

69:                                               ; preds = %34
  %70 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %71 = getelementptr inbounds %struct.FFOBJID, ptr %70, i32 0, i32 2
  %72 = load i8, ptr %71, align 2, !tbaa !29
  %73 = zext i8 %72 to i32
  %74 = and i32 %73, 16
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %119

76:                                               ; preds = %69
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.FATFS, ptr %77, i32 0, i32 0
  %79 = load i8, ptr %78, align 8, !tbaa !22
  %80 = zext i8 %79 to i32
  %81 = icmp eq i32 %80, 4
  br i1 %81, label %82, label %111

82:                                               ; preds = %76
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.FATFS, ptr %83, i32 0, i32 10
  %85 = load ptr, ptr %84, align 8, !tbaa !18
  %86 = getelementptr inbounds i8, ptr %85, i64 52
  %87 = call i32 @ld_dword(ptr noundef %86)
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FATFS, ptr %88, i32 0, i32 13
  store i32 %87, ptr %89, align 8, !tbaa !21
  %90 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %91 = getelementptr inbounds %struct.FFOBJID, ptr %90, i32 0, i32 4
  %92 = load i32, ptr %91, align 4, !tbaa !20
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.FATFS, ptr %93, i32 0, i32 14
  store i32 %92, ptr %94, align 4, !tbaa !24
  %95 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %96 = getelementptr inbounds %struct.FFOBJID, ptr %95, i32 0, i32 5
  %97 = load i64, ptr %96, align 8, !tbaa !30
  %98 = trunc i64 %97 to i32
  %99 = and i32 %98, -256
  %100 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 0
  %101 = getelementptr inbounds %struct.FFOBJID, ptr %100, i32 0, i32 3
  %102 = load i8, ptr %101, align 1, !tbaa !31
  %103 = zext i8 %102 to i32
  %104 = or i32 %99, %103
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.FATFS, ptr %105, i32 0, i32 15
  store i32 %104, ptr %106, align 8, !tbaa !26
  %107 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 6
  %108 = load i32, ptr %107, align 4, !tbaa !32
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.FATFS, ptr %109, i32 0, i32 16
  store i32 %108, ptr %110, align 4, !tbaa !28
  br label %118

111:                                              ; preds = %76
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.DIR, ptr %6, i32 0, i32 4
  %114 = load ptr, ptr %113, align 8, !tbaa !33
  %115 = call i32 @ld_clust(ptr noundef %112, ptr noundef %114)
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.FATFS, ptr %116, i32 0, i32 13
  store i32 %115, ptr %117, align 8, !tbaa !21
  br label %118

118:                                              ; preds = %111, %82
  br label %120

119:                                              ; preds = %69
  store i32 5, ptr %5, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %119, %118
  br label %121

121:                                              ; preds = %120, %68
  br label %122

122:                                              ; preds = %121, %21
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ff_memfree(ptr noundef %123)
  %124 = load i32, ptr %5, align 4, !tbaa !9
  %125 = icmp eq i32 %124, 4
  br i1 %125, label %126, label %127

126:                                              ; preds = %122
  store i32 5, ptr %5, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %126, %122
  %128 = load i32, ptr %5, align 4, !tbaa !9
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %150

130:                                              ; preds = %127
  store i32 3, ptr %4, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %144, %130
  %132 = load i32, ptr %4, align 4, !tbaa !9
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %141

134:                                              ; preds = %131
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = load i32, ptr %4, align 4, !tbaa !9
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds [4 x ptr], ptr @FatFs, i64 0, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = icmp ne ptr %135, %139
  br label %141

141:                                              ; preds = %134, %131
  %142 = phi i1 [ false, %131 ], [ %140, %134 ]
  br i1 %142, label %143, label %147

143:                                              ; preds = %141
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %4, align 4, !tbaa !9
  %146 = add i32 %145, -1
  store i32 %146, ptr %4, align 4, !tbaa !9
  br label %131, !llvm.loop !34

147:                                              ; preds = %141
  %148 = load i32, ptr %4, align 4, !tbaa !9
  %149 = trunc i32 %148 to i8
  store i8 %149, ptr @CurrVol, align 1, !tbaa !19
  br label %150

150:                                              ; preds = %147, %127
  br label %151

151:                                              ; preds = %150, %1
  %152 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %152, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %153

153:                                              ; preds = %151, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %154 = load i32, ptr %2, align 4
  ret i32 %154
}

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, !10, i64 12}
!21 = !{!17, !10, i64 40}
!22 = !{!17, !7, i64 0}
!23 = !{!12, !10, i64 32}
!24 = !{!17, !10, i64 44}
!25 = !{!12, !10, i64 36}
!26 = !{!17, !10, i64 48}
!27 = !{!12, !10, i64 40}
!28 = !{!17, !10, i64 52}
!29 = !{!12, !7, i64 10}
!30 = !{!12, !15, i64 16}
!31 = !{!12, !7, i64 11}
!32 = !{!12, !10, i64 84}
!33 = !{!12, !6, i64 64}
!34 = distinct !{!34, !35}
!35 = !{!"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.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 }

@FatFs = external hidden local_unnamed_addr global [4 x ptr], align 16
@CurrVol = external hidden local_unnamed_addr global i8, align 1

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

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

declare void @ff_memfree(ptr noundef) local_unnamed_addr #2

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

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

10:                                               ; preds = %7
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %9, ptr %12, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %9, i64 512
  %14 = getelementptr inbounds i8, ptr %11, i64 24
  store ptr %13, ptr %14, align 8, !tbaa !17
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call i32 @follow_path(ptr noundef nonnull %3, ptr noundef %15)
  %.fr = freeze i32 %16
  %17 = icmp eq i32 %.fr, 0
  br i1 %17, label %18, label %71

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %3, i64 83
  %20 = load i8, ptr %19, align 1, !tbaa !18
  %.not19 = icmp sgt i8 %20, -1
  br i1 %.not19, label %35, label %21

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %3, i64 12
  %23 = load i32, ptr %22, align 4, !tbaa !19
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 40
  store i32 %23, ptr %25, align 8, !tbaa !20
  %26 = load i8, ptr %24, align 8, !tbaa !21
  %27 = icmp eq i8 %26, 4
  br i1 %27, label %28, label %73

28:                                               ; preds = %21
  %29 = getelementptr inbounds i8, ptr %3, i64 32
  %30 = getelementptr inbounds i8, ptr %24, i64 44
  %31 = load <2 x i32>, ptr %29, align 8, !tbaa !22
  store <2 x i32> %31, ptr %30, align 4, !tbaa !22
  %32 = getelementptr inbounds i8, ptr %3, i64 40
  %33 = load i32, ptr %32, align 8, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %24, i64 52
  store i32 %33, ptr %34, align 4, !tbaa !24
  br label %73

35:                                               ; preds = %18
  %36 = getelementptr inbounds i8, ptr %3, i64 10
  %37 = load i8, ptr %36, align 2, !tbaa !25
  %38 = and i8 %37, 16
  %.not20 = icmp eq i8 %38, 0
  br i1 %.not20, label %.thread27, label %39

.thread27:                                        ; preds = %35
  call void @ff_memfree(ptr noundef nonnull %9) #3
  br label %.thread26

39:                                               ; preds = %35
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load i8, ptr %40, align 8, !tbaa !21
  %42 = icmp eq i8 %41, 4
  br i1 %42, label %43, label %65

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %40, i64 24
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  %46 = getelementptr inbounds i8, ptr %45, i64 52
  %47 = call i32 @ld_dword(ptr noundef nonnull %46)
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  store i32 %47, ptr %49, align 8, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %3, i64 12
  %51 = load i32, ptr %50, align 4, !tbaa !19
  %52 = getelementptr inbounds i8, ptr %48, i64 44
  store i32 %51, ptr %52, align 4, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %3, i64 16
  %54 = load i64, ptr %53, align 8, !tbaa !27
  %55 = trunc i64 %54 to i32
  %56 = and i32 %55, -256
  %57 = getelementptr inbounds i8, ptr %3, i64 11
  %58 = load i8, ptr %57, align 1, !tbaa !28
  %59 = zext i8 %58 to i32
  %60 = or disjoint i32 %56, %59
  %61 = getelementptr inbounds i8, ptr %48, i64 48
  store i32 %60, ptr %61, align 8, !tbaa !29
  %62 = getelementptr inbounds i8, ptr %3, i64 84
  %63 = load i32, ptr %62, align 4, !tbaa !30
  %64 = getelementptr inbounds i8, ptr %48, i64 52
  store i32 %63, ptr %64, align 4, !tbaa !24
  br label %73

65:                                               ; preds = %39
  %66 = getelementptr inbounds i8, ptr %3, i64 64
  %67 = load ptr, ptr %66, align 8, !tbaa !31
  %68 = call i32 @ld_clust(ptr noundef nonnull %40, ptr noundef %67)
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 40
  store i32 %68, ptr %70, align 8, !tbaa !20
  br label %73

71:                                               ; preds = %10
  call void @ff_memfree(ptr noundef nonnull %9) #3
  %72 = icmp eq i32 %.fr, 4
  %spec.select = select i1 %72, i32 5, i32 %.fr
  br label %.thread26

73:                                               ; preds = %28, %21, %43, %65
  call void @ff_memfree(ptr noundef nonnull %9) #3
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load ptr, ptr getelementptr inbounds (i8, ptr @FatFs, i64 24), align 8, !tbaa !5
  %.not22 = icmp eq ptr %74, %75
  br i1 %.not22, label %.critedge, label %76

76:                                               ; preds = %73
  %77 = load ptr, ptr getelementptr inbounds (i8, ptr @FatFs, i64 16), align 16, !tbaa !5
  %.not22.1 = icmp eq ptr %74, %77
  br i1 %.not22.1, label %.critedge, label %78

78:                                               ; preds = %76
  %79 = load ptr, ptr getelementptr inbounds (i8, ptr @FatFs, i64 8), align 8, !tbaa !5
  %.not22.2 = icmp eq ptr %74, %79
  %spec.select30 = zext i1 %.not22.2 to i8
  br label %.critedge

.critedge:                                        ; preds = %78, %76, %73
  %.014.lcssa = phi i8 [ 3, %73 ], [ 2, %76 ], [ %spec.select30, %78 ]
  store i8 %.014.lcssa, ptr @CurrVol, align 1, !tbaa !18
  br label %.thread26

.thread26:                                        ; preds = %71, %.thread27, %1, %.critedge, %7
  %.0 = phi i32 [ 17, %7 ], [ 0, %.critedge ], [ %5, %1 ], [ 5, %.thread27 ], [ %spec.select, %71 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %3) #3
  ret i32 %.0
}

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, !13, i64 12}
!20 = !{!16, !13, i64 40}
!21 = !{!16, !7, i64 0}
!22 = !{!13, !13, i64 0}
!23 = !{!10, !13, i64 40}
!24 = !{!16, !13, i64 52}
!25 = !{!10, !7, i64 10}
!26 = !{!16, !13, i64 44}
!27 = !{!10, !14, i64 16}
!28 = !{!10, !7, i64 11}
!29 = !{!16, !13, i64 48}
!30 = !{!10, !13, i64 84}
!31 = !{!10, !6, i64 64}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass