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

; 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
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPj = external hidden unnamed_addr constant [71 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZNK7Riemann12HeightField315GetCellTriangleEiiPj(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #2 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 i32, 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
  %17 = load ptr, ptr %5, align 8
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp sle i32 0, %18
  br i1 %19, label %20, label %26

20:                                               ; preds = %4
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = sub nsw i32 %23, 1
  %25 = icmp slt i32 %21, %24
  br label %26

26:                                               ; preds = %20, %4
  %27 = phi i1 [ false, %4 ], [ %25, %20 ]
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  br label %31

29:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 444, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPj) #3
  unreachable

30:                                               ; No predecessors!
  br label %31

31:                                               ; preds = %30, %28
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = icmp sle i32 0, %32
  br i1 %33, label %34, label %40

34:                                               ; preds = %31
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !20
  %38 = sub nsw i32 %37, 1
  %39 = icmp slt i32 %35, %38
  br label %40

40:                                               ; preds = %34, %31
  %41 = phi i1 [ false, %31 ], [ %39, %34 ]
  br i1 %41, label %42, label %43

42:                                               ; preds = %40
  br label %45

43:                                               ; preds = %40
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 445, ptr noundef @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPj) #3
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  %46 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 9
  %47 = load ptr, ptr %46, align 8, !tbaa !21
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !11
  %52 = mul i32 %49, %51
  %53 = add i32 %48, %52
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %47, i64 %54
  %56 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %55, i32 0, i32 1
  %57 = load i8, ptr %56, align 2, !tbaa !22
  %58 = zext i8 %57 to i32
  %59 = and i32 %58, 128
  %60 = icmp ne i32 %59, 0
  %61 = zext i1 %60 to i8
  store i8 %61, ptr %9, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !11
  %65 = mul i32 %62, %64
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = add i32 %65, %66
  %68 = trunc i32 %67 to i16
  store i16 %68, ptr %10, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #4
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !11
  %72 = mul i32 %69, %71
  %73 = load i32, ptr %6, align 4, !tbaa !9
  %74 = add i32 %72, %73
  %75 = add i32 %74, 1
  %76 = trunc i32 %75 to i16
  store i16 %76, ptr %11, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  %79 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !11
  %81 = mul i32 %78, %80
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = add i32 %81, %82
  %84 = trunc i32 %83 to i16
  store i16 %84, ptr %12, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  %87 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !11
  %89 = mul i32 %86, %88
  %90 = load i32, ptr %6, align 4, !tbaa !9
  %91 = add i32 %89, %90
  %92 = add i32 %91, 1
  %93 = trunc i32 %92 to i16
  store i16 %93, ptr %13, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  %94 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 9
  %95 = load ptr, ptr %94, align 8, !tbaa !21
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !11
  %100 = mul i32 %97, %99
  %101 = add i32 %96, %100
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %95, i64 %102
  %104 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %103, i32 0, i32 1
  %105 = load i8, ptr %104, align 2, !tbaa !22
  store i8 %105, ptr %14, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  %106 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 9
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = load i32, ptr %6, align 4, !tbaa !9
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %17, i32 0, i32 0
  %111 = load i32, ptr %110, align 8, !tbaa !11
  %112 = mul i32 %109, %111
  %113 = add i32 %108, %112
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %107, i64 %114
  %116 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %115, i32 0, i32 2
  %117 = load i8, ptr %116, align 1, !tbaa !29
  store i8 %117, ptr %15, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  %118 = load i8, ptr %14, align 1, !tbaa !28
  %119 = zext i8 %118 to i32
  %120 = icmp ne i32 %119, 127
  br i1 %120, label %121, label %143

121:                                              ; preds = %45
  %122 = load i16, ptr %12, align 2, !tbaa !27
  %123 = zext i16 %122 to i32
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = getelementptr inbounds i32, ptr %124, i64 0
  store i32 %123, ptr %125, align 4, !tbaa !9
  %126 = load i16, ptr %10, align 2, !tbaa !27
  %127 = zext i16 %126 to i32
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds i32, ptr %128, i64 1
  store i32 %127, ptr %129, align 4, !tbaa !9
  %130 = load i8, ptr %9, align 1, !tbaa !25, !range !30, !noundef !31
  %131 = trunc i8 %130 to i1
  br i1 %131, label %132, label %134

132:                                              ; preds = %121
  %133 = load i16, ptr %13, align 2, !tbaa !27
  br label %136

134:                                              ; preds = %121
  %135 = load i16, ptr %11, align 2, !tbaa !27
  br label %136

136:                                              ; preds = %134, %132
  %137 = phi i16 [ %133, %132 ], [ %135, %134 ]
  %138 = zext i16 %137 to i32
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds i32, ptr %139, i64 2
  store i32 %138, ptr %140, align 4, !tbaa !9
  %141 = load i32, ptr %16, align 4, !tbaa !9
  %142 = add nsw i32 %141, 3
  store i32 %142, ptr %16, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %136, %45
  %144 = load i8, ptr %15, align 1, !tbaa !28
  %145 = zext i8 %144 to i32
  %146 = icmp ne i32 %145, 127
  br i1 %146, label %147, label %178

147:                                              ; preds = %143
  %148 = load i16, ptr %13, align 2, !tbaa !27
  %149 = zext i16 %148 to i32
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = load i32, ptr %16, align 4, !tbaa !9
  %152 = add nsw i32 %151, 0
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i32, ptr %150, i64 %153
  store i32 %149, ptr %154, align 4, !tbaa !9
  %155 = load i8, ptr %9, align 1, !tbaa !25, !range !30, !noundef !31
  %156 = trunc i8 %155 to i1
  br i1 %156, label %157, label %159

157:                                              ; preds = %147
  %158 = load i16, ptr %10, align 2, !tbaa !27
  br label %161

159:                                              ; preds = %147
  %160 = load i16, ptr %12, align 2, !tbaa !27
  br label %161

161:                                              ; preds = %159, %157
  %162 = phi i16 [ %158, %157 ], [ %160, %159 ]
  %163 = zext i16 %162 to i32
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = load i32, ptr %16, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i32, ptr %164, i64 %167
  store i32 %163, ptr %168, align 4, !tbaa !9
  %169 = load i16, ptr %11, align 2, !tbaa !27
  %170 = zext i16 %169 to i32
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = load i32, ptr %16, align 4, !tbaa !9
  %173 = add nsw i32 %172, 2
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %171, i64 %174
  store i32 %170, ptr %175, align 4, !tbaa !9
  %176 = load i32, ptr %16, align 4, !tbaa !9
  %177 = add nsw i32 %176, 3
  store i32 %177, ptr %16, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %161, %143
  %179 = load i32, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  ret i32 %179
}

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

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

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


; 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
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPj = external hidden unnamed_addr constant [71 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 7) i32 @_ZNK7Riemann12HeightField315GetCellTriangleEiiPj(ptr nocapture noundef nonnull readonly align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 align 2 {
  %5 = icmp sgt i32 %1, -1
  br i1 %5, label %6, label %.critedge

6:                                                ; preds = %4
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = add nsw i32 %7, -1
  %9 = icmp sgt i32 %8, %1
  br i1 %9, label %10, label %.critedge

.critedge:                                        ; preds = %4, %6
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 444, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPj) #2
  unreachable

10:                                               ; preds = %6
  %11 = icmp sgt i32 %2, -1
  br i1 %11, label %12, label %.critedge2

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !18
  %15 = add nsw i32 %14, -1
  %16 = icmp sgt i32 %15, %2
  br i1 %16, label %17, label %.critedge2

.critedge2:                                       ; preds = %10, %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 445, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK7Riemann12HeightField315GetCellTriangleEiiPj) #2
  unreachable

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %0, i64 80
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  %20 = mul i32 %7, %2
  %21 = add i32 %20, %1
  %22 = zext i32 %21 to i64
  %23 = getelementptr inbounds %"struct.Riemann::HeightField3::CellInfo", ptr %19, i64 %22
  %24 = getelementptr inbounds i8, ptr %23, i64 2
  %25 = load i8, ptr %24, align 2, !tbaa !20
  %.not = icmp sgt i8 %25, -1
  %26 = trunc i32 %21 to i16
  %27 = add i16 %26, 1
  %28 = add nuw nsw i32 %2, 1
  %29 = mul i32 %7, %28
  %30 = add i32 %29, %1
  %31 = trunc i32 %30 to i16
  %32 = add i16 %31, 1
  %33 = getelementptr inbounds i8, ptr %23, i64 3
  %34 = load i8, ptr %33, align 1, !tbaa !23
  %.not46 = icmp eq i8 %25, 127
  br i1 %.not46, label %42, label %35

35:                                               ; preds = %17
  %36 = and i32 %30, 65535
  store i32 %36, ptr %3, align 4, !tbaa !24
  %37 = and i32 %21, 65535
  %38 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %37, ptr %38, align 4, !tbaa !24
  %39 = select i1 %.not, i16 %27, i16 %32
  %40 = zext i16 %39 to i32
  %41 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %40, ptr %41, align 4, !tbaa !24
  br label %42

42:                                               ; preds = %35, %17
  %.0 = phi i32 [ 3, %35 ], [ 0, %17 ]
  %.not47 = icmp eq i8 %34, 127
  br i1 %.not47, label %52, label %43

43:                                               ; preds = %42
  %44 = zext i16 %32 to i32
  %45 = zext nneg i32 %.0 to i64
  %46 = getelementptr inbounds i32, ptr %3, i64 %45
  store i32 %44, ptr %46, align 4, !tbaa !24
  %.v = select i1 %.not, i32 %30, i32 %21
  %47 = and i32 %.v, 65535
  %48 = getelementptr inbounds i8, ptr %46, i64 4
  store i32 %47, ptr %48, align 4, !tbaa !24
  %49 = zext i16 %27 to i32
  %50 = getelementptr inbounds i8, ptr %46, i64 8
  store i32 %49, ptr %50, align 4, !tbaa !24
  %51 = add nuw nsw i32 %.0, 3
  br label %52

52:                                               ; preds = %43, %42
  %.1 = phi i32 [ %51, %43 ], [ %.0, %42 ]
  ret i32 %.1
}

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn 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 = !{!7, !7, i64 0}


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