; LLVM IR from ryanlayer/giggle :: src (giggle_index)

; 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.priority = type { i32, [50 x i8] }
%struct.__kstring_t = type { i64, i64, ptr }
%struct.input_file = type { ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, ptr, ptr, ptr }
%struct.giggle_index = type { ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.file_data = type { ptr, i32, double }
%struct.pq_data = type { i32, i64 }

@.str.65 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [47 x i8], align 1
@__PRETTY_FUNCTION__.giggle_bulk_insert_prime_pqs = external hidden unnamed_addr constant [133 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @file_index_get(ptr noundef, i32 noundef) #5

declare i64 @offset_index_add(ptr noundef, i64 noundef, ptr noundef, i32 noundef) #6

; Function Attrs: nounwind uwtable
define dso_local void @giggle_bulk_insert_prime_pqs(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #5 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.priority, align 8
  %14 = alloca %struct.priority, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca %struct.__kstring_t, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 56, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 10, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %27 = load i32, ptr %16, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = mul i64 %28, 1
  %30 = call noalias ptr @malloc(i64 noundef %29) #9
  store ptr %30, ptr %17, align 8, !tbaa !5
  %31 = load ptr, ptr %17, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %6
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.67) #10
  unreachable

34:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #8
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  store i64 0, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %138, %34
  %36 = load i32, ptr %23, align 4, !tbaa !9
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = icmp ult i32 %36, %37
  br i1 %38, label %39, label %141

39:                                               ; preds = %35
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = load i32, ptr %23, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.input_file, ptr %44, i32 0, i32 8
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = load i32, ptr %23, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %47, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = call i32 %46(ptr noundef %51, ptr noundef %17, ptr noundef %16, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef %21)
  store i32 %52, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.giggle_index, ptr %53, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  %56 = load i32, ptr %23, align 4, !tbaa !9
  %57 = call ptr @file_index_get(ptr noundef %55, i32 noundef %56)
  store ptr %57, ptr %25, align 8, !tbaa !5
  %58 = load i32, ptr %19, align 4, !tbaa !9
  %59 = load i32, ptr %18, align 4, !tbaa !9
  %60 = sub i32 %58, %59
  %61 = uitofp i32 %60 to double
  %62 = load ptr, ptr %25, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.file_data, ptr %62, i32 0, i32 2
  %64 = load double, ptr %63, align 8, !tbaa !17
  %65 = fadd double %64, %61
  store double %65, ptr %63, align 8, !tbaa !17
  %66 = load ptr, ptr %25, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.file_data, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 8, !tbaa !20
  %69 = add i32 %68, 1
  store i32 %69, ptr %67, align 8, !tbaa !20
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.giggle_index, ptr %70, i32 0, i32 5
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = load i64, ptr %20, align 8, !tbaa !11
  %74 = load i32, ptr %23, align 4, !tbaa !9
  %75 = call i64 @offset_index_add(ptr noundef %72, i64 noundef %73, ptr noundef %21, i32 noundef %74)
  store i64 %75, ptr %22, align 8, !tbaa !11
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.giggle_index, ptr %76, i32 0, i32 6
  %78 = load ptr, ptr %77, align 8, !tbaa !22
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %92

80:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.giggle_index, ptr %81, i32 0, i32 6
  %83 = load ptr, ptr %82, align 8, !tbaa !22
  %84 = load i32, ptr %23, align 4, !tbaa !9
  %85 = call i64 @metadata_index_add(ptr noundef %83, i32 noundef %84, ptr noundef %21)
  store i64 %85, ptr %26, align 8, !tbaa !11
  %86 = load i64, ptr %22, align 8, !tbaa !11
  %87 = load i64, ptr %26, align 8, !tbaa !11
  %88 = icmp eq i64 %86, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %80
  br label %91

90:                                               ; preds = %80
  call void @__assert_fail(ptr noundef @.str.65, ptr noundef @.str.66, i32 noundef 2936, ptr noundef @__PRETTY_FUNCTION__.giggle_bulk_insert_prime_pqs) #11
  unreachable

91:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %92

92:                                               ; preds = %91, %39
  %93 = load i32, ptr %23, align 4, !tbaa !9
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = load i32, ptr %23, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds %struct.pq_data, ptr %94, i64 %96
  %98 = getelementptr inbounds %struct.pq_data, ptr %97, i32 0, i32 0
  store i32 %93, ptr %98, align 8, !tbaa !23
  %99 = load i64, ptr %22, align 8, !tbaa !11
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load i32, ptr %23, align 4, !tbaa !9
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds %struct.pq_data, ptr %100, i64 %102
  %104 = getelementptr inbounds %struct.pq_data, ptr %103, i32 0, i32 1
  store i64 %99, ptr %104, align 8, !tbaa !25
  %105 = load i32, ptr %18, align 4, !tbaa !9
  %106 = getelementptr inbounds %struct.priority, ptr %13, i32 0, i32 0
  store i32 %105, ptr %106, align 4, !tbaa !26
  %107 = getelementptr inbounds %struct.priority, ptr %13, i32 0, i32 1
  %108 = getelementptr inbounds [50 x i8], ptr %107, i64 0, i64 0
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = call ptr @strcpy(ptr noundef %108, ptr noundef %109) #8
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = load i32, ptr %23, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds %struct.pq_data, ptr %113, i64 %115
  call void @priq_push(ptr noundef %112, ptr noundef %116, ptr noundef byval(%struct.priority) align 8 %13)
  %117 = call noalias ptr @malloc(i64 noundef 16) #9
  store ptr %117, ptr %15, align 8, !tbaa !5
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %92
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.67) #10
  unreachable

121:                                              ; preds = %92
  %122 = load i32, ptr %23, align 4, !tbaa !9
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.pq_data, ptr %123, i32 0, i32 0
  store i32 %122, ptr %124, align 8, !tbaa !23
  %125 = load i64, ptr %22, align 8, !tbaa !11
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.pq_data, ptr %126, i32 0, i32 1
  store i64 %125, ptr %127, align 8, !tbaa !25
  %128 = load i32, ptr %19, align 4, !tbaa !9
  %129 = add i32 %128, 1
  %130 = getelementptr inbounds %struct.priority, ptr %14, i32 0, i32 0
  store i32 %129, ptr %130, align 4, !tbaa !26
  %131 = getelementptr inbounds %struct.priority, ptr %14, i32 0, i32 1
  %132 = getelementptr inbounds [50 x i8], ptr %131, i64 0, i64 0
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = call ptr @strcpy(ptr noundef %132, ptr noundef %133) #8
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  call void @priq_push(ptr noundef %136, ptr noundef %137, ptr noundef byval(%struct.priority) align 8 %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %138

138:                                              ; preds = %121
  %139 = load i32, ptr %23, align 4, !tbaa !9
  %140 = add i32 %139, 1
  store i32 %140, ptr %23, align 4, !tbaa !9
  br label %35, !llvm.loop !28

141:                                              ; preds = %35
  %142 = getelementptr inbounds %struct.__kstring_t, ptr %21, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !30
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %148

145:                                              ; preds = %141
  %146 = getelementptr inbounds %struct.__kstring_t, ptr %21, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !30
  call void @free(ptr noundef %147) #8
  br label %148

148:                                              ; preds = %145, %141
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %149) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #8
  ret void
}

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

