; LLVM IR from Razakhel/RaZ :: src/RaZ/Data (BoundingVolumeHierarchy)

; 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.Raz::AABB" = type { %"class.Raz::Shape", %"class.Raz::Vector", %"class.Raz::Vector" }
%"class.Raz::Shape" = type { ptr }
%"class.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { i32, float }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo" = type { %"class.Raz::Triangle", ptr }
%"class.Raz::Triangle" = type <{ %"class.Raz::Shape", %"class.Raz::Vector", %"class.Raz::Vector", %"class.Raz::Vector", [4 x i8] }>
%"class.Raz::BoundingVolumeHierarchyNode" = type { %"class.Raz::AABB", %"class.std::unique_ptr", %"class.std::unique_ptr", %"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo" }

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2, i64 noundef %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.Raz::AABB", align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.Raz::AABB", align 8
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca %"class.Raz::AABB", align 8
  %21 = alloca %"class.Raz::Vector", align 4
  %22 = alloca %"class.Raz::Vector", align 4
  %23 = alloca float, align 4
  %24 = alloca i32, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca %class.anon, align 4
  %34 = alloca i64, align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %37 = alloca %"class.std::unique_ptr", align 8
  %38 = alloca %"class.std::unique_ptr", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i64 %3, ptr %8, align 8, !tbaa !9
  %39 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41) #8
  %43 = getelementptr inbounds %"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo", ptr %42, i32 0, i32 0
  call void @_ZNK3Raz8Triangle18computeBoundingBoxEv(ptr dead_on_unwind writable sret(%"class.Raz::AABB") align 8 %9, ptr noundef nonnull align 8 dereferenceable(48) %43)
  %44 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %45 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3Raz4AABBaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) %44, ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = load i64, ptr %7, align 8, !tbaa !9
  %48 = sub i64 %46, %47
  %49 = icmp ule i64 %48, 1
  br i1 %49, label %50, label %56

50:                                               ; preds = %4
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load i64, ptr %7, align 8, !tbaa !9
  %53 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %52) #8
  %54 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 3
  %55 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN3Raz27BoundingVolumeHierarchyNode12TriangleInfoaSERKS1_(ptr noundef nonnull align 8 dereferenceable(56) %54, ptr noundef nonnull align 8 dereferenceable(56) %53) #8
  br label %269

56:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %57 = load i64, ptr %7, align 8, !tbaa !9
  %58 = add i64 %57, 1
  store i64 %58, ptr %10, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %131, %56
  %60 = load i64, ptr %10, align 8, !tbaa !9
  %61 = load i64, ptr %8, align 8, !tbaa !9
  %62 = icmp ult i64 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %163

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #8
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load i64, ptr %10, align 8, !tbaa !9
  %67 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %66) #8
  %68 = getelementptr inbounds %"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo", ptr %67, i32 0, i32 0
  call void @_ZNK3Raz8Triangle18computeBoundingBoxEv(ptr dead_on_unwind writable sret(%"class.Raz::AABB") align 8 %11, ptr noundef nonnull align 8 dereferenceable(48) %68)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %69 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %70 unwind label %134

70:                                               ; preds = %64
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %69) #8
  %72 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %73 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %72)
          to label %74 unwind label %134

74:                                               ; preds = %70
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %73) #8
  %76 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %71, ptr noundef nonnull align 4 dereferenceable(4) %75)
          to label %77 unwind label %134

77:                                               ; preds = %74
  %78 = load float, ptr %76, align 4, !tbaa !11
  store float %78, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %79 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %80 unwind label %138

80:                                               ; preds = %77
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %79) #8
  %82 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %83 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %82)
          to label %84 unwind label %138

84:                                               ; preds = %80
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %83) #8
  %86 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %85)
          to label %87 unwind label %138

87:                                               ; preds = %84
  %88 = load float, ptr %86, align 4, !tbaa !11
  store float %88, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %89 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %90 unwind label %142

90:                                               ; preds = %87
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %89) #8
  %92 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %93 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %92)
          to label %94 unwind label %142

94:                                               ; preds = %90
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %93) #8
  %96 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %91, ptr noundef nonnull align 4 dereferenceable(4) %95)
          to label %97 unwind label %142

97:                                               ; preds = %94
  %98 = load float, ptr %96, align 4, !tbaa !11
  store float %98, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %99 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %100 unwind label %146

100:                                              ; preds = %97
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %99) #8
  %102 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %103 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %102)
          to label %104 unwind label %146

104:                                              ; preds = %100
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %103) #8
  %106 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %101, ptr noundef nonnull align 4 dereferenceable(4) %105)
          to label %107 unwind label %146

107:                                              ; preds = %104
  %108 = load float, ptr %106, align 4, !tbaa !11
  store float %108, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %109 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %110 unwind label %150

110:                                              ; preds = %107
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %109) #8
  %112 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %113 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %112)
          to label %114 unwind label %150

114:                                              ; preds = %110
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %113) #8
  %116 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %111, ptr noundef nonnull align 4 dereferenceable(4) %115)
          to label %117 unwind label %150

117:                                              ; preds = %114
  %118 = load float, ptr %116, align 4, !tbaa !11
  store float %118, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %119 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %120 unwind label %154

120:                                              ; preds = %117
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %119) #8
  %122 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %123 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %122)
          to label %124 unwind label %154

124:                                              ; preds = %120
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %123) #8
  %126 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %121, ptr noundef nonnull align 4 dereferenceable(4) %125)
          to label %127 unwind label %154

127:                                              ; preds = %124
  %128 = load float, ptr %126, align 4, !tbaa !11
  store float %128, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #8
  call void @_ZN3Raz6VectorIfLm3EEC2IJRKfS4_S4_EvvEEDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #8
  call void @_ZN3Raz6VectorIfLm3EEC2IJRKfS4_S4_EvvEEDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19) #8
  call void @_ZN3Raz4AABBC2ERKNS_6VectorIfLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(12) %22) #8
  %129 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %130 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3Raz4AABBaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) %129, ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  br label %131

131:                                              ; preds = %127
  %132 = load i64, ptr %10, align 8, !tbaa !9
  %133 = add i64 %132, 1
  store i64 %133, ptr %10, align 8, !tbaa !9
  br label %59, !llvm.loop !13

134:                                              ; preds = %74, %70, %64
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %13, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %14, align 4
  br label %162

138:                                              ; preds = %84, %80, %77
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %13, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %14, align 4
  br label %161

142:                                              ; preds = %94, %90, %87
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %13, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %14, align 4
  br label %160

146:                                              ; preds = %104, %100, %97
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %13, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %14, align 4
  br label %159

150:                                              ; preds = %114, %110, %107
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %13, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %14, align 4
  br label %158

154:                                              ; preds = %124, %120, %117
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %13, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %158

158:                                              ; preds = %154, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %159

159:                                              ; preds = %158, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %160

160:                                              ; preds = %159, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %161

161:                                              ; preds = %160, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %162

162:                                              ; preds = %161, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %270

163:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %164 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %165 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %164)
  %166 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %165) #8
  %167 = load float, ptr %166, align 4, !tbaa !11
  %168 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %169 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %168)
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %169) #8
  %171 = load float, ptr %170, align 4, !tbaa !11
  %172 = fsub float %167, %171
  store float %172, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %173 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %174 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %173)
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %174) #8
  %176 = load float, ptr %175, align 4, !tbaa !11
  %177 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %178 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %177)
  %179 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %178) #8
  %180 = load float, ptr %179, align 4, !tbaa !11
  %181 = fsub float %176, %180
  store float %181, ptr %25, align 4, !tbaa !11
  %182 = load float, ptr %25, align 4, !tbaa !11
  %183 = load float, ptr %23, align 4, !tbaa !11
  %184 = fcmp ogt float %182, %183
  br i1 %184, label %185, label %187

185:                                              ; preds = %163
  %186 = load float, ptr %25, align 4, !tbaa !11
  store float %186, ptr %23, align 4, !tbaa !11
  store i32 1, ptr %24, align 4, !tbaa !15
  br label %187

187:                                              ; preds = %185, %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %188 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %189 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %188)
  %190 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %189) #8
  %191 = load float, ptr %190, align 4, !tbaa !11
  %192 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %193 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %192)
  %194 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %193) #8
  %195 = load float, ptr %194, align 4, !tbaa !11
  %196 = fsub float %191, %195
  store float %196, ptr %26, align 4, !tbaa !11
  %197 = load float, ptr %26, align 4, !tbaa !11
  %198 = load float, ptr %23, align 4, !tbaa !11
  %199 = fcmp ogt float %197, %198
  br i1 %199, label %200, label %202

200:                                              ; preds = %187
  %201 = load float, ptr %26, align 4, !tbaa !11
  store float %201, ptr %23, align 4, !tbaa !11
  store i32 2, ptr %24, align 4, !tbaa !15
  br label %202

202:                                              ; preds = %200, %187
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %203 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 0
  %204 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %203)
  %205 = load i32, ptr %24, align 4, !tbaa !15
  %206 = zext i32 %205 to i64
  %207 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %204, i64 noundef %206) #8
  %208 = load float, ptr %207, align 4, !tbaa !11
  %209 = load float, ptr %23, align 4, !tbaa !11
  %210 = call float @llvm.fmuladd.f32(float %209, float 5.000000e-01, float %208)
  store float %210, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = call ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %211) #8
  %213 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %212, ptr %213, align 8
  %214 = load i64, ptr %7, align 8, !tbaa !9
  %215 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %214) #8
  %216 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %215, ptr %216, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = call ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %217) #8
  %219 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  store ptr %218, ptr %219, align 8
  %220 = load i64, ptr %8, align 8, !tbaa !9
  %221 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef %220) #8
  %222 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  store ptr %221, ptr %222, align 8
  %223 = getelementptr inbounds %class.anon, ptr %33, i32 0, i32 0
  %224 = load i32, ptr %24, align 4, !tbaa !15
  store i32 %224, ptr %223, align 4, !tbaa !16
  %225 = getelementptr inbounds %class.anon, ptr %33, i32 0, i32 1
  %226 = load float, ptr %27, align 4, !tbaa !11
  store float %226, ptr %225, align 4, !tbaa !18
  %227 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  %228 = load ptr, ptr %227, align 8
  %229 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8
  %231 = load i64, ptr %33, align 4
  %232 = call ptr @"_ZSt9partitionIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEZNS3_5buildERS8_mmE3$_0ET_SC_SC_T0_"(ptr %228, ptr %230, i64 %231)
  %233 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %232, ptr %233, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = call ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %234) #8
  %236 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %235, ptr %236, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %28, i64 8, i1 false), !tbaa.struct !19
  %237 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8
  %239 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8
  %241 = call noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESB_SB_(ptr %238, ptr %240)
  store i64 %241, ptr %34, align 8, !tbaa !9
  %242 = load i64, ptr %34, align 8, !tbaa !9
  %243 = load i64, ptr %7, align 8, !tbaa !9
  %244 = icmp eq i64 %242, %243
  br i1 %244, label %249, label %245

245:                                              ; preds = %202
  %246 = load i64, ptr %34, align 8, !tbaa !9
  %247 = load i64, ptr %8, align 8, !tbaa !9
  %248 = icmp eq i64 %246, %247
  br i1 %248, label %249, label %254

249:                                              ; preds = %245, %202
  %250 = load i64, ptr %7, align 8, !tbaa !9
  %251 = load i64, ptr %8, align 8, !tbaa !9
  %252 = add i64 %250, %251
  %253 = udiv i64 %252, 2
  store i64 %253, ptr %34, align 8, !tbaa !9
  br label %254

254:                                              ; preds = %249, %245
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  call void @_ZSt11make_uniqueIN3Raz27BoundingVolumeHierarchyNodeEJEENSt8__detail9_MakeUniqIT_E15__single_objectEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %37)
  %255 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 1
  %256 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %255, ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  call void @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  %257 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 1
  %258 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %257) #8
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = load i64, ptr %7, align 8, !tbaa !9
  %261 = load i64, ptr %34, align 8, !tbaa !9
  call void @_ZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(104) %258, ptr noundef nonnull align 8 dereferenceable(24) %259, i64 noundef %260, i64 noundef %261)
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  call void @_ZSt11make_uniqueIN3Raz27BoundingVolumeHierarchyNodeEJEENSt8__detail9_MakeUniqIT_E15__single_objectEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %38)
  %262 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 2
  %263 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %262, ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  call void @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  %264 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %39, i32 0, i32 2
  %265 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %264) #8
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = load i64, ptr %34, align 8, !tbaa !9
  %268 = load i64, ptr %8, align 8, !tbaa !9
  call void @_ZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(104) %265, ptr noundef nonnull align 8 dereferenceable(24) %266, i64 noundef %267, i64 noundef %268)
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %269

269:                                              ; preds = %254, %50
  ret void

270:                                              ; preds = %162
  %271 = load ptr, ptr %13, align 8
  %272 = load i32, ptr %14, align 4
  %273 = insertvalue { ptr, i32 } poison, ptr %271, 0
  %274 = insertvalue { ptr, i32 } %273, i32 %272, 1
  resume { ptr, i32 } %274
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

declare void @_ZNK3Raz8Triangle18computeBoundingBoxEv(ptr dead_on_unwind writable sret(%"class.Raz::AABB") align 8, ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN3Raz4AABBaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN3Raz27BoundingVolumeHierarchyNode12TriangleInfoaSERKS1_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Raz6VectorIfLm3EEC2IJRKfS4_S4_EvvEEDpOT_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Raz4AABBC2ERKNS_6VectorIfLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt9partitionIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEZNS3_5buildERS8_mmE3$_0ET_SC_SC_T0_"(ptr, ptr, i64) #7

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESB_SB_(ptr, ptr) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_uniqueIN3Raz27BoundingVolumeHierarchyNodeEJEENSt8__detail9_MakeUniqIT_E15__single_objectEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8) #7

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Raz5ShapeD2Ev(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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { inlinehint 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 #8 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"_ZTSZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmmE3$_0", !7, i64 0, !12, i64 4}
!18 = !{!17, !12, i64 4}
!19 = !{i64 0, i64 8, !5}


; 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.Raz::AABB" = type { %"class.Raz::Shape", %"class.Raz::Vector", %"class.Raz::Vector" }
%"class.Raz::Shape" = type { ptr }
%"class.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 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 uwtable
define dso_local void @_ZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.Raz::AABB", align 8
  %6 = alloca %"class.Raz::AABB", align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca %"class.Raz::AABB", align 8
  %14 = alloca %"class.Raz::Vector", align 4
  %15 = alloca %"class.Raz::Vector", align 4
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.std::unique_ptr", align 8
  %19 = alloca %"class.std::unique_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  %20 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2) #7
  call void @_ZNK3Raz8Triangle18computeBoundingBoxEv(ptr dead_on_unwind nonnull writable sret(%"class.Raz::AABB") align 8 %5, ptr noundef nonnull align 8 dereferenceable(48) %20)
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3Raz4AABBaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  %22 = sub i64 %3, %2
  %23 = icmp ult i64 %22, 2
  br i1 %23, label %25, label %.preheader

.preheader:                                       ; preds = %4
  %.053 = add i64 %2, 1
  %24 = icmp ult i64 %.053, %3
  br i1 %24, label %.lr.ph, label %._crit_edge

25:                                               ; preds = %4
  %26 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2) #7
  %27 = getelementptr inbounds i8, ptr %0, i64 48
  %28 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN3Raz27BoundingVolumeHierarchyNode12TriangleInfoaSERKS1_(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull align 8 dereferenceable(56) %26) #7
  br label %112

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %29 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %29) #7
  %31 = load float, ptr %30, align 4, !tbaa !5
  %32 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %32) #7
  %34 = load float, ptr %33, align 4, !tbaa !5
  %35 = fsub float %31, %34
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %36) #7
  %38 = load float, ptr %37, align 4, !tbaa !5
  %39 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %39) #7
  %41 = load float, ptr %40, align 4, !tbaa !5
  %42 = fsub float %38, %41
  %43 = fcmp ogt float %42, %35
  %.046 = zext i1 %43 to i64
  %.044 = select i1 %43, float %42, float %35
  %44 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %44) #7
  %46 = load float, ptr %45, align 4, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %47) #7
  %49 = load float, ptr %48, align 4, !tbaa !5
  %50 = fsub float %46, %49
  %51 = fcmp ogt float %50, %.044
  %.147 = select i1 %51, i64 2, i64 %.046
  %.1 = select i1 %51, float %50, float %.044
  %52 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %52, i64 noundef %.147) #7
  %54 = load float, ptr %53, align 4, !tbaa !5
  %55 = call float @llvm.fmuladd.f32(float %.1, float 5.000000e-01, float %54)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %56 = call ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %56, ptr %16, align 8
  %57 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %58 = call ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %58, ptr %17, align 8
  %59 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %17, i64 noundef %3) #7
  %60 = bitcast float %55 to i32
  %.sroa.2.0.insert.ext = zext i32 %60 to i64
  %.sroa.2.0.insert.shift = shl nuw i64 %.sroa.2.0.insert.ext, 32
  %.sroa.05.0.insert.insert = or disjoint i64 %.sroa.2.0.insert.shift, %.147
  %61 = call ptr @"_ZSt9partitionIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEZNS3_5buildERS8_mmE3$_0ET_SC_SC_T0_"(ptr %57, ptr %59, i64 %.sroa.05.0.insert.insert)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  %62 = call ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %63 = call noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESB_SB_(ptr %62, ptr %61)
  %64 = icmp eq i64 %63, %2
  %65 = icmp eq i64 %63, %3
  %or.cond = or i1 %64, %65
  %66 = add i64 %3, %2
  %67 = lshr i64 %66, 1
  %.045 = select i1 %or.cond, i64 %67, i64 %63
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  call void @_ZSt11make_uniqueIN3Raz27BoundingVolumeHierarchyNodeEJEENSt8__detail9_MakeUniqIT_E15__single_objectEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %18)
  %68 = getelementptr inbounds i8, ptr %0, i64 32
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  %70 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %68) #7
  call void @_ZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(104) %70, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2, i64 noundef %.045)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  call void @_ZSt11make_uniqueIN3Raz27BoundingVolumeHierarchyNodeEJEENSt8__detail9_MakeUniqIT_E15__single_objectEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %19)
  %71 = getelementptr inbounds i8, ptr %0, i64 40
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  call void @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  %73 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %71) #7
  call void @_ZN3Raz27BoundingVolumeHierarchyNode5buildERSt6vectorINS0_12TriangleInfoESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(104) %73, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.045, i64 noundef %3)
  br label %112

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.054 = phi i64 [ %.0, %.lr.ph ], [ %.053, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  %74 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.054) #7
  call void @_ZNK3Raz8Triangle18computeBoundingBoxEv(ptr dead_on_unwind nonnull writable sret(%"class.Raz::AABB") align 8 %6, ptr noundef nonnull align 8 dereferenceable(48) %74)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %75) #7
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %77) #7
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %76, ptr noundef nonnull align 4 dereferenceable(4) %78)
  %80 = load float, ptr %79, align 4, !tbaa !5
  store float %80, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %81 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %81) #7
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %83) #7
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %82, ptr noundef nonnull align 4 dereferenceable(4) %84)
  %86 = load float, ptr %85, align 4, !tbaa !5
  store float %86, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %87 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %87) #7
  %89 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %89) #7
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %88, ptr noundef nonnull align 4 dereferenceable(4) %90)
  %92 = load float, ptr %91, align 4, !tbaa !5
  store float %92, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %93 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %93) #7
  %95 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %95) #7
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %96)
  %98 = load float, ptr %97, align 4, !tbaa !5
  store float %98, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %99 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %99) #7
  %101 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %101) #7
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %100, ptr noundef nonnull align 4 dereferenceable(4) %102)
  %104 = load float, ptr %103, align 4, !tbaa !5
  store float %104, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %105 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %105) #7
  %107 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %107) #7
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %106, ptr noundef nonnull align 4 dereferenceable(4) %108)
  %110 = load float, ptr %109, align 4, !tbaa !5
  store float %110, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #7
  call void @_ZN3Raz6VectorIfLm3EEC2IJRKfS4_S4_EvvEEDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #7
  call void @_ZN3Raz6VectorIfLm3EEC2IJRKfS4_S4_EvvEEDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12) #7
  call void @_ZN3Raz4AABBC2ERKNS_6VectorIfLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %15) #7
  %111 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3Raz4AABBaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @_ZN3Raz5ShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  %.0 = add nuw i64 %.054, 1
  %exitcond.not = icmp eq i64 %.0, %3
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

112:                                              ; preds = %._crit_edge, %25
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

declare void @_ZNK3Raz8Triangle18computeBoundingBoxEv(ptr dead_on_unwind writable sret(%"class.Raz::AABB") align 8, ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN3Raz4AABBaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN3Raz27BoundingVolumeHierarchyNode12TriangleInfoaSERKS1_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Raz6VectorIfLm3EEC2IJRKfS4_S4_EvvEEDpOT_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Raz4AABBC2ERKNS_6VectorIfLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt9partitionIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEZNS3_5buildERS8_mmE3$_0ET_SC_SC_T0_"(ptr, ptr, i64) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt8distanceIN9__gnu_cxx17__normal_iteratorIPN3Raz27BoundingVolumeHierarchyNode12TriangleInfoESt6vectorIS4_SaIS4_EEEEENSt15iterator_traitsIT_E15difference_typeESB_SB_(ptr, ptr) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_uniqueIN3Raz27BoundingVolumeHierarchyNodeEJEENSt8__detail9_MakeUniqIT_E15__single_objectEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Raz5ShapeD2Ev(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 = { "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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { inlinehint 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 #7 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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