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

; 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.bpt_node = type { ptr }

@ORDER = external dso_local global i32, align 4
@cache = external dso_local global %struct.cache_def, align 8

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

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

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

declare ptr @bpt_new_node(i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @test_bpt_find_leaf() #2 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %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 i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  %9 = call ptr @simple_cache_init(i32 noundef 5, i32 noundef 1, ptr noundef null)
  store ptr %9, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %10 = load i32, ptr %2, align 4, !tbaa !9
  %11 = call ptr @bpt_new_node(i32 noundef %10)
  store ptr %11, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.bpt_node, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds i32, ptr %14, i64 5
  store i32 1, ptr %15, align 4, !tbaa !9
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.bpt_node, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds i32, ptr %18, i64 6
  %20 = getelementptr inbounds i32, ptr %19, i64 0
  store i32 9, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = call ptr @bpt_new_node(i32 noundef %21)
  store ptr %22, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.bpt_node, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds i32, ptr %25, i64 5
  store i32 1, ptr %26, align 4, !tbaa !9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.bpt_node, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds i32, ptr %29, i64 6
  %31 = getelementptr inbounds i32, ptr %30, i64 0
  store i32 5, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %32 = load i32, ptr %2, align 4, !tbaa !9
  %33 = call ptr @bpt_new_node(i32 noundef %32)
  store ptr %33, ptr %5, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.bpt_node, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds i32, ptr %36, i64 2
  store i32 1, ptr %37, align 4, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.bpt_node, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds i32, ptr %40, i64 5
  store i32 4, ptr %41, align 4, !tbaa !9
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.bpt_node, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds i32, ptr %44, i64 6
  %46 = getelementptr inbounds i32, ptr %45, i64 0
  store i32 1, ptr %46, align 4, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.bpt_node, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds i32, ptr %49, i64 6
  %51 = getelementptr inbounds i32, ptr %50, i64 1
  store i32 2, ptr %51, align 4, !tbaa !9
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.bpt_node, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = getelementptr inbounds i32, ptr %54, i64 6
  %56 = getelementptr inbounds i32, ptr %55, i64 2
  store i32 3, ptr %56, align 4, !tbaa !9
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.bpt_node, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  %60 = getelementptr inbounds i32, ptr %59, i64 6
  %61 = getelementptr inbounds i32, ptr %60, i64 3
  store i32 4, ptr %61, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %62 = load i32, ptr %2, align 4, !tbaa !9
  %63 = call ptr @bpt_new_node(i32 noundef %62)
  store ptr %63, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.bpt_node, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = getelementptr inbounds i32, ptr %66, i64 2
  store i32 1, ptr %67, align 4, !tbaa !9
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.bpt_node, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds i32, ptr %70, i64 5
  store i32 4, ptr %71, align 4, !tbaa !9
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.bpt_node, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = getelementptr inbounds i32, ptr %74, i64 6
  %76 = getelementptr inbounds i32, ptr %75, i64 0
  store i32 5, ptr %76, align 4, !tbaa !9
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.bpt_node, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = getelementptr inbounds i32, ptr %79, i64 6
  %81 = getelementptr inbounds i32, ptr %80, i64 1
  store i32 6, ptr %81, align 4, !tbaa !9
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.bpt_node, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds i32, ptr %84, i64 6
  %86 = getelementptr inbounds i32, ptr %85, i64 2
  store i32 7, ptr %86, align 4, !tbaa !9
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.bpt_node, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = getelementptr inbounds i32, ptr %89, i64 6
  %91 = getelementptr inbounds i32, ptr %90, i64 3
  store i32 8, ptr %91, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %92 = load i32, ptr %2, align 4, !tbaa !9
  %93 = call ptr @bpt_new_node(i32 noundef %92)
  store ptr %93, ptr %7, align 8, !tbaa !5
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.bpt_node, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = getelementptr inbounds i32, ptr %96, i64 2
  store i32 1, ptr %97, align 4, !tbaa !9
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.bpt_node, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds i32, ptr %100, i64 5
  store i32 4, ptr %101, align 4, !tbaa !9
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.bpt_node, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = getelementptr inbounds i32, ptr %104, i64 6
  %106 = getelementptr inbounds i32, ptr %105, i64 0
  store i32 9, ptr %106, align 4, !tbaa !9
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.bpt_node, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = getelementptr inbounds i32, ptr %109, i64 6
  %111 = getelementptr inbounds i32, ptr %110, i64 1
  store i32 10, ptr %111, align 4, !tbaa !9
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.bpt_node, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !11
  %115 = getelementptr inbounds i32, ptr %114, i64 6
  %116 = getelementptr inbounds i32, ptr %115, i64 2
  store i32 11, ptr %116, align 4, !tbaa !9
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.bpt_node, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = getelementptr inbounds i32, ptr %119, i64 6
  %121 = getelementptr inbounds i32, ptr %120, i64 3
  store i32 12, ptr %121, align 4, !tbaa !9
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.bpt_node, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !11
  %125 = getelementptr inbounds i32, ptr %124, i64 0
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.bpt_node, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !11
  %130 = getelementptr inbounds i32, ptr %129, i64 4
  store i32 %126, ptr %130, align 4, !tbaa !9
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.bpt_node, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds i32, ptr %133, i64 0
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.bpt_node, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = getelementptr inbounds i32, ptr %138, i64 4
  store i32 %135, ptr %139, align 4, !tbaa !9
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.bpt_node, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !11
  %143 = getelementptr inbounds i32, ptr %142, i64 0
  %144 = load i32, ptr %143, align 4, !tbaa !9
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.bpt_node, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !11
  %148 = load i32, ptr @ORDER, align 4, !tbaa !9
  %149 = add i32 6, %148
  %150 = add i32 %149, 2
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %147, i64 %151
  %153 = getelementptr inbounds i32, ptr %152, i64 0
  store i32 %144, ptr %153, align 4, !tbaa !9
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.bpt_node, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !11
  %157 = getelementptr inbounds i32, ptr %156, i64 0
  %158 = load i32, ptr %157, align 4, !tbaa !9
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.bpt_node, ptr %159, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8, !tbaa !11
  %162 = load i32, ptr @ORDER, align 4, !tbaa !9
  %163 = add i32 6, %162
  %164 = add i32 %163, 2
  %165 = zext i32 %164 to i64
  %166 = getelementptr inbounds i32, ptr %161, i64 %165
  %167 = getelementptr inbounds i32, ptr %166, i64 1
  store i32 %158, ptr %167, align 4, !tbaa !9
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.bpt_node, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !11
  %171 = getelementptr inbounds i32, ptr %170, i64 0
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.bpt_node, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !11
  %176 = getelementptr inbounds i32, ptr %175, i64 1
  store i32 %172, ptr %176, align 4, !tbaa !9
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.bpt_node, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds i32, ptr %179, i64 0
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.bpt_node, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !11
  %185 = getelementptr inbounds i32, ptr %184, i64 1
  store i32 %181, ptr %185, align 4, !tbaa !9
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.bpt_node, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !11
  %189 = getelementptr inbounds i32, ptr %188, i64 0
  %190 = load i32, ptr %189, align 4, !tbaa !9
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.bpt_node, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = load i32, ptr @ORDER, align 4, !tbaa !9
  %195 = add i32 6, %194
  %196 = add i32 %195, 2
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds i32, ptr %193, i64 %197
  %199 = getelementptr inbounds i32, ptr %198, i64 0
  store i32 %190, ptr %199, align 4, !tbaa !9
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.bpt_node, ptr %200, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !11
  %203 = getelementptr inbounds i32, ptr %202, i64 0
  %204 = load i32, ptr %203, align 4, !tbaa !9
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.bpt_node, ptr %205, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  %208 = load i32, ptr @ORDER, align 4, !tbaa !9
  %209 = add i32 6, %208
  %210 = add i32 %209, 2
  %211 = zext i32 %210 to i64
  %212 = getelementptr inbounds i32, ptr %207, i64 %211
  %213 = getelementptr inbounds i32, ptr %212, i64 1
  store i32 %204, ptr %213, align 4, !tbaa !9
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.bpt_node, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !11
  %217 = getelementptr inbounds i32, ptr %216, i64 0
  %218 = load i32, ptr %217, align 4, !tbaa !9
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.bpt_node, ptr %219, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !11
  %222 = getelementptr inbounds i32, ptr %221, i64 1
  store i32 %218, ptr %222, align 4, !tbaa !9
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.bpt_node, ptr %223, i32 0, i32 0
  %225 = load ptr, ptr %224, align 8, !tbaa !11
  %226 = getelementptr inbounds i32, ptr %225, i64 0
  %227 = load i32, ptr %226, align 4, !tbaa !9
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.bpt_node, ptr %228, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8, !tbaa !11
  %231 = getelementptr inbounds i32, ptr %230, i64 1
  store i32 %227, ptr %231, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %232

232:                                              ; preds = %251, %0
  %233 = load i32, ptr %8, align 4, !tbaa !9
  %234 = icmp sle i32 %233, 4
  br i1 %234, label %235, label %254

235:                                              ; preds = %232
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.bpt_node, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !11
  %239 = getelementptr inbounds i32, ptr %238, i64 0
  %240 = load i32, ptr %239, align 4, !tbaa !9
  %241 = zext i32 %240 to i64
  %242 = load i32, ptr %2, align 4, !tbaa !9
  %243 = load ptr, ptr %3, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.bpt_node, ptr %243, i32 0, i32 0
  %245 = load ptr, ptr %244, align 8, !tbaa !11
  %246 = getelementptr inbounds i32, ptr %245, i64 0
  %247 = load i32, ptr %246, align 4, !tbaa !9
  %248 = load i32, ptr %8, align 4, !tbaa !9
  %249 = call i32 @bpt_find_leaf(i32 noundef %242, i32 noundef %247, i32 noundef %248)
  %250 = zext i32 %249 to i64
  call void @UnityAssertEqualNumber(i64 noundef %241, i64 noundef %250, ptr noundef null, i64 noundef 245, i32 noundef 148)
  br label %251

251:                                              ; preds = %235
  %252 = load i32, ptr %8, align 4, !tbaa !9
  %253 = add nsw i32 %252, 1
  store i32 %253, ptr %8, align 4, !tbaa !9
  br label %232, !llvm.loop !13

254:                                              ; preds = %232
  store i32 5, ptr %8, align 4, !tbaa !9
  br label %255

255:                                              ; preds = %274, %254
  %256 = load i32, ptr %8, align 4, !tbaa !9
  %257 = icmp sle i32 %256, 8
  br i1 %257, label %258, label %277

258:                                              ; preds = %255
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.bpt_node, ptr %259, i32 0, i32 0
  %261 = load ptr, ptr %260, align 8, !tbaa !11
  %262 = getelementptr inbounds i32, ptr %261, i64 0
  %263 = load i32, ptr %262, align 4, !tbaa !9
  %264 = zext i32 %263 to i64
  %265 = load i32, ptr %2, align 4, !tbaa !9
  %266 = load ptr, ptr %3, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.bpt_node, ptr %266, i32 0, i32 0
  %268 = load ptr, ptr %267, align 8, !tbaa !11
  %269 = getelementptr inbounds i32, ptr %268, i64 0
  %270 = load i32, ptr %269, align 4, !tbaa !9
  %271 = load i32, ptr %8, align 4, !tbaa !9
  %272 = call i32 @bpt_find_leaf(i32 noundef %265, i32 noundef %270, i32 noundef %271)
  %273 = zext i32 %272 to i64
  call void @UnityAssertEqualNumber(i64 noundef %264, i64 noundef %273, ptr noundef null, i64 noundef 249, i32 noundef 148)
  br label %274

274:                                              ; preds = %258
  %275 = load i32, ptr %8, align 4, !tbaa !9
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %8, align 4, !tbaa !9
  br label %255, !llvm.loop !15

277:                                              ; preds = %255
  store i32 9, ptr %8, align 4, !tbaa !9
  br label %278

278:                                              ; preds = %297, %277
  %279 = load i32, ptr %8, align 4, !tbaa !9
  %280 = icmp sle i32 %279, 12
  br i1 %280, label %281, label %300

281:                                              ; preds = %278
  %282 = load ptr, ptr %7, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.bpt_node, ptr %282, i32 0, i32 0
  %284 = load ptr, ptr %283, align 8, !tbaa !11
  %285 = getelementptr inbounds i32, ptr %284, i64 0
  %286 = load i32, ptr %285, align 4, !tbaa !9
  %287 = zext i32 %286 to i64
  %288 = load i32, ptr %2, align 4, !tbaa !9
  %289 = load ptr, ptr %3, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.bpt_node, ptr %289, i32 0, i32 0
  %291 = load ptr, ptr %290, align 8, !tbaa !11
  %292 = getelementptr inbounds i32, ptr %291, i64 0
  %293 = load i32, ptr %292, align 4, !tbaa !9
  %294 = load i32, ptr %8, align 4, !tbaa !9
  %295 = call i32 @bpt_find_leaf(i32 noundef %288, i32 noundef %293, i32 noundef %294)
  %296 = zext i32 %295 to i64
  call void @UnityAssertEqualNumber(i64 noundef %287, i64 noundef %296, ptr noundef null, i64 noundef 253, i32 noundef 148)
  br label %297

297:                                              ; preds = %281
  %298 = load i32, ptr %8, align 4, !tbaa !9
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %8, align 4, !tbaa !9
  br label %278, !llvm.loop !16

300:                                              ; preds = %278
  %301 = load ptr, ptr getelementptr inbounds (%struct.cache_def, ptr @cache, i32 0, i32 6), align 8, !tbaa !17
  call void (...) %301()
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

declare i32 @bpt_find_leaf(i32 noundef, i32 noundef, i32 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !6, i64 0}
!12 = !{!"bpt_node", !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !6, i64 48}
!18 = !{!"cache_def", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, 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 }

@ORDER = external dso_local local_unnamed_addr global i32, align 4
@cache = external dso_local local_unnamed_addr global %struct.cache_def, align 8

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

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

declare ptr @bpt_new_node(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @test_bpt_find_leaf() local_unnamed_addr #1 {
.preheader64.preheader:
  %0 = tail call ptr @simple_cache_init(i32 noundef 5, i32 noundef 1, ptr noundef null) #2
  %1 = tail call ptr @bpt_new_node(i32 noundef 0) #2
  %2 = load ptr, ptr %1, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 1, ptr %3, align 4, !tbaa !10
  %4 = getelementptr inbounds i8, ptr %2, i64 24
  store i32 9, ptr %4, align 4, !tbaa !10
  %5 = tail call ptr @bpt_new_node(i32 noundef 0) #2
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 20
  store i32 1, ptr %7, align 4, !tbaa !10
  %8 = getelementptr inbounds i8, ptr %6, i64 24
  store i32 5, ptr %8, align 4, !tbaa !10
  %9 = tail call ptr @bpt_new_node(i32 noundef 0) #2
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 1, ptr %11, align 4, !tbaa !10
  %12 = getelementptr inbounds i8, ptr %10, i64 20
  store <4 x i32> <i32 4, i32 1, i32 2, i32 3>, ptr %12, align 4, !tbaa !10
  %13 = getelementptr inbounds i8, ptr %10, i64 36
  store i32 4, ptr %13, align 4, !tbaa !10
  %14 = tail call ptr @bpt_new_node(i32 noundef 0) #2
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  store i32 1, ptr %16, align 4, !tbaa !10
  %17 = getelementptr inbounds i8, ptr %15, i64 20
  store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, ptr %17, align 4, !tbaa !10
  %18 = getelementptr inbounds i8, ptr %15, i64 36
  store i32 8, ptr %18, align 4, !tbaa !10
  %19 = tail call ptr @bpt_new_node(i32 noundef 0) #2
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  store i32 1, ptr %21, align 4, !tbaa !10
  %22 = getelementptr inbounds i8, ptr %20, i64 20
  store <4 x i32> <i32 4, i32 9, i32 10, i32 11>, ptr %22, align 4, !tbaa !10
  %23 = getelementptr inbounds i8, ptr %20, i64 36
  store i32 12, ptr %23, align 4, !tbaa !10
  %24 = load ptr, ptr %14, align 8, !tbaa !5
  %25 = load i32, ptr %24, align 4, !tbaa !10
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store i32 %25, ptr %27, align 4, !tbaa !10
  %28 = load i32, ptr %20, align 4, !tbaa !10
  %29 = getelementptr inbounds i8, ptr %24, i64 16
  store i32 %28, ptr %29, align 4, !tbaa !10
  %30 = load i32, ptr %26, align 4, !tbaa !10
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load i32, ptr @ORDER, align 4, !tbaa !10
  %33 = add i32 %32, 8
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %31, i64 %34
  store i32 %30, ptr %35, align 4, !tbaa !10
  %36 = load i32, ptr %24, align 4, !tbaa !10
  %37 = load i32, ptr @ORDER, align 4, !tbaa !10
  %38 = add i32 %37, 8
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %31, i64 %39
  %41 = getelementptr inbounds i8, ptr %40, i64 4
  store i32 %36, ptr %41, align 4, !tbaa !10
  %42 = load i32, ptr %31, align 4, !tbaa !10
  %43 = getelementptr inbounds i8, ptr %26, i64 4
  store i32 %42, ptr %43, align 4, !tbaa !10
  %44 = getelementptr inbounds i8, ptr %24, i64 4
  store i32 %42, ptr %44, align 4, !tbaa !10
  %45 = load i32, ptr %31, align 4, !tbaa !10
  %46 = load ptr, ptr %1, align 8, !tbaa !5
  %47 = load i32, ptr @ORDER, align 4, !tbaa !10
  %48 = add i32 %47, 8
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr %46, i64 %49
  store i32 %45, ptr %50, align 4, !tbaa !10
  %51 = load i32, ptr %20, align 4, !tbaa !10
  %52 = load i32, ptr @ORDER, align 4, !tbaa !10
  %53 = add i32 %52, 8
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %46, i64 %54
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  store i32 %51, ptr %56, align 4, !tbaa !10
  %57 = load i32, ptr %46, align 4, !tbaa !10
  %58 = getelementptr inbounds i8, ptr %31, i64 4
  store i32 %57, ptr %58, align 4, !tbaa !10
  %59 = getelementptr inbounds i8, ptr %20, i64 4
  store i32 %57, ptr %59, align 4, !tbaa !10
  %60 = load i32, ptr %26, align 4, !tbaa !10
  %61 = zext i32 %60 to i64
  %62 = load i32, ptr %46, align 4, !tbaa !10
  %63 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %62, i32 noundef 1) #2
  %64 = zext i32 %63 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %61, i64 noundef %64, ptr noundef null, i64 noundef 245, i32 noundef 148) #2
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = load i32, ptr %65, align 4, !tbaa !10
  %67 = zext i32 %66 to i64
  %68 = load ptr, ptr %1, align 8, !tbaa !5
  %69 = load i32, ptr %68, align 4, !tbaa !10
  %70 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %69, i32 noundef 2) #2
  %71 = zext i32 %70 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %67, i64 noundef %71, ptr noundef null, i64 noundef 245, i32 noundef 148) #2
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load i32, ptr %72, align 4, !tbaa !10
  %74 = zext i32 %73 to i64
  %75 = load ptr, ptr %1, align 8, !tbaa !5
  %76 = load i32, ptr %75, align 4, !tbaa !10
  %77 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %76, i32 noundef 3) #2
  %78 = zext i32 %77 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %74, i64 noundef %78, ptr noundef null, i64 noundef 245, i32 noundef 148) #2
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = load i32, ptr %79, align 4, !tbaa !10
  %81 = zext i32 %80 to i64
  %82 = load ptr, ptr %1, align 8, !tbaa !5
  %83 = load i32, ptr %82, align 4, !tbaa !10
  %84 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %83, i32 noundef 4) #2
  %85 = zext i32 %84 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %81, i64 noundef %85, ptr noundef null, i64 noundef 245, i32 noundef 148) #2
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = load i32, ptr %86, align 4, !tbaa !10
  %88 = zext i32 %87 to i64
  %89 = load ptr, ptr %1, align 8, !tbaa !5
  %90 = load i32, ptr %89, align 4, !tbaa !10
  %91 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %90, i32 noundef 5) #2
  %92 = zext i32 %91 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %88, i64 noundef %92, ptr noundef null, i64 noundef 249, i32 noundef 148) #2
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !10
  %95 = zext i32 %94 to i64
  %96 = load ptr, ptr %1, align 8, !tbaa !5
  %97 = load i32, ptr %96, align 4, !tbaa !10
  %98 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %97, i32 noundef 6) #2
  %99 = zext i32 %98 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %95, i64 noundef %99, ptr noundef null, i64 noundef 249, i32 noundef 148) #2
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = load i32, ptr %100, align 4, !tbaa !10
  %102 = zext i32 %101 to i64
  %103 = load ptr, ptr %1, align 8, !tbaa !5
  %104 = load i32, ptr %103, align 4, !tbaa !10
  %105 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %104, i32 noundef 7) #2
  %106 = zext i32 %105 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %102, i64 noundef %106, ptr noundef null, i64 noundef 249, i32 noundef 148) #2
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = load i32, ptr %107, align 4, !tbaa !10
  %109 = zext i32 %108 to i64
  %110 = load ptr, ptr %1, align 8, !tbaa !5
  %111 = load i32, ptr %110, align 4, !tbaa !10
  %112 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %111, i32 noundef 8) #2
  %113 = zext i32 %112 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %109, i64 noundef %113, ptr noundef null, i64 noundef 249, i32 noundef 148) #2
  %114 = load ptr, ptr %19, align 8, !tbaa !5
  %115 = load i32, ptr %114, align 4, !tbaa !10
  %116 = zext i32 %115 to i64
  %117 = load ptr, ptr %1, align 8, !tbaa !5
  %118 = load i32, ptr %117, align 4, !tbaa !10
  %119 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %118, i32 noundef 9) #2
  %120 = zext i32 %119 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %116, i64 noundef %120, ptr noundef null, i64 noundef 253, i32 noundef 148) #2
  %121 = load ptr, ptr %19, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !10
  %123 = zext i32 %122 to i64
  %124 = load ptr, ptr %1, align 8, !tbaa !5
  %125 = load i32, ptr %124, align 4, !tbaa !10
  %126 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %125, i32 noundef 10) #2
  %127 = zext i32 %126 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %123, i64 noundef %127, ptr noundef null, i64 noundef 253, i32 noundef 148) #2
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = load i32, ptr %128, align 4, !tbaa !10
  %130 = zext i32 %129 to i64
  %131 = load ptr, ptr %1, align 8, !tbaa !5
  %132 = load i32, ptr %131, align 4, !tbaa !10
  %133 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %132, i32 noundef 11) #2
  %134 = zext i32 %133 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %130, i64 noundef %134, ptr noundef null, i64 noundef 253, i32 noundef 148) #2
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  %136 = load i32, ptr %135, align 4, !tbaa !10
  %137 = zext i32 %136 to i64
  %138 = load ptr, ptr %1, align 8, !tbaa !5
  %139 = load i32, ptr %138, align 4, !tbaa !10
  %140 = tail call i32 @bpt_find_leaf(i32 noundef 0, i32 noundef %139, i32 noundef 12) #2
  %141 = zext i32 %140 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef %137, i64 noundef %141, ptr noundef null, i64 noundef 253, i32 noundef 148) #2
  %142 = load ptr, ptr getelementptr inbounds (i8, ptr @cache, i64 48), align 8, !tbaa !12
  tail call void (...) %142() #2
  ret void
}

declare i32 @bpt_find_leaf(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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, !7, i64 0}
!6 = !{!"bpt_node", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !7, i64 48}
!13 = !{!"cache_def", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass