; LLVM IR from xdevelnet/libsdb :: tests (tests)

; 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.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 }

@example_string = external dso_local constant [650 x i8], align 16
@buffer = external dso_local global ptr, align 8
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @test_prep() #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

declare i32 @open(ptr noundef, i32 noundef, ...) #3

declare void @perror(ptr noundef) #3

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #3

declare i32 @close(i32 noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca %struct.stat, align 8
  store i32 0, ptr %1, align 4
  %9 = call i32 @chdir(ptr noundef @.str.7) #5
  %10 = icmp slt i32 %9, 0
  br i1 %10, label %11, label %14

11:                                               ; preds = %0
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef @.str.8, ptr noundef @.str.7) #5
  store i32 1, ptr %1, align 4
  br label %180

14:                                               ; preds = %0
  %15 = call zeroext i1 @test_prep()
  %16 = zext i1 %15 to i32
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %21

18:                                               ; preds = %14
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.9) #5
  store i32 1, ptr %1, align 4
  br label %180

21:                                               ; preds = %14
  %22 = call i32 @chdir(ptr noundef @.str.10) #5
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  call void @perror(ptr noundef null)
  store i32 1, ptr %1, align 4
  br label %180

25:                                               ; preds = %21
  call void @sdb_tune(i64 noundef 458752)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %26 = call ptr @sdb_open(i32 noundef 1, ptr noundef @.str.7)
  store ptr %26, ptr %2, align 8, !tbaa !5
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.11) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %179

32:                                               ; preds = %25
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = call zeroext i1 @sdb_insert(ptr noundef %33, ptr noundef @.str.1, ptr noundef @example_string)
  %35 = zext i1 %34 to i32
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %40

37:                                               ; preds = %32
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str.12) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %179

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %41 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.13, i32 noundef 0)
  store i32 %41, ptr %4, align 4, !tbaa !9
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %40
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.14, ptr noundef @.str.13) #5
  br label %47

47:                                               ; preds = %44, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %48 = load i32, ptr %4, align 4, !tbaa !9
  %49 = load ptr, ptr @buffer, align 8, !tbaa !5
  %50 = call i64 @read(i32 noundef %48, ptr noundef %49, i64 noundef 3072000)
  store i64 %50, ptr %5, align 8, !tbaa !11
  %51 = load i64, ptr %5, align 8, !tbaa !11
  %52 = icmp sle i64 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %47
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

54:                                               ; preds = %47
  %55 = load i64, ptr %5, align 8, !tbaa !11
  %56 = icmp ne i64 649, %55
  br i1 %56, label %57, label %60

57:                                               ; preds = %54
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.15) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

60:                                               ; preds = %54
  %61 = load ptr, ptr @buffer, align 8, !tbaa !5
  %62 = call i32 @memcmp(ptr noundef @example_string, ptr noundef %61, i64 noundef 649) #6
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %67

64:                                               ; preds = %60
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.16) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

67:                                               ; preds = %60
  %68 = load i32, ptr %4, align 4, !tbaa !9
  %69 = call i32 @close(i32 noundef %68)
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.17) #5
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = call zeroext i1 @sdb_update(ptr noundef %72, ptr noundef @.str.2, ptr noundef @example_string)
  %74 = zext i1 %73 to i32
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %79

76:                                               ; preds = %67
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.18) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

79:                                               ; preds = %67
  %80 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.19, i32 noundef 0)
  store i32 %80, ptr %4, align 4, !tbaa !9
  %81 = load i32, ptr %4, align 4, !tbaa !9
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %79
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.14, ptr noundef @.str.19) #5
  br label %86

86:                                               ; preds = %83, %79
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = load ptr, ptr @buffer, align 8, !tbaa !5
  %89 = call i64 @read(i32 noundef %87, ptr noundef %88, i64 noundef 3072000)
  store i64 %89, ptr %5, align 8, !tbaa !11
  %90 = load i64, ptr %5, align 8, !tbaa !11
  %91 = icmp sle i64 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

93:                                               ; preds = %86
  %94 = load i64, ptr %5, align 8, !tbaa !11
  %95 = icmp ne i64 649, %94
  br i1 %95, label %96, label %99

96:                                               ; preds = %93
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.20) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

99:                                               ; preds = %93
  %100 = load ptr, ptr @buffer, align 8, !tbaa !5
  %101 = call i32 @memcmp(ptr noundef @example_string, ptr noundef %100, i64 noundef 649) #6
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %106

103:                                              ; preds = %99
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.21) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %178

106:                                              ; preds = %99
  %107 = load i32, ptr %4, align 4, !tbaa !9
  %108 = call i32 @close(i32 noundef %107)
  %109 = load ptr, ptr @stderr, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = call ptr @sdb_select(ptr noundef %111, ptr noundef @.str.3)
  store ptr %112, ptr %6, align 8, !tbaa !5
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %118

115:                                              ; preds = %106
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.23) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %177

118:                                              ; preds = %106
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = call i32 @strcmp(ptr noundef %119, ptr noundef @example_string) #6
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %125

122:                                              ; preds = %118
  %123 = load ptr, ptr @stderr, align 8, !tbaa !5
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.24) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %177

125:                                              ; preds = %118
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.25) #5
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = call zeroext i1 @sdb_delete(ptr noundef %128, ptr noundef @.str.4)
  %130 = zext i1 %129 to i32
  %131 = icmp ne i32 %130, 1
  br i1 %131, label %132, label %135

132:                                              ; preds = %125
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.23) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %177

135:                                              ; preds = %125
  %136 = call i32 @access(ptr noundef @.str.4, i32 noundef 0) #5
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %141

138:                                              ; preds = %135
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.26) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %177

141:                                              ; preds = %135
  %142 = load ptr, ptr @stderr, align 8, !tbaa !5
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str.27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = call i64 @sdb_exist(ptr noundef %144, ptr noundef @.str.5)
  store i64 %145, ptr %7, align 8, !tbaa !11
  %146 = load i64, ptr %7, align 8, !tbaa !11
  %147 = icmp sle i64 %146, 0
  br i1 %147, label %148, label %151

148:                                              ; preds = %141
  %149 = load ptr, ptr @stderr, align 8, !tbaa !5
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef @.str.28) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %176

151:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 144, ptr %8) #5
  %152 = call i32 @stat(ptr noundef @.str.29, ptr noundef %8) #5
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %157

154:                                              ; preds = %151
  %155 = load ptr, ptr @stderr, align 8, !tbaa !5
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.30) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %175

157:                                              ; preds = %151
  %158 = load i64, ptr %7, align 8, !tbaa !11
  %159 = getelementptr inbounds %struct.stat, ptr %8, i32 0, i32 8
  %160 = load i64, ptr %159, align 8, !tbaa !13
  %161 = icmp ne i64 %158, %160
  br i1 %161, label %162, label %170

162:                                              ; preds = %157
  %163 = load ptr, ptr @stderr, align 8, !tbaa !5
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef @.str.31) #5
  %165 = load ptr, ptr @stderr, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.stat, ptr %8, i32 0, i32 8
  %167 = load i64, ptr %166, align 8, !tbaa !13
  %168 = load i64, ptr %7, align 8, !tbaa !11
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str.32, i64 noundef %167, i64 noundef %168) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %175

170:                                              ; preds = %157
  %171 = load ptr, ptr @stderr, align 8, !tbaa !5
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.33) #5
  %173 = load ptr, ptr @buffer, align 8, !tbaa !5
  call void @free(ptr noundef %173) #5
  %174 = load ptr, ptr %2, align 8, !tbaa !5
  call void @sdb_close(ptr noundef %174)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %175

175:                                              ; preds = %170, %162, %154
  call void @llvm.lifetime.end.p0(i64 144, ptr %8) #5
  br label %176

176:                                              ; preds = %175, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %177

177:                                              ; preds = %176, %138, %132, %122, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %178

178:                                              ; preds = %177, %103, %96, %92, %76, %64, %57, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %179

179:                                              ; preds = %178, %37, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %180

180:                                              ; preds = %179, %24, %18, %11
  %181 = load i32, ptr %1, align 4
  ret i32 %181
}

; Function Attrs: nounwind
declare i32 @chdir(ptr noundef) #1

declare void @sdb_tune(i64 noundef) #3

declare ptr @sdb_open(i32 noundef, ptr noundef) #3

declare zeroext i1 @sdb_insert(ptr noundef, ptr noundef, ptr noundef) #3

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

declare zeroext i1 @sdb_update(ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @sdb_select(ptr noundef, ptr noundef) #3

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

declare zeroext i1 @sdb_delete(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #1

declare i64 @sdb_exist(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @stat(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

declare void @sdb_close(ptr noundef) #3

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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(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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 48}
!14 = !{!"stat", !12, i64 0, !12, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !15, i64 72, !15, i64 88, !15, i64 104, !7, i64 120}
!15 = !{!"timespec", !12, i64 0, !12, i64 8}


; 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.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 }

@example_string = external dso_local constant [650 x i8], align 16
@buffer = external dso_local local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @test_prep() local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

declare i32 @close(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.stat, align 8
  %2 = tail call i32 @chdir(ptr noundef nonnull @.str.7) #9
  %3 = icmp slt i32 %2, 0
  br i1 %3, label %4, label %7

4:                                                ; preds = %0
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.7) #10
  br label %123

7:                                                ; preds = %0
  %8 = tail call zeroext i1 @test_prep()
  br i1 %8, label %12, label %9

9:                                                ; preds = %7
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.9) #10
  br label %123

12:                                               ; preds = %7
  %13 = tail call i32 @chdir(ptr noundef nonnull @.str.10) #9
  %14 = icmp slt i32 %13, 0
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  tail call void @perror(ptr noundef null) #11
  br label %123

16:                                               ; preds = %12
  tail call void @sdb_tune(i64 noundef 458752) #9
  %17 = tail call ptr @sdb_open(i32 noundef 1, ptr noundef nonnull @.str.7) #9
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %22

19:                                               ; preds = %16
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.11) #10
  br label %123

22:                                               ; preds = %16
  %23 = tail call zeroext i1 @sdb_insert(ptr noundef nonnull %17, ptr noundef nonnull @.str.1, ptr noundef nonnull @example_string) #9
  br i1 %23, label %27, label %24

24:                                               ; preds = %22
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.12) #10
  br label %123

27:                                               ; preds = %22
  %28 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull @.str.13, i32 noundef 0) #9
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.13) #10
  br label %33

33:                                               ; preds = %30, %27
  %34 = load ptr, ptr @buffer, align 8, !tbaa !5
  %35 = tail call i64 @read(i32 noundef %28, ptr noundef %34, i64 noundef 3072000) #9
  %36 = icmp slt i64 %35, 1
  br i1 %36, label %123, label %37

37:                                               ; preds = %33
  %.not = icmp eq i64 %35, 649
  br i1 %.not, label %41, label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.15) #10
  br label %123

41:                                               ; preds = %37
  %42 = load ptr, ptr @buffer, align 8, !tbaa !5
  %bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(649) @example_string, ptr noundef nonnull dereferenceable(649) %42, i64 649)
  %.not27 = icmp eq i32 %bcmp, 0
  br i1 %.not27, label %46, label %43

43:                                               ; preds = %41
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.16) #10
  br label %123

46:                                               ; preds = %41
  %47 = tail call i32 @close(i32 noundef %28) #9
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.17) #10
  %50 = tail call zeroext i1 @sdb_update(ptr noundef nonnull %17, ptr noundef nonnull @.str.2, ptr noundef nonnull @example_string) #9
  br i1 %50, label %54, label %51

51:                                               ; preds = %46
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.18) #10
  br label %123

54:                                               ; preds = %46
  %55 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull @.str.19, i32 noundef 0) #9
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %54
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.19) #10
  br label %60

60:                                               ; preds = %57, %54
  %61 = load ptr, ptr @buffer, align 8, !tbaa !5
  %62 = tail call i64 @read(i32 noundef %55, ptr noundef %61, i64 noundef 3072000) #9
  %63 = icmp slt i64 %62, 1
  br i1 %63, label %123, label %64

64:                                               ; preds = %60
  %.not28 = icmp eq i64 %62, 649
  br i1 %.not28, label %68, label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.20) #10
  br label %123

68:                                               ; preds = %64
  %69 = load ptr, ptr @buffer, align 8, !tbaa !5
  %bcmp29 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(649) @example_string, ptr noundef nonnull dereferenceable(649) %69, i64 649)
  %.not30 = icmp eq i32 %bcmp29, 0
  br i1 %.not30, label %73, label %70

70:                                               ; preds = %68
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.21) #10
  br label %123

73:                                               ; preds = %68
  %74 = tail call i32 @close(i32 noundef %55) #9
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %76 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.22) #10
  %77 = tail call ptr @sdb_select(ptr noundef nonnull %17, ptr noundef nonnull @.str.3) #9
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %82

79:                                               ; preds = %73
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.23) #10
  br label %123

82:                                               ; preds = %73
  %83 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %77, ptr noundef nonnull dereferenceable(1) @example_string) #12
  %.not31 = icmp eq i32 %83, 0
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  br i1 %.not31, label %87, label %85

85:                                               ; preds = %82
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.24) #10
  br label %123

87:                                               ; preds = %82
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.25) #10
  %89 = tail call zeroext i1 @sdb_delete(ptr noundef nonnull %17, ptr noundef nonnull @.str.4) #9
  br i1 %89, label %93, label %90

90:                                               ; preds = %87
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef nonnull @.str.23) #10
  br label %123

93:                                               ; preds = %87
  %94 = tail call i32 @access(ptr noundef nonnull @.str.4, i32 noundef 0) #9
  %95 = icmp eq i32 %94, 0
  %96 = load ptr, ptr @stderr, align 8, !tbaa !5
  br i1 %95, label %97, label %99

97:                                               ; preds = %93
  %98 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.26) #10
  br label %123

99:                                               ; preds = %93
  %100 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.27) #10
  %101 = tail call i64 @sdb_exist(ptr noundef nonnull %17, ptr noundef nonnull @.str.5) #9
  %102 = icmp slt i64 %101, 1
  br i1 %102, label %103, label %106

103:                                              ; preds = %99
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.28) #10
  br label %123

106:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %1) #9
  %107 = call i32 @stat(ptr noundef nonnull @.str.29, ptr noundef nonnull %1) #9
  %.not33 = icmp eq i32 %107, 0
  br i1 %.not33, label %111, label %108

108:                                              ; preds = %106
  %109 = load ptr, ptr @stderr, align 8, !tbaa !5
  %110 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef nonnull @.str.30) #10
  br label %122

111:                                              ; preds = %106
  %112 = getelementptr inbounds i8, ptr %1, i64 48
  %113 = load i64, ptr %112, align 8, !tbaa !9
  %.not34 = icmp eq i64 %101, %113
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  br i1 %.not34, label %119, label %115

115:                                              ; preds = %111
  %116 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef nonnull @.str.31) #10
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef nonnull @.str.32, i64 noundef %113, i64 noundef %101) #10
  br label %122

119:                                              ; preds = %111
  %120 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef nonnull @.str.33) #10
  %121 = load ptr, ptr @buffer, align 8, !tbaa !5
  tail call void @free(ptr noundef %121) #9
  tail call void @sdb_close(ptr noundef nonnull %17) #9
  br label %122

122:                                              ; preds = %119, %115, %108
  %.0 = phi i32 [ 1, %108 ], [ 1, %115 ], [ 0, %119 ]
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %1) #9
  br label %123

123:                                              ; preds = %19, %24, %79, %85, %90, %97, %122, %103, %60, %33, %70, %65, %51, %43, %38, %15, %9, %4
  %.5 = phi i32 [ 1, %4 ], [ 1, %9 ], [ 1, %15 ], [ 1, %19 ], [ 1, %24 ], [ 1, %38 ], [ 1, %43 ], [ 1, %51 ], [ 1, %65 ], [ 1, %70 ], [ 1, %33 ], [ 1, %60 ], [ 1, %79 ], [ 1, %85 ], [ 1, %90 ], [ 1, %97 ], [ 1, %103 ], [ %.0, %122 ]
  ret i32 %.5
}

; Function Attrs: nounwind
declare i32 @chdir(ptr noundef) local_unnamed_addr #5

declare void @sdb_tune(i64 noundef) local_unnamed_addr #4

declare ptr @sdb_open(i32 noundef, ptr noundef) local_unnamed_addr #4

declare zeroext i1 @sdb_insert(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare zeroext i1 @sdb_update(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @sdb_select(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare zeroext i1 @sdb_delete(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #1

declare i64 @sdb_exist(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @stat(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7

declare void @sdb_close(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #8

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree "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 = { "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 "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(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 #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { nofree nounwind willreturn memory(argmem: read) }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { cold }
attributes #12 = { 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, !11, i64 48}
!10 = !{!"stat", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !13, i64 72, !13, i64 88, !13, i64 104, !7, i64 120}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"timespec", !11, i64 0, !11, i64 8}


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