; LLVM IR from ryansturmer/thinfat32 :: src (thinfat32)

; 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.struct_TFFILE = type { i32, i32, i32, i32, i16, i16, i32, i8, i8, i8, i32, [256 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local void @tf_release_handle(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_get_fat_entry(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_set_fat_entry(i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @tf_walk(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @tf_get_free_handle() #1

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strchr(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @tf_fnopen(ptr noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca [256 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %13 = call ptr @tf_get_free_handle()
  store ptr %13, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %14 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  store ptr %14, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  store ptr inttoptr (i64 -1 to ptr), ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %156

18:                                               ; preds = %3
  %19 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = call ptr @strncpy(ptr noundef %19, ptr noundef %20, i64 noundef %22) #4
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 %25
  store i8 0, ptr %26, align 1, !tbaa !11
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.struct_TFFILE, ptr %27, i32 0, i32 3
  store i32 2, ptr %28, align 4, !tbaa !12
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.struct_TFFILE, ptr %29, i32 0, i32 1
  store i32 2, ptr %30, align 4, !tbaa !15
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.struct_TFFILE, ptr %31, i32 0, i32 0
  store i32 -1, ptr %32, align 4, !tbaa !16
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.struct_TFFILE, ptr %33, i32 0, i32 2
  store i32 0, ptr %34, align 4, !tbaa !17
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.struct_TFFILE, ptr %35, i32 0, i32 4
  store i16 0, ptr %36, align 4, !tbaa !18
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.struct_TFFILE, ptr %37, i32 0, i32 5
  store i16 0, ptr %38, align 2, !tbaa !19
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.struct_TFFILE, ptr %39, i32 0, i32 8
  store i8 16, ptr %40, align 1, !tbaa !20
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.struct_TFFILE, ptr %41, i32 0, i32 6
  store i32 0, ptr %42, align 4, !tbaa !21
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.struct_TFFILE, ptr %43, i32 0, i32 7
  %45 = load i8, ptr %44, align 4, !tbaa !22
  %46 = zext i8 %45 to i32
  %47 = or i32 %46, 8
  %48 = trunc i32 %47 to i8
  store i8 %48, ptr %44, align 4, !tbaa !22
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.struct_TFFILE, ptr %49, i32 0, i32 10
  store i32 -1, ptr %50, align 4, !tbaa !23
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.struct_TFFILE, ptr %51, i32 0, i32 9
  store i8 11, ptr %52, align 2, !tbaa !24
  br label %53

53:                                               ; preds = %67, %18
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %68

56:                                               ; preds = %53
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = call ptr @tf_walk(ptr noundef %57, ptr noundef %58)
  store ptr %59, ptr %10, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.struct_TFFILE, ptr %60, i32 0, i32 7
  %62 = load i8, ptr %61, align 4, !tbaa !22
  %63 = zext i8 %62 to i32
  %64 = icmp eq i32 %63, 255
  br i1 %64, label %65, label %67

65:                                               ; preds = %56
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tf_release_handle(ptr noundef %66)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %156

67:                                               ; preds = %56
  br label %53, !llvm.loop !25

68:                                               ; preds = %53
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = call ptr @strchr(ptr noundef %69, i32 noundef 114) #5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %79

72:                                               ; preds = %68
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.struct_TFFILE, ptr %73, i32 0, i32 9
  %75 = load i8, ptr %74, align 2, !tbaa !24
  %76 = zext i8 %75 to i32
  %77 = or i32 %76, 1
  %78 = trunc i32 %77 to i8
  store i8 %78, ptr %74, align 2, !tbaa !24
  br label %79

79:                                               ; preds = %72, %68
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call ptr @strchr(ptr noundef %80, i32 noundef 97) #5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %95

83:                                               ; preds = %79
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.struct_TFFILE, ptr %85, i32 0, i32 10
  %87 = load i32, ptr %86, align 4, !tbaa !23
  %88 = call i32 @tf_unsafe_fseek(ptr noundef %84, i32 noundef %87, i64 noundef 0)
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.struct_TFFILE, ptr %89, i32 0, i32 9
  %91 = load i8, ptr %90, align 2, !tbaa !24
  %92 = zext i8 %91 to i32
  %93 = or i32 %92, 10
  %94 = trunc i32 %93 to i8
  store i8 %94, ptr %90, align 2, !tbaa !24
  br label %95

95:                                               ; preds = %83, %79
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = call ptr @strchr(ptr noundef %96, i32 noundef 43) #5
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %106

99:                                               ; preds = %95
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.struct_TFFILE, ptr %100, i32 0, i32 9
  %102 = load i8, ptr %101, align 2, !tbaa !24
  %103 = zext i8 %102 to i32
  %104 = or i32 %103, 10
  %105 = trunc i32 %104 to i8
  store i8 %105, ptr %101, align 2, !tbaa !24
  br label %106

106:                                              ; preds = %99, %95
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = call ptr @strchr(ptr noundef %107, i32 noundef 119) #5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %142

110:                                              ; preds = %106
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.struct_TFFILE, ptr %111, i32 0, i32 8
  %113 = load i8, ptr %112, align 1, !tbaa !20
  %114 = zext i8 %113 to i32
  %115 = and i32 %114, 16
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %135, label %117

117:                                              ; preds = %110
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.struct_TFFILE, ptr %118, i32 0, i32 10
  store i32 0, ptr %119, align 4, !tbaa !23
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = call i32 @tf_unsafe_fseek(ptr noundef %120, i32 noundef 0, i64 noundef 0)
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.struct_TFFILE, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !15
  %125 = call i32 @tf_get_fat_entry(i32 noundef %124)
  store i32 %125, ptr %11, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 268435448
  br i1 %126, label %127, label %134

127:                                              ; preds = %117
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = call i32 @tf_free_clusterchain(i32 noundef %128)
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.struct_TFFILE, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !15
  %133 = call i32 @tf_set_fat_entry(i32 noundef %132, i32 noundef 268435448)
  br label %134

134:                                              ; preds = %127, %117
  br label %135

135:                                              ; preds = %134, %110
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.struct_TFFILE, ptr %136, i32 0, i32 9
  %138 = load i8, ptr %137, align 2, !tbaa !24
  %139 = zext i8 %138 to i32
  %140 = or i32 %139, 2
  %141 = trunc i32 %140 to i8
  store i8 %141, ptr %137, align 2, !tbaa !24
  br label %142

142:                                              ; preds = %135, %106
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.struct_TFFILE, ptr %143, i32 0, i32 11
  %145 = getelementptr inbounds [256 x i8], ptr %144, i64 0, i64 0
  %146 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %147 = load i32, ptr %7, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = call ptr @strncpy(ptr noundef %145, ptr noundef %146, i64 noundef %148) #4
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.struct_TFFILE, ptr %150, i32 0, i32 11
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [256 x i8], ptr %151, i64 0, i64 %153
  store i8 0, ptr %154, align 1, !tbaa !11
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %155, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %156

156:                                              ; preds = %142, %65, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %157 = load ptr, ptr %4, align 8
  ret ptr %157
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_unsafe_fseek(ptr noundef, i32 noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_free_clusterchain(i32 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 = { nounwind willreturn memory(read) "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 "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 12}
!13 = !{!"struct_TFFILE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !14, i64 16, !14, i64 18, !10, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !10, i64 28, !7, i64 32}
!14 = !{!"short", !7, i64 0}
!15 = !{!13, !10, i64 4}
!16 = !{!13, !10, i64 0}
!17 = !{!13, !10, i64 8}
!18 = !{!13, !14, i64 16}
!19 = !{!13, !14, i64 18}
!20 = !{!13, !7, i64 25}
!21 = !{!13, !10, i64 20}
!22 = !{!13, !7, i64 24}
!23 = !{!13, !10, i64 28}
!24 = !{!13, !7, i64 26}
!25 = distinct !{!25, !26}
!26 = !{!"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"

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @tf_release_handle(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_get_fat_entry(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_set_fat_entry(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @tf_walk(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @tf_get_free_handle() local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strchr(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local ptr @tf_fnopen(ptr nocapture noundef readonly %0, ptr noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca [256 x i8], align 16
  %5 = tail call ptr @tf_get_free_handle()
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #4
  %6 = icmp eq ptr %5, null
  br i1 %6, label %64, label %7

7:                                                ; preds = %3
  %8 = sext i32 %2 to i64
  %9 = call ptr @strncpy(ptr noundef nonnull %4, ptr noundef %0, i64 noundef %8) #4
  %10 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %8
  store i8 0, ptr %10, align 1, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %5, i64 4
  store <4 x i32> <i32 -1, i32 2, i32 0, i32 2>, ptr %5, align 4, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %5, i64 16
  store i16 0, ptr %12, align 4, !tbaa !10
  %13 = getelementptr inbounds i8, ptr %5, i64 18
  store i16 0, ptr %13, align 2, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %5, i64 25
  store i8 16, ptr %14, align 1, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %5, i64 20
  store i32 0, ptr %15, align 4, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %5, i64 24
  %17 = load i8, ptr %16, align 4, !tbaa !16
  %18 = or i8 %17, 8
  store i8 %18, ptr %16, align 4, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %5, i64 28
  store i32 -1, ptr %19, align 4, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %5, i64 26
  store i8 11, ptr %20, align 2, !tbaa !18
  br label %21

21:                                               ; preds = %22, %7
  %.041 = phi ptr [ %4, %7 ], [ %23, %22 ]
  %.not = icmp eq ptr %.041, null
  br i1 %.not, label %27, label %22

22:                                               ; preds = %21
  %23 = call ptr @tf_walk(ptr noundef nonnull %.041, ptr noundef nonnull %5)
  %24 = load i8, ptr %16, align 4, !tbaa !16
  %25 = icmp eq i8 %24, -1
  br i1 %25, label %26, label %21, !llvm.loop !19

26:                                               ; preds = %22
  call void @tf_release_handle(ptr noundef nonnull %5)
  br label %64

27:                                               ; preds = %21
  %28 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %1, i32 noundef 114) #5
  %.not44 = icmp eq ptr %28, null
  br i1 %.not44, label %32, label %29

29:                                               ; preds = %27
  %30 = load i8, ptr %20, align 2, !tbaa !18
  %31 = or i8 %30, 1
  store i8 %31, ptr %20, align 2, !tbaa !18
  br label %32

32:                                               ; preds = %29, %27
  %33 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %1, i32 noundef 97) #5
  %.not45 = icmp eq ptr %33, null
  br i1 %.not45, label %39, label %34

34:                                               ; preds = %32
  %35 = load i32, ptr %19, align 4, !tbaa !17
  %36 = call i32 @tf_unsafe_fseek(ptr noundef nonnull %5, i32 noundef %35, i64 noundef 0)
  %37 = load i8, ptr %20, align 2, !tbaa !18
  %38 = or i8 %37, 10
  store i8 %38, ptr %20, align 2, !tbaa !18
  br label %39

39:                                               ; preds = %34, %32
  %40 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %1, i32 noundef 43) #5
  %.not46 = icmp eq ptr %40, null
  br i1 %.not46, label %44, label %41

41:                                               ; preds = %39
  %42 = load i8, ptr %20, align 2, !tbaa !18
  %43 = or i8 %42, 10
  store i8 %43, ptr %20, align 2, !tbaa !18
  br label %44

44:                                               ; preds = %41, %39
  %45 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %1, i32 noundef 119) #5
  %.not47 = icmp eq ptr %45, null
  br i1 %.not47, label %60, label %46

46:                                               ; preds = %44
  %47 = load i8, ptr %14, align 1, !tbaa !14
  %48 = and i8 %47, 16
  %.not48 = icmp eq i8 %48, 0
  br i1 %.not48, label %49, label %57

49:                                               ; preds = %46
  store i32 0, ptr %19, align 4, !tbaa !17
  %50 = call i32 @tf_unsafe_fseek(ptr noundef nonnull %5, i32 noundef 0, i64 noundef 0)
  %51 = load i32, ptr %11, align 4, !tbaa !21
  %52 = call i32 @tf_get_fat_entry(i32 noundef %51)
  %.not49 = icmp eq i32 %52, 268435448
  br i1 %.not49, label %57, label %53

53:                                               ; preds = %49
  %54 = call i32 @tf_free_clusterchain(i32 noundef %52)
  %55 = load i32, ptr %11, align 4, !tbaa !21
  %56 = call i32 @tf_set_fat_entry(i32 noundef %55, i32 noundef 268435448)
  br label %57

57:                                               ; preds = %49, %53, %46
  %58 = load i8, ptr %20, align 2, !tbaa !18
  %59 = or i8 %58, 2
  store i8 %59, ptr %20, align 2, !tbaa !18
  br label %60

60:                                               ; preds = %57, %44
  %61 = getelementptr inbounds i8, ptr %5, i64 32
  %62 = call ptr @strncpy(ptr noundef nonnull %61, ptr noundef nonnull %4, i64 noundef %8) #4
  %63 = getelementptr inbounds [256 x i8], ptr %61, i64 0, i64 %8
  store i8 0, ptr %63, align 1, !tbaa !5
  br label %64

64:                                               ; preds = %3, %60, %26
  %.0 = phi ptr [ null, %26 ], [ %5, %60 ], [ inttoptr (i64 -1 to ptr), %3 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #4
  ret ptr %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_unsafe_fseek(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tf_free_clusterchain(i32 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !12, i64 16}
!11 = !{!"struct_TFFILE", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !12, i64 16, !12, i64 18, !9, i64 20, !6, i64 24, !6, i64 25, !6, i64 26, !9, i64 28, !6, i64 32}
!12 = !{!"short", !6, i64 0}
!13 = !{!11, !12, i64 18}
!14 = !{!11, !6, i64 25}
!15 = !{!11, !9, i64 20}
!16 = !{!11, !6, i64 24}
!17 = !{!11, !9, i64 28}
!18 = !{!11, !6, i64 26}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!11, !9, i64 4}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass