; LLVM IR from ryanlayer/giggle :: test/unit (test_giggle)

; 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.cache_def = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.file_id_offset_pair = type { i32, i64 }
%struct.__kstring_t = type { i64, i64, ptr }
%struct.uint64_t_ll = type { i64, ptr, ptr }
%struct.giggle_index = type { ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.uint64_t_ll_node = type { i64, ptr }
%struct.file_data = type { ptr, i32, double }
%struct.input_file = type { ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, ptr, ptr, ptr }

@ORDER = external dso_local global i32, align 4
@cache = external dso_local global %struct.cache_def, align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 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

declare ptr @simple_cache_init(i32 noundef, i32 noundef, ptr noundef) #1

declare void @uint64_t_ll_giggle_set_data_handler(...) #1

declare void @UnityAssertEqualNumber(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #1

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

declare void @uint64_t_ll_free(ptr noundef) #1

declare ptr @giggle_init_index(i32 noundef, ptr noundef) #1

declare void @giggle_index_destroy(ptr noundef) #1

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

declare i32 @giggle_index_file(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @test_uint64_t_ll_giggle_query_region() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.file_id_offset_pair, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, 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
  %15 = alloca i32, align 4
  %16 = alloca %struct.file_id_offset_pair, align 8
  store i32 10, ptr @ORDER, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #8
  %17 = call ptr @simple_cache_init(i32 noundef 1000, i32 noundef 30, ptr noundef null)
  store ptr %17, ptr %1, align 8, !tbaa !9
  call void (...) @uint64_t_ll_giggle_set_data_handler()
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %18 = call ptr @giggle_init_index(i32 noundef 30, ptr noundef @.str.1)
  store ptr %18, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store ptr @.str.8, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %19 = load ptr, ptr %2, align 8, !tbaa !9
  %20 = load ptr, ptr %3, align 8, !tbaa !9
  %21 = call i32 @giggle_index_file(ptr noundef %19, ptr noundef %20)
  store i32 %21, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %22 = load ptr, ptr %2, align 8, !tbaa !9
  %23 = call ptr @giggle_query_region(ptr noundef %22, ptr noundef @.str.11, i32 noundef 1000, i32 noundef 3000000)
  store ptr %23, ptr %5, align 8, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.uint64_t_ll, ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !11
  call void @UnityAssertEqualNumber(i64 noundef 2, i64 noundef %26, ptr noundef null, i64 noundef 1035, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #8
  %27 = load ptr, ptr %2, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.giggle_index, ptr %27, i32 0, i32 5
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.uint64_t_ll, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = getelementptr inbounds %struct.uint64_t_ll_node, ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !17
  %35 = call { i32, i64 } @offset_index_get(ptr noundef %29, i64 noundef %34)
  %36 = getelementptr inbounds { i32, i64 }, ptr %6, i32 0, i32 0
  %37 = extractvalue { i32, i64 } %35, 0
  store i32 %37, ptr %36, align 8
  %38 = getelementptr inbounds { i32, i64 }, ptr %6, i32 0, i32 1
  %39 = extractvalue { i32, i64 } %35, 1
  store i64 %39, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %40 = load ptr, ptr %2, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.giggle_index, ptr %40, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = getelementptr inbounds %struct.file_id_offset_pair, ptr %6, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !20
  %45 = call ptr @file_index_get(ptr noundef %42, i32 noundef %44)
  store ptr %45, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.file_data, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !22
  %49 = call ptr @input_file_init(ptr noundef %48)
  store ptr %49, ptr %8, align 8, !tbaa !9
  %50 = load ptr, ptr %8, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.input_file, ptr %50, i32 0, i32 10
  %52 = load ptr, ptr %51, align 8, !tbaa !25
  %53 = load ptr, ptr %8, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.file_id_offset_pair, ptr %6, i32 0, i32 1
  %55 = load i64, ptr %54, align 8, !tbaa !27
  call void %52(ptr noundef %53, i64 noundef %55)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 10, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = mul i64 %57, 1
  %59 = call noalias ptr @malloc(i64 noundef %58) #9
  store ptr %59, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #8
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %60 = load ptr, ptr %8, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.input_file, ptr %60, i32 0, i32 8
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  %63 = load ptr, ptr %8, align 8, !tbaa !9
  %64 = call i32 %62(ptr noundef %63, ptr noundef %10, ptr noundef %9, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  store i32 %64, ptr %15, align 4, !tbaa !5
  %65 = load ptr, ptr %10, align 8, !tbaa !9
  %66 = call i32 @strcmp(ptr noundef @.str.11, ptr noundef %65) #10
  %67 = sext i32 %66 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %67, ptr noundef null, i64 noundef 1064, i32 noundef 148)
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = zext i32 %68 to i64
  call void @UnityAssertEqualNumber(i64 noundef 575808, i64 noundef %69, ptr noundef null, i64 noundef 1065, i32 noundef 148)
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = zext i32 %70 to i64
  call void @UnityAssertEqualNumber(i64 noundef 576604, i64 noundef %71, ptr noundef null, i64 noundef 1066, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  %72 = load ptr, ptr %2, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.giggle_index, ptr %72, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  %75 = load ptr, ptr %5, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.uint64_t_ll, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !16
  %78 = getelementptr inbounds %struct.uint64_t_ll_node, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  %80 = getelementptr inbounds %struct.uint64_t_ll_node, ptr %79, i32 0, i32 0
  %81 = load i64, ptr %80, align 8, !tbaa !17
  %82 = call { i32, i64 } @offset_index_get(ptr noundef %74, i64 noundef %81)
  %83 = getelementptr inbounds { i32, i64 }, ptr %16, i32 0, i32 0
  %84 = extractvalue { i32, i64 } %82, 0
  store i32 %84, ptr %83, align 8
  %85 = getelementptr inbounds { i32, i64 }, ptr %16, i32 0, i32 1
  %86 = extractvalue { i32, i64 } %82, 1
  store i64 %86, ptr %85, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  %87 = load ptr, ptr %8, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.input_file, ptr %87, i32 0, i32 10
  %89 = load ptr, ptr %88, align 8, !tbaa !25
  %90 = load ptr, ptr %8, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.file_id_offset_pair, ptr %6, i32 0, i32 1
  %92 = load i64, ptr %91, align 8, !tbaa !27
  call void %89(ptr noundef %90, i64 noundef %92)
  %93 = load ptr, ptr %8, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.input_file, ptr %93, i32 0, i32 8
  %95 = load ptr, ptr %94, align 8, !tbaa !28
  %96 = load ptr, ptr %8, align 8, !tbaa !9
  %97 = call i32 %95(ptr noundef %96, ptr noundef %10, ptr noundef %9, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  store i32 %97, ptr %15, align 4, !tbaa !5
  %98 = load ptr, ptr %10, align 8, !tbaa !9
  %99 = call i32 @strcmp(ptr noundef @.str.11, ptr noundef %98) #10
  %100 = sext i32 %99 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %100, ptr noundef null, i64 noundef 1082, i32 noundef 148)
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = zext i32 %101 to i64
  call void @UnityAssertEqualNumber(i64 noundef 2950239, i64 noundef %102, ptr noundef null, i64 noundef 1083, i32 noundef 148)
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = zext i32 %103 to i64
  call void @UnityAssertEqualNumber(i64 noundef 2952321, i64 noundef %104, ptr noundef null, i64 noundef 1084, i32 noundef 148)
  call void @uint64_t_ll_free(ptr noundef %5)
  %105 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %105) #8
  %106 = getelementptr inbounds %struct.__kstring_t, ptr %14, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !32
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %112

109:                                              ; preds = %0
  %110 = getelementptr inbounds %struct.__kstring_t, ptr %14, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !32
  call void @free(ptr noundef %111) #8
  br label %112

112:                                              ; preds = %109, %0
  call void @input_file_destroy(ptr noundef %8)
  call void @giggle_index_destroy(ptr noundef %2)
  %113 = load ptr, ptr getelementptr inbounds (%struct.cache_def, ptr @cache, i32 0, i32 6), align 8, !tbaa !34
  call void (...) %113()
  %114 = call i32 @remove(ptr noundef @.str.1) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  ret void
}

declare ptr @giggle_query_region(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

declare { i32, i64 } @offset_index_get(ptr noundef, i64 noundef) #1

declare ptr @file_index_get(ptr noundef, i32 noundef) #1

declare ptr @input_file_init(ptr noundef) #1

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

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

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

declare void @input_file_destroy(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"uint64_t_ll", !13, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 32}
!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 = !{!12, !10, i64 8}
!17 = !{!18, !13, i64 0}
!18 = !{!"uint64_t_ll_node", !13, i64 0, !10, i64 8}
!19 = !{!15, !10, i64 24}
!20 = !{!21, !6, i64 0}
!21 = !{!"file_id_offset_pair", !6, i64 0, !13, i64 8}
!22 = !{!23, !10, i64 0}
!23 = !{!"file_data", !10, i64 0, !6, i64 8, !24, i64 16}
!24 = !{!"double", !7, i64 0}
!25 = !{!26, !10, i64 80}
!26 = !{!"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}
!27 = !{!21, !13, i64 8}
!28 = !{!26, !10, i64 64}
!29 = !{!18, !10, i64 8}
!30 = !{i64 0, i64 4, !5, i64 8, i64 8, !31}
!31 = !{!13, !13, i64 0}
!32 = !{!33, !10, i64 16}
!33 = !{!"__kstring_t", !13, i64 0, !13, i64 8, !10, i64 16}
!34 = !{!35, !10, i64 48}
!35 = !{!"cache_def", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}


; 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.cache_def = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__kstring_t = type { i64, i64, ptr }

@ORDER = external dso_local local_unnamed_addr global i32, align 4
@cache = external dso_local local_unnamed_addr global %struct.cache_def, align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 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

declare ptr @simple_cache_init(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @uint64_t_ll_giggle_set_data_handler(...) local_unnamed_addr #1

declare void @UnityAssertEqualNumber(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

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

declare void @uint64_t_ll_free(ptr noundef) local_unnamed_addr #1

declare ptr @giggle_init_index(i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @giggle_index_destroy(ptr noundef) local_unnamed_addr #1

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

declare i32 @giggle_index_file(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test_uint64_t_ll_giggle_query_region() local_unnamed_addr #4 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %struct.__kstring_t, align 8
  store i32 10, ptr @ORDER, align 4, !tbaa !5
  %10 = tail call ptr @simple_cache_init(i32 noundef 1000, i32 noundef 30, ptr noundef null) #8
  tail call void (...) @uint64_t_ll_giggle_set_data_handler() #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %11 = tail call ptr @giggle_init_index(i32 noundef 30, ptr noundef nonnull @.str.1) #8
  store ptr %11, ptr %1, align 8, !tbaa !9
  %12 = tail call i32 @giggle_index_file(ptr noundef %11, ptr noundef nonnull @.str.8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %13 = tail call ptr @giggle_query_region(ptr noundef %11, ptr noundef nonnull @.str.11, i32 noundef 1000, i32 noundef 3000000) #8
  store ptr %13, ptr %2, align 8, !tbaa !9
  %14 = load i64, ptr %13, align 8, !tbaa !11
  tail call void @UnityAssertEqualNumber(i64 noundef 2, i64 noundef %14, ptr noundef null, i64 noundef 1035, i32 noundef 148) #8
  %15 = getelementptr inbounds i8, ptr %11, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %13, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = load i64, ptr %18, align 8, !tbaa !17
  %20 = tail call { i32, i64 } @offset_index_get(ptr noundef %16, i64 noundef %19) #8
  %21 = extractvalue { i32, i64 } %20, 0
  %22 = extractvalue { i32, i64 } %20, 1
  %23 = getelementptr inbounds i8, ptr %11, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !19
  %25 = tail call ptr @file_index_get(ptr noundef %24, i32 noundef %21) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  %27 = tail call ptr @input_file_init(ptr noundef %26) #8
  store ptr %27, ptr %3, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %27, i64 80
  %29 = load ptr, ptr %28, align 8, !tbaa !23
  tail call void %29(ptr noundef %27, i64 noundef %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 10, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %30 = tail call noalias dereferenceable_or_null(10) ptr @malloc(i64 noundef 10) #9
  store ptr %30, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  %31 = getelementptr inbounds i8, ptr %27, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !25
  %33 = call i32 %32(ptr noundef %27, ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #8
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef nonnull dereferenceable(1) %34) #10
  %36 = sext i32 %35 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %36, ptr noundef null, i64 noundef 1064, i32 noundef 148) #8
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = zext i32 %37 to i64
  call void @UnityAssertEqualNumber(i64 noundef 575808, i64 noundef %38, ptr noundef null, i64 noundef 1065, i32 noundef 148) #8
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = zext i32 %39 to i64
  call void @UnityAssertEqualNumber(i64 noundef 576604, i64 noundef %40, ptr noundef null, i64 noundef 1066, i32 noundef 148) #8
  %41 = load ptr, ptr %15, align 8, !tbaa !14
  %42 = load ptr, ptr %17, align 8, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !26
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %46 = call { i32, i64 } @offset_index_get(ptr noundef %41, i64 noundef %45) #8
  %47 = extractvalue { i32, i64 } %46, 1
  %48 = load ptr, ptr %28, align 8, !tbaa !23
  call void %48(ptr noundef %27, i64 noundef %47) #8
  %49 = load ptr, ptr %31, align 8, !tbaa !25
  %50 = call i32 %49(ptr noundef %27, ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #8
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef nonnull dereferenceable(1) %51) #10
  %53 = sext i32 %52 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %53, ptr noundef null, i64 noundef 1082, i32 noundef 148) #8
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  call void @UnityAssertEqualNumber(i64 noundef 2950239, i64 noundef %55, ptr noundef null, i64 noundef 1083, i32 noundef 148) #8
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = zext i32 %56 to i64
  call void @UnityAssertEqualNumber(i64 noundef 2952321, i64 noundef %57, ptr noundef null, i64 noundef 1084, i32 noundef 148) #8
  call void @uint64_t_ll_free(ptr noundef nonnull %2) #8
  %58 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %58) #8
  %59 = getelementptr inbounds i8, ptr %9, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  %.not = icmp eq ptr %60, null
  br i1 %.not, label %62, label %61

61:                                               ; preds = %0
  call void @free(ptr noundef nonnull %60) #8
  br label %62

62:                                               ; preds = %61, %0
  call void @input_file_destroy(ptr noundef nonnull %3) #8
  call void @giggle_index_destroy(ptr noundef nonnull %1) #8
  %63 = load ptr, ptr getelementptr inbounds (i8, ptr @cache, i64 48), align 8, !tbaa !29
  call void (...) %63() #8
  %64 = call i32 @remove(ptr noundef nonnull @.str.1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret void
}

declare ptr @giggle_query_region(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare { i32, i64 } @offset_index_get(ptr noundef, i64 noundef) local_unnamed_addr #1

declare ptr @file_index_get(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @input_file_init(ptr noundef) local_unnamed_addr #1

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

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

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

declare void @input_file_destroy(ptr noundef) local_unnamed_addr #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"uint64_t_ll", !13, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 32}
!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 = !{!12, !10, i64 8}
!17 = !{!18, !13, i64 0}
!18 = !{!"uint64_t_ll_node", !13, i64 0, !10, i64 8}
!19 = !{!15, !10, i64 24}
!20 = !{!21, !10, i64 0}
!21 = !{!"file_data", !10, i64 0, !6, i64 8, !22, i64 16}
!22 = !{!"double", !7, i64 0}
!23 = !{!24, !10, i64 80}
!24 = !{!"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}
!25 = !{!24, !10, i64 64}
!26 = !{!18, !10, i64 8}
!27 = !{!28, !10, i64 16}
!28 = !{!"__kstring_t", !13, i64 0, !13, i64 8, !10, i64 16}
!29 = !{!30, !10, i64 48}
!30 = !{!"cache_def", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass