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

; 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.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.giggle_index = type { ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.bpt_node = type { ptr }

@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@OFFSET_INDEX_FILE_NAME = external dso_local global ptr, align 8
@CHRM_INDEX_FILE_NAME = external dso_local global ptr, align 8
@ORDER = external dso_local global i32, align 4
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@CACHE_FILE_NAME_PREFIX = external dso_local global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys = external hidden unnamed_addr constant [5 x i32], align 16
@__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers = external hidden unnamed_addr constant [6 x i32], align 16

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

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

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

declare void @input_file_destroy(ptr noundef) #1

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

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

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

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

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

declare i32 @rmrf(ptr noundef) #1

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

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

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

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

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

declare ptr @priq_new(i32 noundef) #1

declare void @giggle_bulk_insert_prime_pqs(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare void @priq_free(ptr noundef) #1

declare void @giggle_bulk_insert_build_leaf_levels(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare void @giggle_bulk_insert_build_tree_on_leaves(ptr noundef) #1

declare ptr @disk_store_load(ptr noundef, ptr noundef, 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) #5

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

declare i64 @bpt_node_deserialize(ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @test_giggle_bulk_insert_build_tree_on_leaves_few() #6 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca %struct.stat, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca [5 x i32], align 16
  %23 = alloca [6 x i32], align 16
  store i32 5, ptr @ORDER, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #7
  store ptr @.str.4, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store ptr @.str.5, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 144, ptr %3) #7
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 144, i1 false)
  %24 = load ptr, ptr %2, align 8, !tbaa !9
  %25 = call i32 @stat(ptr noundef %24, ptr noundef %3) #7
  %26 = icmp eq i32 %25, -1
  br i1 %26, label %27, label %30

27:                                               ; preds = %0
  %28 = load ptr, ptr %2, align 8, !tbaa !9
  %29 = call i32 @mkdir(ptr noundef %28, i32 noundef 448) #7
  br label %35

30:                                               ; preds = %0
  %31 = load ptr, ptr %2, align 8, !tbaa !9
  %32 = call i32 @rmrf(ptr noundef %31)
  %33 = load ptr, ptr %2, align 8, !tbaa !9
  %34 = call i32 @mkdir(ptr noundef %33, i32 noundef 448) #7
  br label %35

35:                                               ; preds = %30, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %36 = call noalias ptr @malloc(i64 noundef 64) #8
  store ptr %36, ptr %4, align 8, !tbaa !9
  %37 = load ptr, ptr %2, align 8, !tbaa !9
  %38 = call noalias ptr @strdup(ptr noundef %37) #7
  %39 = load ptr, ptr %4, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.giggle_index, ptr %39, i32 0, i32 7
  store ptr %38, ptr %40, align 8, !tbaa !11
  %41 = load ptr, ptr %4, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.giggle_index, ptr %41, i32 0, i32 4
  store ptr null, ptr %42, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store ptr null, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %43 = load ptr, ptr %1, align 8, !tbaa !9
  %44 = load ptr, ptr %4, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.giggle_index, ptr %44, i32 0, i32 7
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = load ptr, ptr %4, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.giggle_index, ptr %47, i32 0, i32 4
  %49 = call i32 @giggle_bulk_insert_open_files(ptr noundef %43, ptr noundef %46, ptr noundef %5, ptr noundef %48)
  store i32 %49, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %50 = load ptr, ptr %4, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.giggle_index, ptr %50, i32 0, i32 7
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = load ptr, ptr @OFFSET_INDEX_FILE_NAME, align 8, !tbaa !9
  %54 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %7, ptr noundef @.str.2, ptr noundef %52, ptr noundef %53) #7
  store i32 %54, ptr %8, align 4, !tbaa !5
  %55 = load ptr, ptr %7, align 8, !tbaa !9
  %56 = call ptr @offset_index_init(i32 noundef 1000, ptr noundef %55)
  %57 = load ptr, ptr %4, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.giggle_index, ptr %57, i32 0, i32 5
  store ptr %56, ptr %58, align 8, !tbaa !14
  %59 = load ptr, ptr %7, align 8, !tbaa !9
  call void @free(ptr noundef %59) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !9
  %60 = load ptr, ptr %4, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.giggle_index, ptr %60, i32 0, i32 7
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = load ptr, ptr @CHRM_INDEX_FILE_NAME, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %9, ptr noundef @.str.2, ptr noundef %62, ptr noundef %63) #7
  store i32 %64, ptr %8, align 4, !tbaa !5
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  %66 = call ptr @chrm_index_init(i32 noundef 24, ptr noundef %65)
  %67 = load ptr, ptr %4, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.giggle_index, ptr %67, i32 0, i32 3
  store ptr %66, ptr %68, align 8, !tbaa !15
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %69) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = call ptr @priq_new(i32 noundef %70)
  store ptr %71, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = zext i32 %72 to i64
  %74 = mul i64 %73, 16
  %75 = call noalias ptr @malloc(i64 noundef %74) #8
  store ptr %75, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = call ptr @priq_new(i32 noundef %76)
  store ptr %77, ptr %12, align 8, !tbaa !9
  %78 = load ptr, ptr %4, align 8, !tbaa !9
  %79 = load ptr, ptr %11, align 8, !tbaa !9
  %80 = load ptr, ptr %5, align 8, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !5
  call void @giggle_bulk_insert_prime_pqs(ptr noundef %78, ptr noundef %10, ptr noundef %79, ptr noundef %12, ptr noundef %80, i32 noundef %81)
  %82 = load ptr, ptr %4, align 8, !tbaa !9
  %83 = load ptr, ptr %11, align 8, !tbaa !9
  %84 = load ptr, ptr %5, align 8, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !5
  call void @giggle_bulk_insert_build_leaf_levels(ptr noundef %82, ptr noundef %10, ptr noundef %83, ptr noundef %12, ptr noundef %84, i32 noundef %85)
  %86 = load ptr, ptr %12, align 8, !tbaa !9
  call void @priq_free(ptr noundef %86)
  %87 = load ptr, ptr %10, align 8, !tbaa !9
  call void @priq_free(ptr noundef %87)
  %88 = load ptr, ptr %11, align 8, !tbaa !9
  call void @free(ptr noundef %88) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %98, %35
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = icmp ult i32 %90, %91
  br i1 %92, label %93, label %101

