; LLVM IR from Razakhel/RaZ :: src/RaZ/Data/MeshDistanceField.ll (ZN3Raz17MeshDistanceField7computeEm)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }
%class.anon = type { ptr, float, float, float, i64 }
%"class.Raz::MeshDistanceField" = type { %"class.Raz::AABB", i32, i32, i32, %"class.std::vector", ptr }
%"class.Raz::AABB" = type { %"class.Raz::Shape", %"class.Raz::Vector", %"class.Raz::Vector" }
%"class.Raz::Shape" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

; 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 float @_ZNSt14numeric_limitsIfE3maxEv() #1 align 2

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Raz17MeshDistanceField7computeEm(ptr noundef nonnull align 8 dereferenceable(80) %0, i64 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca float, align 4
  %10 = alloca %"class.Raz::Vector", align 4
  %11 = alloca { <2 x float>, float }, align 8
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %class.anon, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %16 = load ptr, ptr %3, align 8
  %17 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 5
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %27

20:                                               ; preds = %2
  %21 = call ptr @__cxa_allocate_exception(i64 16) #9
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef @.str.1)
          to label %22 unwind label %23

22:                                               ; preds = %20
  call void @__cxa_throw(ptr %21, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #10
  unreachable

23:                                               ; preds = %20
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %6, align 4
  call void @__cxa_free_exception(ptr %21) #9
  br label %80

27:                                               ; preds = %2
  %28 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 4
  %29 = call ptr @_ZNSt6vectorIfSaIfEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #9
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  %31 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 4
  %32 = call ptr @_ZNSt6vectorIfSaIfEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #9
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %34 = call noundef float @_ZNSt14numeric_limitsIfE3maxEv() #9
  store float %34, ptr %9, align 4, !tbaa !22
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEfEvT_S7_RKT0_(ptr %36, ptr %38, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #9
  %39 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 0
  %40 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %39)
  %41 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 0
  %42 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %41)
  %43 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %40, ptr noundef nonnull align 4 dereferenceable(12) %42) #9
  %44 = getelementptr inbounds %"class.Raz::Vector", ptr %10, i32 0, i32 0
  %45 = getelementptr inbounds %"struct.std::array", ptr %44, i32 0, i32 0
  store { <2 x float>, float } %43, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 8 %11, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  %47 = load float, ptr %46, align 4, !tbaa !22
  %48 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 1
  %49 = load i32, ptr %48, align 8, !tbaa !24
  %50 = sub i32 %49, 1
  %51 = uitofp i32 %50 to float
  %52 = fdiv float %47, %51
  store float %52, ptr %12, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  %54 = load float, ptr %53, align 4, !tbaa !22
  %55 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !25
  %57 = sub i32 %56, 1
  %58 = uitofp i32 %57 to float
  %59 = fdiv float %54, %58
  store float %59, ptr %13, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  %61 = load float, ptr %60, align 4, !tbaa !22
  %62 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 3
  %63 = load i32, ptr %62, align 8, !tbaa !26
  %64 = sub i32 %63, 1
  %65 = uitofp i32 %64 to float
  %66 = fdiv float %61, %65
  store float %66, ptr %14, align 4, !tbaa !22
  %67 = getelementptr inbounds %"class.Raz::MeshDistanceField", ptr %16, i32 0, i32 3
  %68 = load i32, ptr %67, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #9
  %69 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 0
  store ptr %16, ptr %69, align 8, !tbaa !27
  %70 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 1
  %71 = load float, ptr %12, align 4, !tbaa !22
  store float %71, ptr %70, align 8, !tbaa !29
  %72 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 2
  %73 = load float, ptr %13, align 4, !tbaa !22
  store float %73, ptr %72, align 4, !tbaa !30
  %74 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 3
  %75 = load float, ptr %14, align 4, !tbaa !22
  store float %75, ptr %74, align 8, !tbaa !31
  %76 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 4
  %77 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %77, ptr %76, align 8, !tbaa !32
  %78 = call noundef i32 @_ZN3Raz9Threading20getSystemThreadCountEv() #9
  %79 = mul i32 %78, 2
  call void @"_ZN3Raz9Threading11parallelizeIijZNS_17MeshDistanceField7computeEmE3$_0vEEvT_T0_RKT1_j"(i32 noundef 0, i32 noundef %68, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %79)
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #9
  ret void

80:                                               ; preds = %23
  %81 = load ptr, ptr %5, align 8
  %82 = load i32, ptr %6, align 4
  %83 = insertvalue { ptr, i32 } poison, ptr %81, 0
  %84 = insertvalue { ptr, i32 } %83, i32 %82, 1
  resume { ptr, i32 } %84
}

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

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

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

; 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 { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; 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

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

; 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: mustprogress uwtable
declare hidden void @"_ZN3Raz9Threading11parallelizeIijZNS_17MeshDistanceField7computeEmE3$_0vEEvT_T0_RKT1_j"(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3Raz9Threading20getSystemThreadCountEv() #8

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

!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, !6, i64 72}
!12 = !{!"_ZTSN3Raz17MeshDistanceFieldE", !13, i64 0, !17, i64 32, !17, i64 36, !17, i64 40, !18, i64 48, !6, i64 72}
!13 = !{!"_ZTSN3Raz4AABBE", !14, i64 0, !15, i64 8, !15, i64 20}
!14 = !{!"_ZTSN3Raz5ShapeE"}
!15 = !{!"_ZTSN3Raz6VectorIfLm3EEE", !16, i64 0}
!16 = !{!"_ZTSSt5arrayIfLm3EE", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIfSaIfEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!12, !17, i64 32}
!25 = !{!12, !17, i64 36}
!26 = !{!12, !17, i64 40}
!27 = !{!28, !6, i64 0}
!28 = !{!"_ZTSZN3Raz17MeshDistanceField7computeEmE3$_0", !6, i64 0, !23, i64 8, !23, i64 12, !23, i64 16, !10, i64 24}
!29 = !{!28, !23, i64 8}
!30 = !{!28, !23, i64 12}
!31 = !{!28, !23, i64 16}
!32 = !{!28, !10, i64 24}


; 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::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }
%class.anon = type { ptr, float, float, float, i64 }

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@_ZTISt13runtime_error = external constant 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 float @_ZNSt14numeric_limitsIfE3maxEv() local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Raz17MeshDistanceField7computeEm(ptr noundef nonnull align 8 dereferenceable(80) %0, i64 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca float, align 4
  %4 = alloca %"class.Raz::Vector", align 8
  %5 = alloca %class.anon, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %14

9:                                                ; preds = %2
  %10 = tail call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull @.str.1)
          to label %11 unwind label %12

11:                                               ; preds = %9
  tail call void @__cxa_throw(ptr nonnull %10, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
  unreachable

12:                                               ; preds = %9
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %10) #8
  resume { ptr, i32 } %13

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = tail call ptr @_ZNSt6vectorIfSaIfEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  %17 = tail call ptr @_ZNSt6vectorIfSaIfEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %18 = tail call noundef float @_ZNSt14numeric_limitsIfE3maxEv() #8
  store float %18, ptr %3, align 4, !tbaa !19
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEfEvT_S7_RKT0_(ptr %16, ptr %17, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  %19 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMaxPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %20 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %21 = call { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %20) #8
  %.fca.0.extract = extractvalue { <2 x float>, float } %21, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %21, 1
  store <2 x float> %.fca.0.extract, ptr %4, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1xEv(ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  %23 = load float, ptr %22, align 4, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  %25 = getelementptr inbounds i8, ptr %0, i64 36
  %26 = getelementptr inbounds i8, ptr %0, i64 40
  %27 = getelementptr inbounds i8, ptr %5, i64 8
  %28 = load <4 x i32>, ptr %24, align 8
  %29 = shufflevector <4 x i32> %28, <4 x i32> poison, <2 x i32> <i32 0, i32 poison>
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1yEv(ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  %31 = load float, ptr %30, align 4, !tbaa !19
  %32 = load i32, ptr %25, align 4, !tbaa !21
  %33 = insertelement <2 x i32> %29, i32 %32, i64 1
  %34 = add <2 x i32> %33, <i32 -1, i32 -1>
  %35 = uitofp <2 x i32> %34 to <2 x float>
  %36 = insertelement <2 x float> poison, float %23, i64 0
  %37 = insertelement <2 x float> %36, float %31, i64 1
  %38 = fdiv <2 x float> %37, %35
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3Raz6VectorIfLm3EE1zEv(ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  %40 = load float, ptr %39, align 4, !tbaa !19
  %41 = load i32, ptr %26, align 8, !tbaa !22
  %42 = add i32 %41, -1
  %43 = uitofp i32 %42 to float
  %44 = fdiv float %40, %43
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  store ptr %0, ptr %5, align 8, !tbaa !23
  store <2 x float> %38, ptr %27, align 8, !tbaa !19
  %45 = getelementptr inbounds i8, ptr %5, i64 16
  store float %44, ptr %45, align 8, !tbaa !26
  %46 = getelementptr inbounds i8, ptr %5, i64 24
  store i64 %1, ptr %46, align 8, !tbaa !27
  %47 = call noundef i32 @_ZN3Raz9Threading20getSystemThreadCountEv() #8
  %48 = shl i32 %47, 1
  call void @"_ZN3Raz9Threading11parallelizeIijZNS_17MeshDistanceField7computeEmE3$_0vEEvT_T0_RKT1_j"(i32 noundef 0, i32 noundef %41, ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %48)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  ret void
}

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

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

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

; 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 { <2 x float>, float } @_ZNK3Raz6VectorIfLm3EEmiERKS1_(ptr noundef nonnull align 4 dereferenceable(12), 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(12) ptr @_ZNK3Raz4AABB14getMinPositionEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; 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: mustprogress uwtable
declare hidden void @"_ZN3Raz9Threading11parallelizeIijZNS_17MeshDistanceField7computeEmE3$_0vEEvT_T0_RKT1_j"(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3Raz9Threading20getSystemThreadCountEv() local_unnamed_addr #7

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"="64" "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 = { 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 #8 = { nounwind }
attributes #9 = { noreturn }

!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, !18, i64 72}
!6 = !{!"_ZTSN3Raz17MeshDistanceFieldE", !7, i64 0, !13, i64 32, !13, i64 36, !13, i64 40, !14, i64 48, !18, i64 72}
!7 = !{!"_ZTSN3Raz4AABBE", !8, i64 0, !9, i64 8, !9, i64 20}
!8 = !{!"_ZTSN3Raz5ShapeE"}
!9 = !{!"_ZTSN3Raz6VectorIfLm3EEE", !10, i64 0}
!10 = !{!"_ZTSSt5arrayIfLm3EE", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"int", !11, i64 0}
!14 = !{!"_ZTSSt6vectorIfSaIfEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !11, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !11, i64 0}
!21 = !{!6, !13, i64 36}
!22 = !{!6, !13, i64 40}
!23 = !{!24, !18, i64 0}
!24 = !{!"_ZTSZN3Raz17MeshDistanceField7computeEmE3$_0", !18, i64 0, !20, i64 8, !20, i64 12, !20, i64 16, !25, i64 24}
!25 = !{!"long", !11, i64 0}
!26 = !{!24, !20, i64 16}
!27 = !{!24, !25, i64 24}


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