; LLVM IR from begeekmyfriend/CuckooFilter :: nvrom_test (main)

; 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.SHA_CTX = type { [5 x i32], [80 x i32], i32, i32, 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 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [45 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.SHA_CTX, align 4
  %7 = alloca %struct.stat, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [12 x i8], align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 352, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 144, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 3
  br i1 %19, label %20, label %23

20:                                               ; preds = %2
  %21 = load ptr, ptr @stderr, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str) #9
  call void @exit(i32 noundef -1) #10
  unreachable

23:                                               ; preds = %2
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %4, align 4, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i32 1
  store ptr %27, ptr %5, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %28, i64 0
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = call noalias ptr @fopen(ptr noundef %30, ptr noundef @.str.1)
  store ptr %31, ptr %16, align 8, !tbaa !9
  %32 = load ptr, ptr %16, align 8, !tbaa !9
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %40

34:                                               ; preds = %23
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 0
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.2, ptr noundef %38) #9
  call void @exit(i32 noundef -1) #10
  unreachable

40:                                               ; preds = %23
  %41 = load ptr, ptr %5, align 8, !tbaa !9
  %42 = getelementptr inbounds ptr, ptr %41, i64 0
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = call i32 @stat(ptr noundef %43, ptr noundef %7) #9
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 1
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call noalias ptr @fopen(ptr noundef %47, ptr noundef @.str.3)
  store ptr %48, ptr %17, align 8, !tbaa !9
  %49 = load ptr, ptr %17, align 8, !tbaa !9
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %57

51:                                               ; preds = %40
  %52 = load ptr, ptr @stderr, align 8, !tbaa !9
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = getelementptr inbounds ptr, ptr %53, i64 1
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.2, ptr noundef %55) #9
  call void @exit(i32 noundef -1) #10
  unreachable

57:                                               ; preds = %40
  %58 = getelementptr inbounds %struct.stat, ptr %7, i32 0, i32 8
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = call i32 @cuckoo_filter_init(i64 noundef %59)
  %61 = getelementptr inbounds %struct.stat, ptr %7, i32 0, i32 8
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = trunc i64 %62 to i32
  %64 = call i32 @next_pow_of_2(i32 noundef %63)
  %65 = udiv i32 %64, 12
  store i32 %65, ptr %8, align 4, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = mul i32 %66, 20
  %68 = zext i32 %67 to i64
  %69 = call noalias ptr @malloc(i64 noundef %68) #11
  store ptr %69, ptr %9, align 8, !tbaa !9
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = zext i32 %70 to i64
  %72 = mul i64 %71, 8
  %73 = call noalias ptr @malloc(i64 noundef %72) #11
  store ptr %73, ptr %10, align 8, !tbaa !9
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %79

76:                                               ; preds = %57
  %77 = load ptr, ptr %10, align 8, !tbaa !9
  %78 = icmp ne ptr %77, null
  br i1 %78, label %82, label %79

79:                                               ; preds = %76, %57
  %80 = load ptr, ptr @stderr, align 8, !tbaa !9
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.4) #9
  call void @exit(i32 noundef -1) #10
  unreachable

82:                                               ; preds = %76
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %97, %82
  %84 = load i32, ptr %14, align 4, !tbaa !5
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = icmp ult i32 %84, %85
  br i1 %86, label %87, label %100

87:                                               ; preds = %83
  %88 = load ptr, ptr %9, align 8, !tbaa !9
  %89 = load i32, ptr %14, align 4, !tbaa !5
  %90 = mul nsw i32 %89, 20
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %88, i64 %91
  %93 = load ptr, ptr %10, align 8, !tbaa !9
  %94 = load i32, ptr %14, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  store ptr %92, ptr %96, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %87
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %14, align 4, !tbaa !5
  br label %83, !llvm.loop !15

100:                                              ; preds = %83
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %122, %100
  %102 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 1 %102, i8 0, i64 12, i1 false)
  %103 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  %104 = load ptr, ptr %16, align 8, !tbaa !9
  %105 = call i64 @fread(ptr noundef %103, i64 noundef 1, i64 noundef 12, ptr noundef %104)
  %106 = trunc i64 %105 to i32
  store i32 %106, ptr %13, align 4, !tbaa !5
  call void @SHA1_Init(ptr noundef %6)
  %107 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  %108 = load i32, ptr %13, align 4, !tbaa !5
  call void @SHA1_Update(ptr noundef %6, ptr noundef %107, i32 noundef %108)
  %109 = load ptr, ptr %10, align 8, !tbaa !9
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds ptr, ptr %109, i64 %111
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  call void @SHA1_Final(ptr noundef %113, ptr noundef %6)
  %114 = load ptr, ptr %10, align 8, !tbaa !9
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds ptr, ptr %114, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  call void @cuckoo_filter_put(ptr noundef %118, ptr noundef %119)
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %14, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %101
  %123 = load i32, ptr %13, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 12
  br i1 %124, label %101, label %125, !llvm.loop !17

125:                                              ; preds = %122
  %126 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %126, ptr %8, align 4, !tbaa !5
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %127)
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %139, %125
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = icmp ult i32 %130, %131
  br i1 %132, label %133, label %142

133:                                              ; preds = %129
  %134 = load ptr, ptr %10, align 8, !tbaa !9
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds ptr, ptr %134, i64 %136
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  call void @cuckoo_filter_put(ptr noundef %138, ptr noundef null)
  br label %139

139:                                              ; preds = %133
  %140 = load i32, ptr %14, align 4, !tbaa !5
  %141 = add nsw i32 %140, 2
  store i32 %141, ptr %14, align 4, !tbaa !5
  br label %129, !llvm.loop !18

142:                                              ; preds = %129
  %143 = load ptr, ptr %16, align 8, !tbaa !9
  %144 = call i32 @fseek(ptr noundef %143, i64 noundef 0, i32 noundef 0)
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %166, %142
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = icmp ult i32 %146, %147
  br i1 %148, label %149, label %169

149:                                              ; preds = %145
  %150 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 1 %150, i8 0, i64 12, i1 false)
  %151 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  %152 = load ptr, ptr %16, align 8, !tbaa !9
  %153 = call i64 @fread(ptr noundef %151, i64 noundef 1, i64 noundef 12, ptr noundef %152)
  %154 = trunc i64 %153 to i32
  store i32 %154, ptr %13, align 4, !tbaa !5
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = and i32 %155, 1
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %165, label %158

158:                                              ; preds = %149
  %159 = load ptr, ptr %10, align 8, !tbaa !9
  %160 = load i32, ptr %14, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds ptr, ptr %159, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  call void @cuckoo_filter_put(ptr noundef %163, ptr noundef %164)
  br label %165

165:                                              ; preds = %158, %149
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %14, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %14, align 4, !tbaa !5
  br label %145, !llvm.loop !19

169:                                              ; preds = %145
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %190, %169
  %171 = load i32, ptr %15, align 4, !tbaa !5
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = icmp ult i32 %171, %172
  br i1 %173, label %174, label %193

174:                                              ; preds = %170
  %175 = load ptr, ptr %10, align 8, !tbaa !9
  %176 = load i32, ptr %15, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds ptr, ptr %175, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = call ptr @cuckoo_filter_get(ptr noundef %179)
  store ptr %180, ptr %12, align 8, !tbaa !9
  %181 = load ptr, ptr %12, align 8, !tbaa !9
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %189

183:                                              ; preds = %174
  %184 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  %185 = load ptr, ptr %12, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %184, ptr align 1 %185, i64 12, i1 false)
  %186 = getelementptr inbounds [12 x i8], ptr %11, i64 0, i64 0
  %187 = load ptr, ptr %17, align 8, !tbaa !9
  %188 = call i64 @fwrite(ptr noundef %186, i64 noundef 1, i64 noundef 12, ptr noundef %187)
  br label %189

189:                                              ; preds = %183, %174
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %15, align 4, !tbaa !5
  br label %170, !llvm.loop !20

193:                                              ; preds = %170
  %194 = load ptr, ptr %16, align 8, !tbaa !9
  %195 = call i32 @fclose(ptr noundef %194)
  %196 = load ptr, ptr %17, align 8, !tbaa !9
  %197 = call i32 @fclose(ptr noundef %196)
  %198 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %198) #9
  %199 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %199) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 144, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 352, ptr %6) #9
  ret i32 0
}

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

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

declare i32 @cuckoo_filter_init(i64 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @next_pow_of_2(i32 noundef) #5

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare void @SHA1_Init(ptr noundef) #4

declare void @SHA1_Update(ptr noundef, ptr noundef, i32 noundef) #4

declare void @SHA1_Final(ptr noundef, ptr noundef) #4

declare void @cuckoo_filter_put(ptr noundef, ptr noundef) #4

declare i32 @printf(ptr noundef, ...) #4

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #4

declare ptr @cuckoo_filter_get(ptr noundef) #4

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 = { "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 = { inlinehint 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 #6 = { nounwind allocsize(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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0) }

!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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 48}
!12 = !{!"stat", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !14, i64 88, !14, i64 104, !7, i64 120}
!13 = !{!"long", !7, i64 0}
!14 = !{!"timespec", !13, i64 0, !13, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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.SHA_CTX = type { [5 x i32], [80 x i32], i32, i32, 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 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [45 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.SHA_CTX, align 4
  %4 = alloca %struct.stat, align 8
  %5 = alloca [12 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 352, ptr nonnull %3) #10
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #10
  %6 = icmp slt i32 %0, 3
  br i1 %6, label %7, label %10

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #11
  tail call void @exit(i32 noundef -1) #12
  unreachable

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call noalias ptr @fopen(ptr noundef %12, ptr noundef nonnull @.str.1)
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %19

15:                                               ; preds = %10
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = load ptr, ptr %11, align 8, !tbaa !5
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.2, ptr noundef %17) #11
  tail call void @exit(i32 noundef -1) #12
  unreachable

19:                                               ; preds = %10
  %20 = load ptr, ptr %11, align 8, !tbaa !5
  %21 = call i32 @stat(ptr noundef %20, ptr noundef nonnull %4) #10
  %22 = getelementptr inbounds i8, ptr %1, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = tail call noalias ptr @fopen(ptr noundef %23, ptr noundef nonnull @.str.3)
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %30

26:                                               ; preds = %19
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = load ptr, ptr %22, align 8, !tbaa !5
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.2, ptr noundef %28) #11
  tail call void @exit(i32 noundef -1) #12
  unreachable

30:                                               ; preds = %19
  %31 = getelementptr inbounds i8, ptr %4, i64 48
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = tail call i32 @cuckoo_filter_init(i64 noundef %32) #10
  %34 = trunc i64 %32 to i32
  %35 = tail call i32 @next_pow_of_2(i32 noundef %34)
  %36 = udiv i32 %35, 12
  %37 = mul i32 %36, 20
  %38 = zext i32 %37 to i64
  %39 = tail call noalias ptr @malloc(i64 noundef %38) #13
  %40 = shl nuw i32 %36, 3
  %41 = zext i32 %40 to i64
  %42 = tail call noalias ptr @malloc(i64 noundef %41) #13
  %43 = icmp ne ptr %39, null
  %44 = icmp ne ptr %42, null
  %or.cond = and i1 %43, %44
  br i1 %or.cond, label %.preheader68, label %47

.preheader68:                                     ; preds = %30
  %.not73 = icmp ult i32 %35, 12
  br i1 %.not73, label %.preheader67.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader68
  %wide.trip.count = zext nneg i32 %36 to i64
  %45 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %wide.trip.count, 3
  %46 = icmp ult i64 %45, 3
  br i1 %46, label %.preheader67.preheader.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 536870908
  br label %.lr.ph

47:                                               ; preds = %30
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.4) #11
  tail call void @exit(i32 noundef -1) #12
  unreachable

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %50 = mul nuw nsw i64 %indvars.iv, 20
  %51 = getelementptr inbounds i8, ptr %39, i64 %50
  %52 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv
  store ptr %51, ptr %52, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %53 = mul nuw nsw i64 %indvars.iv.next, 20
  %54 = getelementptr inbounds i8, ptr %39, i64 %53
  %55 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv.next
  store ptr %54, ptr %55, align 8, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %56 = mul nuw nsw i64 %indvars.iv.next.1, 20
  %57 = getelementptr inbounds i8, ptr %39, i64 %56
  %58 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv.next.1
  store ptr %57, ptr %58, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %59 = mul nuw nsw i64 %indvars.iv.next.2, 20
  %60 = getelementptr inbounds i8, ptr %39, i64 %59
  %61 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv.next.2
  store ptr %60, ptr %61, align 8, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader67.preheader.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !14

.preheader67.preheader.loopexit.unr-lcssa:        ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader67.preheader, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader67.preheader.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader67.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader67.preheader.loopexit.unr-lcssa ]
  %62 = mul nuw nsw i64 %indvars.iv.epil, 20
  %63 = getelementptr inbounds i8, ptr %39, i64 %62
  %64 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv.epil
  store ptr %63, ptr %64, align 8, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader67.preheader, label %.lr.ph.epil, !llvm.loop !16

.preheader67.preheader:                           ; preds = %.preheader67.preheader.loopexit.unr-lcssa, %.lr.ph.epil, %.preheader68
  br label %.preheader67

.preheader67:                                     ; preds = %.preheader67.preheader, %.preheader67
  %indvars.iv84 = phi i32 [ %indvars.iv.next85, %.preheader67 ], [ 1, %.preheader67.preheader ]
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.preheader67 ], [ 0, %.preheader67.preheader ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %5, i8 0, i64 12, i1 false)
  %65 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 12, ptr noundef nonnull %13)
  %66 = trunc i64 %65 to i32
  call void @SHA1_Init(ptr noundef nonnull %3) #10
  call void @SHA1_Update(ptr noundef nonnull %3, ptr noundef nonnull %5, i32 noundef %66) #10
  %67 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv75
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  call void @SHA1_Final(ptr noundef %68, ptr noundef nonnull %3) #10
  call void @cuckoo_filter_put(ptr noundef %68, ptr noundef nonnull %5) #10
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %69 = icmp eq i32 %66, 12
  %indvars.iv.next85 = add nuw i32 %indvars.iv84, 1
  br i1 %69, label %.preheader67, label %70, !llvm.loop !18

70:                                               ; preds = %.preheader67
  %71 = trunc nuw i64 %indvars.iv.next76 to i32
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %71)
  %73 = and i64 %indvars.iv75, 4294967295
  br label %74

74:                                               ; preds = %70, %74
  %indvars.iv78 = phi i64 [ 0, %70 ], [ %indvars.iv.next79, %74 ]
  %75 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv78
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  call void @cuckoo_filter_put(ptr noundef %76, ptr noundef null) #10
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 2
  %.not = icmp ugt i64 %indvars.iv.next79, %73
  br i1 %.not, label %77, label %74, !llvm.loop !19

77:                                               ; preds = %74
  %78 = call i32 @fseek(ptr noundef nonnull %13, i64 noundef 0, i32 noundef 0)
  %wide.trip.count86 = zext i32 %indvars.iv84 to i64
  br label %79

79:                                               ; preds = %77, %85
  %indvars.iv81 = phi i64 [ 0, %77 ], [ %indvars.iv.next82, %85 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %5, i8 0, i64 12, i1 false)
  %80 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 12, ptr noundef nonnull %13)
  %81 = and i64 %indvars.iv81, 1
  %.not66 = icmp eq i64 %81, 0
  br i1 %.not66, label %82, label %85

82:                                               ; preds = %79
  %83 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv81
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  call void @cuckoo_filter_put(ptr noundef %84, ptr noundef nonnull %5) #10
  br label %85

85:                                               ; preds = %79, %82
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count86
  br i1 %exitcond87.not, label %.preheader, label %79, !llvm.loop !20

.preheader:                                       ; preds = %85, %91
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %91 ], [ 0, %85 ]
  %86 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv88
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = call ptr @cuckoo_filter_get(ptr noundef %87) #10
  %.not65 = icmp eq ptr %88, null
  br i1 %.not65, label %91, label %89

89:                                               ; preds = %.preheader
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %5, ptr noundef nonnull align 1 dereferenceable(12) %88, i64 12, i1 false)
  %90 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 12, ptr noundef nonnull %24)
  br label %91

91:                                               ; preds = %.preheader, %89
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count86
  br i1 %exitcond93.not, label %92, label %.preheader, !llvm.loop !21

92:                                               ; preds = %91
  %93 = call i32 @fclose(ptr noundef nonnull %13)
  %94 = call i32 @fclose(ptr noundef nonnull %24)
  call void @free(ptr noundef %39) #10
  call void @free(ptr noundef nonnull %42) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 352, ptr nonnull %3) #10
  ret i32 0
}

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

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

declare i32 @cuckoo_filter_init(i64 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @next_pow_of_2(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

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

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

declare void @SHA1_Init(ptr noundef) local_unnamed_addr #4

declare void @SHA1_Update(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare void @SHA1_Final(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @cuckoo_filter_put(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

declare ptr @cuckoo_filter_get(ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 = { "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 = { inlinehint 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 #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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 #10 = { nounwind }
attributes #11 = { cold nounwind }
attributes #12 = { noreturn nounwind }
attributes #13 = { nounwind allocsize(0) }

!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}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}


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