; LLVM IR from albertobsd/keyhunt :: keyhunt.ll (Z19forceReadFileXPointPc)

; 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.bloom = type { i64, i64, i64, i8, x86_fp80, i8, i8, i8, double, ptr }
%struct.str_tokenizer = type { i32, i32, ptr }
%struct.address_value = type { [20 x i8] }

@bloom = external dso_local global %struct.bloom, align 16
@N = external dso_local global i64, align 8
@MAXLENGTHADDRESS = external dso_local global i32, align 4
@addressTable = external dso_local global ptr, align 8
@stderr = external global ptr, align 8
@.str.81 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.290 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.300 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.301 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.302 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.304 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.305 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.306 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.307 = external hidden unnamed_addr constant [23 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z12checkpointerPvPKcS1_S1_i(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

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

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

declare void @_Z15stringtokenizerPcP13str_tokenizer(ptr noundef, ptr noundef) #2

declare noundef ptr @_Z9nextTokenP13str_tokenizer(ptr noundef) #2

declare noundef i32 @_Z10isValidHexPc(ptr noundef) #2

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

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

declare noundef ptr @_Z4trimPcPKc(ptr noundef, ptr noundef) #2

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

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

declare void @_Z13freetokenizerP13str_tokenizer(ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

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

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

declare i32 @bloom_add(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z15initBloomFilterP5bloomm(ptr noundef, i64 noundef) #8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z19forceReadFileXPointPc(ptr noundef %0) #8 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [100 x i8], align 16
  %10 = alloca [1000 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca %struct.str_tokenizer, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 100, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 1000, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #9
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = call noalias ptr @fopen(ptr noundef %14, ptr noundef @.str.290)
  store ptr %15, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %22

18:                                               ; preds = %1
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.301, ptr noundef %20, i32 noundef 6462) #9
  store i1 false, ptr %2, align 1
  store i32 1, ptr %13, align 4
  br label %180

22:                                               ; preds = %1
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %46, %22
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i32 @feof(ptr noundef %24) #9
  %26 = icmp ne i32 %25, 0
  %27 = xor i1 %26, true
  br i1 %27, label %28, label %47

28:                                               ; preds = %23
  %29 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = call ptr @fgets(ptr noundef %29, i32 noundef 1000, ptr noundef %30)
  store ptr %31, ptr %11, align 8, !tbaa !5
  %32 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %33 = call noundef ptr @_Z4trimPcPKc(ptr noundef %32, ptr noundef @.str.152)
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %36 = icmp eq ptr %34, %35
  br i1 %36, label %37, label %46

37:                                               ; preds = %28
  %38 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %39 = call i64 @strlen(ptr noundef %38) #10
  store i64 %39, ptr %7, align 8, !tbaa !9
  %40 = load i64, ptr %7, align 8, !tbaa !9
  %41 = icmp uge i64 %40, 40
  br i1 %41, label %42, label %45

42:                                               ; preds = %37
  %43 = load i64, ptr %5, align 8, !tbaa !9
  %44 = add i64 %43, 1
  store i64 %44, ptr %5, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %42, %37
  br label %46

46:                                               ; preds = %45, %28
  br label %23, !llvm.loop !11

47:                                               ; preds = %23
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = call i32 @fseek(ptr noundef %48, i64 noundef 0, i32 noundef 0)
  store i32 20, ptr @MAXLENGTHADDRESS, align 4, !tbaa !13
  %50 = load i64, ptr %5, align 8, !tbaa !9
  %51 = load i64, ptr %5, align 8, !tbaa !9
  %52 = uitofp i64 %51 to double
  %53 = fmul double 2.000000e+01, %52
  %54 = fdiv double %53, 0x4130000000000000
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.300, i64 noundef %50, double noundef %54)
  %56 = load i64, ptr %5, align 8, !tbaa !9
  %57 = mul i64 20, %56
  %58 = call noalias ptr @malloc(i64 noundef %57) #11
  store ptr %58, ptr @addressTable, align 8, !tbaa !5
  %59 = load ptr, ptr @addressTable, align 8, !tbaa !5
  call void @_Z12checkpointerPvPKcS1_S1_i(ptr noundef %59, ptr noundef @.str.81, ptr noundef @.str.82, ptr noundef @.str.302, i32 noundef 6484)
  %60 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %60, ptr @N, align 8, !tbaa !9
  %61 = load i64, ptr @N, align 8, !tbaa !9
  %62 = call noundef zeroext i1 @_Z15initBloomFilterP5bloomm(ptr noundef @bloom, i64 noundef %61)
  br i1 %62, label %64, label %63

63:                                               ; preds = %47
  store i1 false, ptr %2, align 1
  store i32 1, ptr %13, align 4
  br label %180

64:                                               ; preds = %47
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %174, %64
  %66 = load i64, ptr %6, align 8, !tbaa !9
  %67 = load i64, ptr @N, align 8, !tbaa !9
  %68 = icmp ult i64 %66, %67
  br i1 %68, label %69, label %177

69:                                               ; preds = %65
  %70 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %70, i8 0, i64 1000, i1 false)
  %71 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = call ptr @fgets(ptr noundef %71, i32 noundef 1000, ptr noundef %72)
  store ptr %73, ptr %11, align 8, !tbaa !5
  %74 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %75 = load i64, ptr %6, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.address_value, ptr %74, i64 %75
  call void @llvm.memset.p0.i64(ptr align 1 %76, i8 0, i64 20, i1 false)
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %79 = icmp eq ptr %77, %78
  br i1 %79, label %80, label %168

80:                                               ; preds = %69
  %81 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %82 = call noundef ptr @_Z4trimPcPKc(ptr noundef %81, ptr noundef @.str.152)
  %83 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  call void @_Z15stringtokenizerPcP13str_tokenizer(ptr noundef %83, ptr noundef %12)
  %84 = call noundef ptr @_Z9nextTokenP13str_tokenizer(ptr noundef %12)
  store ptr %84, ptr %11, align 8, !tbaa !5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = call i64 @strlen(ptr noundef %85) #10
  store i64 %86, ptr %8, align 8, !tbaa !9
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = call noundef i32 @_Z10isValidHexPc(ptr noundef %87)
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %163

90:                                               ; preds = %80
  %91 = load i64, ptr %8, align 8, !tbaa !9
  switch i64 %91, label %157 [
    i64 64, label %92
    i64 66, label %113
    i64 130, label %135
  ]

92:                                               ; preds = %90
  %93 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %94 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %95 = call noundef i32 @_Z8hexs2binPcPh(ptr noundef %93, ptr noundef %94)
  %96 = sext i32 %95 to i64
  store i64 %96, ptr %7, align 8, !tbaa !9
  %97 = load i64, ptr %7, align 8, !tbaa !9
  %98 = icmp ne i64 %97, 0
  br i1 %98, label %99, label %109

99:                                               ; preds = %92
  %100 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %101 = load i64, ptr %6, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.address_value, ptr %100, i64 %101
  %103 = getelementptr inbounds %struct.address_value, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds [20 x i8], ptr %103, i64 0, i64 0
  %105 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %104, ptr align 16 %105, i64 20, i1 false)
  %106 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %107 = load i32, ptr @MAXLENGTHADDRESS, align 4, !tbaa !13
  %108 = call i32 @bloom_add(ptr noundef @bloom, ptr noundef %106, i32 noundef %107)
  br label %112

109:                                              ; preds = %92
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.304) #9
  br label %112

112:                                              ; preds = %109, %99
  br label %162

113:                                              ; preds = %90
  %114 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %115 = getelementptr inbounds i8, ptr %114, i64 2
  %116 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %117 = call noundef i32 @_Z8hexs2binPcPh(ptr noundef %115, ptr noundef %116)
  %118 = sext i32 %117 to i64
  store i64 %118, ptr %7, align 8, !tbaa !9
  %119 = load i64, ptr %7, align 8, !tbaa !9
  %120 = icmp ne i64 %119, 0
  br i1 %120, label %121, label %131

121:                                              ; preds = %113
  %122 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %123 = load i64, ptr %6, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.address_value, ptr %122, i64 %123
  %125 = getelementptr inbounds %struct.address_value, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds [20 x i8], ptr %125, i64 0, i64 0
  %127 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %126, ptr align 16 %127, i64 20, i1 false)
  %128 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %129 = load i32, ptr @MAXLENGTHADDRESS, align 4, !tbaa !13
  %130 = call i32 @bloom_add(ptr noundef @bloom, ptr noundef %128, i32 noundef %129)
  br label %134

131:                                              ; preds = %113
  %132 = load ptr, ptr @stderr, align 8, !tbaa !5
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.304) #9
  br label %134

134:                                              ; preds = %131, %121
  br label %162

135:                                              ; preds = %90
  %136 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %137 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %138 = call noundef i32 @_Z8hexs2binPcPh(ptr noundef %136, ptr noundef %137)
  %139 = sext i32 %138 to i64
  store i64 %139, ptr %7, align 8, !tbaa !9
  %140 = load i64, ptr %7, align 8, !tbaa !9
  %141 = icmp ne i64 %140, 0
  br i1 %141, label %142, label %153

142:                                              ; preds = %135
  %143 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %144 = load i64, ptr %6, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.address_value, ptr %143, i64 %144
  %146 = getelementptr inbounds %struct.address_value, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds [20 x i8], ptr %146, i64 0, i64 0
  %148 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %149 = getelementptr inbounds i8, ptr %148, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %147, ptr align 1 %149, i64 20, i1 false)
  %150 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %151 = load i32, ptr @MAXLENGTHADDRESS, align 4, !tbaa !13
  %152 = call i32 @bloom_add(ptr noundef @bloom, ptr noundef %150, i32 noundef %151)
  br label %156

153:                                              ; preds = %135
  %154 = load ptr, ptr @stderr, align 8, !tbaa !5
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef @.str.304) #9
  br label %156

156:                                              ; preds = %153, %142
  br label %162

157:                                              ; preds = %90
  %158 = load ptr, ptr @stderr, align 8, !tbaa !5
  %159 = load i64, ptr %8, align 8, !tbaa !9
  %160 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef @.str.305, i64 noundef %159, ptr noundef %160) #9
  br label %162

162:                                              ; preds = %157, %156, %134, %112
  br label %167

163:                                              ; preds = %80
  %164 = load ptr, ptr @stderr, align 8, !tbaa !5
  %165 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str.306, ptr noundef %165) #9
  br label %167

167:                                              ; preds = %163, %162
  call void @_Z13freetokenizerP13str_tokenizer(ptr noundef %12)
  br label %174

168:                                              ; preds = %69
  %169 = load ptr, ptr @stderr, align 8, !tbaa !5
  %170 = getelementptr inbounds [1000 x i8], ptr %10, i64 0, i64 0
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %169, ptr noundef @.str.307, ptr noundef %170) #9
  %172 = load i64, ptr @N, align 8, !tbaa !9
  %173 = add i64 %172, -1
  store i64 %173, ptr @N, align 8, !tbaa !9
  br label %174

174:                                              ; preds = %168, %167
  %175 = load i64, ptr %6, align 8, !tbaa !9
  %176 = add i64 %175, 1
  store i64 %176, ptr %6, align 8, !tbaa !9
  br label %65, !llvm.loop !15

177:                                              ; preds = %65
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = call i32 @fclose(ptr noundef %178)
  store i1 true, ptr %2, align 1
  store i32 1, ptr %13, align 4
  br label %180

180:                                              ; preds = %177, %63, %18
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 1000, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 100, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  %181 = load i1, ptr %2, align 1
  ret i1 %181
}

declare noundef i32 @_Z8hexs2binPcPh(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { mustprogress 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 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { mustprogress 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !12}


; 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.bloom = type { i64, i64, i64, i8, x86_fp80, i8, i8, i8, double, ptr }
%struct.str_tokenizer = type { i32, i32, ptr }
%struct.address_value = type { [20 x i8] }

@bloom = external dso_local global %struct.bloom, align 16
@N = external dso_local local_unnamed_addr global i64, align 8
@MAXLENGTHADDRESS = external dso_local local_unnamed_addr global i32, align 4
@addressTable = external dso_local local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.81 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.290 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.300 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.301 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.302 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.304 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.305 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.306 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.307 = external hidden unnamed_addr constant [23 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z12checkpointerPvPKcS1_S1_i(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

declare void @_Z15stringtokenizerPcP13str_tokenizer(ptr noundef, ptr noundef) local_unnamed_addr #5

declare noundef ptr @_Z9nextTokenP13str_tokenizer(ptr noundef) local_unnamed_addr #5

declare noundef i32 @_Z10isValidHexPc(ptr noundef) local_unnamed_addr #5

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

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

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

declare noundef ptr @_Z4trimPcPKc(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

declare void @_Z13freetokenizerP13str_tokenizer(ptr noundef) local_unnamed_addr #5

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

; 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) #7

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

declare i32 @bloom_add(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z15initBloomFilterP5bloomm(ptr noundef, i64 noundef) local_unnamed_addr #8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z19forceReadFileXPointPc(ptr noundef %0) local_unnamed_addr #8 {
  %2 = alloca [100 x i8], align 16
  %3 = alloca [1000 x i8], align 16
  %4 = alloca %struct.str_tokenizer, align 8
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  %5 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.290)
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %.preheader38

.preheader38:                                     ; preds = %1
  %7 = tail call i32 @feof(ptr noundef nonnull %5) #9
  %.not39 = icmp eq i32 %7, 0
  br i1 %.not39, label %.lr.ph, label %._crit_edge

8:                                                ; preds = %1
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.301, ptr noundef %0, i32 noundef 6462) #10
  br label %89

.lr.ph:                                           ; preds = %.preheader38, %18
  %.03040 = phi i64 [ %.1, %18 ], [ 0, %.preheader38 ]
  %11 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1000, ptr noundef nonnull %5)
  %12 = call noundef ptr @_Z4trimPcPKc(ptr noundef nonnull %3, ptr noundef nonnull @.str.152)
  %13 = icmp eq ptr %11, %3
  br i1 %13, label %14, label %18

14:                                               ; preds = %.lr.ph
  %15 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #11
  %16 = icmp ugt i64 %15, 39
  %17 = zext i1 %16 to i64
  %spec.select = add i64 %.03040, %17
  br label %18

18:                                               ; preds = %14, %.lr.ph
  %.1 = phi i64 [ %.03040, %.lr.ph ], [ %spec.select, %14 ]
  %19 = call i32 @feof(ptr noundef nonnull %5) #9
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %18, %.preheader38
  %.030.lcssa = phi i64 [ 0, %.preheader38 ], [ %.1, %18 ]
  %20 = call i32 @fseek(ptr noundef nonnull %5, i64 noundef 0, i32 noundef 0)
  store i32 20, ptr @MAXLENGTHADDRESS, align 4, !tbaa !11
  %21 = uitofp i64 %.030.lcssa to double
  %22 = fmul double %21, 2.000000e+01
  %23 = fmul double %22, 0x3EB0000000000000
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.300, i64 noundef %.030.lcssa, double noundef %23)
  %25 = mul i64 %.030.lcssa, 20
  %26 = call noalias ptr @malloc(i64 noundef %25) #12
  store ptr %26, ptr @addressTable, align 8, !tbaa !5
  call void @_Z12checkpointerPvPKcS1_S1_i(ptr noundef %26, ptr noundef nonnull @.str.81, ptr noundef nonnull @.str.82, ptr noundef nonnull @.str.302, i32 noundef 6484)
  store i64 %.030.lcssa, ptr @N, align 8, !tbaa !13
  %27 = call noundef zeroext i1 @_Z15initBloomFilterP5bloomm(ptr noundef nonnull @bloom, i64 noundef %.030.lcssa)
  br i1 %27, label %.preheader, label %89

.preheader:                                       ; preds = %._crit_edge
  %28 = load i64, ptr @N, align 8, !tbaa !13
  %.not45 = icmp eq i64 %28, 0
  br i1 %.not45, label %._crit_edge44, label %.lr.ph43

.lr.ph43:                                         ; preds = %.preheader
  %29 = getelementptr inbounds i8, ptr %2, i64 2
  %30 = getelementptr inbounds i8, ptr %3, i64 2
  br label %31

31:                                               ; preds = %.lr.ph43, %84
  %.02941 = phi i64 [ 0, %.lr.ph43 ], [ %86, %84 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %3, i8 0, i64 1000, i1 false)
  %32 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1000, ptr noundef nonnull %5)
  %33 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.address_value, ptr %33, i64 %.02941
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %34, i8 0, i64 20, i1 false)
  %35 = icmp eq ptr %32, %3
  br i1 %35, label %36, label %79

36:                                               ; preds = %31
  %37 = call noundef ptr @_Z4trimPcPKc(ptr noundef nonnull %3, ptr noundef nonnull @.str.152)
  call void @_Z15stringtokenizerPcP13str_tokenizer(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %38 = call noundef ptr @_Z9nextTokenP13str_tokenizer(ptr noundef nonnull %4)
  %39 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %38) #11
  %40 = call noundef i32 @_Z10isValidHexPc(ptr noundef %38)
  %.not34 = icmp eq i32 %40, 0
  br i1 %.not34, label %75, label %41

41:                                               ; preds = %36
  switch i64 %39, label %72 [
    i64 64, label %42
    i64 66, label %52
    i64 130, label %62
  ]

42:                                               ; preds = %41
  %43 = call noundef i32 @_Z8hexs2binPcPh(ptr noundef nonnull %3, ptr noundef nonnull %2)
  %.not37 = icmp eq i32 %43, 0
  br i1 %.not37, label %49, label %44

44:                                               ; preds = %42
  %45 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.address_value, ptr %45, i64 %.02941
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %46, ptr noundef nonnull align 16 dereferenceable(20) %2, i64 20, i1 false)
  %47 = load i32, ptr @MAXLENGTHADDRESS, align 4, !tbaa !11
  %48 = call i32 @bloom_add(ptr noundef nonnull @bloom, ptr noundef nonnull %2, i32 noundef %47)
  br label %78

49:                                               ; preds = %42
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.304) #10
  br label %78

52:                                               ; preds = %41
  %53 = call noundef i32 @_Z8hexs2binPcPh(ptr noundef nonnull %30, ptr noundef nonnull %2)
  %.not36 = icmp eq i32 %53, 0
  br i1 %.not36, label %59, label %54

54:                                               ; preds = %52
  %55 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.address_value, ptr %55, i64 %.02941
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %56, ptr noundef nonnull align 16 dereferenceable(20) %2, i64 20, i1 false)
  %57 = load i32, ptr @MAXLENGTHADDRESS, align 4, !tbaa !11
  %58 = call i32 @bloom_add(ptr noundef nonnull @bloom, ptr noundef nonnull %2, i32 noundef %57)
  br label %78

59:                                               ; preds = %52
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.304) #10
  br label %78

62:                                               ; preds = %41
  %63 = call noundef i32 @_Z8hexs2binPcPh(ptr noundef nonnull %3, ptr noundef nonnull %2)
  %.not35 = icmp eq i32 %63, 0
  br i1 %.not35, label %69, label %64

64:                                               ; preds = %62
  %65 = load ptr, ptr @addressTable, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.address_value, ptr %65, i64 %.02941
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %66, ptr noundef nonnull align 2 dereferenceable(20) %29, i64 20, i1 false)
  %67 = load i32, ptr @MAXLENGTHADDRESS, align 4, !tbaa !11
  %68 = call i32 @bloom_add(ptr noundef nonnull @bloom, ptr noundef nonnull %2, i32 noundef %67)
  br label %78

69:                                               ; preds = %62
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.304) #10
  br label %78

72:                                               ; preds = %41
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.305, i64 noundef %39, ptr noundef nonnull %3) #10
  br label %78

75:                                               ; preds = %36
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.306, ptr noundef nonnull %3) #10
  br label %78

78:                                               ; preds = %72, %49, %44, %59, %54, %69, %64, %75
  call void @_Z13freetokenizerP13str_tokenizer(ptr noundef nonnull %4)
  %.pre = load i64, ptr @N, align 8, !tbaa !13
  br label %84

79:                                               ; preds = %31
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.307, ptr noundef nonnull %3) #10
  %82 = load i64, ptr @N, align 8, !tbaa !13
  %83 = add i64 %82, -1
  store i64 %83, ptr @N, align 8, !tbaa !13
  br label %84

84:                                               ; preds = %79, %78
  %85 = phi i64 [ %83, %79 ], [ %.pre, %78 ]
  %86 = add nuw i64 %.02941, 1
  %87 = icmp ult i64 %86, %85
  br i1 %87, label %31, label %._crit_edge44, !llvm.loop !15

._crit_edge44:                                    ; preds = %84, %.preheader
  %88 = call i32 @fclose(ptr noundef nonnull %5)
  br label %89

89:                                               ; preds = %._crit_edge, %._crit_edge44, %8
  %.0 = phi i1 [ false, %8 ], [ true, %._crit_edge44 ], [ false, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %2) #9
  ret i1 %.0
}

declare noundef i32 @_Z8hexs2binPcPh(ptr noundef, ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #3 = { 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 #4 = { 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 #5 = { "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { mustprogress 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 #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !10}


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