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

; 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.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.Maths::TVector3" = type { float, float, float }
%"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 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_ = external hidden unnamed_addr constant [77 x i8], align 1
@.str.2 = 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #1 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca i16, align 2
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca i16, align 2
  %17 = alloca i8, align 1
  %18 = alloca i8, align 1
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca i32, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = icmp sle i32 0, %29
  br i1 %30, label %31, label %37

31:                                               ; preds = %5
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !11
  %35 = sub nsw i32 %34, 1
  %36 = icmp slt i32 %32, %35
  br label %37

37:                                               ; preds = %31, %5
  %38 = phi i1 [ false, %5 ], [ %36, %31 ]
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  br label %42

40:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 356, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_) #4
  unreachable

41:                                               ; No predecessors!
  br label %42

42:                                               ; preds = %41, %39
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = icmp sle i32 0, %43
  br i1 %44, label %45, label %51

45:                                               ; preds = %42
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !20
  %49 = sub nsw i32 %48, 1
  %50 = icmp slt i32 %46, %49
  br label %51

51:                                               ; preds = %45, %42
  %52 = phi i1 [ false, %42 ], [ %50, %45 ]
  br i1 %52, label %53, label %54

53:                                               ; preds = %51
  br label %56

54:                                               ; preds = %51
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 357, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_) #4
  unreachable

55:                                               ; No predecessors!
  br label %56

56:                                               ; preds = %55, %53
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  %57 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 9
  %58 = load ptr, ptr %57, align 8, !tbaa !21
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !11
  %63 = mul i32 %60, %62
  %64 = add i32 %59, %63
  %65 = zext i32 %64 to i64
  %66 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %58, i64 %65
  %67 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %66, i32 0, i32 1
  %68 = load i8, ptr %67, align 2, !tbaa !22
  %69 = zext i8 %68 to i32
  %70 = and i32 %69, 128
  %71 = icmp ne i32 %70, 0
  %72 = zext i1 %71 to i8
  store i8 %72, ptr %12, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #5
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %75 = load i32, ptr %74, align 8, !tbaa !11
  %76 = mul i32 %73, %75
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = add i32 %76, %77
  %79 = trunc i32 %78 to i16
  store i16 %79, ptr %13, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #5
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !11
  %83 = mul i32 %80, %82
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = add i32 %83, %84
  %86 = add i32 %85, 1
  %87 = trunc i32 %86 to i16
  store i16 %87, ptr %14, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #5
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  %90 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !11
  %92 = mul i32 %89, %91
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = add i32 %92, %93
  %95 = trunc i32 %94 to i16
  store i16 %95, ptr %15, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #5
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  %98 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !11
  %100 = mul i32 %97, %99
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = add i32 %100, %101
  %103 = add i32 %102, 1
  %104 = trunc i32 %103 to i16
  store i16 %104, ptr %16, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %105 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 9
  %106 = load ptr, ptr %105, align 8, !tbaa !21
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !11
  %111 = mul i32 %108, %110
  %112 = add i32 %107, %111
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %106, i64 %113
  %115 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %114, i32 0, i32 1
  %116 = load i8, ptr %115, align 2, !tbaa !22
  store i8 %116, ptr %17, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  %117 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 9
  %118 = load ptr, ptr %117, align 8, !tbaa !21
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %28, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !11
  %123 = mul i32 %120, %122
  %124 = add i32 %119, %123
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %118, i64 %125
  %127 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %126, i32 0, i32 2
  %128 = load i8, ptr %127, align 1, !tbaa !29
  store i8 %128, ptr %18, align 1, !tbaa !28
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  store float 0x47EFFFFFE0000000, ptr %129, align 4, !tbaa !30
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  store float 0xC7EFFFFFE0000000, ptr %130, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %131 = load i16, ptr %13, align 2, !tbaa !27
  %132 = zext i16 %131 to i32
  %133 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %28, i32 noundef %132)
  store float %133, ptr %19, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %134 = load i16, ptr %14, align 2, !tbaa !27
  %135 = zext i16 %134 to i32
  %136 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %28, i32 noundef %135)
  store float %136, ptr %20, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %137 = load i16, ptr %15, align 2, !tbaa !27
  %138 = zext i16 %137 to i32
  %139 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %28, i32 noundef %138)
  store float %139, ptr %21, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %140 = load i16, ptr %16, align 2, !tbaa !27
  %141 = zext i16 %140 to i32
  %142 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %28, i32 noundef %141)
  store float %142, ptr %22, align 4, !tbaa !30
  %143 = load i8, ptr %17, align 1, !tbaa !28
  %144 = zext i8 %143 to i32
  %145 = icmp ne i32 %144, 127
  br i1 %145, label %146, label %158

146:                                              ; preds = %56
  %147 = load i8, ptr %18, align 1, !tbaa !28
  %148 = zext i8 %147 to i32
  %149 = icmp ne i32 %148, 127
  br i1 %149, label %150, label %158

150:                                              ; preds = %146
  %151 = call noundef float @_ZN5Maths3MinIfJfffEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  store float %151, ptr %152, align 4, !tbaa !30
  %153 = load float, ptr %20, align 4, !tbaa !30
  %154 = load float, ptr %21, align 4, !tbaa !30
  %155 = load float, ptr %22, align 4, !tbaa !30
  %156 = call noundef float @_ZN5Maths3MaxIfJfffEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %19, float noundef %153, float noundef %154, float noundef %155)
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  store float %156, ptr %157, align 4, !tbaa !30
  store i1 true, ptr %6, align 1
  store i32 1, ptr %23, align 4
  br label %213

158:                                              ; preds = %146, %56
  %159 = load i8, ptr %17, align 1, !tbaa !28
  %160 = zext i8 %159 to i32
  %161 = icmp ne i32 %160, 127
  br i1 %161, label %162, label %184

162:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %163 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %21)
  store float %163, ptr %24, align 4, !tbaa !30
  %164 = load i8, ptr %12, align 1, !tbaa !25, !range !31, !noundef !32
  %165 = trunc i8 %164 to i1
  br i1 %165, label %166, label %167

166:                                              ; preds = %162
  br label %168

167:                                              ; preds = %162
  br label %168

168:                                              ; preds = %167, %166
  %169 = phi ptr [ %22, %166 ], [ %20, %167 ]
  %170 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %169)
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  store float %170, ptr %171, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %172 = load float, ptr %21, align 4, !tbaa !30
  %173 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %19, float noundef %172)
  store float %173, ptr %25, align 4, !tbaa !30
  %174 = load i8, ptr %12, align 1, !tbaa !25, !range !31, !noundef !32
  %175 = trunc i8 %174 to i1
  br i1 %175, label %176, label %178

176:                                              ; preds = %168
  %177 = load float, ptr %22, align 4, !tbaa !30
  br label %180

178:                                              ; preds = %168
  %179 = load float, ptr %20, align 4, !tbaa !30
  br label %180

180:                                              ; preds = %178, %176
  %181 = phi float [ %177, %176 ], [ %179, %178 ]
  %182 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %25, float noundef %181)
  %183 = load ptr, ptr %11, align 8, !tbaa !5
  store float %182, ptr %183, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %211

184:                                              ; preds = %158
  %185 = load i8, ptr %18, align 1, !tbaa !28
  %186 = zext i8 %185 to i32
  %187 = icmp ne i32 %186, 127
  br i1 %187, label %188, label %210

188:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %189 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %22)
  store float %189, ptr %26, align 4, !tbaa !30
  %190 = load i8, ptr %12, align 1, !tbaa !25, !range !31, !noundef !32
  %191 = trunc i8 %190 to i1
  br i1 %191, label %192, label %193

192:                                              ; preds = %188
  br label %194

193:                                              ; preds = %188
  br label %194

194:                                              ; preds = %193, %192
  %195 = phi ptr [ %19, %192 ], [ %21, %193 ]
  %196 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %195)
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  store float %196, ptr %197, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %198 = load float, ptr %22, align 4, !tbaa !30
  %199 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %20, float noundef %198)
  store float %199, ptr %27, align 4, !tbaa !30
  %200 = load i8, ptr %12, align 1, !tbaa !25, !range !31, !noundef !32
  %201 = trunc i8 %200 to i1
  br i1 %201, label %202, label %204

202:                                              ; preds = %194
  %203 = load float, ptr %19, align 4, !tbaa !30
  br label %206

204:                                              ; preds = %194
  %205 = load float, ptr %21, align 4, !tbaa !30
  br label %206

206:                                              ; preds = %204, %202
  %207 = phi float [ %203, %202 ], [ %205, %204 ]
  %208 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %27, float noundef %207)
  %209 = load ptr, ptr %11, align 8, !tbaa !5
  store float %208, ptr %209, align 4, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %210

210:                                              ; preds = %206, %184
  br label %211

211:                                              ; preds = %210, %180
  br label %212

212:                                              ; preds = %211
  store i1 false, ptr %6, align 1
  store i32 1, ptr %23, align 4
  br label %213

213:                                              ; preds = %212, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  %214 = load i1, ptr %6, align 1
  ret i1 %214
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MinIfJfffEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MaxIfJfffEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4), float noundef, float noundef, float noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4), float noundef) #1

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 = { 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 = { 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 #4 = { noreturn nounwind }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!15, !15, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}


; 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"

%"struct.Riemann::HeightField3::CellInfo" = type { i16, i8, i8 }

@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_ = external hidden unnamed_addr constant [77 x i8], align 1
@.str.2 = 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 uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %3, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %4) local_unnamed_addr #1 align 2 {
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = icmp sgt i32 %1, -1
  br i1 %14, label %15, label %.critedge

15:                                               ; preds = %5
  %16 = load i32, ptr %0, align 8, !tbaa !5
  %17 = add nsw i32 %16, -1
  %18 = icmp sgt i32 %17, %1
  br i1 %18, label %19, label %.critedge

.critedge:                                        ; preds = %5, %15
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 356, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_) #4
  unreachable

19:                                               ; preds = %15
  %20 = icmp sgt i32 %2, -1
  br i1 %20, label %21, label %.critedge2

21:                                               ; preds = %19
  %22 = getelementptr inbounds i8, ptr %0, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !18
  %24 = add nsw i32 %23, -1
  %25 = icmp sgt i32 %24, %2
  br i1 %25, label %26, label %.critedge2

.critedge2:                                       ; preds = %19, %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 357, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField314GetHeightRangeEiiRfS1_) #4
  unreachable

26:                                               ; preds = %21
  %27 = getelementptr inbounds i8, ptr %0, i64 80
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = mul i32 %16, %2
  %30 = add i32 %29, %1
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %28, i64 %31
  %33 = getelementptr inbounds i8, ptr %32, i64 2
  %34 = load i8, ptr %33, align 2, !tbaa !20
  %.not = icmp sgt i8 %34, -1
  %35 = add i32 %30, 1
  %36 = add nuw nsw i32 %2, 1
  %37 = mul i32 %16, %36
  %38 = add i32 %37, %1
  %39 = add i32 %38, 1
  %40 = getelementptr inbounds i8, ptr %32, i64 3
  %41 = load i8, ptr %40, align 1, !tbaa !23
  store float 0x47EFFFFFE0000000, ptr %3, align 4, !tbaa !24
  store float 0xC7EFFFFFE0000000, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %42 = and i32 %30, 65535
  %43 = tail call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %42)
  store float %43, ptr %6, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %44 = and i32 %35, 65535
  %45 = tail call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %44)
  store float %45, ptr %7, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %46 = and i32 %38, 65535
  %47 = tail call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %46)
  store float %47, ptr %8, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %48 = and i32 %39, 65535
  %49 = tail call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %48)
  store float %49, ptr %9, align 4, !tbaa !24
  %50 = icmp ne i8 %34, 127
  %51 = icmp ne i8 %41, 127
  %or.cond = select i1 %50, i1 %51, i1 false
  br i1 %or.cond, label %52, label %58

52:                                               ; preds = %26
  %53 = call noundef float @_ZN5Maths3MinIfJfffEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store float %53, ptr %3, align 4, !tbaa !24
  %54 = load float, ptr %7, align 4, !tbaa !24
  %55 = load float, ptr %8, align 4, !tbaa !24
  %56 = load float, ptr %9, align 4, !tbaa !24
  %57 = call noundef float @_ZN5Maths3MaxIfJfffEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %6, float noundef %54, float noundef %55, float noundef %56)
  store float %57, ptr %4, align 4, !tbaa !24
  br label %76

58:                                               ; preds = %26
  br i1 %50, label %59, label %68

59:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %60 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store float %60, ptr %10, align 4, !tbaa !24
  %. = select i1 %.not, ptr %7, ptr %9
  %61 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %.)
  store float %61, ptr %3, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %62 = load float, ptr %8, align 4, !tbaa !24
  %63 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %6, float noundef %62)
  store float %63, ptr %11, align 4, !tbaa !24
  %64 = load float, ptr %9, align 4
  %65 = load float, ptr %7, align 4
  %66 = select i1 %.not, float %65, float %64
  %67 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %11, float noundef %66)
  store float %67, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %76

68:                                               ; preds = %58
  br i1 %51, label %69, label %76

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %70 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store float %70, ptr %12, align 4, !tbaa !24
  %71 = call noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store float %71, ptr %3, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %72 = load float, ptr %9, align 4, !tbaa !24
  %73 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %7, float noundef %72)
  store float %73, ptr %13, align 4, !tbaa !24
  %74 = load float, ptr %8, align 4
  %75 = call noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4) %13, float noundef %74)
  store float %75, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  br label %76

76:                                               ; preds = %68, %69, %59, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  ret i1 %or.cond
}

; 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 nounwind uwtable
declare dso_local noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) 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 #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MinIfJfffEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MaxIfJfffEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4), float noundef, float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MinIfJfEEET_RKS1_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN5Maths3MaxIfJfEEET_RKS1_DpT0_(ptr noundef nonnull align 4 dereferenceable(4), float noundef) local_unnamed_addr #1

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 = { 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 = { 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 #4 = { noreturn nounwind }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!12, !12, i64 0}


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