; LLVM IR from clausecker/24puzzle :: ida (search_ida_bounded)

; 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.timespec = type { i64, i64 }
%struct.path = type { i64, [256 x i8] }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @search_ida_bounded(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7) #0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.timespec, align 8
  %18 = alloca %struct.timespec, align 8
  %19 = alloca %struct.timespec, align 8
  %20 = alloca %struct.timespec, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca double, align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %struct.timespec, align 8
  %28 = alloca %struct.timespec, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i64 %3, ptr %12, align 8, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store i32 %7, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !11
  %29 = load i32, ptr %16, align 4, !tbaa !11
  %30 = xor i32 %29, -1
  %31 = and i32 %30, 2
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %8
  store i32 1, ptr %26, align 4, !tbaa !11
  br label %40

34:                                               ; preds = %8
  %35 = call i32 @clock_gettime(i32 noundef 3, ptr noundef %17) #7
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  call void @perror(ptr noundef @.str)
  store i32 1, ptr %26, align 4, !tbaa !11
  br label %39

38:                                               ; preds = %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !15
  br label %39

39:                                               ; preds = %38, %37
  br label %40

40:                                               ; preds = %39, %33
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.path, ptr %41, i32 0, i32 0
  store i64 -1, ptr %42, align 8, !tbaa !16
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = call i32 @catalogue_hval(ptr noundef %43, ptr noundef %44)
  %46 = zext i32 %45 to i64
  store i64 %46, ptr %24, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %125, %40
  %48 = load i32, ptr %25, align 4, !tbaa !11
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %54

50:                                               ; preds = %47
  %51 = load i64, ptr %24, align 8, !tbaa !9
  %52 = load i64, ptr %12, align 8, !tbaa !9
  %53 = icmp ule i64 %51, %52
  br label %54

54:                                               ; preds = %50, %47
  %55 = phi i1 [ false, %47 ], [ %53, %50 ]
  br i1 %55, label %56, label %128

56:                                               ; preds = %54
  %57 = load i32, ptr %16, align 4, !tbaa !11
  %58 = and i32 %57, 2
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %64

60:                                               ; preds = %56
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = load i64, ptr %24, align 8, !tbaa !9
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.1, i64 noundef %62) #7
  br label %64

64:                                               ; preds = %60, %56
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load i64, ptr %24, align 8, !tbaa !9
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load i32, ptr %16, align 4, !tbaa !11
  %73 = call i32 @search_to_bound(ptr noundef %65, ptr noundef %66, ptr noundef %67, ptr noundef %68, i64 noundef %69, ptr noundef %21, ptr noundef %70, ptr noundef %71, i32 noundef %72)
  store i32 %73, ptr %25, align 4, !tbaa !11
  %74 = load i64, ptr %21, align 8, !tbaa !13
  %75 = load i64, ptr %22, align 8, !tbaa !13
  %76 = add i64 %75, %74
  store i64 %76, ptr %22, align 8, !tbaa !13
  %77 = load i32, ptr %16, align 4, !tbaa !11
  %78 = and i32 %77, 2
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %84

80:                                               ; preds = %64
  %81 = load ptr, ptr @stderr, align 8, !tbaa !5
  %82 = load i64, ptr %21, align 8, !tbaa !13
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef @.str.2, i64 noundef %82) #7
  br label %84

84:                                               ; preds = %80, %64
  %85 = load i32, ptr %26, align 4, !tbaa !11
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  br label %125

88:                                               ; preds = %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !15
  %89 = load i32, ptr %26, align 4, !tbaa !11
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  br label %125

