; LLVM IR from QiaoLiuHit/LSOTB-TIR :: vlfeat-0.9.19/vl (kdtree)

; 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"

%union.anon = type { i32 }
%struct._VlKDForest = type { i64, ptr, i32, ptr, i64, i32, ptr, ptr, i64, i32, [5 x %struct._VlKDTreeSplitDimension], i64, i64, i64, i64, i64, ptr }
%struct._VlKDTreeSplitDimension = type { i32, double, double }
%struct._VlKDTree = type { ptr, i64, i64, ptr, i32 }
%struct._VlKDTreeDataIndexEntry = type { i64, double }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_kdforest_build = external hidden unnamed_addr constant [60 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@vl_infinity_f = external hidden constant %union.anon, align 4

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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 @vl_malloc(i64 noundef) #2

declare void @vl_free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @vl_kdforest_build(ptr noundef %0, i64 noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %3
  br label %17

16:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 536, ptr noundef @__PRETTY_FUNCTION__.vl_kdforest_build) #5
  unreachable

17:                                               ; preds = %15
  %18 = load i64, ptr %5, align 8, !tbaa !9
  %19 = icmp uge i64 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  br label %22

21:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 537, ptr noundef @__PRETTY_FUNCTION__.vl_kdforest_build) #5
  unreachable

22:                                               ; preds = %20
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._VlKDForest, ptr %24, i32 0, i32 3
  store ptr %23, ptr %25, align 8, !tbaa !11
  %26 = load i64, ptr %5, align 8, !tbaa !9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._VlKDForest, ptr %27, i32 0, i32 4
  store i64 %26, ptr %28, align 8, !tbaa !14
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._VlKDForest, ptr %29, i32 0, i32 8
  %31 = load i64, ptr %30, align 8, !tbaa !15
  %32 = mul i64 8, %31
  %33 = call ptr @vl_malloc(i64 noundef %32)
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._VlKDForest, ptr %34, i32 0, i32 7
  store ptr %33, ptr %35, align 8, !tbaa !16
  store i64 0, ptr %9, align 8, !tbaa !9
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %154, %22
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._VlKDForest, ptr %38, i32 0, i32 8
  %40 = load i64, ptr %39, align 8, !tbaa !15
  %41 = icmp ult i64 %37, %40
  br i1 %41, label %42, label %157

42:                                               ; preds = %36
  %43 = call ptr @vl_malloc(i64 noundef 40)
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._VlKDForest, ptr %44, i32 0, i32 7
  %46 = load ptr, ptr %45, align 8, !tbaa !16
  %47 = load i64, ptr %8, align 8, !tbaa !9
  %48 = getelementptr inbounds ptr, ptr %46, i64 %47
  store ptr %43, ptr %48, align 8, !tbaa !5
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._VlKDForest, ptr %49, i32 0, i32 4
  %51 = load i64, ptr %50, align 8, !tbaa !14
  %52 = mul i64 16, %51
  %53 = call ptr @vl_malloc(i64 noundef %52)
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._VlKDForest, ptr %54, i32 0, i32 7
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = load i64, ptr %8, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %56, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._VlKDTree, ptr %59, i32 0, i32 3
  store ptr %53, ptr %60, align 8, !tbaa !17
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %80, %42
  %62 = load i64, ptr %7, align 8, !tbaa !9
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._VlKDForest, ptr %63, i32 0, i32 4
  %65 = load i64, ptr %64, align 8, !tbaa !14
  %66 = icmp ult i64 %62, %65
  br i1 %66, label %67, label %83

67:                                               ; preds = %61
  %68 = load i64, ptr %7, align 8, !tbaa !9
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._VlKDForest, ptr %69, i32 0, i32 7
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = load i64, ptr %8, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %71, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._VlKDTree, ptr %74, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !17
  %77 = load i64, ptr %7, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %76, i64 %77
  %79 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %78, i32 0, i32 0
  store i64 %68, ptr %79, align 8, !tbaa !19
  br label %80

80:                                               ; preds = %67
  %81 = load i64, ptr %7, align 8, !tbaa !9
  %82 = add i64 %81, 1
  store i64 %82, ptr %7, align 8, !tbaa !9
  br label %61, !llvm.loop !22

83:                                               ; preds = %61
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._VlKDForest, ptr %84, i32 0, i32 7
  %86 = load ptr, ptr %85, align 8, !tbaa !16
  %87 = load i64, ptr %8, align 8, !tbaa !9
  %88 = getelementptr inbounds ptr, ptr %86, i64 %87
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._VlKDTree, ptr %89, i32 0, i32 1
  store i64 0, ptr %90, align 8, !tbaa !24
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._VlKDForest, ptr %91, i32 0, i32 4
  %93 = load i64, ptr %92, align 8, !tbaa !14
  %94 = mul i64 2, %93
  %95 = sub i64 %94, 1
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._VlKDForest, ptr %96, i32 0, i32 7
  %98 = load ptr, ptr %97, align 8, !tbaa !16
  %99 = load i64, ptr %8, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %98, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._VlKDTree, ptr %101, i32 0, i32 2
  store i64 %95, ptr %102, align 8, !tbaa !25
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._VlKDForest, ptr %103, i32 0, i32 7
  %105 = load ptr, ptr %104, align 8, !tbaa !16
  %106 = load i64, ptr %8, align 8, !tbaa !9
  %107 = getelementptr inbounds ptr, ptr %105, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._VlKDTree, ptr %108, i32 0, i32 2
  %110 = load i64, ptr %109, align 8, !tbaa !25
  %111 = mul i64 56, %110
  %112 = call ptr @vl_malloc(i64 noundef %111)
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._VlKDForest, ptr %113, i32 0, i32 7
  %115 = load ptr, ptr %114, align 8, !tbaa !16
  %116 = load i64, ptr %8, align 8, !tbaa !9
  %117 = getelementptr inbounds ptr, ptr %115, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._VlKDTree, ptr %118, i32 0, i32 0
  store ptr %112, ptr %119, align 8, !tbaa !26
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._VlKDForest, ptr %120, i32 0, i32 7
  %122 = load ptr, ptr %121, align 8, !tbaa !16
  %123 = load i64, ptr %8, align 8, !tbaa !9
  %124 = getelementptr inbounds ptr, ptr %122, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._VlKDTree, ptr %125, i32 0, i32 4
  store i32 0, ptr %126, align 8, !tbaa !27
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._VlKDForest, ptr %128, i32 0, i32 7
  %130 = load ptr, ptr %129, align 8, !tbaa !16
  %131 = load i64, ptr %8, align 8, !tbaa !9
  %132 = getelementptr inbounds ptr, ptr %130, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._VlKDForest, ptr %134, i32 0, i32 7
  %136 = load ptr, ptr %135, align 8, !tbaa !16
  %137 = load i64, ptr %8, align 8, !tbaa !9
  %138 = getelementptr inbounds ptr, ptr %136, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = call i64 @vl_kdtree_node_new(ptr noundef %139, i64 noundef 0)
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._VlKDForest, ptr %141, i32 0, i32 4
  %143 = load i64, ptr %142, align 8, !tbaa !14
  call void @vl_kdtree_build_recursively(ptr noundef %127, ptr noundef %133, i64 noundef %140, i64 noundef 0, i64 noundef %143, i32 noundef 0)
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._VlKDForest, ptr %144, i32 0, i32 7
  %146 = load ptr, ptr %145, align 8, !tbaa !16
  %147 = load i64, ptr %8, align 8, !tbaa !9
  %148 = getelementptr inbounds ptr, ptr %146, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._VlKDTree, ptr %149, i32 0, i32 1
  %151 = load i64, ptr %150, align 8, !tbaa !24
  %152 = load i64, ptr %9, align 8, !tbaa !9
  %153 = add i64 %152, %151
  store i64 %153, ptr %9, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %83
  %155 = load i64, ptr %8, align 8, !tbaa !9
  %156 = add i64 %155, 1
  store i64 %156, ptr %8, align 8, !tbaa !9
  br label %36, !llvm.loop !28

157:                                              ; preds = %36
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._VlKDForest, ptr %158, i32 0, i32 0
  %160 = load i64, ptr %159, align 8, !tbaa !29
  %161 = mul i64 16, %160
  %162 = call ptr @vl_malloc(i64 noundef %161)
  store ptr %162, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %163

163:                                              ; preds = %199, %157
  %164 = load i64, ptr %8, align 8, !tbaa !9
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._VlKDForest, ptr %165, i32 0, i32 8
  %167 = load i64, ptr %166, align 8, !tbaa !15
  %168 = icmp ult i64 %164, %167
  br i1 %168, label %169, label %202

169:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %170, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._VlKDForest, ptr %172, i32 0, i32 0
  %174 = load i64, ptr %173, align 8, !tbaa !29
  %175 = mul i64 2, %174
  %176 = getelementptr inbounds double, ptr %171, i64 %175
  store ptr %176, ptr %12, align 8, !tbaa !5
  br label %177

177:                                              ; preds = %181, %169
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = icmp ult ptr %178, %179
  br i1 %180, label %181, label %191

181:                                              ; preds = %177
  %182 = load float, ptr @vl_infinity_f, align 4, !tbaa !30
  %183 = fneg float %182
  %184 = fpext float %183 to double
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = getelementptr inbounds double, ptr %185, i32 1
  store ptr %186, ptr %11, align 8, !tbaa !5
  store double %184, ptr %185, align 8, !tbaa !31
  %187 = load float, ptr @vl_infinity_f, align 4, !tbaa !30
  %188 = fpext float %187 to double
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = getelementptr inbounds double, ptr %189, i32 1
  store ptr %190, ptr %11, align 8, !tbaa !5
  store double %188, ptr %189, align 8, !tbaa !31
  br label %177, !llvm.loop !32

191:                                              ; preds = %177
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._VlKDForest, ptr %192, i32 0, i32 7
  %194 = load ptr, ptr %193, align 8, !tbaa !16
  %195 = load i64, ptr %8, align 8, !tbaa !9
  %196 = getelementptr inbounds ptr, ptr %194, i64 %195
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  call void @vl_kdtree_calc_bounds_recursively(ptr noundef %197, i64 noundef 0, ptr noundef %198)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %199

199:                                              ; preds = %191
  %200 = load i64, ptr %8, align 8, !tbaa !9
  %201 = add i64 %200, 1
  store i64 %201, ptr %8, align 8, !tbaa !9
  br label %163, !llvm.loop !33

202:                                              ; preds = %163
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  call void @vl_free(ptr noundef %203)
  %204 = load i64, ptr %9, align 8, !tbaa !9
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._VlKDForest, ptr %205, i32 0, i32 13
  store i64 %204, ptr %206, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @vl_kdtree_build_recursively(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i64 @vl_kdtree_node_new(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @vl_kdtree_calc_bounds_recursively(ptr noundef, i64 noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 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 #4 = { nounwind }
attributes #5 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_VlKDForest", !10, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !13, i64 72, !7, i64 80, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !6, i64 240}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !10, i64 32}
!15 = !{!12, !10, i64 64}
!16 = !{!12, !6, i64 56}
!17 = !{!18, !6, i64 24}
!18 = !{!"_VlKDTree", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !13, i64 32}
!19 = !{!20, !10, i64 0}
!20 = !{!"_VlKDTreeDataIndexEntry", !10, i64 0, !21, i64 8}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!18, !10, i64 8}
!25 = !{!18, !10, i64 16}
!26 = !{!18, !6, i64 0}
!27 = !{!18, !13, i64 32}
!28 = distinct !{!28, !23}
!29 = !{!12, !10, i64 0}
!30 = !{!7, !7, i64 0}
!31 = !{!21, !21, i64 0}
!32 = distinct !{!32, !23}
!33 = distinct !{!33, !23}
!34 = !{!12, !10, i64 216}


; 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"

%union.anon = type { i32 }
%struct._VlKDTreeDataIndexEntry = type { i64, double }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_kdforest_build = external hidden unnamed_addr constant [60 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@vl_infinity_f = external hidden local_unnamed_addr constant %union.anon, align 4

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

declare ptr @vl_malloc(i64 noundef) local_unnamed_addr #1

declare void @vl_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @vl_kdforest_build(ptr noundef %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 536, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_kdforest_build) #3
  unreachable

5:                                                ; preds = %3
  %.not64 = icmp eq i64 %1, 0
  br i1 %.not64, label %6, label %7

6:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 537, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_kdforest_build) #3
  unreachable

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %2, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 %1, ptr %9, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = load i64, ptr %10, align 8, !tbaa !13
  %12 = shl i64 %11, 3
  %13 = tail call ptr @vl_malloc(i64 noundef %12) #4
  %14 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %13, ptr %14, align 8, !tbaa !14
  %15 = load i64, ptr %10, align 8, !tbaa !13
  %.not79 = icmp eq i64 %15, 0
  br i1 %.not79, label %._crit_edge70, label %.lr.ph69

.lr.ph69:                                         ; preds = %7, %._crit_edge
  %.06067 = phi i64 [ %60, %._crit_edge ], [ 0, %7 ]
  %.06166 = phi i64 [ %59, %._crit_edge ], [ 0, %7 ]
  %16 = tail call ptr @vl_malloc(i64 noundef 40) #4
  %17 = load ptr, ptr %14, align 8, !tbaa !14
  %18 = getelementptr inbounds ptr, ptr %17, i64 %.06067
  store ptr %16, ptr %18, align 8, !tbaa !15
  %19 = load i64, ptr %9, align 8, !tbaa !12
  %20 = shl i64 %19, 4
  %21 = tail call ptr @vl_malloc(i64 noundef %20) #4
  %22 = load ptr, ptr %14, align 8, !tbaa !14
  %23 = getelementptr inbounds ptr, ptr %22, i64 %.06067
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %24, i64 24
  store ptr %21, ptr %25, align 8, !tbaa !16
  %26 = load i64, ptr %9, align 8, !tbaa !12
  %.not80 = icmp eq i64 %26, 0
  %.pre = load ptr, ptr %23, align 8, !tbaa !15
  br i1 %.not80, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph69
  %27 = getelementptr inbounds i8, ptr %.pre, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %xtraiter = and i64 %26, 3
  %29 = icmp ult i64 %26, 4
  br i1 %29, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %26, -4
  br label %30

30:                                               ; preds = %30, %.lr.ph.new
  %.065 = phi i64 [ 0, %.lr.ph.new ], [ %38, %30 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %30 ]
  %31 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %28, i64 %.065
  store i64 %.065, ptr %31, align 8, !tbaa !18
  %32 = or disjoint i64 %.065, 1
  %33 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %28, i64 %32
  store i64 %32, ptr %33, align 8, !tbaa !18
  %34 = or disjoint i64 %.065, 2
  %35 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %28, i64 %34
  store i64 %34, ptr %35, align 8, !tbaa !18
  %36 = or disjoint i64 %.065, 3
  %37 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %28, i64 %36
  store i64 %36, ptr %37, align 8, !tbaa !18
  %38 = add nuw i64 %.065, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %30, !llvm.loop !21

._crit_edge.loopexit.unr-lcssa:                   ; preds = %30, %.lr.ph
  %.065.unr = phi i64 [ 0, %.lr.ph ], [ %38, %30 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %.065.epil = phi i64 [ %40, %.epil.preheader ], [ %.065.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %39 = getelementptr inbounds %struct._VlKDTreeDataIndexEntry, ptr %28, i64 %.065.epil
  store i64 %.065.epil, ptr %39, align 8, !tbaa !18
  %40 = add nuw i64 %.065.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !23

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %.lr.ph69
  %41 = getelementptr inbounds i8, ptr %.pre, i64 8
  store i64 0, ptr %41, align 8, !tbaa !25
  %42 = shl i64 %26, 1
  %43 = add i64 %42, -1
  %44 = getelementptr inbounds i8, ptr %.pre, i64 16
  store i64 %43, ptr %44, align 8, !tbaa !26
  %45 = mul i64 %43, 56
  %46 = tail call ptr @vl_malloc(i64 noundef %45) #4
  %47 = load ptr, ptr %14, align 8, !tbaa !14
  %48 = getelementptr inbounds ptr, ptr %47, i64 %.06067
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  store ptr %46, ptr %49, align 8, !tbaa !27
  %50 = load ptr, ptr %48, align 8, !tbaa !15
  %51 = getelementptr inbounds i8, ptr %50, i64 32
  store i32 0, ptr %51, align 8, !tbaa !28
  %52 = tail call i64 @vl_kdtree_node_new(ptr noundef %50, i64 noundef 0)
  %53 = load i64, ptr %9, align 8, !tbaa !12
  tail call void @vl_kdtree_build_recursively(ptr noundef nonnull %0, ptr noundef %50, i64 noundef %52, i64 noundef 0, i64 noundef %53, i32 noundef 0)
  %54 = load ptr, ptr %14, align 8, !tbaa !14
  %55 = getelementptr inbounds ptr, ptr %54, i64 %.06067
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = load i64, ptr %57, align 8, !tbaa !25
  %59 = add i64 %58, %.06166
  %60 = add nuw i64 %.06067, 1
  %61 = load i64, ptr %10, align 8, !tbaa !13
  %62 = icmp ult i64 %60, %61
  br i1 %62, label %.lr.ph69, label %._crit_edge70, !llvm.loop !29

._crit_edge70:                                    ; preds = %._crit_edge, %7
  %.061.lcssa = phi i64 [ 0, %7 ], [ %59, %._crit_edge ]
  %63 = load i64, ptr %0, align 8, !tbaa !30
  %64 = shl i64 %63, 4
  %65 = tail call ptr @vl_malloc(i64 noundef %64) #4
  %66 = load i64, ptr %10, align 8, !tbaa !13
  %.not81 = icmp eq i64 %66, 0
  br i1 %.not81, label %._crit_edge78, label %.lr.ph77

.lr.ph77:                                         ; preds = %._crit_edge70
  %67 = load float, ptr @vl_infinity_f, align 4
  %68 = fneg float %67
  %69 = insertelement <2 x float> poison, float %68, i64 0
  %70 = insertelement <2 x float> %69, float %67, i64 1
  %71 = fpext <2 x float> %70 to <2 x double>
  br label %72

72:                                               ; preds = %.lr.ph77, %._crit_edge74
  %.175 = phi i64 [ 0, %.lr.ph77 ], [ %81, %._crit_edge74 ]
  %73 = load i64, ptr %0, align 8, !tbaa !30
  %.idx = shl i64 %73, 4
  %74 = getelementptr inbounds i8, ptr %65, i64 %.idx
  %75 = icmp sgt i64 %.idx, 0
  br i1 %75, label %.lr.ph73, label %._crit_edge74

.lr.ph73:                                         ; preds = %72, %.lr.ph73
  %.05971 = phi ptr [ %76, %.lr.ph73 ], [ %65, %72 ]
  %76 = getelementptr inbounds i8, ptr %.05971, i64 16
  store <2 x double> %71, ptr %.05971, align 8, !tbaa !31
  %77 = icmp ult ptr %76, %74
  br i1 %77, label %.lr.ph73, label %._crit_edge74, !llvm.loop !32

._crit_edge74:                                    ; preds = %.lr.ph73, %72
  %78 = load ptr, ptr %14, align 8, !tbaa !14
  %79 = getelementptr inbounds ptr, ptr %78, i64 %.175
  %80 = load ptr, ptr %79, align 8, !tbaa !15
  tail call void @vl_kdtree_calc_bounds_recursively(ptr noundef %80, i64 noundef 0, ptr noundef %65)
  %81 = add nuw i64 %.175, 1
  %82 = load i64, ptr %10, align 8, !tbaa !13
  %83 = icmp ult i64 %81, %82
  br i1 %83, label %72, label %._crit_edge78, !llvm.loop !33

._crit_edge78:                                    ; preds = %._crit_edge74, %._crit_edge70
  tail call void @vl_free(ptr noundef %65) #4
  %84 = getelementptr inbounds i8, ptr %0, i64 216
  store i64 %.061.lcssa, ptr %84, align 8, !tbaa !34
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @vl_kdtree_build_recursively(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i64 @vl_kdtree_node_new(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @vl_kdtree_calc_bounds_recursively(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { noreturn nounwind }
attributes #4 = { 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, !10, i64 24}
!6 = !{!"_VlKDForest", !7, i64 0, !10, i64 8, !11, i64 16, !10, i64 24, !7, i64 32, !11, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !11, i64 72, !8, i64 80, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !10, i64 240}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 32}
!13 = !{!6, !7, i64 64}
!14 = !{!6, !10, i64 56}
!15 = !{!10, !10, i64 0}
!16 = !{!17, !10, i64 24}
!17 = !{!"_VlKDTree", !10, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !11, i64 32}
!18 = !{!19, !7, i64 0}
!19 = !{!"_VlKDTreeDataIndexEntry", !7, i64 0, !20, i64 8}
!20 = !{!"double", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = !{!17, !7, i64 8}
!26 = !{!17, !7, i64 16}
!27 = !{!17, !10, i64 0}
!28 = !{!17, !11, i64 32}
!29 = distinct !{!29, !22}
!30 = !{!6, !7, i64 0}
!31 = !{!20, !20, i64 0}
!32 = distinct !{!32, !22}
!33 = distinct !{!33, !22}
!34 = !{!6, !7, i64 216}


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