93:                                               ; preds = %89
  %94 = load ptr, ptr %5, align 8, !tbaa !9
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds ptr, ptr %94, i64 %96
  call void @input_file_destroy(ptr noundef %97)
  br label %98

98:                                               ; preds = %93
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = add i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !5
  br label %89, !llvm.loop !16

101:                                              ; preds = %89
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %102) #7
  %103 = load ptr, ptr %4, align 8, !tbaa !9
  call void @giggle_bulk_insert_build_tree_on_leaves(ptr noundef %103)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %104 = load ptr, ptr %4, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.giggle_index, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !18
  %107 = getelementptr inbounds i32, ptr %106, i64 0
  %108 = load i32, ptr %107, align 4, !tbaa !5
  store i32 %108, ptr %14, align 4, !tbaa !5
  call void @giggle_index_destroy(ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr null, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr null, ptr %16, align 8, !tbaa !9
  %109 = load ptr, ptr %2, align 8, !tbaa !9
  %110 = load ptr, ptr @CACHE_FILE_NAME_PREFIX, align 8, !tbaa !9
  %111 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %15, ptr noundef @.str.6, ptr noundef %109, ptr noundef %110) #7
  store i32 %111, ptr %8, align 4, !tbaa !5
  %112 = load ptr, ptr %2, align 8, !tbaa !9
  %113 = load ptr, ptr @CACHE_FILE_NAME_PREFIX, align 8, !tbaa !9
  %114 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %16, ptr noundef @.str.7, ptr noundef %112, ptr noundef %113) #7
  store i32 %114, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %115 = load ptr, ptr %15, align 8, !tbaa !9
  %116 = load ptr, ptr %16, align 8, !tbaa !9
  %117 = call ptr @disk_store_load(ptr noundef null, ptr noundef %115, ptr noundef null, ptr noundef %116)
  store ptr %117, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %118 = load ptr, ptr %17, align 8, !tbaa !9
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = sub i32 %119, 1
  %121 = call ptr @disk_store_get(ptr noundef %118, i32 noundef %120, ptr noundef %18)
  store ptr %121, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %122 = load ptr, ptr %19, align 8, !tbaa !9
  %123 = load i64, ptr %18, align 8, !tbaa !19
  %124 = call i64 @bpt_node_deserialize(ptr noundef %122, i64 noundef %123, ptr noundef %20)
  store i64 %124, ptr %21, align 8, !tbaa !19
  %125 = load ptr, ptr %19, align 8, !tbaa !9
  call void @free(ptr noundef %125) #7
  %126 = load ptr, ptr %20, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.bpt_node, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !21
  %129 = getelementptr inbounds i32, ptr %128, i64 5
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = zext i32 %130 to i64
  call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %131, ptr noundef null, i64 noundef 1398, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 20, ptr %22) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, i64 24, i1 false)
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %150, %101
  %133 = load i32, ptr %13, align 4, !tbaa !5
  %134 = icmp ult i32 %133, 5
  br i1 %134, label %135, label %153

