; LLVM IR from erthink/libmdbx :: src (osal)

; 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.statvfs = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, [6 x i32] }
%struct.statfs = type { i64, i64, i64, i64, i64, i64, i64, %struct.__fsid_t, i64, i64, i64, [4 x i64] }
%struct.__fsid_t = type { [2 x i32] }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.mntent = type { ptr, ptr, ptr, ptr, i32, i32 }

@.str.26 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #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
declare i32 @stat64(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fstat64(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fstatvfs64(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fstatfs64(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @osal_check_fs_local(i32 noundef %0, i32 noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.statvfs, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.statfs, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.stat, align 8
  %13 = alloca [4096 x i8], align 16
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.mntent, align 8
  %17 = alloca i8, align 1
  %18 = alloca %struct.stat, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 112, ptr %6) #5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = call i32 @fstatvfs64(i32 noundef %19, ptr noundef %6) #5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %25

22:                                               ; preds = %2
  %23 = call ptr @__errno_location() #6
  %24 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %24, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %161

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 120, ptr %8) #5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = call i32 @fstatfs64(i32 noundef %26, ptr noundef %8) #5
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  %30 = call ptr @__errno_location() #6
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %160

32:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %33 = getelementptr inbounds %struct.statfs, ptr %8, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = trunc i64 %34 to i32
  store i32 %35, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr @.str.26, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 144, ptr %12) #5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = call i32 @fstat64(i32 noundef %36, ptr noundef %12) #5
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %32
  %40 = call ptr @__errno_location() #6
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %159

42:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4096, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !13
  %43 = call ptr @setmntent(ptr noundef @.str.27, ptr noundef @.str.28) #5
  store ptr %43, ptr %14, align 8, !tbaa !13
  %44 = load ptr, ptr %14, align 8, !tbaa !13
  %45 = icmp ne ptr %44, null
  br i1 %45, label %48, label %46

46:                                               ; preds = %42
  %47 = call ptr @setmntent(ptr noundef @.str.29, ptr noundef @.str.28) #5
  store ptr %47, ptr %14, align 8, !tbaa !13
  br label %48

48:                                               ; preds = %46, %42
  %49 = load ptr, ptr %14, align 8, !tbaa !13
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %83

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  store i8 0, ptr %17, align 1, !tbaa !15
  br label %52

52:                                               ; preds = %79, %51
  %53 = load ptr, ptr %14, align 8, !tbaa !13
  %54 = getelementptr inbounds [4096 x i8], ptr %13, i64 0, i64 0
  %55 = call ptr @getmntent_r(ptr noundef %53, ptr noundef %16, ptr noundef %54, i32 noundef 4096) #5
  store ptr %55, ptr %15, align 8, !tbaa !13
  %56 = icmp ne ptr null, %55
  br i1 %56, label %57, label %80

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 144, ptr %18) #5
  %58 = load ptr, ptr %15, align 8, !tbaa !13
  %59 = getelementptr inbounds %struct.mntent, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = call i32 @stat64(ptr noundef %60, ptr noundef %18) #5
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %76, label %63

63:                                               ; preds = %57
  %64 = getelementptr inbounds %struct.stat, ptr %18, i32 0, i32 0
  %65 = load i64, ptr %64, align 8, !tbaa !19
  %66 = getelementptr inbounds %struct.stat, ptr %12, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !19
  %68 = icmp eq i64 %65, %67
  br i1 %68, label %69, label %76

69:                                               ; preds = %63
  %70 = load ptr, ptr %15, align 8, !tbaa !13
  %71 = getelementptr inbounds %struct.mntent, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !22
  store ptr %72, ptr %10, align 8, !tbaa !13
  %73 = load ptr, ptr %10, align 8, !tbaa !13
  %74 = call i64 @strlen(ptr noundef %73) #7
  %75 = trunc i64 %74 to i32
  store i32 %75, ptr %11, align 4, !tbaa !5
  store i32 3, ptr %7, align 4
  br label %77

76:                                               ; preds = %63, %57
  store i32 0, ptr %7, align 4
  br label %77

77:                                               ; preds = %76, %69
  call void @llvm.lifetime.end.p0(i64 144, ptr %18) #5
  %78 = load i32, ptr %7, align 4
  switch i32 %78, label %163 [
    i32 0, label %79
    i32 3, label %80
  ]

79:                                               ; preds = %77
  br label %52, !llvm.loop !23

80:                                               ; preds = %77, %52
  %81 = load ptr, ptr %14, align 8, !tbaa !13
  %82 = call i32 @endmntent(ptr noundef %81) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %83

83:                                               ; preds = %80, %48
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %147

86:                                               ; preds = %83
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = icmp ugt i32 %87, 2
  br i1 %88, label %89, label %93

89:                                               ; preds = %86
  %90 = load ptr, ptr %10, align 8, !tbaa !13
  %91 = call i32 @strncasecmp(ptr noundef @.str.30, ptr noundef %90, i64 noundef 3) #7
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %128, label %93

93:                                               ; preds = %89, %86
  %94 = load ptr, ptr %10, align 8, !tbaa !13
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = zext i32 %95 to i64
  %97 = call i32 @strncasecmp(ptr noundef @.str.31, ptr noundef %94, i64 noundef %96) #7
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %128, label %99

99:                                               ; preds = %93
  %100 = load ptr, ptr %10, align 8, !tbaa !13
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = zext i32 %101 to i64
  %103 = call i32 @strncasecmp(ptr noundef @.str.32, ptr noundef %100, i64 noundef %102) #7
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %128, label %105

105:                                              ; preds = %99
  %106 = load ptr, ptr %10, align 8, !tbaa !13
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = zext i32 %107 to i64
  %109 = call i32 @strncasecmp(ptr noundef @.str.33, ptr noundef %106, i64 noundef %108) #7
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %128, label %111

111:                                              ; preds = %105
  %112 = load ptr, ptr %10, align 8, !tbaa !13
  %113 = call i32 @strcasecmp(ptr noundef @.str.34, ptr noundef %112) #7
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %128, label %115

115:                                              ; preds = %111
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = icmp ugt i32 %116, 3
  br i1 %117, label %118, label %133

118:                                              ; preds = %115
  %119 = load ptr, ptr %10, align 8, !tbaa !13
  %120 = call i32 @strncasecmp(ptr noundef @.str.35, ptr noundef %119, i64 noundef 4) #7
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %133

122:                                              ; preds = %118
  %123 = load ptr, ptr %10, align 8, !tbaa !13
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = zext i32 %124 to i64
  %126 = call i32 @strncasecmp(ptr noundef @.str.36, ptr noundef %123, i64 noundef %125) #7
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %133

128:                                              ; preds = %122, %111, %105, %99, %93, %89
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = and i32 %129, 4194304
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 121, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %158

133:                                              ; preds = %128, %122, %118, %115
  %134 = load ptr, ptr %10, align 8, !tbaa !13
  %135 = call i32 @strcasecmp(ptr noundef @.str.37, ptr noundef %134) #7
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %145, label %137

137:                                              ; preds = %133
  %138 = load ptr, ptr %10, align 8, !tbaa !13
  %139 = call i32 @strcasecmp(ptr noundef @.str.38, ptr noundef %138) #7
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %145, label %141

141:                                              ; preds = %137
  %142 = load ptr, ptr %10, align 8, !tbaa !13
  %143 = call i32 @strcasecmp(ptr noundef @.str.39, ptr noundef %142) #7
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %141, %137, %133
  store i32 121, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %158

146:                                              ; preds = %141
  br label %147

147:                                              ; preds = %146, %83
  %148 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %148, label %156 [
    i32 -11317950, label %149
    i32 26985, label %149
    i32 22092, label %149
    i32 20859, label %149
    i32 0, label %155
  ]

149:                                              ; preds = %147, %147, %147, %147
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = and i32 %150, 4194304
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %149
  store i32 121, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %158

154:                                              ; preds = %149
  br label %155

155:                                              ; preds = %154, %147
  br label %156

156:                                              ; preds = %155, %147
  br label %157

157:                                              ; preds = %156
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %158

158:                                              ; preds = %157, %153, %145, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4096, ptr %13) #5
  br label %159

159:                                              ; preds = %158, %39
  call void @llvm.lifetime.end.p0(i64 144, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %160

160:                                              ; preds = %159, %29
  call void @llvm.lifetime.end.p0(i64 120, ptr %8) #5
  br label %161

161:                                              ; preds = %160, %22
  call void @llvm.lifetime.end.p0(i64 112, ptr %6) #5
  %162 = load i32, ptr %3, align 4
  ret i32 %162

163:                                              ; preds = %77
  unreachable
}

; Function Attrs: nounwind
declare ptr @setmntent(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare ptr @getmntent_r(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @endmntent(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncasecmp(ptr noundef, ptr noundef, i64 noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(none) "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 "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 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"statfs", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !7, i64 88}
!11 = !{!"long", !7, i64 0}
!12 = !{!"", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!18, !14, i64 8}
!18 = !{!"mntent", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !6, i64 32, !6, i64 36}
!19 = !{!20, !11, i64 0}
!20 = !{!"stat", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !21, i64 72, !21, i64 88, !21, i64 104, !7, i64 120}
!21 = !{!"timespec", !11, i64 0, !11, i64 8}
!22 = !{!18, !14, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.statvfs = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, [6 x i32] }
%struct.statfs = type { i64, i64, i64, i64, i64, i64, i64, %struct.__fsid_t, i64, i64, i64, [4 x i64] }
%struct.__fsid_t = type { [2 x i32] }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.mntent = type { ptr, ptr, ptr, ptr, i32, i32 }

@.str.27 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() 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: nofree nounwind
declare noundef i32 @stat64(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fstat64(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fstatvfs64(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @fstatfs64(i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @osal_check_fs_local(i32 noundef %0, i32 noundef %1) local_unnamed_addr #4 {
  %3 = alloca %struct.statvfs, align 8
  %4 = alloca %struct.statfs, align 8
  %5 = alloca %struct.stat, align 8
  %6 = alloca [4096 x i8], align 16
  %7 = alloca %struct.mntent, align 8
  %8 = alloca %struct.stat, align 8
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %3) #7
  %9 = call i32 @fstatvfs64(i32 noundef %0, ptr noundef nonnull %3) #7
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %13, label %10

10:                                               ; preds = %2
  %11 = tail call ptr @__errno_location() #8
  %12 = load i32, ptr %11, align 4, !tbaa !5
  br label %88

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %4) #7
  %14 = call i32 @fstatfs64(i32 noundef %0, ptr noundef nonnull %4) #7
  %.not43 = icmp eq i32 %14, 0
  br i1 %.not43, label %18, label %15

15:                                               ; preds = %13
  %16 = tail call ptr @__errno_location() #8
  %17 = load i32, ptr %16, align 4, !tbaa !5
  br label %87

18:                                               ; preds = %13
  %19 = load i64, ptr %4, align 8, !tbaa !9
  %20 = trunc i64 %19 to i32
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %5) #7
  %21 = call i32 @fstat64(i32 noundef %0, ptr noundef nonnull %5) #7
  %.not44 = icmp eq i32 %21, 0
  br i1 %.not44, label %25, label %22

22:                                               ; preds = %18
  %23 = tail call ptr @__errno_location() #8
  %24 = load i32, ptr %23, align 4, !tbaa !5
  br label %86

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %6) #7
  %26 = call ptr @setmntent(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28) #7
  %.not45 = icmp eq ptr %26, null
  br i1 %.not45, label %27, label %.thread

27:                                               ; preds = %25
  %28 = call ptr @setmntent(ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.28) #7
  %.not46 = icmp eq ptr %28, null
  br i1 %.not46, label %.thread60, label %.thread

.thread:                                          ; preds = %25, %27
  %.03254 = phi ptr [ %28, %27 ], [ %26, %25 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #7
  %29 = call ptr @getmntent_r(ptr noundef nonnull %.03254, ptr noundef nonnull %7, ptr noundef nonnull %6, i32 noundef 4096) #7
  %.not4766 = icmp eq ptr %29, null
  br i1 %.not4766, label %.loopexit.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.thread
  %30 = load i64, ptr %5, align 8
  br label %31

31:                                               ; preds = %.lr.ph, %38
  %32 = phi ptr [ %29, %.lr.ph ], [ %39, %38 ]
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %8) #7
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = call i32 @stat64(ptr noundef %34, ptr noundef nonnull %8) #7
  %.not48 = icmp eq i32 %35, 0
  %36 = load i64, ptr %8, align 8
  %37 = icmp eq i64 %36, %30
  %or.cond69 = select i1 %.not48, i1 %37, i1 false
  br i1 %or.cond69, label %.loopexit, label %38

38:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %8) #7
  %39 = call ptr @getmntent_r(ptr noundef nonnull %.03254, ptr noundef nonnull %7, ptr noundef nonnull %6, i32 noundef 4096) #7
  %.not47 = icmp eq ptr %39, null
  br i1 %.not47, label %.loopexit.thread, label %31

.loopexit.thread:                                 ; preds = %38, %.thread
  %40 = call i32 @endmntent(ptr noundef nonnull %.03254) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  br label %.thread60

.loopexit:                                        ; preds = %31
  %41 = load ptr, ptr %32, align 8, !tbaa !16
  %42 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %41) #9
  %43 = trunc i64 %42 to i32
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %8) #7
  %44 = call i32 @endmntent(ptr noundef nonnull %.03254) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  %.not49 = icmp eq i32 %43, 0
  br i1 %.not49, label %.thread60, label %45

45:                                               ; preds = %.loopexit
  %46 = icmp ugt i32 %43, 2
  br i1 %46, label %47, label %50

47:                                               ; preds = %45
  %48 = call i32 @strncasecmp(ptr noundef nonnull @.str.30, ptr noundef %41, i64 noundef 3) #9
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %71, label %50

50:                                               ; preds = %47, %45
  %51 = and i64 %42, 4294967295
  %52 = call i32 @strncasecmp(ptr noundef nonnull @.str.31, ptr noundef %41, i64 noundef %51) #9
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %71, label %54

54:                                               ; preds = %50
  %55 = call i32 @strncasecmp(ptr noundef nonnull @.str.32, ptr noundef %41, i64 noundef %51) #9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %71, label %57

57:                                               ; preds = %54
  %58 = call i32 @strncasecmp(ptr noundef nonnull @.str.33, ptr noundef %41, i64 noundef %51) #9
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %71, label %60

60:                                               ; preds = %57
  %61 = call i32 @strcasecmp(ptr noundef nonnull @.str.34, ptr noundef %41) #9
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %71, label %63

63:                                               ; preds = %60
  %64 = icmp ugt i32 %43, 3
  br i1 %64, label %65, label %72

65:                                               ; preds = %63
  %66 = call i32 @strncasecmp(ptr noundef nonnull @.str.35, ptr noundef %41, i64 noundef 4) #9
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %72

68:                                               ; preds = %65
  %69 = call i32 @strncasecmp(ptr noundef nonnull @.str.36, ptr noundef %41, i64 noundef %51) #9
  %.not50 = icmp ne i32 %69, 0
  %70 = and i32 %1, 4194304
  %.not51 = icmp eq i32 %70, 0
  %or.cond = and i1 %.not51, %.not50
  br i1 %or.cond, label %85, label %72

71:                                               ; preds = %60, %57, %54, %50, %47
  %.old = and i32 %1, 4194304
  %.not51.old = icmp eq i32 %.old, 0
  br i1 %.not51.old, label %85, label %72

72:                                               ; preds = %71, %68, %65, %63
  %73 = call i32 @strcasecmp(ptr noundef nonnull @.str.37, ptr noundef %41) #9
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %85, label %75

75:                                               ; preds = %72
  %76 = call i32 @strcasecmp(ptr noundef nonnull @.str.38, ptr noundef %41) #9
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %85, label %78

78:                                               ; preds = %75
  %79 = call i32 @strcasecmp(ptr noundef nonnull @.str.39, ptr noundef %41) #9
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %85, label %.thread60

.thread60:                                        ; preds = %.loopexit.thread, %27, %78, %.loopexit
  switch i32 %20, label %84 [
    i32 -11317950, label %81
    i32 26985, label %81
    i32 22092, label %81
    i32 20859, label %81
  ]

81:                                               ; preds = %.thread60, %.thread60, %.thread60, %.thread60
  %82 = and i32 %1, 4194304
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %85, label %84

84:                                               ; preds = %.thread60, %81
  br label %85

85:                                               ; preds = %81, %72, %75, %78, %71, %68, %84
  %.0 = phi i32 [ 0, %84 ], [ 121, %68 ], [ 121, %71 ], [ 121, %78 ], [ 121, %75 ], [ 121, %72 ], [ 121, %81 ]
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %6) #7
  br label %86

86:                                               ; preds = %85, %22
  %.1 = phi i32 [ %24, %22 ], [ %.0, %85 ]
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %5) #7
  br label %87

87:                                               ; preds = %86, %15
  %.2 = phi i32 [ %17, %15 ], [ %.1, %86 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %4) #7
  br label %88

88:                                               ; preds = %87, %10
  %.3 = phi i32 [ %12, %10 ], [ %.2, %87 ]
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %3) #7
  ret i32 %.3
}

; Function Attrs: nounwind
declare ptr @setmntent(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @getmntent_r(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i32 @endmntent(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @strncasecmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @strcasecmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { nofree 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 #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 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 #5 = { 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 #6 = { mustprogress nofree 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"statfs", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !7, i64 88}
!11 = !{!"long", !7, i64 0}
!12 = !{!"", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"mntent", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !6, i64 32, !6, i64 36}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!14, !15, i64 0}


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