92:                                               ; preds = %88
  %93 = call i32 @clock_gettime(i32 noundef 3, ptr noundef %19) #7
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %92
  call void @perror(ptr noundef @.str)
  store i32 1, ptr %26, align 4, !tbaa !11
  br label %125

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #7
  %97 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %98 = load i64, ptr %97, align 8
  %99 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %100 = load i64, ptr %99, align 8
  %101 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %102 = load i64, ptr %101, align 8
  %103 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %104 = load i64, ptr %103, align 8
  %105 = call { i64, i64 } @timediff(i64 %98, i64 %100, i64 %102, i64 %104)
  %106 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 0
  %107 = extractvalue { i64, i64 } %105, 0
  store i64 %107, ptr %106, align 8
  %108 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 1
  %109 = extractvalue { i64, i64 } %105, 1
  store i64 %109, ptr %108, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %27, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #7
  %110 = getelementptr inbounds %struct.timespec, ptr %20, i32 0, i32 0
  %111 = load i64, ptr %110, align 8, !tbaa !18
  %112 = sitofp i64 %111 to double
  %113 = getelementptr inbounds %struct.timespec, ptr %20, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !20
  %115 = sitofp i64 %114 to double
  %116 = fdiv double %115, 1.000000e+09
  %117 = fadd double %112, %116
  store double %117, ptr %23, align 8, !tbaa !21
  %118 = load ptr, ptr @stderr, align 8, !tbaa !5
  %119 = load double, ptr %23, align 8, !tbaa !21
  %120 = load i64, ptr %21, align 8, !tbaa !13
  %121 = uitofp i64 %120 to double
  %122 = load double, ptr %23, align 8, !tbaa !21
  %123 = fdiv double %121, %122
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.3, double noundef %119, double noundef %123) #7
  br label %125

125:                                              ; preds = %96, %95, %91, %87
  %126 = load i64, ptr %24, align 8, !tbaa !9
  %127 = add i64 %126, 2
  store i64 %127, ptr %24, align 8, !tbaa !9
  br label %47, !llvm.loop !23

128:                                              ; preds = %54
  %129 = load i32, ptr %16, align 4, !tbaa !11
  %130 = and i32 %129, 2
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %146

132:                                              ; preds = %128
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = load i64, ptr %22, align 8, !tbaa !13
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.4, i64 noundef %134) #7
  %136 = load i32, ptr %25, align 4, !tbaa !11
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %138, label %142

138:                                              ; preds = %132
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = load i32, ptr %25, align 4, !tbaa !11
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.5, i32 noundef %140) #7
  br label %145

142:                                              ; preds = %132
  %143 = load ptr, ptr @stderr, align 8, !tbaa !5
  %144 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %143, ptr noundef @.str.6) #7
  br label %145

145:                                              ; preds = %142, %138
  br label %146

146:                                              ; preds = %145, %128
  %147 = load i32, ptr %26, align 4, !tbaa !11
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %178, label %149

149:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  %150 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %151 = load i64, ptr %150, align 8
  %152 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %153 = load i64, ptr %152, align 8
  %154 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %155 = load i64, ptr %154, align 8
  %156 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %157 = load i64, ptr %156, align 8
  %158 = call { i64, i64 } @timediff(i64 %151, i64 %153, i64 %155, i64 %157)
  %159 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 0
  %160 = extractvalue { i64, i64 } %158, 0
  store i64 %160, ptr %159, align 8
  %161 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 1
  %162 = extractvalue { i64, i64 } %158, 1
  store i64 %162, ptr %161, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %28, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  %163 = getelementptr inbounds %struct.timespec, ptr %20, i32 0, i32 0
  %164 = load i64, ptr %163, align 8, !tbaa !18
  %165 = sitofp i64 %164 to double
  %166 = getelementptr inbounds %struct.timespec, ptr %20, i32 0, i32 1
  %167 = load i64, ptr %166, align 8, !tbaa !20
  %168 = sitofp i64 %167 to double
  %169 = fdiv double %168, 1.000000e+09
  %170 = fadd double %165, %169
  store double %170, ptr %23, align 8, !tbaa !21
  %171 = load ptr, ptr @stderr, align 8, !tbaa !5
  %172 = load double, ptr %23, align 8, !tbaa !21
  %173 = load i64, ptr %22, align 8, !tbaa !13
  %174 = uitofp i64 %173 to double
  %175 = load double, ptr %23, align 8, !tbaa !21
  %176 = fdiv double %174, %175
  %177 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.7, double noundef %172, double noundef %176) #7
  br label %178

178:                                              ; preds = %149, %146
  %179 = load i32, ptr %16, align 4, !tbaa !11
  %180 = and i32 %179, 4
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %195

182:                                              ; preds = %178
  %183 = load ptr, ptr %11, align 8, !tbaa !5
  %184 = load ptr, ptr %13, align 8, !tbaa !5
  %185 = call i32 @verify(ptr noundef %183, ptr noundef %184)
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %195, label %187

187:                                              ; preds = %182
  %188 = load i32, ptr %16, align 4, !tbaa !11
  %189 = and i32 %188, 2
  %190 = icmp ne i32 %189, 0
  br i1 %190, label %191, label %194

191:                                              ; preds = %187
  %192 = load ptr, ptr @stderr, align 8, !tbaa !5
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.8) #7
  br label %194

194:                                              ; preds = %191, %187
  call void @abort() #8
  unreachable

195:                                              ; preds = %182, %178
  %196 = load i64, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  ret i64 %196
}

; 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 @clock_gettime(i32 noundef, ptr noundef) #2

declare void @perror(ptr noundef) #3

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden { i64, i64 } @timediff(i64, i64, i64, i64) #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @verify(ptr noundef, ptr noundef) #0

; Function Attrs: noreturn nounwind
declare void @abort() #6

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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { nounwind }
attributes #8 = { noreturn nounwind }

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

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


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

%struct.timespec = type { i64, i64 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @search_ida_bounded(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = alloca %struct.timespec, align 8
  %10 = alloca %struct.timespec, align 8
  %11 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %12 = and i32 %7, 2
  %.not.not = icmp eq i32 %12, 0
  br i1 %.not.not, label %.thread, label %13

13:                                               ; preds = %8
  %14 = call i32 @clock_gettime(i32 noundef 3, ptr noundef nonnull %9) #7
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %16, label %15

15:                                               ; preds = %13
  call void @perror(ptr noundef nonnull @.str) #8
  br label %17

16:                                               ; preds = %13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %9, i64 16, i1 false), !tbaa.struct !5
  br label %17

17:                                               ; preds = %15, %16
  %.043 = phi i32 [ 1, %15 ], [ 0, %16 ]
  store i64 -1, ptr %4, align 8, !tbaa !10
  %18 = call i32 @catalogue_hval(ptr noundef %0, ptr noundef %2)
  %19 = zext i32 %18 to i64
  %.not60 = icmp ugt i64 %19, %3
  br i1 %.not60, label %._crit_edge.thread77, label %.lr.ph

.thread:                                          ; preds = %8
  store i64 -1, ptr %4, align 8, !tbaa !10
  %20 = tail call i32 @catalogue_hval(ptr noundef %0, ptr noundef %2)
  %21 = zext i32 %20 to i64
  %.not6066 = icmp ugt i64 %21, %3
  br i1 %.not6066, label %.thread90, label %.lr.ph.thread

.lr.ph.thread:                                    ; preds = %.thread
  %.sroa.423.0..sroa_idx69 = getelementptr inbounds i8, ptr %10, i64 8
  br label %.thread.us.preheader

.lr.ph:                                           ; preds = %17
  %.sroa.423.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  br i1 %.not.not, label %.thread.us.preheader, label %.lr.ph.split

.thread.us.preheader:                             ; preds = %.lr.ph.thread, %.lr.ph
  %.sroa.423.0..sroa_idx71 = phi ptr [ %.sroa.423.0..sroa_idx69, %.lr.ph.thread ], [ %.sroa.423.0..sroa_idx, %.lr.ph ]
  %.0436770 = phi i32 [ 1, %.lr.ph.thread ], [ %.043, %.lr.ph ]
  %22 = phi i64 [ %21, %.lr.ph.thread ], [ %19, %.lr.ph ]
  br label %.thread.us

.thread.us:                                       ; preds = %.thread.us.preheader, %44
  %.055.us = phi i64 [ %25, %44 ], [ 0, %.thread.us.preheader ]
  %.154.us = phi i32 [ %.2.us, %44 ], [ %.0436770, %.thread.us.preheader ]
  %.04553.us = phi i64 [ %45, %44 ], [ %22, %.thread.us.preheader ]
  %23 = call i32 @search_to_bound(ptr noundef nonnull %4, ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %.04553.us, ptr noundef nonnull %11, ptr noundef %5, ptr noundef %6, i32 noundef %7)
  %24 = load i64, ptr %11, align 8, !tbaa !12
  %25 = add i64 %24, %.055.us
  %.not51.us = icmp eq i32 %.154.us, 0
  br i1 %.not51.us, label %26, label %44

26:                                               ; preds = %.thread.us
  %.sroa.022.0.copyload.us = load i64, ptr %10, align 8, !tbaa !6
  %.sroa.423.0.copyload.us = load i64, ptr %.sroa.423.0..sroa_idx71, align 8, !tbaa !6
  %27 = call i32 @clock_gettime(i32 noundef 3, ptr noundef nonnull %10) #7
  %.not52.us = icmp eq i32 %27, 0
  br i1 %.not52.us, label %29, label %28

28:                                               ; preds = %26
  call void @perror(ptr noundef nonnull @.str) #8
  br label %44

29:                                               ; preds = %26
  %30 = load i64, ptr %10, align 8
  %31 = load i64, ptr %.sroa.423.0..sroa_idx71, align 8
  %32 = call { i64, i64 } @timediff(i64 %.sroa.022.0.copyload.us, i64 %.sroa.423.0.copyload.us, i64 %30, i64 %31)
  %33 = extractvalue { i64, i64 } %32, 0
  %34 = extractvalue { i64, i64 } %32, 1
  %35 = sitofp i64 %33 to double
  %36 = sitofp i64 %34 to double
  %37 = fdiv double %36, 1.000000e+09
  %38 = fadd double %37, %35
  %39 = load ptr, ptr @stderr, align 8, !tbaa !14
  %40 = load i64, ptr %11, align 8, !tbaa !12
  %41 = uitofp i64 %40 to double
  %42 = fdiv double %41, %38
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.3, double noundef %38, double noundef %42) #9
  br label %44

44:                                               ; preds = %29, %28, %.thread.us
  %.2.us = phi i32 [ 1, %.thread.us ], [ 1, %28 ], [ 0, %29 ]
  %45 = add i64 %.04553.us, 2
  %46 = icmp eq i32 %23, 0
  %47 = icmp ule i64 %45, %3
  %48 = and i1 %46, %47
  br i1 %48, label %.thread.us, label %._crit_edge, !llvm.loop !16

.lr.ph.split:                                     ; preds = %.lr.ph, %74
  %.055 = phi i64 [ %55, %74 ], [ 0, %.lr.ph ]
  %.154 = phi i32 [ %.2, %74 ], [ %.043, %.lr.ph ]
  %.04553 = phi i64 [ %75, %74 ], [ %19, %.lr.ph ]
  %49 = load ptr, ptr @stderr, align 8, !tbaa !14
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.1, i64 noundef %.04553) #9
  %51 = call i32 @search_to_bound(ptr noundef nonnull %4, ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %.04553, ptr noundef nonnull %11, ptr noundef %5, ptr noundef %6, i32 noundef %7)
  %52 = load i64, ptr %11, align 8, !tbaa !12
  %53 = load ptr, ptr @stderr, align 8, !tbaa !14
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.2, i64 noundef %52) #9
  %55 = add i64 %52, %.055
  %.not51 = icmp eq i32 %.154, 0
  br i1 %.not51, label %56, label %74

56:                                               ; preds = %.lr.ph.split
  %.sroa.022.0.copyload = load i64, ptr %10, align 8, !tbaa !6
  %.sroa.423.0.copyload = load i64, ptr %.sroa.423.0..sroa_idx, align 8, !tbaa !6
  %57 = call i32 @clock_gettime(i32 noundef 3, ptr noundef nonnull %10) #7
  %.not52 = icmp eq i32 %57, 0
  br i1 %.not52, label %59, label %58

58:                                               ; preds = %56
  call void @perror(ptr noundef nonnull @.str) #8
  br label %74

59:                                               ; preds = %56
  %60 = load i64, ptr %10, align 8
  %61 = load i64, ptr %.sroa.423.0..sroa_idx, align 8
  %62 = call { i64, i64 } @timediff(i64 %.sroa.022.0.copyload, i64 %.sroa.423.0.copyload, i64 %60, i64 %61)
  %63 = extractvalue { i64, i64 } %62, 0
  %64 = extractvalue { i64, i64 } %62, 1
  %65 = sitofp i64 %63 to double
  %66 = sitofp i64 %64 to double
  %67 = fdiv double %66, 1.000000e+09
  %68 = fadd double %67, %65
  %69 = load ptr, ptr @stderr, align 8, !tbaa !14
  %70 = load i64, ptr %11, align 8, !tbaa !12
  %71 = uitofp i64 %70 to double
  %72 = fdiv double %71, %68
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.3, double noundef %68, double noundef %72) #9
  br label %74

74:                                               ; preds = %.lr.ph.split, %59, %58
  %.2 = phi i32 [ 1, %.lr.ph.split ], [ 1, %58 ], [ 0, %59 ]
  %75 = add i64 %.04553, 2
  %76 = icmp eq i32 %51, 0
  %77 = icmp ule i64 %75, %3
  %78 = and i1 %76, %77
  br i1 %78, label %.lr.ph.split, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %74, %44
  %.044.lcssa = phi i32 [ %23, %44 ], [ %51, %74 ]
  %.1.lcssa = phi i32 [ %.2.us, %44 ], [ %.2, %74 ]
  %.0.lcssa = phi i64 [ %25, %44 ], [ %55, %74 ]
  br i1 %.not.not, label %91, label %81

._crit_edge.thread77:                             ; preds = %17
  br i1 %.not.not, label %91, label %.thread84

.thread84:                                        ; preds = %._crit_edge.thread77
  %79 = load ptr, ptr @stderr, align 8, !tbaa !14
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef nonnull @.str.4, i64 noundef 0) #9
  br label %88

81:                                               ; preds = %._crit_edge
  %82 = load ptr, ptr @stderr, align 8, !tbaa !14
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.4, i64 noundef %.0.lcssa) #9
  %84 = icmp sgt i32 %.044.lcssa, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %81
  %86 = load ptr, ptr @stderr, align 8, !tbaa !14
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.5, i32 noundef %.044.lcssa) #9
  br label %91

88:                                               ; preds = %.thread84, %81
  %.1.lcssa8289 = phi i32 [ %.043, %.thread84 ], [ %.1.lcssa, %81 ]
  %.0.lcssa8388 = phi i64 [ 0, %.thread84 ], [ %.0.lcssa, %81 ]
  %89 = load ptr, ptr @stderr, align 8, !tbaa !14
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.6) #9
  br label %91

91:                                               ; preds = %._crit_edge.thread77, %85, %88, %._crit_edge
  %.0.lcssa76 = phi i64 [ %.0.lcssa, %85 ], [ %.0.lcssa8388, %88 ], [ %.0.lcssa, %._crit_edge ], [ 0, %._crit_edge.thread77 ]
  %.1.lcssa75 = phi i32 [ %.1.lcssa, %85 ], [ %.1.lcssa8289, %88 ], [ %.1.lcssa, %._crit_edge ], [ %.043, %._crit_edge.thread77 ]
  %.not47 = icmp eq i32 %.1.lcssa75, 0
  br i1 %.not47, label %92, label %.thread90

92:                                               ; preds = %91
  %93 = load i64, ptr %9, align 8
  %94 = getelementptr inbounds i8, ptr %9, i64 8
  %95 = load i64, ptr %94, align 8
  %96 = load i64, ptr %10, align 8
  %97 = getelementptr inbounds i8, ptr %10, i64 8
  %98 = load i64, ptr %97, align 8
  %99 = call { i64, i64 } @timediff(i64 %93, i64 %95, i64 %96, i64 %98)
  %100 = extractvalue { i64, i64 } %99, 0
  %101 = extractvalue { i64, i64 } %99, 1
  %102 = sitofp i64 %100 to double
  %103 = sitofp i64 %101 to double
  %104 = fdiv double %103, 1.000000e+09
  %105 = fadd double %104, %102
  %106 = load ptr, ptr @stderr, align 8, !tbaa !14
  %107 = uitofp i64 %.0.lcssa76 to double
  %108 = fdiv double %107, %105
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull @.str.7, double noundef %105, double noundef %108) #9
  br label %.thread90

.thread90:                                        ; preds = %.thread, %92, %91
  %.0.lcssa7694 = phi i64 [ %.0.lcssa76, %92 ], [ %.0.lcssa76, %91 ], [ 0, %.thread ]
  %110 = and i32 %7, 4
  %.not48 = icmp eq i32 %110, 0
  br i1 %.not48, label %118, label %111

111:                                              ; preds = %.thread90
  %112 = call i32 @verify(ptr noundef %2, ptr noundef nonnull %4)
  %.not49 = icmp eq i32 %112, 0
  br i1 %.not49, label %113, label %118

113:                                              ; preds = %111
  br i1 %.not.not, label %117, label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr @stderr, align 8, !tbaa !14
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.8) #9
  br label %117

117:                                              ; preds = %114, %113
  call void @abort() #10
  unreachable

118:                                              ; preds = %111, %.thread90
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  ret i64 %.0.lcssa7694
}

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden { i64, i64 } @timediff(i64, i64, i64, i64) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @verify(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

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 = { 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { nounwind }
attributes #8 = { cold }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 8, !6, i64 8, i64 8, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"path", !7, i64 0, !8, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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