; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Middlewares/Third_Party/FatFs/src (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._FDID, i64, i64, i64, ptr, [12 x i8], i64 }
%struct._FDID = type { ptr, i16, i8, i8, i64, i64 }
%struct.FATFS = type { i8, i8, i8, i8, i8, i16, i16, i16, ptr, i64, i64, i64, 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 @find_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

declare i64 @get_fattime() #2

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i64 @create_chain(ptr noundef, i64 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 ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 88, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %12 = call i32 @find_volume(ptr noundef %2, ptr noundef %5, i8 noundef zeroext 2)
  store i32 %12, ptr %3, align 4, !tbaa !9
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 0
  %15 = getelementptr inbounds %struct._FDID, ptr %14, i32 0, i32 0
  store ptr %13, ptr %15, align 8, !tbaa !11
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %161

18:                                               ; preds = %1
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = call i32 @follow_path(ptr noundef %4, ptr noundef %19)
  store i32 %20, ptr %3, align 4, !tbaa !9
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %18
  store i32 8, ptr %3, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %23, %18
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 4
  br i1 %26, label %27, label %160

27:                                               ; preds = %24
  %28 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 0
  %29 = call i64 @create_chain(ptr noundef %28, i64 noundef 0)
  store i64 %29, ptr %9, align 8, !tbaa !16
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.FATFS, ptr %30, i32 0, i32 7
  %32 = load i16, ptr %31, align 2, !tbaa !17
  %33 = zext i16 %32 to i64
  %34 = mul i64 %33, 512
  %35 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 0
  %36 = getelementptr inbounds %struct._FDID, ptr %35, i32 0, i32 5
  store i64 %34, ptr %36, align 8, !tbaa !19
  store i32 0, ptr %3, align 4, !tbaa !9
  %37 = load i64, ptr %9, align 8, !tbaa !16
  %38 = icmp eq i64 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %27
  store i32 7, ptr %3, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %39, %27
  %41 = load i64, ptr %9, align 8, !tbaa !16
  %42 = icmp eq i64 %41, 1
  br i1 %42, label %43, label %44

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

44:                                               ; preds = %43, %40
  %45 = load i64, ptr %9, align 8, !tbaa !16
  %46 = icmp eq i64 %45, 4294967295
  br i1 %46, label %47, label %48

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

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

51:                                               ; preds = %48
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = call i32 @sync_window(ptr noundef %52)
  store i32 %53, ptr %3, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %51, %48
  %55 = call i64 @get_fattime()
  store i64 %55, ptr %11, align 8, !tbaa !16
  %56 = load i32, ptr %3, align 4, !tbaa !9
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %128

58:                                               ; preds = %54
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load i64, ptr %9, align 8, !tbaa !16
  %61 = call i64 @clust2sect(ptr noundef %59, i64 noundef %60)
  store i64 %61, ptr %8, align 8, !tbaa !16
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.FATFS, ptr %62, i32 0, i32 18
  %64 = getelementptr inbounds [512 x i8], ptr %63, i64 0, i64 0
  store ptr %64, ptr %6, align 8, !tbaa !5
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mem_set(ptr noundef %65, i32 noundef 0, i32 noundef 512)
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 0
  call void @mem_set(ptr noundef %67, i32 noundef 32, i32 noundef 11)
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 0
  store i8 46, ptr %69, align 1, !tbaa !20
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 11
  store i8 16, ptr %71, align 1, !tbaa !20
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 22
  %74 = load i64, ptr %11, align 8, !tbaa !16
  call void @st_dword(ptr noundef %73, i64 noundef %74)
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load i64, ptr %9, align 8, !tbaa !16
  call void @st_clust(ptr noundef %75, ptr noundef %76, i64 noundef %77)
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 32
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mem_cpy(ptr noundef %79, ptr noundef %80, i32 noundef 32)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 33
  store i8 46, ptr %82, align 1, !tbaa !20
  %83 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 0
  %84 = getelementptr inbounds %struct._FDID, ptr %83, i32 0, i32 4
  %85 = load i64, ptr %84, align 8, !tbaa !21
  store i64 %85, ptr %10, align 8, !tbaa !16
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.FATFS, ptr %86, i32 0, i32 0
  %88 = load i8, ptr %87, align 8, !tbaa !22
  %89 = zext i8 %88 to i32
  %90 = icmp eq i32 %89, 3
  br i1 %90, label %91, label %98

91:                                               ; preds = %58
  %92 = load i64, ptr %10, align 8, !tbaa !16
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.FATFS, ptr %93, i32 0, i32 15
  %95 = load i64, ptr %94, align 8, !tbaa !23
  %96 = icmp eq i64 %92, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %91
  store i64 0, ptr %10, align 8, !tbaa !16
  br label %98

98:                                               ; preds = %97, %91, %58
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 32
  %102 = load i64, ptr %10, align 8, !tbaa !16
  call void @st_clust(ptr noundef %99, ptr noundef %101, i64 noundef %102)
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.FATFS, ptr %103, i32 0, i32 7
  %105 = load i16, ptr %104, align 2, !tbaa !17
  %106 = zext i16 %105 to i32
  store i32 %106, ptr %7, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %124, %98
  %108 = load i32, ptr %7, align 4, !tbaa !9
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %127

110:                                              ; preds = %107
  %111 = load i64, ptr %8, align 8, !tbaa !16
  %112 = add i64 %111, 1
  store i64 %112, ptr %8, align 8, !tbaa !16
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.FATFS, ptr %113, i32 0, i32 17
  store i64 %111, ptr %114, align 8, !tbaa !24
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.FATFS, ptr %115, i32 0, i32 3
  store i8 1, ptr %116, align 1, !tbaa !25
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = call i32 @sync_window(ptr noundef %117)
  store i32 %118, ptr %3, align 4, !tbaa !9
  %119 = load i32, ptr %3, align 4, !tbaa !9
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %110
  br label %127

122:                                              ; preds = %110
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mem_set(ptr noundef %123, i32 noundef 0, i32 noundef 512)
  br label %124

124:                                              ; preds = %122
  %125 = load i32, ptr %7, align 4, !tbaa !9
  %126 = add i32 %125, -1
  store i32 %126, ptr %7, align 4, !tbaa !9
  br label %107, !llvm.loop !26

127:                                              ; preds = %121, %107
  br label %128

128:                                              ; preds = %127, %54
  %129 = load i32, ptr %3, align 4, !tbaa !9
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %133

131:                                              ; preds = %128
  %132 = call i32 @dir_register(ptr noundef %4)
  store i32 %132, ptr %3, align 4, !tbaa !9
  br label %133

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

136:                                              ; preds = %133
  %137 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 4
  %138 = load ptr, ptr %137, align 8, !tbaa !28
  store ptr %138, ptr %6, align 8, !tbaa !5
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 22
  %141 = load i64, ptr %11, align 8, !tbaa !16
  call void @st_dword(ptr noundef %140, i64 noundef %141)
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = load i64, ptr %9, align 8, !tbaa !16
  call void @st_clust(ptr noundef %142, ptr noundef %143, i64 noundef %144)
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 11
  store i8 16, ptr %146, align 1, !tbaa !20
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.FATFS, ptr %147, i32 0, i32 3
  store i8 1, ptr %148, align 1, !tbaa !25
  %149 = load i32, ptr %3, align 4, !tbaa !9
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %151, label %154

151:                                              ; preds = %136
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = call i32 @sync_fs(ptr noundef %152)
  store i32 %153, ptr %3, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %151, %136
  br label %159

155:                                              ; preds = %133
  %156 = getelementptr inbounds %struct.DIR, ptr %4, i32 0, i32 0
  %157 = load i64, ptr %9, align 8, !tbaa !16
  %158 = call i32 @remove_chain(ptr noundef %156, i64 noundef %157, i64 noundef 0)
  br label %159

159:                                              ; preds = %155, %154
  br label %160

160:                                              ; preds = %159, %24
  br label %161

161:                                              ; preds = %160, %1
  %162 = load i32, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 88, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret i32 %162
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !13, i64 0, !15, i64 32, !15, i64 40, !15, i64 48, !6, i64 56, !7, i64 64, !15, i64 80}
!13 = !{!"", !6, i64 0, !14, i64 8, !7, i64 10, !7, i64 11, !15, i64 16, !15, i64 24}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!18, !14, i64 10}
!18 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !14, i64 6, !14, i64 8, !14, i64 10, !6, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !7, i64 96}
!19 = !{!12, !15, i64 24}
!20 = !{!7, !7, i64 0}
!21 = !{!12, !15, i64 16}
!22 = !{!18, !7, i64 0}
!23 = !{!18, !15, i64 72}
!24 = !{!18, !15, i64 88}
!25 = !{!18, !7, i64 3}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!12, !6, i64 56}


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

