; 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::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"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.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 }

; 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7Riemann12HeightField313IntersectAABBERKN5Maths8TVector3IfEES5_(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.Maths::TAABB3", align 4
  %9 = alloca %"class.Maths::TAABB3", align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #3
  call void @_ZN5Maths6TAABB3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(24) %8)
  %21 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #3
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %23)
  %24 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE15GetIntersectionERKS1_RS1_(ptr noundef nonnull align 4 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(24) %8)
  %25 = xor i1 %24, true
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  br i1 %25, label %26, label %27

26:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %128

27:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.Maths::TVector3", ptr %28, i32 0, i32 1
  %30 = load float, ptr %29, align 4, !tbaa !9
  store float %30, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.Maths::TVector3", ptr %31, i32 0, i32 1
  %33 = load float, ptr %32, align 4, !tbaa !9
  store float %33, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %34 = getelementptr inbounds %"class.Maths::TAABB3", ptr %8, i32 0, i32 0
  %35 = getelementptr inbounds %"class.Maths::TVector3", ptr %34, i32 0, i32 0
  %36 = load float, ptr %35, align 4, !tbaa !13
  %37 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 2
  %38 = getelementptr inbounds %"class.Maths::TAABB3", ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %"class.Maths::TVector3", ptr %38, i32 0, i32 0
  %40 = load float, ptr %39, align 8, !tbaa !15
  %41 = fsub float %36, %40
  %42 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 5
  %43 = load float, ptr %42, align 8, !tbaa !22
  %44 = fmul float %41, %43
  %45 = fptosi float %44 to i32
  store i32 %45, ptr %13, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %46 = getelementptr inbounds %"class.Maths::TAABB3", ptr %8, i32 0, i32 0
  %47 = getelementptr inbounds %"class.Maths::TVector3", ptr %46, i32 0, i32 2
  %48 = load float, ptr %47, align 4, !tbaa !24
  %49 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 2
  %50 = getelementptr inbounds %"class.Maths::TAABB3", ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %"class.Maths::TVector3", ptr %50, i32 0, i32 2
  %52 = load float, ptr %51, align 8, !tbaa !25
  %53 = fsub float %48, %52
  %54 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 6
  %55 = load float, ptr %54, align 4, !tbaa !26
  %56 = fmul float %53, %55
  %57 = fptosi float %56 to i32
  store i32 %57, ptr %14, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %58 = getelementptr inbounds %"class.Maths::TAABB3", ptr %8, i32 0, i32 1
  %59 = getelementptr inbounds %"class.Maths::TVector3", ptr %58, i32 0, i32 0
  %60 = load float, ptr %59, align 4, !tbaa !27
  %61 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 2
  %62 = getelementptr inbounds %"class.Maths::TAABB3", ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %"class.Maths::TVector3", ptr %62, i32 0, i32 0
  %64 = load float, ptr %63, align 8, !tbaa !15
  %65 = fsub float %60, %64
  %66 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 5
  %67 = load float, ptr %66, align 8, !tbaa !22
  %68 = fmul float %65, %67
  %69 = fptosi float %68 to i32
  store i32 %69, ptr %15, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %70 = getelementptr inbounds %"class.Maths::TAABB3", ptr %8, i32 0, i32 1
  %71 = getelementptr inbounds %"class.Maths::TVector3", ptr %70, i32 0, i32 2
  %72 = load float, ptr %71, align 4, !tbaa !28
  %73 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 2
  %74 = getelementptr inbounds %"class.Maths::TAABB3", ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds %"class.Maths::TVector3", ptr %74, i32 0, i32 2
  %76 = load float, ptr %75, align 8, !tbaa !25
  %77 = fsub float %72, %76
  %78 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 6
  %79 = load float, ptr %78, align 4, !tbaa !26
  %80 = fmul float %77, %79
  %81 = fptosi float %80 to i32
  store i32 %81, ptr %16, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %82 = load i32, ptr %13, align 4, !tbaa !23
  store i32 %82, ptr %17, align 4, !tbaa !23
  br label %83

83:                                               ; preds = %121, %27
  %84 = load i32, ptr %17, align 4, !tbaa !23
  %85 = load i32, ptr %15, align 4, !tbaa !23
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 2, ptr %10, align 4
  br label %124

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %89 = load i32, ptr %14, align 4, !tbaa !23
  store i32 %89, ptr %18, align 4, !tbaa !23
  br label %90

90:                                               ; preds = %115, %88
  %91 = load i32, ptr %18, align 4, !tbaa !23
  %92 = load i32, ptr %16, align 4, !tbaa !23
  %93 = icmp sle i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 5, ptr %10, align 4
  br label %118

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %96 = load i32, ptr %17, align 4, !tbaa !23
  %97 = getelementptr inbounds %"class.Riemann::HeightField3", ptr %20, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !29
  %99 = mul i32 %96, %98
  %100 = load i32, ptr %18, align 4, !tbaa !23
  %101 = add i32 %99, %100
  %102 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %20, i32 noundef %101)
  store float %102, ptr %19, align 4, !tbaa !12
  %103 = load float, ptr %11, align 4, !tbaa !12
  %104 = load float, ptr %19, align 4, !tbaa !12
  %105 = fcmp ole float %103, %104
  br i1 %105, label %106, label %111

106:                                              ; preds = %95
  %107 = load float, ptr %19, align 4, !tbaa !12
  %108 = load float, ptr %12, align 4, !tbaa !12
  %109 = fcmp ole float %107, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %112

111:                                              ; preds = %106, %95
  store i32 0, ptr %10, align 4
  br label %112

112:                                              ; preds = %111, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  %113 = load i32, ptr %10, align 4
  switch i32 %113, label %118 [
    i32 0, label %114
  ]

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %18, align 4, !tbaa !23
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %18, align 4, !tbaa !23
  br label %90, !llvm.loop !30

118:                                              ; preds = %112, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  %119 = load i32, ptr %10, align 4
  switch i32 %119, label %124 [
    i32 5, label %120
  ]

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %17, align 4, !tbaa !23
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %17, align 4, !tbaa !23
  br label %83, !llvm.loop !32

124:                                              ; preds = %118, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  %125 = load i32, ptr %10, align 4
  switch i32 %125, label %127 [
    i32 2, label %126
  ]

126:                                              ; preds = %124
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %127

127:                                              ; preds = %126, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %128

128:                                              ; preds = %127, %26
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  %129 = load i1, ptr %4, align 1
  ret i1 %129
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths6TAABB3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5Maths6TAABB3IfE15GetIntersectionERKS1_RS1_(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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, !11, i64 4}
!10 = !{!"_ZTSN5Maths8TVector3IfEE", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"float", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !11, i64 0}
!14 = !{!"_ZTSN5Maths6TAABB3IfEE", !10, i64 0, !10, i64 12}
!15 = !{!16, !11, i64 8}
!16 = !{!"_ZTSN7Riemann12HeightField3E", !17, i64 0, !17, i64 4, !14, i64 8, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !18, i64 56, !6, i64 80}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIN7Riemann12HeightField38CellInfoESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!16, !11, i64 40}
!23 = !{!17, !17, i64 0}
!24 = !{!14, !11, i64 8}
!25 = !{!16, !11, i64 16}
!26 = !{!16, !11, i64 44}
!27 = !{!14, !11, i64 12}
!28 = !{!14, !11, i64 20}
!29 = !{!16, !17, i64 4}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !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"

%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }

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

; 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 zeroext i1 @_ZNK7Riemann12HeightField313IntersectAABBERKN5Maths8TVector3IfEES5_(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"class.Maths::TAABB3", align 16
  %5 = alloca %"class.Maths::TAABB3", align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @_ZN5Maths6TAABB3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(24) %4)
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
  %7 = call noundef zeroext i1 @_ZNK5Maths6TAABB3IfE15GetIntersectionERKS1_RS1_(ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  br i1 %7, label %8, label %.critedge34

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %1, i64 4
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %2, i64 4
  %12 = load float, ptr %11, align 4, !tbaa !5
  %13 = load <4 x float>, ptr %4, align 16
  %14 = shufflevector <4 x float> %13, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %15 = load <4 x float>, ptr %6, align 8
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = load <4 x float>, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  %19 = load float, ptr %18, align 8, !tbaa !10
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load float, ptr %20, align 8, !tbaa !12
  %22 = fsub float %19, %21
  %23 = getelementptr inbounds i8, ptr %0, i64 44
  %24 = load float, ptr %23, align 4, !tbaa !20
  %25 = fmul float %22, %24
  %26 = fptosi float %25 to i32
  %27 = getelementptr inbounds i8, ptr %4, i64 12
  %28 = load float, ptr %27, align 4, !tbaa !21
  %29 = insertelement <2 x float> %14, float %28, i64 1
  %30 = shufflevector <4 x float> %15, <4 x float> poison, <2 x i32> zeroinitializer
  %31 = fsub <2 x float> %29, %30
  %32 = shufflevector <4 x float> %17, <4 x float> poison, <2 x i32> zeroinitializer
  %33 = fmul <2 x float> %31, %32
  %34 = fptosi <2 x float> %33 to <2 x i32>
  %35 = getelementptr inbounds i8, ptr %4, i64 20
  %36 = load float, ptr %35, align 4, !tbaa !22
  %37 = fsub float %36, %21
  %38 = fmul float %24, %37
  %39 = fptosi float %38 to i32
  %40 = extractelement <2 x i32> %34, i64 0
  %41 = extractelement <2 x i32> %34, i64 1
  %.not38 = icmp sgt i32 %40, %41
  br i1 %.not38, label %.critedge34, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %8
  %.not3036 = icmp sgt i32 %26, %39
  %42 = getelementptr inbounds i8, ptr %0, i64 4
  br i1 %.not3036, label %.critedge34, label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %..critedge32_crit_edge
  %.02539 = phi i32 [ %51, %..critedge32_crit_edge ], [ %40, %.preheader.lr.ph ]
  br label %.critedge

43:                                               ; preds = %.critedge
  %44 = add i32 %.02437, 1
  %exitcond.not = icmp eq i32 %.02437, %39
  br i1 %exitcond.not, label %..critedge32_crit_edge, label %.critedge, !llvm.loop !23

.critedge:                                        ; preds = %.preheader, %43
  %.02437 = phi i32 [ %26, %.preheader ], [ %44, %43 ]
  %45 = load i32, ptr %42, align 4, !tbaa !25
  %46 = mul i32 %45, %.02539
  %47 = add i32 %46, %.02437
  %48 = call noundef float @_ZNK7Riemann12HeightField39GetHeightEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %47)
  %49 = fcmp ugt float %10, %48
  %50 = fcmp ugt float %48, %12
  %or.cond = select i1 %49, i1 true, i1 %50
  br i1 %or.cond, label %43, label %.critedge34

..critedge32_crit_edge:                           ; preds = %43
  %51 = add i32 %.02539, 1
  %exitcond42.not = icmp eq i32 %.02539, %41
  br i1 %exitcond42.not, label %.critedge34, label %.preheader, !llvm.loop !26

.critedge34:                                      ; preds = %..critedge32_crit_edge, %.critedge, %.preheader.lr.ph, %8, %3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  ret i1 %7
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths6TAABB3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5Maths6TAABB3IfE15GetIntersectionERKS1_RS1_(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 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 #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 4}
!6 = !{!"_ZTSN5Maths8TVector3IfEE", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 8}
!11 = !{!"_ZTSN5Maths6TAABB3IfEE", !6, i64 0, !6, i64 12}
!12 = !{!13, !7, i64 16}
!13 = !{!"_ZTSN7Riemann12HeightField3E", !14, i64 0, !14, i64 4, !11, i64 8, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !15, i64 56, !19, i64 80}
!14 = !{!"int", !8, i64 0}
!15 = !{!"_ZTSSt6vectorIN7Riemann12HeightField38CellInfoESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN7Riemann12HeightField38CellInfoESaIS2_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!13, !7, i64 44}
!21 = !{!11, !7, i64 12}
!22 = !{!11, !7, i64 20}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!13, !14, i64 4}
!26 = distinct !{!26, !24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass