; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (HeightFieldShape)

; 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.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local { double, double } @_ZNK3JPH16HeightFieldShape16GetSurfaceNormalERKNS_10SubShapeIDENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(176) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, double %2, double %3) unnamed_addr #4 align 2 {
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  store double %2, ptr %27, align 16
  %28 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  store double %3, ptr %28, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZNK3JPH16HeightFieldShape16DecodeSubShapeIDERKNS_10SubShapeIDERjS4_S4_(ptr noundef nonnull align 16 dereferenceable(176) %29, ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %29, i32 noundef %31, i32 noundef %32)
  %34 = getelementptr inbounds %"class.JPH::Vec3", ptr %12, i32 0, i32 0
  %35 = getelementptr inbounds %union.anon.3, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %37 = extractvalue { double, double } %33, 0
  store double %37, ptr %36, align 16
  %38 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %39 = extractvalue { double, double } %33, 1
  store double %39, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = add i32 %40, 1
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = add i32 %42, 1
  %44 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %29, i32 noundef %41, i32 noundef %43)
  %45 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %46 = getelementptr inbounds %union.anon.3, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 0
  %48 = extractvalue { double, double } %44, 0
  store double %48, ptr %47, align 16
  %49 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 1
  %50 = extractvalue { double, double } %44, 1
  store double %50, ptr %49, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %97

53:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = add i32 %55, 1
  %57 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %29, i32 noundef %54, i32 noundef %56)
  %58 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %59 = getelementptr inbounds %union.anon.3, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 0
  %61 = extractvalue { double, double } %57, 0
  store double %61, ptr %60, align 16
  %62 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 1
  %63 = extractvalue { double, double } %57, 1
  store double %63, ptr %62, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %15, i64 16, i1 false), !tbaa.struct !11
  %64 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %65 = load double, ptr %64, align 16
  %66 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %67 = load double, ptr %66, align 8
  %68 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %13, double %65, double %67)
  %69 = getelementptr inbounds %"class.JPH::Vec3", ptr %17, i32 0, i32 0
  %70 = getelementptr inbounds %union.anon.3, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds { double, double }, ptr %70, i32 0, i32 0
  %72 = extractvalue { double, double } %68, 0
  store double %72, ptr %71, align 16
  %73 = getelementptr inbounds { double, double }, ptr %70, i32 0, i32 1
  %74 = extractvalue { double, double } %68, 1
  store double %74, ptr %73, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %15, i64 16, i1 false), !tbaa.struct !11
  %75 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %76 = load double, ptr %75, align 16
  %77 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %78 = load double, ptr %77, align 8
  %79 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %76, double %78)
  %80 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %81 = getelementptr inbounds %union.anon.3, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds { double, double }, ptr %81, i32 0, i32 0
  %83 = extractvalue { double, double } %79, 0
  store double %83, ptr %82, align 16
  %84 = getelementptr inbounds { double, double }, ptr %81, i32 0, i32 1
  %85 = extractvalue { double, double } %79, 1
  store double %85, ptr %84, align 8
  %86 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %87 = load double, ptr %86, align 16
  %88 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %89 = load double, ptr %88, align 8
  %90 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %87, double %89)
  %91 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %92 = getelementptr inbounds %union.anon.3, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 0
  %94 = extractvalue { double, double } %90, 0
  store double %94, ptr %93, align 16
  %95 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 1
  %96 = extractvalue { double, double } %90, 1
  store double %96, ptr %95, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %16, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %141

97:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = add i32 %98, 1
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %29, i32 noundef %99, i32 noundef %100)
  %102 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %103 = getelementptr inbounds %union.anon.3, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds { double, double }, ptr %103, i32 0, i32 0
  %105 = extractvalue { double, double } %101, 0
  store double %105, ptr %104, align 16
  %106 = getelementptr inbounds { double, double }, ptr %103, i32 0, i32 1
  %107 = extractvalue { double, double } %101, 1
  store double %107, ptr %106, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %21, i64 16, i1 false), !tbaa.struct !11
  %108 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %109 = load double, ptr %108, align 16
  %110 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %111 = load double, ptr %110, align 8
  %112 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %109, double %111)
  %113 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %114 = getelementptr inbounds %union.anon.3, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds { double, double }, ptr %114, i32 0, i32 0
  %116 = extractvalue { double, double } %112, 0
  store double %116, ptr %115, align 16
  %117 = getelementptr inbounds { double, double }, ptr %114, i32 0, i32 1
  %118 = extractvalue { double, double } %112, 1
  store double %118, ptr %117, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %21, i64 16, i1 false), !tbaa.struct !11
  %119 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %120 = load double, ptr %119, align 16
  %121 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %122 = load double, ptr %121, align 8
  %123 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %13, double %120, double %122)
  %124 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %125 = getelementptr inbounds %union.anon.3, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds { double, double }, ptr %125, i32 0, i32 0
  %127 = extractvalue { double, double } %123, 0
  store double %127, ptr %126, align 16
  %128 = getelementptr inbounds { double, double }, ptr %125, i32 0, i32 1
  %129 = extractvalue { double, double } %123, 1
  store double %129, ptr %128, align 8
  %130 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %131 = load double, ptr %130, align 16
  %132 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %133 = load double, ptr %132, align 8
  %134 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %23, double %131, double %133)
  %135 = getelementptr inbounds %"class.JPH::Vec3", ptr %22, i32 0, i32 0
  %136 = getelementptr inbounds %union.anon.3, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 0
  %138 = extractvalue { double, double } %134, 0
  store double %138, ptr %137, align 16
  %139 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 1
  %140 = extractvalue { double, double } %134, 1
  store double %140, ptr %139, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %22, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %141

141:                                              ; preds = %97, %53
  %142 = call { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %143 = getelementptr inbounds %"class.JPH::Vec3", ptr %5, i32 0, i32 0
  %144 = getelementptr inbounds %union.anon.3, ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds { double, double }, ptr %144, i32 0, i32 0
  %146 = extractvalue { double, double } %142, 0
  store double %146, ptr %145, align 16
  %147 = getelementptr inbounds { double, double }, ptr %144, i32 0, i32 1
  %148 = extractvalue { double, double } %142, 1
  store double %148, ptr %147, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %149 = getelementptr inbounds %"class.JPH::Vec3", ptr %5, i32 0, i32 0
  %150 = getelementptr inbounds %union.anon.3, ptr %149, i32 0, i32 0
  %151 = load { double, double }, ptr %150, align 16
  ret { double, double } %151
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline 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 = { 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 #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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, i64 0}


; 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.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3JPH16HeightFieldShape16DecodeSubShapeIDERKNS_10SubShapeIDERjS4_S4_(ptr noundef nonnull align 16 dereferenceable(176), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local { double, double } @_ZNK3JPH16HeightFieldShape16GetSurfaceNormalERKNS_10SubShapeIDENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(176) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, double %2, double %3) unnamed_addr #3 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  call void @_ZNK3JPH16HeightFieldShape16DecodeSubShapeIDERKNS_10SubShapeIDERjS4_S4_(ptr noundef nonnull align 16 dereferenceable(176) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %13 = load i32, ptr %5, align 4, !tbaa !5
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %13, i32 noundef %14)
  %16 = extractvalue { double, double } %15, 0
  store double %16, ptr %8, align 16
  %17 = getelementptr inbounds i8, ptr %8, i64 8
  %18 = extractvalue { double, double } %15, 1
  store double %18, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = add i32 %19, 1
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = add i32 %21, 1
  %23 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %20, i32 noundef %22)
  %24 = extractvalue { double, double } %23, 0
  store double %24, ptr %9, align 16
  %25 = getelementptr inbounds i8, ptr %9, i64 8
  %26 = extractvalue { double, double } %23, 1
  store double %26, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 0
  %29 = load i32, ptr %5, align 4, !tbaa !5
  br i1 %28, label %30, label %44

30:                                               ; preds = %4
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = add i32 %31, 1
  %33 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %29, i32 noundef %32)
  %34 = extractvalue { double, double } %33, 0
  %35 = extractvalue { double, double } %33, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  %36 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %34, double %35)
  %37 = extractvalue { double, double } %36, 0
  store double %37, ptr %11, align 16
  %38 = getelementptr inbounds i8, ptr %11, i64 8
  %39 = extractvalue { double, double } %36, 1
  store double %39, ptr %38, align 8
  %40 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %34, double %35)
  %41 = extractvalue { double, double } %40, 0
  %42 = extractvalue { double, double } %40, 1
  %43 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %11, double %41, double %42)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  br label %58

44:                                               ; preds = %4
  %45 = add i32 %29, 1
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %45, i32 noundef %46)
  %48 = extractvalue { double, double } %47, 0
  %49 = extractvalue { double, double } %47, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %50 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %48, double %49)
  %51 = extractvalue { double, double } %50, 0
  store double %51, ptr %12, align 16
  %52 = getelementptr inbounds i8, ptr %12, i64 8
  %53 = extractvalue { double, double } %50, 1
  store double %53, ptr %52, align 8
  %54 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %48, double %49)
  %55 = extractvalue { double, double } %54, 0
  %56 = extractvalue { double, double } %54, 1
  %57 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %55, double %56)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %58

58:                                               ; preds = %44, %30
  %.pn = phi { double, double } [ %43, %30 ], [ %57, %44 ]
  %.sink = extractvalue { double, double } %.pn, 1
  %.sink21 = extractvalue { double, double } %.pn, 0
  store double %.sink21, ptr %10, align 16
  %59 = getelementptr inbounds i8, ptr %10, i64 8
  store double %.sink, ptr %59, align 8
  %60 = call { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  ret { double, double } %60
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline 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 = { 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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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