135:                                              ; preds = %132
  %136 = load i32, ptr %13, align 4, !tbaa !5
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds [5 x i32], ptr %22, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = zext i32 %139 to i64
  %141 = load ptr, ptr %20, align 8, !tbaa !9
  %142 = getelementptr inbounds %struct.bpt_node, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !21
  %144 = getelementptr inbounds i32, ptr %143, i64 6
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds i32, ptr %144, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = zext i32 %148 to i64
  call void @UnityAssertEqualNumber(i64 noundef %140, i64 noundef %149, ptr noundef null, i64 noundef 1403, i32 noundef 148)
  br label %150

150:                                              ; preds = %135
  %151 = load i32, ptr %13, align 4, !tbaa !5
  %152 = add i32 %151, 1
  store i32 %152, ptr %13, align 4, !tbaa !5
  br label %132, !llvm.loop !23

153:                                              ; preds = %132
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %176, %153
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = icmp ult i32 %155, 6
  br i1 %156, label %157, label %179

157:                                              ; preds = %154
  %158 = load i32, ptr %13, align 4, !tbaa !5
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds [6 x i32], ptr %23, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = zext i32 %161 to i64
  %163 = load ptr, ptr %20, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.bpt_node, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %164, align 8, !tbaa !21
  %166 = load i32, ptr @ORDER, align 4, !tbaa !5
  %167 = add i32 6, %166
  %168 = add i32 %167, 2
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds i32, ptr %165, i64 %169
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = zext i32 %171 to i64
  %173 = getelementptr inbounds i32, ptr %170, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = zext i32 %174 to i64
  call void @UnityAssertEqualNumber(i64 noundef %162, i64 noundef %175, ptr noundef null, i64 noundef 1406, i32 noundef 148)
  br label %176

176:                                              ; preds = %157
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = add i32 %177, 1
  store i32 %178, ptr %13, align 4, !tbaa !5
  br label %154, !llvm.loop !24

179:                                              ; preds = %154
  %180 = load ptr, ptr %20, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.bpt_node, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !21
  call void @free(ptr noundef %182) #7
  %183 = load ptr, ptr %20, align 8, !tbaa !9
  call void @free(ptr noundef %183) #7
  call void @disk_store_destroy(ptr noundef %17)
  %184 = load ptr, ptr %2, align 8, !tbaa !9
  %185 = call i32 @rmrf(ptr noundef %184)
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 20, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #7
  ret void
}

declare void @giggle_index_destroy(ptr noundef) #1

declare void @disk_store_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: write) }
attributes #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

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

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


; 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.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@OFFSET_INDEX_FILE_NAME = external dso_local local_unnamed_addr global ptr, align 8
@CHRM_INDEX_FILE_NAME = external dso_local local_unnamed_addr global ptr, align 8
@ORDER = external dso_local local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@CACHE_FILE_NAME_PREFIX = external dso_local local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys = external hidden unnamed_addr constant [5 x i32], align 16
@__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers = external hidden unnamed_addr constant [6 x i32], align 16

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

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

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

declare void @input_file_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

declare i32 @rmrf(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 nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @asprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #7

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

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

declare ptr @priq_new(i32 noundef) local_unnamed_addr #1

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

declare void @priq_free(ptr noundef) local_unnamed_addr #1

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

declare void @giggle_bulk_insert_build_tree_on_leaves(ptr noundef) local_unnamed_addr #1

declare ptr @disk_store_load(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare i64 @bpt_node_deserialize(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test_giggle_bulk_insert_build_tree_on_leaves_few() local_unnamed_addr #8 {
  %1 = alloca %struct.stat, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  store i32 5, ptr @ORDER, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %1) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(144) %1, i8 0, i64 144, i1 false)
  %13 = call i32 @stat(ptr noundef nonnull @.str.5, ptr noundef nonnull %1) #9
  %14 = icmp eq i32 %13, -1
  br i1 %14, label %17, label %15

15:                                               ; preds = %0
  %16 = tail call i32 @rmrf(ptr noundef nonnull @.str.5) #9
  br label %17

17:                                               ; preds = %0, %15
  %18 = tail call i32 @mkdir(ptr noundef nonnull @.str.5, i32 noundef 448) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  %19 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #10
  store ptr %19, ptr %2, align 8, !tbaa !9
  %20 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.5) #9
  %21 = getelementptr inbounds i8, ptr %19, i64 48
  store ptr %20, ptr %21, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %19, i64 24
  store ptr null, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store ptr null, ptr %3, align 8, !tbaa !9
  %23 = call i32 @giggle_bulk_insert_open_files(ptr noundef nonnull @.str.4, ptr noundef %20, ptr noundef nonnull %3, ptr noundef nonnull %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store ptr null, ptr %4, align 8, !tbaa !9
  %24 = load ptr, ptr %21, align 8, !tbaa !11
  %25 = load ptr, ptr @OFFSET_INDEX_FILE_NAME, align 8, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.2, ptr noundef %24, ptr noundef %25) #9
  %27 = load ptr, ptr %4, align 8, !tbaa !9
  %28 = call ptr @offset_index_init(i32 noundef 1000, ptr noundef %27) #9
  %29 = getelementptr inbounds i8, ptr %19, i64 32
  store ptr %28, ptr %29, align 8, !tbaa !14
  %30 = load ptr, ptr %4, align 8, !tbaa !9
  call void @free(ptr noundef %30) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  store ptr null, ptr %5, align 8, !tbaa !9
  %31 = load ptr, ptr %21, align 8, !tbaa !11
  %32 = load ptr, ptr @CHRM_INDEX_FILE_NAME, align 8, !tbaa !9
  %33 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.2, ptr noundef %31, ptr noundef %32) #9
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = call ptr @chrm_index_init(i32 noundef 24, ptr noundef %34) #9
  %36 = getelementptr inbounds i8, ptr %19, i64 16
  store ptr %35, ptr %36, align 8, !tbaa !15
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %37) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %38 = call ptr @priq_new(i32 noundef %23) #9
  store ptr %38, ptr %6, align 8, !tbaa !9
  %39 = zext i32 %23 to i64
  %40 = shl nuw nsw i64 %39, 4
  %41 = call noalias ptr @malloc(i64 noundef %40) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %42 = call ptr @priq_new(i32 noundef %23) #9
  store ptr %42, ptr %7, align 8, !tbaa !9
  %43 = load ptr, ptr %3, align 8, !tbaa !9
  call void @giggle_bulk_insert_prime_pqs(ptr noundef %19, ptr noundef nonnull %6, ptr noundef %41, ptr noundef nonnull %7, ptr noundef %43, i32 noundef %23) #9
  %44 = load ptr, ptr %3, align 8, !tbaa !9
  call void @giggle_bulk_insert_build_leaf_levels(ptr noundef %19, ptr noundef nonnull %6, ptr noundef %41, ptr noundef nonnull %7, ptr noundef %44, i32 noundef %23) #9
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  call void @priq_free(ptr noundef %45) #9
  %46 = load ptr, ptr %6, align 8, !tbaa !9
  call void @priq_free(ptr noundef %46) #9
  call void @free(ptr noundef %41) #9
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %17 ]
  %47 = load ptr, ptr %3, align 8, !tbaa !9
  %48 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv
  call void @input_file_destroy(ptr noundef %48) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %39
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %17
  %49 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %49) #9
  call void @giggle_bulk_insert_build_tree_on_leaves(ptr noundef %19) #9
  %50 = load ptr, ptr %19, align 8, !tbaa !18
  %51 = load i32, ptr %50, align 4, !tbaa !5
  call void @giggle_index_destroy(ptr noundef nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  store ptr null, ptr %9, align 8, !tbaa !9
  %52 = load ptr, ptr @CACHE_FILE_NAME_PREFIX, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.5, ptr noundef %52) #9
  %54 = load ptr, ptr @CACHE_FILE_NAME_PREFIX, align 8, !tbaa !9
  %55 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.5, ptr noundef %54) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %56 = load ptr, ptr %8, align 8, !tbaa !9
  %57 = load ptr, ptr %9, align 8, !tbaa !9
  %58 = call ptr @disk_store_load(ptr noundef null, ptr noundef %56, ptr noundef null, ptr noundef %57) #9
  store ptr %58, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  %59 = add i32 %51, -1
  %60 = call ptr @disk_store_get(ptr noundef %58, i32 noundef %59, ptr noundef nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  %61 = load i64, ptr %11, align 8, !tbaa !19
  %62 = call i64 @bpt_node_deserialize(ptr noundef %60, i64 noundef %61, ptr noundef nonnull %12) #9
  call void @free(ptr noundef %60) #9
  %63 = load ptr, ptr %12, align 8, !tbaa !9
  %64 = load ptr, ptr %63, align 8, !tbaa !21
  %65 = getelementptr inbounds i8, ptr %64, i64 20
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %67, ptr noundef null, i64 noundef 1398, i32 noundef 148) #9
  %68 = load i32, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys, align 16, !tbaa !5
  %69 = zext i32 %68 to i64
  %70 = load ptr, ptr %12, align 8, !tbaa !9
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = getelementptr inbounds i8, ptr %71, i64 24
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  call void @UnityAssertEqualNumber(i64 noundef %69, i64 noundef %74, ptr noundef null, i64 noundef 1403, i32 noundef 148) #9
  %75 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys, i64 4), align 4, !tbaa !5
  %76 = zext i32 %75 to i64
  %77 = load ptr, ptr %12, align 8, !tbaa !9
  %78 = load ptr, ptr %77, align 8, !tbaa !21
  %79 = getelementptr inbounds i8, ptr %78, i64 28
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = zext i32 %80 to i64
  call void @UnityAssertEqualNumber(i64 noundef %76, i64 noundef %81, ptr noundef null, i64 noundef 1403, i32 noundef 148) #9
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys, i64 8), align 8, !tbaa !5
  %83 = zext i32 %82 to i64
  %84 = load ptr, ptr %12, align 8, !tbaa !9
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  %86 = getelementptr inbounds i8, ptr %85, i64 32
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = zext i32 %87 to i64
  call void @UnityAssertEqualNumber(i64 noundef %83, i64 noundef %88, ptr noundef null, i64 noundef 1403, i32 noundef 148) #9
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys, i64 12), align 4, !tbaa !5
  %90 = zext i32 %89 to i64
  %91 = load ptr, ptr %12, align 8, !tbaa !9
  %92 = load ptr, ptr %91, align 8, !tbaa !21
  %93 = getelementptr inbounds i8, ptr %92, i64 36
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = zext i32 %94 to i64
  call void @UnityAssertEqualNumber(i64 noundef %90, i64 noundef %95, ptr noundef null, i64 noundef 1403, i32 noundef 148) #9
  %96 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_keys, i64 16), align 16, !tbaa !5
  %97 = zext i32 %96 to i64
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = getelementptr inbounds i8, ptr %99, i64 40
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = zext i32 %101 to i64
  call void @UnityAssertEqualNumber(i64 noundef %97, i64 noundef %102, ptr noundef null, i64 noundef 1403, i32 noundef 148) #9
  %103 = load i32, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, align 16, !tbaa !5
  %104 = zext i32 %103 to i64
  %105 = load ptr, ptr %12, align 8, !tbaa !9
  %106 = load ptr, ptr %105, align 8, !tbaa !21
  %107 = load i32, ptr @ORDER, align 4, !tbaa !5
  %108 = add i32 %107, 8
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %106, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = zext i32 %111 to i64
  call void @UnityAssertEqualNumber(i64 noundef %104, i64 noundef %112, ptr noundef null, i64 noundef 1406, i32 noundef 148) #9
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, i64 4), align 4, !tbaa !5
  %114 = zext i32 %113 to i64
  %115 = load ptr, ptr %12, align 8, !tbaa !9
  %116 = load ptr, ptr %115, align 8, !tbaa !21
  %117 = load i32, ptr @ORDER, align 4, !tbaa !5
  %118 = add i32 %117, 8
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %116, i64 %119
  %121 = getelementptr inbounds i8, ptr %120, i64 4
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = zext i32 %122 to i64
  call void @UnityAssertEqualNumber(i64 noundef %114, i64 noundef %123, ptr noundef null, i64 noundef 1406, i32 noundef 148) #9
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, i64 8), align 8, !tbaa !5
  %125 = zext i32 %124 to i64
  %126 = load ptr, ptr %12, align 8, !tbaa !9
  %127 = load ptr, ptr %126, align 8, !tbaa !21
  %128 = load i32, ptr @ORDER, align 4, !tbaa !5
  %129 = add i32 %128, 8
  %130 = zext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %127, i64 %130
  %132 = getelementptr inbounds i8, ptr %131, i64 8
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = zext i32 %133 to i64
  call void @UnityAssertEqualNumber(i64 noundef %125, i64 noundef %134, ptr noundef null, i64 noundef 1406, i32 noundef 148) #9
  %135 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, i64 12), align 4, !tbaa !5
  %136 = zext i32 %135 to i64
  %137 = load ptr, ptr %12, align 8, !tbaa !9
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  %139 = load i32, ptr @ORDER, align 4, !tbaa !5
  %140 = add i32 %139, 8
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %138, i64 %141
  %143 = getelementptr inbounds i8, ptr %142, i64 12
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = zext i32 %144 to i64
  call void @UnityAssertEqualNumber(i64 noundef %136, i64 noundef %145, ptr noundef null, i64 noundef 1406, i32 noundef 148) #9
  %146 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, i64 16), align 16, !tbaa !5
  %147 = zext i32 %146 to i64
  %148 = load ptr, ptr %12, align 8, !tbaa !9
  %149 = load ptr, ptr %148, align 8, !tbaa !21
  %150 = load i32, ptr @ORDER, align 4, !tbaa !5
  %151 = add i32 %150, 8
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %149, i64 %152
  %154 = getelementptr inbounds i8, ptr %153, i64 16
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = zext i32 %155 to i64
  call void @UnityAssertEqualNumber(i64 noundef %147, i64 noundef %156, ptr noundef null, i64 noundef 1406, i32 noundef 148) #9
  %157 = load i32, ptr getelementptr inbounds (i8, ptr @__const.test_giggle_bulk_insert_build_tree_on_leaves_few.A_pointers, i64 20), align 4, !tbaa !5
  %158 = zext i32 %157 to i64
  %159 = load ptr, ptr %12, align 8, !tbaa !9
  %160 = load ptr, ptr %159, align 8, !tbaa !21
  %161 = load i32, ptr @ORDER, align 4, !tbaa !5
  %162 = add i32 %161, 8
  %163 = zext i32 %162 to i64
  %164 = getelementptr inbounds i32, ptr %160, i64 %163
  %165 = getelementptr inbounds i8, ptr %164, i64 20
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = zext i32 %166 to i64
  call void @UnityAssertEqualNumber(i64 noundef %158, i64 noundef %167, ptr noundef null, i64 noundef 1406, i32 noundef 148) #9
  %168 = load ptr, ptr %12, align 8, !tbaa !9
  %169 = load ptr, ptr %168, align 8, !tbaa !21
  call void @free(ptr noundef %169) #9
  %170 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %170) #9
  call void @disk_store_destroy(ptr noundef nonnull %10) #9
  %171 = call i32 @rmrf(ptr noundef nonnull @.str.5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %1) #9
  ret void
}

declare void @giggle_index_destroy(ptr noundef) local_unnamed_addr #1

declare void @disk_store_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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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 nofree nounwind willreturn 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 #7 = { 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 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 allocsize(0) }

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

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


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