; LLVM IR from yuikns/panther :: ann/src/kd_tree.ll (ZN10ANNkd_treeC2EPPdiii12ANNsplitRule)

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

%class.ANNorthRect = type { ptr, ptr }
%class.ANNkd_tree = type { %class.ANNpointSet, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }
%class.ANNpointSet = type { ptr }

@_ZTV10ANNkd_tree = external dso_local unnamed_addr constant { [12 x ptr] }, align 8
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11ANNorthRectD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10ANNkd_tree12SkeletonTreeEiiiPPdPi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11ANNpointSetC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ANNkd_treeC2EPPdiii12ANNsplitRule(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.ANNorthRect, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !11
  %16 = load ptr, ptr %7, align 8
  call void @_ZN11ANNpointSetC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  store ptr getelementptr inbounds inrange(-16, 80) ({ [12 x ptr] }, ptr @_ZTV10ANNkd_tree, i32 0, i32 0, i32 2), ptr %16, align 8, !tbaa !13
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = load i32, ptr %10, align 4, !tbaa !9
  %19 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN10ANNkd_tree12SkeletonTreeEiiiPPdPi(ptr noundef nonnull align 8 dereferenceable(64) %16, i32 noundef %17, i32 noundef %18, i32 noundef %19, ptr noundef null, ptr noundef null)
          to label %20 unwind label %26

20:                                               ; preds = %6
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 4
  store ptr %21, ptr %22, align 8, !tbaa !15
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %20
  br label %113

26:                                               ; preds = %6
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %13, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %14, align 4
  br label %115

30:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %31 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN11ANNorthRectC2Eidd(ptr noundef nonnull align 8 dereferenceable(16) %15, i32 noundef %31, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %32 unwind label %52

32:                                               ; preds = %30
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 5
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_Z11annEnclRectPPdPiiiR11ANNorthRect(ptr noundef %33, ptr noundef %35, i32 noundef %36, i32 noundef %37, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %38 unwind label %56

38:                                               ; preds = %32
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = getelementptr inbounds %class.ANNorthRect, ptr %15, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !19
  %42 = invoke noundef ptr @_Z9annCopyPtiPd(i32 noundef %39, ptr noundef %41)
          to label %43 unwind label %56

43:                                               ; preds = %38
  %44 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 7
  store ptr %42, ptr %44, align 8, !tbaa !21
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = getelementptr inbounds %class.ANNorthRect, ptr %15, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  %48 = invoke noundef ptr @_Z9annCopyPtiPd(i32 noundef %45, ptr noundef %47)
          to label %49 unwind label %56

49:                                               ; preds = %43
  %50 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 8
  store ptr %48, ptr %50, align 8, !tbaa !23
  %51 = load i32, ptr %12, align 4, !tbaa !11
  switch i32 %51, label %110 [
    i32 0, label %60
    i32 1, label %70
    i32 2, label %80
    i32 5, label %90
    i32 3, label %90
    i32 4, label %100
  ]

52:                                               ; preds = %30
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %13, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %14, align 4
  br label %114

56:                                               ; preds = %110, %100, %90, %80, %70, %60, %43, %38, %32
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %13, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %14, align 4
  call void @_ZN11ANNorthRectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  br label %114

60:                                               ; preds = %49
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 5
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = invoke noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef %61, ptr noundef %63, i32 noundef %64, i32 noundef %65, i32 noundef %66, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef @_Z8kd_splitPPdPiRK11ANNorthRectiiRiRdS5_)
          to label %68 unwind label %56

68:                                               ; preds = %60
  %69 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 6
  store ptr %67, ptr %69, align 8, !tbaa !24
  br label %112

70:                                               ; preds = %49
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 5
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = invoke noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef %71, ptr noundef %73, i32 noundef %74, i32 noundef %75, i32 noundef %76, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef @_Z11midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_)
          to label %78 unwind label %56

78:                                               ; preds = %70
  %79 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 6
  store ptr %77, ptr %79, align 8, !tbaa !24
  br label %112

80:                                               ; preds = %49
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 5
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = invoke noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef %81, ptr noundef %83, i32 noundef %84, i32 noundef %85, i32 noundef %86, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef @_Z10fair_splitPPdPiRK11ANNorthRectiiRiRdS5_)
          to label %88 unwind label %56

88:                                               ; preds = %80
  %89 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 6
  store ptr %87, ptr %89, align 8, !tbaa !24
  br label %112

90:                                               ; preds = %49, %49
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 5
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = invoke noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef %91, ptr noundef %93, i32 noundef %94, i32 noundef %95, i32 noundef %96, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef @_Z14sl_midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_)
          to label %98 unwind label %56

98:                                               ; preds = %90
  %99 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 6
  store ptr %97, ptr %99, align 8, !tbaa !24
  br label %112

100:                                              ; preds = %49
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !18
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = invoke noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef %101, ptr noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef %106, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef @_Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_)
          to label %108 unwind label %56

108:                                              ; preds = %100
  %109 = getelementptr inbounds %class.ANNkd_tree, ptr %16, i32 0, i32 6
  store ptr %107, ptr %109, align 8, !tbaa !24
  br label %112

110:                                              ; preds = %49
  invoke void @_Z8annErrorPKc6ANNerr(ptr noundef @.str.18, i32 noundef 1)
          to label %111 unwind label %56

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111, %108, %98, %88, %78, %68
  call void @_ZN11ANNorthRectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %113

113:                                              ; preds = %112, %25
  ret void

114:                                              ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %115

115:                                              ; preds = %114, %26
  call void @_ZN11ANNpointSetD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %13, align 8
  %118 = load i32, ptr %14, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ANNorthRectC2Eidd(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, double noundef, double noundef) unnamed_addr #2 align 2

declare void @_Z11annEnclRectPPdPiiiR11ANNorthRect(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) #4

declare noundef ptr @_Z9annCopyPtiPd(i32 noundef, ptr noundef) #4

declare void @_Z8kd_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z11midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z10fair_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z14sl_midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z8annErrorPKc6ANNerr(ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11ANNpointSetD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS12ANNsplitRule", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !6, i64 24}
!16 = !{!"_ZTS10ANNkd_tree", !17, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!17 = !{!"_ZTS11ANNpointSet"}
!18 = !{!16, !6, i64 32}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTS11ANNorthRect", !6, i64 0, !6, i64 8}
!21 = !{!16, !6, i64 48}
!22 = !{!20, !6, i64 8}
!23 = !{!16, !6, i64 56}
!24 = !{!16, !6, i64 40}


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

%class.ANNorthRect = type { ptr, ptr }

@_ZTV10ANNkd_tree = external dso_local unnamed_addr constant { [12 x ptr] }, align 8
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@switch.table._ZN10ANNkd_treeC2EPPdiii12ANNsplitRule = private unnamed_addr constant [6 x ptr] [ptr @_Z8kd_splitPPdPiRK11ANNorthRectiiRiRdS5_, ptr @_Z11midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_, ptr @_Z10fair_splitPPdPiRK11ANNorthRectiiRiRdS5_, ptr @_Z14sl_midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_, ptr @_Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_, ptr @_Z14sl_midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_], align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11ANNorthRectD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10ANNkd_tree12SkeletonTreeEiiiPPdPi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11ANNpointSetC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ANNkd_treeC2EPPdiii12ANNsplitRule(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %class.ANNorthRect, align 8
  tail call void @_ZN11ANNpointSetC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  store ptr getelementptr inbounds inrange(-16, 80) (i8, ptr @_ZTV10ANNkd_tree, i64 16), ptr %0, align 8, !tbaa !5
  invoke void @_ZN10ANNkd_tree12SkeletonTreeEiiiPPdPi(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef null, ptr noundef null)
          to label %8 unwind label %11

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %1, ptr %9, align 8, !tbaa !8
  %10 = icmp eq i32 %2, 0
  br i1 %10, label %38, label %13

11:                                               ; preds = %6
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %40

13:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  invoke void @_ZN11ANNorthRectC2Eidd(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %3, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %14 unwind label %28

14:                                               ; preds = %13
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  invoke void @_Z11annEnclRectPPdPiiiR11ANNorthRect(ptr noundef %1, ptr noundef %16, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %17 unwind label %30

17:                                               ; preds = %14
  %18 = load ptr, ptr %7, align 8, !tbaa !15
  %19 = invoke noundef ptr @_Z9annCopyPtiPd(i32 noundef %3, ptr noundef %18)
          to label %20 unwind label %30

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %19, ptr %21, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = invoke noundef ptr @_Z9annCopyPtiPd(i32 noundef %3, ptr noundef %23)
          to label %25 unwind label %30

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %24, ptr %26, align 8, !tbaa !19
  %27 = icmp ult i32 %5, 6
  br i1 %27, label %switch.lookup, label %35

28:                                               ; preds = %13
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %39

30:                                               ; preds = %switch.lookup, %35, %20, %17, %14
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN11ANNorthRectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  br label %39

switch.lookup:                                    ; preds = %25
  %32 = zext nneg i32 %5 to i64
  %switch.gep = getelementptr inbounds [6 x ptr], ptr @switch.table._ZN10ANNkd_treeC2EPPdiii12ANNsplitRule, i64 0, i64 %32
  %switch.load = load ptr, ptr %switch.gep, align 8
  %33 = load ptr, ptr %15, align 8, !tbaa !14
  %34 = invoke noundef ptr @_Z8rkd_treePPdPiiiiR11ANNorthRectPFvS0_S1_RKS2_iiRiRdS6_E(ptr noundef %1, ptr noundef %33, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull %switch.load)
          to label %.sink.split unwind label %30

35:                                               ; preds = %25
  invoke void @_Z8annErrorPKc6ANNerr(ptr noundef nonnull @.str.18, i32 noundef 1)
          to label %37 unwind label %30

.sink.split:                                      ; preds = %switch.lookup
  %36 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %34, ptr %36, align 8, !tbaa !20
  br label %37

37:                                               ; preds = %.sink.split, %35
  call void @_ZN11ANNorthRectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %38

38:                                               ; preds = %8, %37
  ret void

39:                                               ; preds = %30, %28
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %40

40:                                               ; preds = %39, %11
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %12, %11 ]
  call void @_ZN11ANNpointSetD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ANNorthRectC2Eidd(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, double noundef, double noundef) unnamed_addr #2 align 2

declare void @_Z11annEnclRectPPdPiiiR11ANNorthRect(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

declare noundef ptr @_Z9annCopyPtiPd(i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @_Z8kd_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z11midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z10fair_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z14sl_midpt_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z13sl_fair_splitPPdPiRK11ANNorthRectiiRiRdS5_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

declare void @_Z8annErrorPKc6ANNerr(ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11ANNpointSetD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 24}
!9 = !{!"_ZTS10ANNkd_tree", !10, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56}
!10 = !{!"_ZTS11ANNpointSet"}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!9, !13, i64 32}
!15 = !{!16, !13, i64 0}
!16 = !{!"_ZTS11ANNorthRect", !13, i64 0, !13, i64 8}
!17 = !{!9, !13, i64 48}
!18 = !{!16, !13, i64 8}
!19 = !{!9, !13, i64 56}
!20 = !{!9, !13, i64 40}


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