declare i64 @metadata_index_add(ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

declare void @priq_push(ptr noundef, ptr noundef, ptr noundef byval(%struct.priority) align 8) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = { "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 = { 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { noreturn }
attributes #11 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 64}
!14 = !{!"input_file", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!15 = !{!16, !6, i64 24}
!16 = !{!"giggle_index", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!17 = !{!18, !19, i64 16}
!18 = !{!"file_data", !6, i64 0, !10, i64 8, !19, i64 16}
!19 = !{!"double", !7, i64 0}
!20 = !{!18, !10, i64 8}
!21 = !{!16, !6, i64 32}
!22 = !{!16, !6, i64 40}
!23 = !{!24, !10, i64 0}
!24 = !{!"pq_data", !10, i64 0, !12, i64 8}
!25 = !{!24, !12, i64 8}
!26 = !{!27, !10, i64 0}
!27 = !{!"", !10, i64 0, !7, i64 4}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !6, i64 16}
!31 = !{!"__kstring_t", !12, i64 0, !12, i64 8, !6, i64 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.priority = type { i32, [50 x i8] }
%struct.__kstring_t = type { i64, i64, ptr }
%struct.pq_data = type { i32, i64 }

@.str.65 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [47 x i8], align 1
@__PRETTY_FUNCTION__.giggle_bulk_insert_prime_pqs = external hidden unnamed_addr constant [133 x i8], align 1

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

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

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @file_index_get(ptr noundef, i32 noundef) local_unnamed_addr #5

declare i64 @offset_index_add(ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
define dso_local void @giggle_bulk_insert_prime_pqs(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, i32 noundef %5) local_unnamed_addr #5 {
  %7 = alloca %struct.priority, align 8
  %8 = alloca %struct.priority, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca %struct.__kstring_t, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  store i32 10, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %15 = tail call noalias dereferenceable_or_null(10) ptr @malloc(i64 noundef 10) #10
  store ptr %15, ptr %10, align 8, !tbaa !9
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %6
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.67) #11
  unreachable

18:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %14, i8 0, i64 24, i1 false)
  %.not38 = icmp eq i32 %5, 0
  br i1 %.not38, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %18
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = getelementptr inbounds i8, ptr %7, i64 4
  %23 = getelementptr inbounds i8, ptr %8, i64 4
  %wide.trip.count = zext i32 %5 to i64
  br label %24

24:                                               ; preds = %.lr.ph, %61
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %61 ]
  %25 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 64
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = call i32 %28(ptr noundef %26, ptr noundef nonnull %10, ptr noundef nonnull %9, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14) #9
  %30 = load ptr, ptr %19, align 8, !tbaa !14
  %31 = trunc nuw i64 %indvars.iv to i32
  %32 = call ptr @file_index_get(ptr noundef %30, i32 noundef %31)
  %33 = load i32, ptr %12, align 4, !tbaa !5
  %34 = load i32, ptr %11, align 4, !tbaa !5
  %35 = sub i32 %33, %34
  %36 = uitofp i32 %35 to double
  %37 = getelementptr inbounds i8, ptr %32, i64 16
  %38 = load double, ptr %37, align 8, !tbaa !16
  %39 = fadd double %38, %36
  store double %39, ptr %37, align 8, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %32, i64 8
  %41 = load i32, ptr %40, align 8, !tbaa !19
  %42 = add i32 %41, 1
  store i32 %42, ptr %40, align 8, !tbaa !19
  %43 = load ptr, ptr %20, align 8, !tbaa !20
  %44 = load i64, ptr %13, align 8, !tbaa !21
  %45 = call i64 @offset_index_add(ptr noundef %43, i64 noundef %44, ptr noundef nonnull %14, i32 noundef %31) #9
  %46 = load ptr, ptr %21, align 8, !tbaa !22
  %.not36 = icmp eq ptr %46, null
  br i1 %.not36, label %51, label %47

47:                                               ; preds = %24
  %48 = call i64 @metadata_index_add(ptr noundef nonnull %46, i32 noundef %31, ptr noundef nonnull %14) #9
  %49 = icmp eq i64 %45, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  call void @__assert_fail(ptr noundef nonnull @.str.65, ptr noundef nonnull @.str.66, i32 noundef 2936, ptr noundef nonnull @__PRETTY_FUNCTION__.giggle_bulk_insert_prime_pqs) #11
  unreachable

51:                                               ; preds = %47, %24
  %52 = getelementptr inbounds %struct.pq_data, ptr %2, i64 %indvars.iv
  store i32 %31, ptr %52, align 8, !tbaa !23
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  store i64 %45, ptr %53, align 8, !tbaa !25
  %54 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %54, ptr %7, align 8, !tbaa !26
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) %55) #9
  %57 = load ptr, ptr %1, align 8, !tbaa !9
  call void @priq_push(ptr noundef %57, ptr noundef nonnull %52, ptr noundef nonnull byval(%struct.priority) align 8 %7) #9
  %58 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #10
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %51
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.67) #11
  unreachable

61:                                               ; preds = %51
  store i32 %31, ptr %58, align 8, !tbaa !23
  %62 = getelementptr inbounds i8, ptr %58, i64 8
  store i64 %45, ptr %62, align 8, !tbaa !25
  %63 = load i32, ptr %12, align 4, !tbaa !5
  %64 = add i32 %63, 1
  store i32 %64, ptr %8, align 8, !tbaa !26
  %65 = load ptr, ptr %10, align 8, !tbaa !9
  %66 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) %65) #9
  %67 = load ptr, ptr %3, align 8, !tbaa !9
  call void @priq_push(ptr noundef %67, ptr noundef nonnull %58, ptr noundef nonnull byval(%struct.priority) align 8 %8) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %24, !llvm.loop !28

._crit_edge:                                      ; preds = %61
  %.phi.trans.insert = getelementptr inbounds i8, ptr %14, i64 16
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !30
  %.not = icmp eq ptr %.pre, null
  br i1 %.not, label %._crit_edge.thread, label %68

68:                                               ; preds = %._crit_edge
  call void @free(ptr noundef nonnull %.pre) #9
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %18, %68, %._crit_edge
  %69 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %69) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #9
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #7

declare i64 @metadata_index_add(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #8

declare void @priq_push(ptr noundef, ptr noundef, ptr noundef byval(%struct.priority) align 8) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn "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 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = { "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 nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { 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 = !{!"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, !10, i64 64}
!12 = !{!"input_file", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !13, i64 48, !6, i64 56, !10, i64 64, !10, i64 72, !10, i64 80}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 24}
!15 = !{!"giggle_index", !10, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!16 = !{!17, !18, i64 16}
!17 = !{!"file_data", !10, i64 0, !6, i64 8, !18, i64 16}
!18 = !{!"double", !7, i64 0}
!19 = !{!17, !6, i64 8}
!20 = !{!15, !10, i64 32}
!21 = !{!13, !13, i64 0}
!22 = !{!15, !10, i64 40}
!23 = !{!24, !6, i64 0}
!24 = !{!"pq_data", !6, i64 0, !13, i64 8}
!25 = !{!24, !13, i64 8}
!26 = !{!27, !6, i64 0}
!27 = !{!"", !6, i64 0, !7, i64 4}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !10, i64 16}
!31 = !{!"__kstring_t", !13, i64 0, !13, i64 8, !10, i64 16}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass