; LLVM IR from jrouwe/JoltPhysics :: Samples/Utils/ShapeCreator.ll (ZN12ShapeCreator15CreateTorusMeshEffjj)

; 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 }
%"class.JPH::MeshShapeSettings" = type { %"class.JPH::ShapeSettings", %"class.JPH::Array", %"class.JPH::Array.3", %"class.JPH::Array.6", i32, float, i8, i32 }
%"class.JPH::ShapeSettings" = type { %"class.JPH::SerializableObject", %"class.JPH::RefTarget", i64, %"class.JPH::Result" }
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Result" = type <{ %union.anon, i8, [7 x i8] }>
%union.anon = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"class.JPH::Array.6" = type { i64, i64, ptr }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.9 }
%union.anon.9 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.10 }
%union.anon.10 = type { <4 x float> }
%"class.JPH::Float3" = type { float, float, float }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12ShapeCreator15CreateTorusMeshEffjj(ptr dead_on_unwind noalias writable sret(%"class.JPH::RefConst") align 8 %0, float noundef %1, float noundef %2, i32 noundef %3, i32 noundef %4) #1 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.JPH::MeshShapeSettings", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.JPH::Mat44", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Float3", align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %"class.JPH::Result", align 8
  store ptr %0, ptr %6, align 8
  store float %1, ptr %7, align 4, !tbaa !5
  store float %2, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = mul i32 %31, %32
  store i32 %33, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 152, ptr %12) #10
  call void @_ZN3JPH17MeshShapeSettingsC2Ev(ptr noundef nonnull align 8 dereferenceable(152) %12)
  %34 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 1
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  invoke void @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %36)
          to label %37 unwind label %48

37:                                               ; preds = %5
  %38 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = mul i32 %39, 2
  %41 = zext i32 %40 to i64
  invoke void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %41)
          to label %42 unwind label %48

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #10
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %43

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

47:                                               ; preds = %43
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  br label %179

48:                                               ; preds = %37, %5
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %13, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %14, align 4
  br label %193

52:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #10
  %53 = invoke { double, double } @_ZN3JPH4Vec36sAxisYEv()
          to label %54 unwind label %78

54:                                               ; preds = %52
  %55 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %56 = getelementptr inbounds %union.anon.10, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds { double, double }, ptr %56, i32 0, i32 0
  %58 = extractvalue { double, double } %53, 0
  store double %58, ptr %57, align 16
  %59 = getelementptr inbounds { double, double }, ptr %56, i32 0, i32 1
  %60 = extractvalue { double, double } %53, 1
  store double %60, ptr %59, align 8
  %61 = load i32, ptr %15, align 4, !tbaa !9
  %62 = uitofp i32 %61 to float
  %63 = fmul float %62, 2.000000e+00
  %64 = fmul float %63, 0x400921FB60000000
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = uitofp i32 %65 to float
  %67 = fdiv float %64, %66
  %68 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %69 = load double, ptr %68, align 16
  %70 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %71 = load double, ptr %70, align 8
  invoke void @_ZN3JPH5Mat449sRotationENS_4Vec3Ef(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %17, double %69, double %71, float noundef %67)
          to label %72 unwind label %78

72:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %152, %72
  %74 = load i32, ptr %19, align 4, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = icmp ult i32 %74, %75
  br i1 %76, label %82, label %77

77:                                               ; preds = %73
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  br label %174

78:                                               ; preds = %54, %52
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %13, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %14, align 4
  br label %178

82:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  %83 = load i32, ptr %19, align 4, !tbaa !9
  %84 = uitofp i32 %83 to float
  %85 = fmul float %84, 2.000000e+00
  %86 = fmul float %85, 0x400921FB60000000
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = uitofp i32 %87 to float
  %89 = fdiv float %86, %88
  store float %89, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #10
  %90 = load float, ptr %7, align 4, !tbaa !5
  %91 = load float, ptr %8, align 4, !tbaa !5
  %92 = load float, ptr %20, align 4, !tbaa !5
  %93 = invoke noundef float @_ZN3JPH3SinEf(float noundef %92)
          to label %94 unwind label %155

94:                                               ; preds = %82
  %95 = call float @llvm.fmuladd.f32(float %91, float %93, float %90)
  %96 = load float, ptr %8, align 4, !tbaa !5
  %97 = load float, ptr %20, align 4, !tbaa !5
  %98 = invoke noundef float @_ZN3JPH3CosEf(float noundef %97)
          to label %99 unwind label %155

99:                                               ; preds = %94
  %100 = fmul float %96, %98
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %22, float noundef %95, float noundef %100, float noundef 0.000000e+00)
          to label %101 unwind label %155

101:                                              ; preds = %99
  %102 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %103 = load double, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %105 = load double, ptr %104, align 8
  %106 = invoke { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %17, double %103, double %105)
          to label %107 unwind label %155

107:                                              ; preds = %101
  %108 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %109 = getelementptr inbounds %union.anon.10, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds { double, double }, ptr %109, i32 0, i32 0
  %111 = extractvalue { double, double } %106, 0
  store double %111, ptr %110, align 16
  %112 = getelementptr inbounds { double, double }, ptr %109, i32 0, i32 1
  %113 = extractvalue { double, double } %106, 1
  store double %113, ptr %112, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #10
  invoke void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %21, ptr noundef %23)
          to label %114 unwind label %159

114:                                              ; preds = %107
  %115 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 1
  invoke void @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %115, ptr noundef nonnull align 4 dereferenceable(12) %23)
          to label %116 unwind label %159

116:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  %117 = load i32, ptr %15, align 4, !tbaa !9
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = mul i32 %117, %118
  %120 = load i32, ptr %19, align 4, !tbaa !9
  %121 = add i32 %119, %120
  store i32 %121, ptr %24, align 4, !tbaa !9
  %122 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  %123 = load i32, ptr %24, align 4, !tbaa !9
  %124 = add i32 %123, 1
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = urem i32 %124, %125
  store i32 %126, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #10
  %127 = load i32, ptr %24, align 4, !tbaa !9
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = add i32 %127, %128
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = urem i32 %129, %130
  store i32 %131, ptr %26, align 4, !tbaa !9
  %132 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE12emplace_backIJRjjjEEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %133 unwind label %163

133:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  %134 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #10
  %135 = load i32, ptr %24, align 4, !tbaa !9
  %136 = add i32 %135, 1
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = urem i32 %136, %137
  store i32 %138, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #10
  %139 = load i32, ptr %24, align 4, !tbaa !9
  %140 = load i32, ptr %10, align 4, !tbaa !9
  %141 = add i32 %139, %140
  %142 = add i32 %141, 1
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = urem i32 %142, %143
  store i32 %144, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #10
  %145 = load i32, ptr %24, align 4, !tbaa !9
  %146 = load i32, ptr %10, align 4, !tbaa !9
  %147 = add i32 %145, %146
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = urem i32 %147, %148
  store i32 %149, ptr %29, align 4, !tbaa !9
  %150 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE12emplace_backIJjjjEEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %134, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %151 unwind label %167

151:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %19, align 4, !tbaa !9
  %154 = add i32 %153, 1
  store i32 %154, ptr %19, align 4, !tbaa !9
  br label %73, !llvm.loop !11

155:                                              ; preds = %101, %99, %94, %82
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %13, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %14, align 4
  br label %173

159:                                              ; preds = %114, %107
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %13, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %14, align 4
  br label %172

163:                                              ; preds = %116
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %13, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %171

167:                                              ; preds = %133
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %13, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  br label %171

171:                                              ; preds = %167, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  br label %172

172:                                              ; preds = %171, %159
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #10
  br label %173

173:                                              ; preds = %172, %155
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  br label %178

174:                                              ; preds = %77
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #10
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %15, align 4, !tbaa !9
  %177 = add i32 %176, 1
  store i32 %177, ptr %15, align 4, !tbaa !9
  br label %43, !llvm.loop !13

178:                                              ; preds = %173, %78
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  br label %193

179:                                              ; preds = %47
  call void @llvm.lifetime.start.p0(i64 40, ptr %30) #10
  invoke void @_ZNK3JPH17MeshShapeSettings6CreateEv(ptr dead_on_unwind writable sret(%"class.JPH::Result") align 8 %30, ptr noundef nonnull align 8 dereferenceable(152) %12)
          to label %180 unwind label %184

180:                                              ; preds = %179
  %181 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH6ResultINS_3RefINS_5ShapeEEEE3GetEv(ptr noundef nonnull align 8 dereferenceable(33) %30)
          to label %182 unwind label %188

182:                                              ; preds = %180
  invoke void @_ZN3JPH8RefConstINS_5ShapeEEC2ERKNS_3RefIS1_EE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %181)
          to label %183 unwind label %188

183:                                              ; preds = %182
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %30) #10
  call void @llvm.lifetime.end.p0(i64 40, ptr %30) #10
  store i32 1, ptr %16, align 4
  call void @_ZN3JPH17MeshShapeSettingsD2Ev(ptr noundef nonnull align 8 dereferenceable(152) %12) #10
  call void @llvm.lifetime.end.p0(i64 152, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  ret void

184:                                              ; preds = %179
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %13, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %14, align 4
  br label %192

188:                                              ; preds = %182, %180
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %13, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %14, align 4
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %30) #10
  br label %192

192:                                              ; preds = %188, %184
  call void @llvm.lifetime.end.p0(i64 40, ptr %30) #10
  br label %193

193:                                              ; preds = %192, %178, %48
  call void @_ZN3JPH17MeshShapeSettingsD2Ev(ptr noundef nonnull align 8 dereferenceable(152) %12) #10
  call void @llvm.lifetime.end.p0(i64 152, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %13, align 8
  %196 = load i32, ptr %14, align 4
  %197 = insertvalue { ptr, i32 } poison, ptr %195, 0
  %198 = insertvalue { ptr, i32 } %197, i32 %196, 1
  resume { ptr, i32 } %198
}

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH5Mat449sRotationENS_4Vec3Ef(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, double, double, float noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN3JPH3SinEf(float noundef) #3

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN3JPH3CosEf(float noundef) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef) unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

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

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

declare void @_ZNK3JPH17MeshShapeSettings6CreateEv(ptr dead_on_unwind writable sret(%"class.JPH::Result") align 8, ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #7

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { alwaysinline mustprogress nounwind 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 #7 = { "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 = { 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 = { 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 #10 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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 }
%"class.JPH::MeshShapeSettings" = type { %"class.JPH::ShapeSettings", %"class.JPH::Array", %"class.JPH::Array.3", %"class.JPH::Array.6", i32, float, i8, i32 }
%"class.JPH::ShapeSettings" = type { %"class.JPH::SerializableObject", %"class.JPH::RefTarget", i64, %"class.JPH::Result" }
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Result" = type <{ %union.anon, i8, [7 x i8] }>
%union.anon = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"class.JPH::Array.6" = type { i64, i64, ptr }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.9 }
%union.anon.9 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.10 }
%union.anon.10 = type { <4 x float> }
%"class.JPH::Float3" = type { float, float, float }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12ShapeCreator15CreateTorusMeshEffjj(ptr dead_on_unwind noalias writable sret(%"class.JPH::RefConst") align 8 %0, float noundef %1, float noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.JPH::MeshShapeSettings", align 8
  %7 = alloca %"class.JPH::Mat44", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Float3", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.JPH::Result", align 8
  %18 = mul i32 %4, %3
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %6) #10
  call void @_ZN3JPH17MeshShapeSettingsC2Ev(ptr noundef nonnull align 8 dereferenceable(152) %6)
  %19 = getelementptr inbounds i8, ptr %6, i64 64
  %20 = zext i32 %18 to i64
  invoke void @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %20)
          to label %21 unwind label %80

21:                                               ; preds = %5
  %22 = getelementptr inbounds i8, ptr %6, i64 88
  %23 = shl i32 %18, 1
  %24 = zext i32 %23 to i64
  invoke void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %24)
          to label %.preheader48 unwind label %80

.preheader48:                                     ; preds = %21
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader48
  %25 = uitofp i32 %3 to float
  %.not65 = icmp eq i32 %4, 0
  %26 = uitofp i32 %4 to float
  %27 = getelementptr inbounds i8, ptr %9, i64 8
  %28 = getelementptr inbounds i8, ptr %8, i64 8
  br i1 %.not65, label %.lr.ph51.split, label %.lr.ph51.split.us

.lr.ph51.split.us:                                ; preds = %.lr.ph51, %._crit_edge.us
  %.03850.us = phi i32 [ %74, %._crit_edge.us ], [ 0, %.lr.ph51 ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #10
  %29 = invoke { double, double } @_ZN3JPH4Vec36sAxisYEv()
          to label %30 unwind label %.split.us

30:                                               ; preds = %.lr.ph51.split.us
  %31 = extractvalue { double, double } %29, 0
  %32 = extractvalue { double, double } %29, 1
  %33 = uitofp i32 %.03850.us to float
  %34 = fmul float %33, 2.000000e+00
  %35 = fmul float %34, 0x400921FB60000000
  %36 = fdiv float %35, %25
  invoke void @_ZN3JPH5Mat449sRotationENS_4Vec3Ef(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %7, double %31, double %32, float noundef %36)
          to label %.preheader.us unwind label %.split.us

37:                                               ; preds = %.preheader.us, %71
  %.03149.us = phi i32 [ 0, %.preheader.us ], [ %72, %71 ]
  %38 = uitofp i32 %.03149.us to float
  %39 = fmul float %38, 2.000000e+00
  %40 = fmul float %39, 0x400921FB60000000
  %41 = fdiv float %40, %26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #10
  %42 = invoke noundef float @_ZN3JPH3SinEf(float noundef %41)
          to label %43 unwind label %.split54.us

43:                                               ; preds = %37
  %44 = invoke noundef float @_ZN3JPH3CosEf(float noundef %41)
          to label %45 unwind label %.split54.us

45:                                               ; preds = %43
  %46 = call float @llvm.fmuladd.f32(float %2, float %42, float %1)
  %47 = fmul float %44, %2
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %9, float noundef %46, float noundef %47, float noundef 0.000000e+00)
  %48 = load double, ptr %9, align 16
  %49 = load double, ptr %27, align 8
  %50 = invoke { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %7, double %48, double %49)
          to label %51 unwind label %.split54.us

51:                                               ; preds = %45
  %52 = extractvalue { double, double } %50, 0
  store double %52, ptr %8, align 16
  %53 = extractvalue { double, double } %50, 1
  store double %53, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #10
  invoke void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef nonnull %10)
          to label %54 unwind label %.split57.us

54:                                               ; preds = %51
  invoke void @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %55 unwind label %.split57.us

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #10
  %56 = add i32 %.03149.us, %73
  store i32 %56, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #10
  %57 = add i32 %56, 1
  %58 = urem i32 %57, %18
  store i32 %58, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #10
  %59 = add i32 %56, %4
  %60 = urem i32 %59, %18
  store i32 %60, ptr %13, align 4, !tbaa !5
  %61 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE12emplace_backIJRjjjEEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %62 unwind label %.split60.us

62:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #10
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = add i32 %63, 1
  %65 = urem i32 %64, %18
  store i32 %65, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #10
  %66 = add i32 %63, %4
  %67 = add i32 %66, 1
  %68 = urem i32 %67, %18
  store i32 %68, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #10
  %69 = urem i32 %66, %18
  store i32 %69, ptr %16, align 4, !tbaa !5
  %70 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE12emplace_backIJjjjEEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %71 unwind label %.split63.us

71:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #10
  %72 = add nuw i32 %.03149.us, 1
  %exitcond.not = icmp eq i32 %72, %4
  br i1 %exitcond.not, label %._crit_edge.us, label %37, !llvm.loop !9

.preheader.us:                                    ; preds = %30
  %73 = mul i32 %.03850.us, %4
  br label %37

._crit_edge.us:                                   ; preds = %71
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #10
  %74 = add nuw i32 %.03850.us, 1
  %exitcond67.not = icmp eq i32 %74, %3
  br i1 %exitcond67.not, label %._crit_edge52, label %.lr.ph51.split.us, !llvm.loop !11

.split.us:                                        ; preds = %30, %.lr.ph51.split.us
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %95

.split54.us:                                      ; preds = %45, %43, %37
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %94

.split57.us:                                      ; preds = %54, %51
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %93

.split60.us:                                      ; preds = %55
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #10
  br label %92

.split63.us:                                      ; preds = %62
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #10
  br label %92

._crit_edge52:                                    ; preds = %._crit_edge.us, %.preheader, %.preheader48
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %17) #10
  invoke void @_ZNK3JPH17MeshShapeSettings6CreateEv(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Result") align 8 %17, ptr noundef nonnull align 8 dereferenceable(152) %6)
          to label %96 unwind label %100

80:                                               ; preds = %21, %5
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %105

.lr.ph51.split:                                   ; preds = %.lr.ph51, %.preheader
  %.03850 = phi i32 [ %90, %.preheader ], [ 0, %.lr.ph51 ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #10
  %82 = invoke { double, double } @_ZN3JPH4Vec36sAxisYEv()
          to label %83 unwind label %.split

83:                                               ; preds = %.lr.ph51.split
  %84 = extractvalue { double, double } %82, 0
  %85 = extractvalue { double, double } %82, 1
  %86 = uitofp i32 %.03850 to float
  %87 = fmul float %86, 2.000000e+00
  %88 = fmul float %87, 0x400921FB60000000
  %89 = fdiv float %88, %25
  invoke void @_ZN3JPH5Mat449sRotationENS_4Vec3Ef(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %7, double %84, double %85, float noundef %89)
          to label %.preheader unwind label %.split

.preheader:                                       ; preds = %83
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #10
  %90 = add nuw i32 %.03850, 1
  %exitcond68.not = icmp eq i32 %90, %3
  br i1 %exitcond68.not, label %._crit_edge52, label %.lr.ph51.split, !llvm.loop !11

.split:                                           ; preds = %83, %.lr.ph51.split
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %95

92:                                               ; preds = %.split63.us, %.split60.us
  %.pn42 = phi { ptr, i32 } [ %79, %.split63.us ], [ %78, %.split60.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #10
  br label %93

93:                                               ; preds = %92, %.split57.us
  %.pn42.pn = phi { ptr, i32 } [ %.pn42, %92 ], [ %77, %.split57.us ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #10
  br label %94

94:                                               ; preds = %93, %.split54.us
  %.pn42.pn.pn = phi { ptr, i32 } [ %.pn42.pn, %93 ], [ %76, %.split54.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #10
  br label %95

95:                                               ; preds = %.split, %.split.us, %94
  %.pn42.pn.pn.pn = phi { ptr, i32 } [ %.pn42.pn.pn, %94 ], [ %91, %.split ], [ %75, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #10
  br label %105

96:                                               ; preds = %._crit_edge52
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH6ResultINS_3RefINS_5ShapeEEEE3GetEv(ptr noundef nonnull align 8 dereferenceable(33) %17)
          to label %98 unwind label %102

98:                                               ; preds = %96
  invoke void @_ZN3JPH8RefConstINS_5ShapeEEC2ERKNS_3RefIS1_EE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %97)
          to label %99 unwind label %102

99:                                               ; preds = %98
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %17) #10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %17) #10
  call void @_ZN3JPH17MeshShapeSettingsD2Ev(ptr noundef nonnull align 8 dereferenceable(152) %6) #10
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %6) #10
  ret void

100:                                              ; preds = %._crit_edge52
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %98, %96
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH6ResultINS_3RefINS_5ShapeEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %17) #10
  br label %104

104:                                              ; preds = %102, %100
  %.pn = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %17) #10
  br label %105

105:                                              ; preds = %104, %95, %80
  %.pn42.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn42.pn.pn.pn, %95 ], [ %.pn, %104 ], [ %81, %80 ]
  call void @_ZN3JPH17MeshShapeSettingsD2Ev(ptr noundef nonnull align 8 dereferenceable(152) %6) #10
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %6) #10
  resume { ptr, i32 } %.pn42.pn.pn.pn.pn
}

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH5Mat449sRotationENS_4Vec3Ef(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, double, double, float noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() local_unnamed_addr #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN3JPH3SinEf(float noundef) local_unnamed_addr #3

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN3JPH3CosEf(float noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef) unnamed_addr #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE12emplace_backIJRjjjEEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE12emplace_backIJjjjEEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

declare void @_ZNK3JPH17MeshShapeSettings6CreateEv(ptr dead_on_unwind writable sret(%"class.JPH::Result") align 8, ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #7

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { alwaysinline mustprogress nounwind 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 #7 = { "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 = { 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 = { 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 #10 = { 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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass