; 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::RefConst" = type { ptr }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::HeightFieldShape" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", i32, i32, i32, i32, i32, i8, i8, i16, i16, [6 x i8], ptr, ptr, ptr, %"class.JPH::Array.9", %"class.JPH::Array.6", i32, [4 x i8] }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.12", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.12" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::Array.9" = type { i64, i64, ptr }
%"class.JPH::Array.6" = type { i64, i64, ptr }

@.str.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@_ZN3JPH15PhysicsMaterial8sDefaultE = external global %"class.JPH::RefConst", align 8
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [18 x i8], align 1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3JPH16HeightFieldShape11GetMaterialEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  %10 = alloca %"struct.JPH::AssertLastParam", align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.JPH::AssertLastParam", align 1
  %14 = alloca ptr, align 8
  %15 = alloca i16, align 2
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  %16 = load ptr, ptr %5, align 8
  %17 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 17
  %18 = call noundef zeroext i1 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  br i1 %18, label %19, label %21

19:                                               ; preds = %3
  %20 = call noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) @_ZN3JPH15PhysicsMaterial8sDefaultE)
  store ptr %20, ptr %4, align 8
  br label %116

21:                                               ; preds = %3
  %22 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 17
  %23 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  %24 = icmp eq i64 %23, 1
  br i1 %24, label %25, label %29

25:                                               ; preds = %21
  %26 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 17
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 0)
  %28 = call noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %27)
  store ptr %28, ptr %4, align 8
  br label %116

29:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %30 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 4
  %31 = load i32, ptr %30, align 16, !tbaa !11
  %32 = sub i32 %31, 1
  store i32 %32, ptr %8, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %29
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = icmp ult i32 %34, %35
  br i1 %36, label %40, label %37

37:                                               ; preds = %33
  %38 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.27, ptr noundef @.str.2, i32 noundef 1430)
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !24
  br label %40

40:                                               ; preds = %39, %37, %33
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = icmp ult i32 %44, %45
  br i1 %46, label %50, label %47

47:                                               ; preds = %43
  %48 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.28, ptr noundef @.str.2, i32 noundef 1431)
  br i1 %48, label %49, label %50

49:                                               ; preds = %47
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !25
  br label %50

50:                                               ; preds = %49, %47, %43
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = mul i32 %54, %55
  %57 = add i32 %53, %56
  %58 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 19
  %59 = load i32, ptr %58, align 8, !tbaa !26
  %60 = mul i32 %57, %59
  store i32 %60, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = lshr i32 %61, 3
  store i32 %62, ptr %12, align 4, !tbaa !9
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = and i32 %63, 7
  store i32 %64, ptr %11, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %52
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = add i32 %66, 1
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 18
  %70 = call noundef i64 @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %69)
  %71 = icmp ult i64 %68, %70
  br i1 %71, label %75, label %72

72:                                               ; preds = %65
  %73 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 1439)
  br i1 %73, label %74, label %75

74:                                               ; preds = %72
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !27
  br label %75

75:                                               ; preds = %74, %72, %65
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %78 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 18
  %79 = call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %78)
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds i8, ptr %79, i64 %81
  store ptr %82, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #4
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 0
  %85 = load i8, ptr %84, align 1, !tbaa !28
  %86 = zext i8 %85 to i16
  %87 = zext i16 %86 to i32
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 1
  %90 = load i8, ptr %89, align 1, !tbaa !28
  %91 = zext i8 %90 to i16
  %92 = zext i16 %91 to i32
  %93 = shl i32 %92, 8
  %94 = trunc i32 %93 to i16
  %95 = zext i16 %94 to i32
  %96 = add nsw i32 %87, %95
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %15, align 2, !tbaa !29
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = load i16, ptr %15, align 2, !tbaa !29
  %100 = zext i16 %99 to i32
  %101 = ashr i32 %100, %98
  %102 = trunc i32 %101 to i16
  store i16 %102, ptr %15, align 2, !tbaa !29
  %103 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 19
  %104 = load i32, ptr %103, align 8, !tbaa !26
  %105 = shl i32 1, %104
  %106 = sub nsw i32 %105, 1
  %107 = load i16, ptr %15, align 2, !tbaa !29
  %108 = zext i16 %107 to i32
  %109 = and i32 %108, %106
  %110 = trunc i32 %109 to i16
  store i16 %110, ptr %15, align 2, !tbaa !29
  %111 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %16, i32 0, i32 17
  %112 = load i16, ptr %15, align 2, !tbaa !29
  %113 = zext i16 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113)
  %115 = call noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %114)
  store ptr %115, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %116

116:                                              ; preds = %77, %25, %19
  %117 = load ptr, ptr %4, align 8
  ret ptr %117
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 64}
!12 = !{!"_ZTSN3JPH16HeightFieldShapeE", !13, i64 0, !20, i64 32, !20, i64 48, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 84, !7, i64 85, !21, i64 86, !21, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !22, i64 120, !23, i64 144, !10, i64 168}
!13 = !{!"_ZTSN3JPH5ShapeE", !14, i64 8, !17, i64 16, !18, i64 24, !19, i64 25}
!14 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!19 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!20 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!23 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!24 = !{i64 2158620721}
!25 = !{i64 2158621066}
!26 = !{!12, !10, i64 168}
!27 = !{i64 2158621453}
!28 = !{!7, !7, i64 0}
!29 = !{!21, !21, 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::RefConst" = type { ptr }

@.str.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@_ZN3JPH15PhysicsMaterial8sDefaultE = external global %"class.JPH::RefConst", align 8
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3JPH16HeightFieldShape11GetMaterialEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  %5 = tail call noundef zeroext i1 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  br i1 %5, label %50, label %6

6:                                                ; preds = %3
  %7 = tail call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %8 = icmp eq i64 %7, 1
  br i1 %8, label %.sink.split, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = load i32, ptr %10, align 16, !tbaa !5
  %12 = add i32 %11, -1
  %13 = icmp ugt i32 %12, %1
  br i1 %13, label %17, label %14

14:                                               ; preds = %9
  %15 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.2, i32 noundef 1430)
  br i1 %15, label %16, label %17

16:                                               ; preds = %14
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !22
  br label %17

17:                                               ; preds = %9, %14, %16
  %18 = icmp ugt i32 %12, %2
  br i1 %18, label %22, label %19

19:                                               ; preds = %17
  %20 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.2, i32 noundef 1431)
  br i1 %20, label %21, label %22

21:                                               ; preds = %19
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !23
  br label %22

22:                                               ; preds = %21, %19, %17
  %23 = mul i32 %12, %2
  %24 = add i32 %23, %1
  %25 = getelementptr inbounds i8, ptr %0, i64 168
  %26 = load i32, ptr %25, align 8, !tbaa !24
  %27 = mul i32 %26, %24
  %28 = lshr i32 %27, 3
  %29 = and i32 %27, 7
  %30 = add nuw nsw i32 %28, 1
  %31 = zext nneg i32 %30 to i64
  %32 = getelementptr inbounds i8, ptr %0, i64 144
  %33 = tail call noundef i64 @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32)
  %34 = icmp ugt i64 %33, %31
  br i1 %34, label %38, label %35

35:                                               ; preds = %22
  %36 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 1439)
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !25
  br label %38

38:                                               ; preds = %37, %35, %22
  %39 = tail call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %32)
  %40 = zext nneg i32 %28 to i64
  %41 = getelementptr inbounds i8, ptr %39, i64 %40
  %42 = load i16, ptr %41, align 1
  %43 = zext i16 %42 to i32
  %44 = lshr i32 %43, %29
  %45 = load i32, ptr %25, align 8, !tbaa !24
  %notmask = shl nsw i32 -1, %45
  %46 = xor i32 %notmask, -1
  %47 = and i32 %44, %46
  %48 = zext nneg i32 %47 to i64
  br label %.sink.split

.sink.split:                                      ; preds = %6, %38
  %.sink18 = phi i64 [ %48, %38 ], [ 0, %6 ]
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.sink18)
  br label %50

50:                                               ; preds = %.sink.split, %3
  %.sink = phi ptr [ @_ZN3JPH15PhysicsMaterial8sDefaultE, %3 ], [ %49, %.sink.split ]
  %51 = tail call noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %.sink)
  ret ptr %51
}

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

attributes #0 = { 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 #1 = { 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 #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 = { 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, !11, i64 64}
!6 = !{!"_ZTSN3JPH16HeightFieldShapeE", !7, i64 0, !17, i64 32, !17, i64 48, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !12, i64 84, !12, i64 85, !18, i64 86, !18, i64 88, !19, i64 96, !19, i64 104, !19, i64 112, !20, i64 120, !21, i64 144, !11, i64 168}
!7 = !{!"_ZTSN3JPH5ShapeE", !8, i64 8, !14, i64 16, !15, i64 24, !16, i64 25}
!8 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !9, i64 0}
!9 = !{!"_ZTSSt6atomicIjE", !10, i64 0}
!10 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN3JPH10EShapeTypeE", !12, i64 0}
!16 = !{!"_ZTSN3JPH13EShapeSubTypeE", !12, i64 0}
!17 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!18 = !{!"short", !12, i64 0}
!19 = !{!"any pointer", !12, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !14, i64 0, !14, i64 8, !19, i64 16}
!21 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !14, i64 0, !14, i64 8, !19, i64 16}
!22 = !{i64 2158620721}
!23 = !{i64 2158621066}
!24 = !{!6, !11, i64 168}
!25 = !{i64 2158621453}


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