; 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 @find_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

declare i64 @get_fattime() local_unnamed_addr #2

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i64 @create_chain(ptr noundef, i64 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 ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = call i32 @find_volume(ptr noundef nonnull %2, ptr noundef nonnull %4, i8 noundef zeroext 2)
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %6, ptr %3, align 8, !tbaa !9
  %7 = icmp eq i32 %5, 0
  br i1 %7, label %8, label %73

8:                                                ; preds = %1
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call i32 @follow_path(ptr noundef nonnull %3, ptr noundef %9)
  %11 = icmp eq i32 %10, 0
  %spec.store.select = select i1 %11, i32 8, i32 %10
  %12 = icmp eq i32 %spec.store.select, 4
  br i1 %12, label %13, label %73

13:                                               ; preds = %8
  %14 = call i64 @create_chain(ptr noundef nonnull %3, i64 noundef 0)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 10
  %17 = load i16, ptr %16, align 2, !tbaa !14
  %18 = zext i16 %17 to i64
  %19 = shl nuw nsw i64 %18, 9
  %20 = getelementptr inbounds i8, ptr %3, i64 24
  store i64 %19, ptr %20, align 8, !tbaa !16
  %21 = icmp eq i64 %14, 0
  %spec.store.select1 = select i1 %21, i32 7, i32 0
  %22 = icmp eq i64 %14, 1
  %spec.store.select3 = select i1 %22, i32 2, i32 %spec.store.select1
  %23 = icmp eq i64 %14, 4294967295
  %spec.store.select4 = select i1 %23, i32 1, i32 %spec.store.select3
  %24 = icmp eq i32 %spec.store.select4, 0
  br i1 %24, label %26, label %.thread

.thread:                                          ; preds = %13
  %25 = call i64 @get_fattime() #3
  br label %.thread51

26:                                               ; preds = %13
  %27 = call i32 @sync_window(ptr noundef nonnull %15)
  %28 = call i64 @get_fattime() #3
  %29 = icmp eq i32 %27, 0
  br i1 %29, label %30, label %.thread51

30:                                               ; preds = %26
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call i64 @clust2sect(ptr noundef %31, i64 noundef %14)
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 96
  call void @mem_set(ptr noundef nonnull %34, i32 noundef 0, i32 noundef 512)
  call void @mem_set(ptr noundef nonnull %34, i32 noundef 32, i32 noundef 11)
  store i8 46, ptr %34, align 1, !tbaa !17
  %35 = getelementptr inbounds i8, ptr %33, i64 107
  store i8 16, ptr %35, align 1, !tbaa !17
  %36 = getelementptr inbounds i8, ptr %33, i64 118
  call void @st_dword(ptr noundef nonnull %36, i64 noundef %28)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  call void @st_clust(ptr noundef %37, ptr noundef nonnull %34, i64 noundef %14)
  %38 = getelementptr inbounds i8, ptr %33, i64 128
  call void @mem_cpy(ptr noundef nonnull %38, ptr noundef nonnull %34, i32 noundef 32)
  %39 = getelementptr inbounds i8, ptr %33, i64 129
  store i8 46, ptr %39, align 1, !tbaa !17
  %40 = getelementptr inbounds i8, ptr %3, i64 16
  %41 = load i64, ptr %40, align 8, !tbaa !18
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load i8, ptr %42, align 8, !tbaa !19
  %44 = icmp eq i8 %43, 3
  br i1 %44, label %45, label %49

45:                                               ; preds = %30
  %46 = getelementptr inbounds i8, ptr %42, i64 72
  %47 = load i64, ptr %46, align 8, !tbaa !20
  %48 = icmp eq i64 %41, %47
  %spec.store.select2 = select i1 %48, i64 0, i64 %41
  br label %49

49:                                               ; preds = %45, %30
  %.041 = phi i64 [ %spec.store.select2, %45 ], [ %41, %30 ]
  call void @st_clust(ptr noundef nonnull %42, ptr noundef nonnull %38, i64 noundef %.041)
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 10
  %52 = load i16, ptr %51, align 2, !tbaa !14
  %.not54 = icmp eq i16 %52, 0
  br i1 %.not54, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %49
  %53 = zext i16 %52 to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %58
  %.04256 = phi i64 [ %59, %58 ], [ %32, %.lr.ph.preheader ]
  %.04355 = phi i32 [ %60, %58 ], [ %53, %.lr.ph.preheader ]
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 88
  store i64 %.04256, ptr %55, align 8, !tbaa !21
  %56 = getelementptr inbounds i8, ptr %54, i64 3
  store i8 1, ptr %56, align 1, !tbaa !22
  %57 = call i32 @sync_window(ptr noundef %54)
  %.not47 = icmp eq i32 %57, 0
  br i1 %.not47, label %58, label %.thread51

58:                                               ; preds = %.lr.ph
  %59 = add i64 %.04256, 1
  call void @mem_set(ptr noundef nonnull %34, i32 noundef 0, i32 noundef 512)
  %60 = add nsw i32 %.04355, -1
  %.not = icmp eq i32 %60, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %58, %49
  %61 = call i32 @dir_register(ptr noundef nonnull %3)
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %.thread51

63:                                               ; preds = %._crit_edge
  %64 = getelementptr inbounds i8, ptr %3, i64 56
  %65 = load ptr, ptr %64, align 8, !tbaa !25
  %66 = getelementptr inbounds i8, ptr %65, i64 22
  call void @st_dword(ptr noundef nonnull %66, i64 noundef %28)
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  call void @st_clust(ptr noundef %67, ptr noundef %65, i64 noundef %14)
  %68 = getelementptr inbounds i8, ptr %65, i64 11
  store i8 16, ptr %68, align 1, !tbaa !17
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 3
  store i8 1, ptr %70, align 1, !tbaa !22
  %71 = call i32 @sync_fs(ptr noundef %69)
  br label %73

.thread51:                                        ; preds = %.lr.ph, %26, %.thread, %._crit_edge
  %.353 = phi i32 [ %61, %._crit_edge ], [ %spec.store.select4, %.thread ], [ %27, %26 ], [ %57, %.lr.ph ]
  %72 = call i32 @remove_chain(ptr noundef nonnull %3, i64 noundef %14, i64 noundef 0)
  br label %73

73:                                               ; preds = %8, %63, %.thread51, %1
  %.4 = phi i32 [ %71, %63 ], [ %.353, %.thread51 ], [ %spec.store.select, %8 ], [ %5, %1 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #3
  ret i32 %.4
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !11, i64 0, !13, i64 32, !13, i64 40, !13, i64 48, !6, i64 56, !7, i64 64, !13, i64 80}
!11 = !{!"", !6, i64 0, !12, i64 8, !7, i64 10, !7, i64 11, !13, i64 16, !13, i64 24}
!12 = !{!"short", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !12, i64 10}
!15 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !12, i64 6, !12, i64 8, !12, i64 10, !6, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !7, i64 96}
!16 = !{!10, !13, i64 24}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !13, i64 16}
!19 = !{!15, !7, i64 0}
!20 = !{!15, !13, i64 72}
!21 = !{!15, !13, i64 88}
!22 = !{!15, !7, i64 3}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !6, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass