; 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 void @init_alloc_info(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 @inc_share(ptr noundef, i32 noundef) #1

declare void @ff_memfree(ptr noundef) #2

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

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

12:                                               ; preds = %2
  store i32 9, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %161

13:                                               ; preds = %2
  %14 = call i32 @mount_volume(ptr noundef %5, ptr noundef %7, i8 noundef zeroext 0)
  store i32 %14, ptr %6, align 4, !tbaa !9
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %152

17:                                               ; preds = %13
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.DIR, ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds %struct.FFOBJID, ptr %20, i32 0, i32 0
  store ptr %18, ptr %21, align 8, !tbaa !11
  %22 = call ptr @ff_memalloc(i32 noundef 1120)
  store ptr %22, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %17
  store i32 17, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %161

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

40:                                               ; preds = %26
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.DIR, ptr %41, i32 0, i32 5
  %43 = getelementptr inbounds [12 x i8], ptr %42, i64 0, i64 11
  %44 = load i8, ptr %43, align 1, !tbaa !19
  %45 = zext i8 %44 to i32
  %46 = and i32 %45, 128
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %106, label %48

48:                                               ; preds = %40
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.DIR, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %struct.FFOBJID, ptr %50, i32 0, i32 2
  %52 = load i8, ptr %51, align 2, !tbaa !20
  %53 = zext i8 %52 to i32
  %54 = and i32 %53, 16
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %104

56:                                               ; preds = %48
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.FATFS, ptr %57, i32 0, i32 0
  %59 = load i8, ptr %58, align 8, !tbaa !21
  %60 = zext i8 %59 to i32
  %61 = icmp eq i32 %60, 4
  br i1 %61, label %62, label %94

62:                                               ; preds = %56
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.DIR, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %struct.FFOBJID, ptr %64, i32 0, i32 4
  %66 = load i32, ptr %65, align 4, !tbaa !22
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.DIR, ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds %struct.FFOBJID, ptr %68, i32 0, i32 8
  store i32 %66, ptr %69, align 8, !tbaa !23
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.DIR, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.FFOBJID, ptr %71, i32 0, i32 5
  %73 = load i64, ptr %72, align 8, !tbaa !24
  %74 = trunc i64 %73 to i32
  %75 = and i32 %74, -256
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.DIR, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.FFOBJID, ptr %77, i32 0, i32 3
  %79 = load i8, ptr %78, align 1, !tbaa !25
  %80 = zext i8 %79 to i32
  %81 = or i32 %75, %80
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.DIR, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.FFOBJID, ptr %83, i32 0, i32 9
  store i32 %81, ptr %84, align 4, !tbaa !26
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.DIR, ptr %85, i32 0, i32 6
  %87 = load i32, ptr %86, align 4, !tbaa !27
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.DIR, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.FFOBJID, ptr %89, i32 0, i32 10
  store i32 %87, ptr %90, align 8, !tbaa !28
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.DIR, ptr %92, i32 0, i32 0
  call void @init_alloc_info(ptr noundef %91, ptr noundef %93)
  br label %103

94:                                               ; preds = %56
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.DIR, ptr %96, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !29
  %99 = call i32 @ld_clust(ptr noundef %95, ptr noundef %98)
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.DIR, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.FFOBJID, ptr %101, i32 0, i32 4
  store i32 %99, ptr %102, align 4, !tbaa !22
  br label %103

103:                                              ; preds = %94, %62
  br label %105

104:                                              ; preds = %48
  store i32 5, ptr %6, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %104, %103
  br label %106

106:                                              ; preds = %105, %40
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %145

109:                                              ; preds = %106
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.FATFS, ptr %110, i32 0, i32 6
  %112 = load i16, ptr %111, align 2, !tbaa !30
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.DIR, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.FFOBJID, ptr %114, i32 0, i32 1
  store i16 %112, ptr %115, align 8, !tbaa !31
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = call i32 @dir_sdi(ptr noundef %116, i32 noundef 0)
  store i32 %117, ptr %6, align 4, !tbaa !9
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %144

120:                                              ; preds = %109
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.DIR, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %struct.FFOBJID, ptr %122, i32 0, i32 4
  %124 = load i32, ptr %123, align 4, !tbaa !22
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %139

126:                                              ; preds = %120
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = call i32 @inc_share(ptr noundef %127, i32 noundef 0)
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.DIR, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds %struct.FFOBJID, ptr %130, i32 0, i32 11
  store i32 %128, ptr %131, align 4, !tbaa !32
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.DIR, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.FFOBJID, ptr %133, i32 0, i32 11
  %135 = load i32, ptr %134, align 4, !tbaa !32
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %138, label %137

137:                                              ; preds = %126
  store i32 18, ptr %6, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %137, %126
  br label %143

139:                                              ; preds = %120
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.DIR, ptr %140, i32 0, i32 0
  %142 = getelementptr inbounds %struct.FFOBJID, ptr %141, i32 0, i32 11
  store i32 0, ptr %142, align 4, !tbaa !32
  br label %143

143:                                              ; preds = %139, %138
  br label %144

144:                                              ; preds = %143, %109
  br label %145

145:                                              ; preds = %144, %106
  br label %146

146:                                              ; preds = %145, %26
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ff_memfree(ptr noundef %147)
  %148 = load i32, ptr %6, align 4, !tbaa !9
  %149 = icmp eq i32 %148, 4
  br i1 %149, label %150, label %151

150:                                              ; preds = %146
  store i32 5, ptr %6, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %150, %146
  br label %152

152:                                              ; preds = %151, %13
  %153 = load i32, ptr %6, align 4, !tbaa !9
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %159

155:                                              ; preds = %152
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.DIR, ptr %156, i32 0, i32 0
  %158 = getelementptr inbounds %struct.FFOBJID, ptr %157, i32 0, i32 0
  store ptr null, ptr %158, align 8, !tbaa !11
  br label %159

159:                                              ; preds = %155, %152
  %160 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %160, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %161

161:                                              ; preds = %159, %25, %12
  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 4, ptr %6) #3
  %162 = load i32, ptr %3, align 4
  ret i32 %162
}

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 = !{!17, !7, i64 0}
!22 = !{!12, !10, i64 12}
!23 = !{!12, !10, i64 32}
!24 = !{!12, !15, i64 16}
!25 = !{!12, !7, i64 11}
!26 = !{!12, !10, i64 36}
!27 = !{!12, !10, i64 84}
!28 = !{!12, !10, i64 40}
!29 = !{!12, !6, i64 64}
!30 = !{!17, !14, i64 6}
!31 = !{!12, !14, i64 8}
!32 = !{!12, !10, i64 44}


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

; 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 void @init_alloc_info(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 @inc_share(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @ff_memfree(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @f_opendir(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %68, label %5

5:                                                ; preds = %2
  %6 = call i32 @mount_volume(ptr noundef nonnull %3, ptr noundef nonnull %4, i8 noundef zeroext 0)
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %8, label %.thread54

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

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

19:                                               ; preds = %11
  %20 = getelementptr inbounds i8, ptr %0, i64 83
  %21 = load i8, ptr %20, align 1, !tbaa !18
  %.not43 = icmp sgt i8 %21, -1
  br i1 %.not43, label %22, label %51

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 10
  %24 = load i8, ptr %23, align 2, !tbaa !19
  %25 = and i8 %24, 16
  %.not44 = icmp eq i8 %25, 0
  br i1 %.not44, label %select.unfold, label %26

26:                                               ; preds = %22
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load i8, ptr %27, align 8, !tbaa !20
  %29 = icmp eq i8 %28, 4
  br i1 %29, label %30, label %46

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 12
  %32 = load i32, ptr %31, align 4, !tbaa !21
  %33 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %32, ptr %33, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %0, i64 16
  %35 = load i64, ptr %34, align 8, !tbaa !23
  %36 = trunc i64 %35 to i32
  %37 = and i32 %36, -256
  %38 = getelementptr inbounds i8, ptr %0, i64 11
  %39 = load i8, ptr %38, align 1, !tbaa !24
  %40 = zext i8 %39 to i32
  %41 = or disjoint i32 %37, %40
  %42 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %41, ptr %42, align 4, !tbaa !25
  %43 = getelementptr inbounds i8, ptr %0, i64 84
  %44 = load i32, ptr %43, align 4, !tbaa !26
  %45 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %44, ptr %45, align 8, !tbaa !27
  call void @init_alloc_info(ptr noundef nonnull %27, ptr noundef nonnull %0)
  br label %51

46:                                               ; preds = %26
  %47 = getelementptr inbounds i8, ptr %0, i64 64
  %48 = load ptr, ptr %47, align 8, !tbaa !28
  %49 = call i32 @ld_clust(ptr noundef nonnull %27, ptr noundef %48)
  %50 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %49, ptr %50, align 4, !tbaa !21
  br label %51

51:                                               ; preds = %19, %30, %46
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 6
  %54 = load i16, ptr %53, align 2, !tbaa !29
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  store i16 %54, ptr %55, align 8, !tbaa !30
  %56 = call i32 @dir_sdi(ptr noundef nonnull %0, i32 noundef 0)
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %66

58:                                               ; preds = %51
  %59 = getelementptr inbounds i8, ptr %0, i64 12
  %60 = load i32, ptr %59, align 4, !tbaa !21
  %.not45 = icmp eq i32 %60, 0
  br i1 %.not45, label %64, label %61

61:                                               ; preds = %58
  %62 = call i32 @inc_share(ptr noundef nonnull %0, i32 noundef 0)
  %63 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %62, ptr %63, align 4, !tbaa !31
  %.not46 = icmp eq i32 %62, 0
  br i1 %.not46, label %select.unfold, label %.thread59

64:                                               ; preds = %58
  %65 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 0, ptr %65, align 4, !tbaa !31
  br label %.thread59

66:                                               ; preds = %51, %11
  %.1 = phi i32 [ %56, %51 ], [ %17, %11 ]
  %.1.fr = freeze i32 %.1
  call void @ff_memfree(ptr noundef nonnull %10) #3
  %67 = icmp eq i32 %.1.fr, 4
  %spec.select = select i1 %67, i32 5, i32 %.1.fr
  br label %.thread54

.thread59:                                        ; preds = %61, %64
  call void @ff_memfree(ptr noundef nonnull %10) #3
  br label %68

select.unfold:                                    ; preds = %61, %22
  %.1.ph = phi i32 [ 5, %22 ], [ 18, %61 ]
  call void @ff_memfree(ptr noundef nonnull %10) #3
  br label %.thread54

.thread54:                                        ; preds = %66, %5, %select.unfold
  %.257 = phi i32 [ %.1.ph, %select.unfold ], [ %6, %5 ], [ %spec.select, %66 ]
  store ptr null, ptr %0, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %.thread59, %.thread54, %8, %2
  %.0 = phi i32 [ 9, %2 ], [ 17, %8 ], [ %.257, %.thread54 ], [ 0, %.thread59 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #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, !7, i64 10}
!20 = !{!16, !7, i64 0}
!21 = !{!10, !13, i64 12}
!22 = !{!10, !13, i64 32}
!23 = !{!10, !14, i64 16}
!24 = !{!10, !7, i64 11}
!25 = !{!10, !13, i64 36}
!26 = !{!10, !13, i64 84}
!27 = !{!10, !13, i64 40}
!28 = !{!10, !6, i64 64}
!29 = !{!16, !12, i64 6}
!30 = !{!10, !12, i64 8}
!31 = !{!10, !13, i64 44}


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