; LLVM IR from atlantis13579/Riemann :: Src/CollisionPrimitive (HeightField3)

; 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.Maths::TVector3" = type { float, float, float }
%"class.Riemann::HeightField3" = type { i32, i32, %"class.Maths::TAABB3", float, float, float, float, float, %"class.std::vector", ptr }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Riemann::HeightField3::CellInfo, std::allocator<Riemann::HeightField3::CellInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::HeightField3::CellInfo, std::allocator<Riemann::HeightField3::CellInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::HeightField3::CellInfo, std::allocator<Riemann::HeightField3::CellInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::HeightField3::CellInfo, std::allocator<Riemann::HeightField3::CellInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Riemann::HeightField3::CellInfo" = type { i16, i8, i8 }

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE = external hidden unnamed_addr constant [70 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.Maths::TVector3", align 4
  %23 = alloca %"class.Maths::TVector3", align 4
  %24 = alloca %"class.Maths::TVector3", align 4
  %25 = alloca %"class.Maths::TVector3", align 4
  %26 = alloca %"class.Maths::TVector3", align 4
  %27 = alloca %"class.Maths::TVector3", align 4
  %28 = alloca %"class.Maths::TVector3", align 4
  %29 = alloca %"class.Maths::TVector3", align 4
  %30 = alloca %"class.Maths::TVector3", align 4
  %31 = alloca %"class.Maths::TVector3", align 4
  %32 = alloca %"class.Maths::TVector3", align 4
  %33 = alloca %"class.Maths::TVector3", align 4
  %34 = alloca %"class.Maths::TVector3", align 4
  %35 = alloca %"class.Maths::TVector3", align 4
  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
  store ptr %3, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = icmp sge i32 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %4
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = sub nsw i32 %42, 1
  %44 = icmp slt i32 %40, %43
  br label %45

45:                                               ; preds = %39, %4
  %46 = phi i1 [ false, %4 ], [ %44, %39 ]
  br i1 %46, label %47, label %48

47:                                               ; preds = %45
  br label %50

48:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 401, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE) #7
  unreachable

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %47
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = icmp sge i32 %51, 0
  br i1 %52, label %53, label %59

53:                                               ; preds = %50
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !20
  %57 = sub nsw i32 %56, 1
  %58 = icmp slt i32 %54, %57
  br label %59

59:                                               ; preds = %53, %50
  %60 = phi i1 [ false, %50 ], [ %58, %53 ]
  br i1 %60, label %61, label %62

61:                                               ; preds = %59
  br label %64

62:                                               ; preds = %59
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 402, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE) #7
  unreachable

63:                                               ; No predecessors!
  br label %64

64:                                               ; preds = %63, %61
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  %65 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 9
  %66 = load ptr, ptr %65, align 8, !tbaa !21
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !11
  %71 = mul i32 %68, %70
  %72 = add i32 %67, %71
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %66, i64 %73
  %75 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %74, i32 0, i32 1
  %76 = load i8, ptr %75, align 2, !tbaa !22
  %77 = zext i8 %76 to i32
  %78 = and i32 %77, 128
  %79 = icmp ne i32 %78, 0
  %80 = zext i1 %79 to i8
  store i8 %80, ptr %9, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #8
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !11
  %84 = mul i32 %81, %83
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = add i32 %84, %85
  %87 = trunc i32 %86 to i16
  store i16 %87, ptr %10, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #8
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !11
  %91 = mul i32 %88, %90
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = add i32 %91, %92
  %94 = add i32 %93, 1
  %95 = trunc i32 %94 to i16
  store i16 %95, ptr %11, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #8
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  %98 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !11
  %100 = mul i32 %97, %99
  %101 = load i32, ptr %6, align 4, !tbaa !9
  %102 = add i32 %100, %101
  %103 = trunc i32 %102 to i16
  store i16 %103, ptr %12, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #8
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  %106 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !11
  %108 = mul i32 %105, %107
  %109 = load i32, ptr %6, align 4, !tbaa !9
  %110 = add i32 %108, %109
  %111 = add i32 %110, 1
  %112 = trunc i32 %111 to i16
  store i16 %112, ptr %13, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #8
  %113 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 9
  %114 = load ptr, ptr %113, align 8, !tbaa !21
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !11
  %119 = mul i32 %116, %118
  %120 = add i32 %115, %119
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %114, i64 %121
  %123 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %122, i32 0, i32 1
  %124 = load i8, ptr %123, align 2, !tbaa !22
  store i8 %124, ptr %14, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #8
  %125 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 9
  %126 = load ptr, ptr %125, align 8, !tbaa !21
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 0
  %130 = load i32, ptr %129, align 8, !tbaa !11
  %131 = mul i32 %128, %130
  %132 = add i32 %127, %131
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %126, i64 %133
  %135 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %134, i32 0, i32 2
  %136 = load i8, ptr %135, align 1, !tbaa !29
  store i8 %136, ptr %15, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #8
  %137 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 2
  %138 = getelementptr inbounds %"class.Maths::TAABB3", ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %"class.Maths::TVector3", ptr %138, i32 0, i32 0
  %140 = load float, ptr %139, align 8, !tbaa !30
  %141 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 3
  %142 = load float, ptr %141, align 8, !tbaa !31
  %143 = load i32, ptr %6, align 4, !tbaa !9
  %144 = sitofp i32 %143 to float
  %145 = call float @llvm.fmuladd.f32(float %142, float %144, float %140)
  %146 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 2
  %147 = getelementptr inbounds %"class.Maths::TAABB3", ptr %146, i32 0, i32 0
  %148 = getelementptr inbounds %"class.Maths::TVector3", ptr %147, i32 0, i32 2
  %149 = load float, ptr %148, align 8, !tbaa !32
  %150 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 4
  %151 = load float, ptr %150, align 4, !tbaa !33
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = sitofp i32 %152 to float
  %154 = call float @llvm.fmuladd.f32(float %151, float %153, float %149)
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef %145, float noundef 0.000000e+00, float noundef %154)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %155 = load i16, ptr %10, align 2, !tbaa !27
  %156 = zext i16 %155 to i32
  %157 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %36, i32 noundef %156)
  store float %157, ptr %17, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %158 = load i16, ptr %11, align 2, !tbaa !27
  %159 = zext i16 %158 to i32
  %160 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %36, i32 noundef %159)
  store float %160, ptr %18, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %161 = load i16, ptr %12, align 2, !tbaa !27
  %162 = zext i16 %161 to i32
  %163 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %36, i32 noundef %162)
  store float %163, ptr %19, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %164 = load i16, ptr %13, align 2, !tbaa !27
  %165 = zext i16 %164 to i32
  %166 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %36, i32 noundef %165)
  store float %166, ptr %20, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !9
  %167 = load i8, ptr %14, align 1, !tbaa !28
  %168 = zext i8 %167 to i32
  %169 = icmp ne i32 %168, 127
  br i1 %169, label %170, label %199

170:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  %171 = load float, ptr %19, align 4, !tbaa !34
  %172 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 4
  %173 = load float, ptr %172, align 4, !tbaa !33
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %23, float noundef 0.000000e+00, float noundef %171, float noundef %173)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %22, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %23)
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %"class.Maths::TVector3", ptr %174, i64 0
  %176 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %175, ptr noundef nonnull align 4 dereferenceable(12) %22)
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #8
  %177 = load float, ptr %17, align 4, !tbaa !34
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %25, float noundef 0.000000e+00, float noundef %177, float noundef 0.000000e+00)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %24, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %25)
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = getelementptr inbounds %"class.Maths::TVector3", ptr %178, i64 1
  %180 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %179, ptr noundef nonnull align 4 dereferenceable(12) %24)
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #8
  %181 = load i8, ptr %9, align 1, !tbaa !25, !range !35, !noundef !36
  %182 = trunc i8 %181 to i1
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #8
  br i1 %182, label %183, label %189

183:                                              ; preds = %170
  %184 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 3
  %185 = load float, ptr %184, align 8, !tbaa !31
  %186 = load float, ptr %20, align 4, !tbaa !34
  %187 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 4
  %188 = load float, ptr %187, align 4, !tbaa !33
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %27, float noundef %185, float noundef %186, float noundef %188)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %26, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %27)
  br label %193

189:                                              ; preds = %170
  %190 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 3
  %191 = load float, ptr %190, align 8, !tbaa !31
  %192 = load float, ptr %18, align 4, !tbaa !34
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %28, float noundef %191, float noundef %192, float noundef 0.000000e+00)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %26, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %28)
  br label %193

193:                                              ; preds = %189, %183
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  %195 = getelementptr inbounds %"class.Maths::TVector3", ptr %194, i64 2
  %196 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %195, ptr noundef nonnull align 4 dereferenceable(12) %26)
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #8
  %197 = load i32, ptr %21, align 4, !tbaa !9
  %198 = add nsw i32 %197, 3
  store i32 %198, ptr %21, align 4, !tbaa !9
  br label %199

199:                                              ; preds = %193, %64
  %200 = load i8, ptr %15, align 1, !tbaa !28
  %201 = zext i8 %200 to i32
  %202 = icmp ne i32 %201, 127
  br i1 %202, label %203, label %241

203:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #8
  %204 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 3
  %205 = load float, ptr %204, align 8, !tbaa !31
  %206 = load float, ptr %20, align 4, !tbaa !34
  %207 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 4
  %208 = load float, ptr %207, align 4, !tbaa !33
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %30, float noundef %205, float noundef %206, float noundef %208)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %29, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %30)
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = load i32, ptr %21, align 4, !tbaa !9
  %211 = add nsw i32 %210, 0
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds %"class.Maths::TVector3", ptr %209, i64 %212
  %214 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %213, ptr noundef nonnull align 4 dereferenceable(12) %29)
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #8
  %215 = load i8, ptr %9, align 1, !tbaa !25, !range !35, !noundef !36
  %216 = trunc i8 %215 to i1
  call void @llvm.lifetime.start.p0(i64 12, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %33) #8
  br i1 %216, label %217, label %219

217:                                              ; preds = %203
  %218 = load float, ptr %17, align 4, !tbaa !34
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %32, float noundef 0.000000e+00, float noundef %218, float noundef 0.000000e+00)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %31, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %32)
  br label %223

219:                                              ; preds = %203
  %220 = load float, ptr %19, align 4, !tbaa !34
  %221 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 4
  %222 = load float, ptr %221, align 4, !tbaa !33
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %33, float noundef 0.000000e+00, float noundef %220, float noundef %222)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %31, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %33)
  br label %223

223:                                              ; preds = %219, %217
  %224 = load ptr, ptr %8, align 8, !tbaa !5
  %225 = load i32, ptr %21, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds %"class.Maths::TVector3", ptr %224, i64 %227
  %229 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %228, ptr noundef nonnull align 4 dereferenceable(12) %31)
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %34) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %35) #8
  %230 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %36, i32 0, i32 3
  %231 = load float, ptr %230, align 8, !tbaa !31
  %232 = load float, ptr %18, align 4, !tbaa !34
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %35, float noundef %231, float noundef %232, float noundef 0.000000e+00)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %34, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %35)
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = load i32, ptr %21, align 4, !tbaa !9
  %235 = add nsw i32 %234, 2
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds %"class.Maths::TVector3", ptr %233, i64 %236
  %238 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %237, ptr noundef nonnull align 4 dereferenceable(12) %34)
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %34) #8
  %239 = load i32, ptr %21, align 4, !tbaa !9
  %240 = add nsw i32 %239, 3
  store i32 %240, ptr %21, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %223, %199
  %242 = load i32, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  ret i32 %242
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #5 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN7Riemann12HeightField3E", !10, i64 0, !10, i64 4, !13, i64 8, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !16, i64 56, !6, i64 80}
!13 = !{!"_ZTSN5Maths6TAABB3IfEE", !14, i64 0, !14, i64 12}
!14 = !{!"_ZTSN5Maths8TVector3IfEE", !15, i64 0, !15, i64 4, !15, i64 8}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIN7Riemann12HeightField38CellInfoESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!12, !10, i64 4}
!21 = !{!12, !6, i64 80}
!22 = !{!23, !7, i64 2}
!23 = !{!"_ZTSN7Riemann12HeightField38CellInfoE", !24, i64 0, !7, i64 2, !7, i64 3}
!24 = !{!"short", !7, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!24, !24, i64 0}
!28 = !{!7, !7, i64 0}
!29 = !{!23, !7, i64 3}
!30 = !{!12, !15, i64 8}
!31 = !{!12, !15, i64 32}
!32 = !{!12, !15, i64 16}
!33 = !{!12, !15, i64 36}
!34 = !{!15, !15, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}


; 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.Maths::TVector3" = type { float, float, float }
%"struct.Riemann::HeightField3::CellInfo" = type { i16, i8, i8 }

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE = external hidden unnamed_addr constant [70 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 7) i32 @_ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #3 align 2 {
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TVector3", align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca %"class.Maths::TVector3", align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::TVector3", align 4
  %14 = alloca %"class.Maths::TVector3", align 4
  %15 = alloca %"class.Maths::TVector3", align 4
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca %"class.Maths::TVector3", align 4
  %18 = alloca %"class.Maths::TVector3", align 4
  %19 = alloca %"class.Maths::TVector3", align 4
  %20 = icmp sgt i32 %1, -1
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %4
  %22 = load i32, ptr %0, align 8, !tbaa !5
  %23 = add nsw i32 %22, -1
  %24 = icmp sgt i32 %23, %1
  br i1 %24, label %25, label %.critedge

.critedge:                                        ; preds = %4, %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 401, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE) #7
  unreachable

25:                                               ; preds = %21
  %26 = icmp sgt i32 %2, -1
  br i1 %26, label %27, label %.critedge2

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %0, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !18
  %30 = add nsw i32 %29, -1
  %31 = icmp sgt i32 %30, %2
  br i1 %31, label %32, label %.critedge2

.critedge2:                                       ; preds = %25, %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 402, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPN5Maths8TVector3IfEE) #7
  unreachable

32:                                               ; preds = %27
  %33 = getelementptr inbounds i8, ptr %0, i64 80
  %34 = load ptr, ptr %33, align 8, !tbaa !19
  %35 = mul i32 %22, %2
  %36 = add i32 %35, %1
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %34, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 2
  %40 = load i8, ptr %39, align 2, !tbaa !20
  %.not = icmp sgt i8 %40, -1
  %41 = add i32 %36, 1
  %42 = add nuw nsw i32 %2, 1
  %43 = mul i32 %22, %42
  %44 = add i32 %43, %1
  %45 = add i32 %44, 1
  %46 = getelementptr inbounds i8, ptr %38, i64 3
  %47 = load i8, ptr %46, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #8
  %48 = getelementptr inbounds i8, ptr %0, i64 8
  %49 = load float, ptr %48, align 8, !tbaa !24
  %50 = getelementptr inbounds i8, ptr %0, i64 32
  %51 = load float, ptr %50, align 8, !tbaa !25
  %52 = uitofp nneg i32 %1 to float
  %53 = tail call float @llvm.fmuladd.f32(float %51, float %52, float %49)
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  %55 = load float, ptr %54, align 8, !tbaa !26
  %56 = getelementptr inbounds i8, ptr %0, i64 36
  %57 = load float, ptr %56, align 4, !tbaa !27
  %58 = uitofp nneg i32 %2 to float
  %59 = tail call float @llvm.fmuladd.f32(float %57, float %58, float %55)
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef %53, float noundef 0.000000e+00, float noundef %59)
  %60 = and i32 %36, 65535
  %61 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %60)
  %62 = and i32 %41, 65535
  %63 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %62)
  %64 = and i32 %44, 65535
  %65 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %64)
  %66 = and i32 %45, 65535
  %67 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %66)
  %.not52 = icmp eq i8 %40, 127
  br i1 %.not52, label %80, label %68

68:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  %69 = load float, ptr %56, align 4, !tbaa !27
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef 0.000000e+00, float noundef %65, float noundef %69)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #8
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 0.000000e+00, float noundef %61, float noundef 0.000000e+00)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %71 = getelementptr inbounds i8, ptr %3, i64 12
  %72 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %71, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #8
  %73 = load float, ptr %50, align 8, !tbaa !25
  br i1 %.not, label %76, label %74

74:                                               ; preds = %68
  %75 = load float, ptr %56, align 4, !tbaa !27
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %11, float noundef %73, float noundef %67, float noundef %75)
  br label %77

76:                                               ; preds = %68
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef %73, float noundef %63, float noundef 0.000000e+00)
  br label %77

77:                                               ; preds = %76, %74
  %.sink = phi ptr [ %12, %76 ], [ %11, %74 ]
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %10, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %.sink)
  %78 = getelementptr inbounds i8, ptr %3, i64 24
  %79 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %78, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  br label %80

80:                                               ; preds = %77, %32
  %.0 = phi i32 [ 3, %77 ], [ 0, %32 ]
  %.not53 = icmp eq i8 %47, 127
  br i1 %.not53, label %97, label %81

81:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #8
  %82 = load float, ptr %50, align 8, !tbaa !25
  %83 = load float, ptr %56, align 4, !tbaa !27
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %14, float noundef %82, float noundef %67, float noundef %83)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %14)
  %84 = zext nneg i32 %.0 to i64
  %85 = getelementptr inbounds %"class.Maths::TVector3", ptr %3, i64 %84
  %86 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %85, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #8
  br i1 %.not, label %88, label %87

87:                                               ; preds = %81
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef 0.000000e+00, float noundef %61, float noundef 0.000000e+00)
  br label %90

88:                                               ; preds = %81
  %89 = load float, ptr %56, align 4, !tbaa !27
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef 0.000000e+00, float noundef %65, float noundef %89)
  br label %90

90:                                               ; preds = %88, %87
  %.sink54 = phi ptr [ %17, %88 ], [ %16, %87 ]
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %15, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %.sink54)
  %91 = getelementptr inbounds i8, ptr %85, i64 12
  %92 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %91, ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #8
  %93 = load float, ptr %50, align 8, !tbaa !25
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef %93, float noundef %63, float noundef 0.000000e+00)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %18, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %19)
  %94 = getelementptr inbounds i8, ptr %85, i64 24
  %95 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %94, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #8
  %96 = add nuw nsw i32 %.0, 3
  br label %97

97:                                               ; preds = %90, %80
  %.1 = phi i32 [ %96, %90 ], [ %.0, %80 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  ret i32 %.1
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN7Riemann12HeightField3E", !7, i64 0, !7, i64 4, !10, i64 8, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !13, i64 56, !17, i64 80}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN5Maths6TAABB3IfEE", !11, i64 0, !11, i64 12}
!11 = !{!"_ZTSN5Maths8TVector3IfEE", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"float", !8, i64 0}
!13 = !{!"_ZTSSt6vectorIN7Riemann12HeightField38CellInfoESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!6, !7, i64 4}
!19 = !{!6, !17, i64 80}
!20 = !{!21, !8, i64 2}
!21 = !{!"_ZTSN7Riemann12HeightField38CellInfoE", !22, i64 0, !8, i64 2, !8, i64 3}
!22 = !{!"short", !8, i64 0}
!23 = !{!21, !8, i64 3}
!24 = !{!6, !12, i64 8}
!25 = !{!6, !12, i64 32}
!26 = !{!6, !12, i64 16}
!27 = !{!6, !12, i64 36}


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