; LLVM IR from IOsonata/IOsonata :: fatfs (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, i32, ptr, [12 x i8], ptr }
%struct.FFOBJID = type { ptr, i16, i8, i8, i32, i32 }
%struct.FATFS = type { i8, i8, i8, i8, i8, i16, i16, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

13:                                               ; preds = %1
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.DIR, ptr %4, 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 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = call i32 @follow_path(ptr noundef %4, ptr noundef %17)
  store i32 %18, ptr %3, align 4, !tbaa !9
  %19 = load i32, ptr %3, align 4, !tbaa !9
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %13
  store i32 8, ptr %3, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %21, %13
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 4
  br i1 %24, label %25, label %33

25:                                               ; preds = %22
  %26 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 5
  %27 = getelementptr inbounds [12 x i8], ptr %26, i64 0, i64 11
  %28 = load i8, ptr %27, align 1, !tbaa !15
  %29 = zext i8 %28 to i32
  %30 = and i32 %29, 32
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %25
  store i32 6, ptr %3, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %32, %25, %22
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = icmp eq i32 %34, 4
  br i1 %35, label %36, label %131

36:                                               ; preds = %33
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.FFOBJID, ptr %5, i32 0, i32 0
  store ptr %37, ptr %38, align 8, !tbaa !16
  %39 = call i32 @create_chain(ptr noundef %5, i32 noundef 0)
  store i32 %39, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  store i32 7, ptr %3, align 4, !tbaa !9
  br label %43

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

46:                                               ; preds = %43
  store i32 2, ptr %3, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %46, %43
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %50, %47
  store i32 1344339968, ptr %9, align 4, !tbaa !9
  %52 = load i32, ptr %3, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %104

54:                                               ; preds = %51
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = call i32 @dir_clear(ptr noundef %55, i32 noundef %56)
  store i32 %57, ptr %3, align 4, !tbaa !9
  %58 = load i32, ptr %3, align 4, !tbaa !9
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %103

60:                                               ; preds = %54
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.FATFS, ptr %61, i32 0, i32 18
  %63 = getelementptr inbounds [512 x i8], ptr %62, i64 0, i64 0
  %64 = getelementptr inbounds i8, ptr %63, i64 0
  call void @llvm.memset.p0.i64(ptr align 1 %64, i8 32, i64 11, i1 false)
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.FATFS, ptr %65, i32 0, i32 18
  %67 = getelementptr inbounds [512 x i8], ptr %66, i64 0, i64 0
  store i8 46, ptr %67, align 4, !tbaa !15
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.FATFS, ptr %68, i32 0, i32 18
  %70 = getelementptr inbounds [512 x i8], ptr %69, i64 0, i64 11
  store i8 16, ptr %70, align 1, !tbaa !15
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.FATFS, ptr %71, i32 0, i32 18
  %73 = getelementptr inbounds [512 x i8], ptr %72, i64 0, i64 0
  %74 = getelementptr inbounds i8, ptr %73, i64 22
  %75 = load i32, ptr %9, align 4, !tbaa !9
  call void @st_dword(ptr noundef %74, i32 noundef %75)
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.FATFS, ptr %77, i32 0, i32 18
  %79 = getelementptr inbounds [512 x i8], ptr %78, i64 0, i64 0
  %80 = load i32, ptr %7, align 4, !tbaa !9
  call void @st_clust(ptr noundef %76, ptr noundef %79, i32 noundef %80)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.FATFS, ptr %81, i32 0, i32 18
  %83 = getelementptr inbounds [512 x i8], ptr %82, i64 0, i64 0
  %84 = getelementptr inbounds i8, ptr %83, i64 32
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.FATFS, ptr %85, i32 0, i32 18
  %87 = getelementptr inbounds [512 x i8], ptr %86, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %84, ptr align 4 %87, i64 32, i1 false)
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FATFS, ptr %88, i32 0, i32 18
  %90 = getelementptr inbounds [512 x i8], ptr %89, i64 0, i64 33
  store i8 46, ptr %90, align 1, !tbaa !15
  %91 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 0
  %92 = getelementptr inbounds %struct.FFOBJID, ptr %91, i32 0, i32 4
  %93 = load i32, ptr %92, align 4, !tbaa !17
  store i32 %93, ptr %8, align 4, !tbaa !9
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.FATFS, ptr %95, i32 0, i32 18
  %97 = getelementptr inbounds [512 x i8], ptr %96, i64 0, i64 0
  %98 = getelementptr inbounds i8, ptr %97, i64 32
  %99 = load i32, ptr %8, align 4, !tbaa !9
  call void @st_clust(ptr noundef %94, ptr noundef %98, i32 noundef %99)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.FATFS, ptr %100, i32 0, i32 3
  store i8 1, ptr %101, align 1, !tbaa !18
  %102 = call i32 @dir_register(ptr noundef %4)
  store i32 %102, ptr %3, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %60, %54
  br label %104

104:                                              ; preds = %103, %51
  %105 = load i32, ptr %3, align 4, !tbaa !9
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %107, label %127

107:                                              ; preds = %104
  %108 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !20
  %110 = getelementptr inbounds i8, ptr %109, i64 22
  %111 = load i32, ptr %9, align 4, !tbaa !9
  call void @st_dword(ptr noundef %110, i32 noundef %111)
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 4
  %114 = load ptr, ptr %113, align 8, !tbaa !20
  %115 = load i32, ptr %7, align 4, !tbaa !9
  call void @st_clust(ptr noundef %112, ptr noundef %114, i32 noundef %115)
  %116 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 4
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = getelementptr inbounds i8, ptr %117, i64 11
  store i8 16, ptr %118, align 1, !tbaa !15
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.FATFS, ptr %119, i32 0, i32 3
  store i8 1, ptr %120, align 1, !tbaa !18
  %121 = load i32, ptr %3, align 4, !tbaa !9
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %126

123:                                              ; preds = %107
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = call i32 @sync_fs(ptr noundef %124)
  store i32 %125, ptr %3, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %123, %107
  br label %130

127:                                              ; preds = %104
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = call i32 @remove_chain(ptr noundef %5, i32 noundef %128, i32 noundef 0)
  br label %130

130:                                              ; preds = %127, %126
  br label %131

131:                                              ; preds = %130, %33
  br label %132

132:                                              ; preds = %131, %1
  %133 = load i32, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret i32 %133
}

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_clear(ptr noundef, 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !13, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !7, i64 48, !6, i64 64}
!13 = !{!"", !6, i64 0, !14, i64 8, !7, i64 10, !7, i64 11, !10, i64 12, !10, i64 16}
!14 = !{!"short", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!13, !6, i64 0}
!17 = !{!12, !10, i64 12}
!18 = !{!19, !7, i64 3}
!19 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !14, i64 6, !14, i64 8, !14, i64 10, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 52}
!20 = !{!12, !6, i64 40}


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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @st_clust(ptr noundef, ptr noundef, i32 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

8:                                                ; preds = %1
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %9, ptr %3, align 8, !tbaa !9
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = call i32 @follow_path(ptr noundef nonnull %3, ptr noundef %10)
  %12 = icmp eq i32 %11, 0
  %spec.store.select = select i1 %12, i32 8, i32 %11
  %13 = icmp eq i32 %spec.store.select, 4
  %14 = getelementptr inbounds i8, ptr %3, i64 59
  %15 = load i8, ptr %14, align 1
  %16 = and i8 %15, 32
  %.not = icmp eq i8 %16, 0
  %spec.select = select i1 %.not, i32 4, i32 6
  %.0 = select i1 %13, i32 %spec.select, i32 %spec.store.select
  %17 = select i1 %13, i1 %.not, i1 false
  br i1 %17, label %18, label %59

18:                                               ; preds = %8
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %19, ptr %4, align 8, !tbaa !14
  %20 = call i32 @create_chain(ptr noundef nonnull %4, i32 noundef 0)
  %21 = icmp eq i32 %20, 0
  %spec.store.select1 = select i1 %21, i32 7, i32 0
  %22 = icmp eq i32 %20, 1
  %spec.store.select2 = select i1 %22, i32 2, i32 %spec.store.select1
  %23 = icmp eq i32 %20, -1
  %spec.store.select3 = select i1 %23, i32 1, i32 %spec.store.select2
  %24 = icmp eq i32 %spec.store.select3, 0
  br i1 %24, label %25, label %.thread

25:                                               ; preds = %18
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call i32 @dir_clear(ptr noundef %26, i32 noundef %20)
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %.thread

29:                                               ; preds = %25
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 52
  %32 = getelementptr inbounds i8, ptr %30, i64 53
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(11) %32, i8 32, i64 10, i1 false)
  store i8 46, ptr %31, align 4, !tbaa !15
  %33 = getelementptr inbounds i8, ptr %30, i64 63
  store i8 16, ptr %33, align 1, !tbaa !15
  %34 = getelementptr inbounds i8, ptr %30, i64 74
  call void @st_dword(ptr noundef nonnull %34, i32 noundef 1344339968)
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 52
  call void @st_clust(ptr noundef %35, ptr noundef nonnull %36, i32 noundef %20)
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 52
  %39 = getelementptr inbounds i8, ptr %37, i64 84
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %39, ptr noundef nonnull align 4 dereferenceable(32) %38, i64 32, i1 false)
  %40 = getelementptr inbounds i8, ptr %37, i64 85
  store i8 46, ptr %40, align 1, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %3, i64 12
  %42 = load i32, ptr %41, align 4, !tbaa !16
  call void @st_clust(ptr noundef %37, ptr noundef nonnull %39, i32 noundef %42)
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 3
  store i8 1, ptr %44, align 1, !tbaa !17
  %45 = call i32 @dir_register(ptr noundef nonnull %3)
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %.thread

47:                                               ; preds = %29
  %48 = getelementptr inbounds i8, ptr %3, i64 40
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = getelementptr inbounds i8, ptr %49, i64 22
  call void @st_dword(ptr noundef nonnull %50, i32 noundef 1344339968)
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr %48, align 8, !tbaa !19
  call void @st_clust(ptr noundef %51, ptr noundef %52, i32 noundef %20)
  %53 = load ptr, ptr %48, align 8, !tbaa !19
  %54 = getelementptr inbounds i8, ptr %53, i64 11
  store i8 16, ptr %54, align 1, !tbaa !15
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 3
  store i8 1, ptr %56, align 1, !tbaa !17
  %57 = call i32 @sync_fs(ptr noundef %55)
  br label %59

.thread:                                          ; preds = %18, %25, %29
  %.125 = phi i32 [ %45, %29 ], [ %spec.store.select3, %18 ], [ %27, %25 ]
  %58 = call i32 @remove_chain(ptr noundef nonnull %4, i32 noundef %20, i32 noundef 0)
  br label %59

59:                                               ; preds = %8, %47, %.thread, %1
  %.2 = phi i32 [ %57, %47 ], [ %.125, %.thread ], [ %.0, %8 ], [ %6, %1 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #4
  ret i32 %.2
}

; Function Attrs: nounwind uwtable
declare hidden i32 @dir_clear(ptr noundef, 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !11, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !6, i64 40, !7, i64 48, !6, i64 64}
!11 = !{!"", !6, i64 0, !12, i64 8, !7, i64 10, !7, i64 11, !13, i64 12, !13, i64 16}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!11, !6, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!10, !13, i64 12}
!17 = !{!18, !7, i64 3}
!18 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !12, i64 6, !12, i64 8, !12, i64 10, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !7, i64 52}
!19 = !{!10, !6, i64 40}


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