; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3PlanarGrid.ll (ZN12R3PlanarGrid5ResetERK7R3PlaneRK5R3Boxd)

; 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.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R2Box = type { %class.R2Solid, %class.R2Point, %class.R2Point }
%class.R2Solid = type { %class.R2Shape }
%class.R2Shape = type { ptr }
%class.R2Point = type { [2 x double] }
%class.R3Point = type { [3 x double] }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.R3PlanarGrid = type <{ %class.R3Plane, %class.R3Affine, %class.R2Grid, %class.R3Box, i32, [4 x i8] }>
%class.R3Plane = type { %class.R3Vector, double }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.RNFlags = type { i64 }
%class.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

@R3xyz_triad = external global %class.R3Triad, align 8
@R2null_box = external global %class.R2Box, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12R3PlanarGrid5ResetERK7R3PlaneRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(572) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(56) %2, double noundef %3) #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = alloca i32, align 4
  %11 = alloca %class.R3Vector, align 8
  %12 = alloca %class.R3Vector, align 8
  %13 = alloca %class.R3Vector, align 8
  %14 = alloca %class.R3Triad, align 8
  %15 = alloca %class.R3CoordSystem, align 8
  %16 = alloca %class.R4Matrix, align 8
  %17 = alloca %class.R2Box, align 8
  %18 = alloca i32, align 4
  %19 = alloca %class.R3Point, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca %class.R2Point, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, 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
  store double %3, ptr %8, align 8, !tbaa !9
  %25 = load ptr, ptr %5, align 8
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %class.R3PlanarGrid, ptr %25, i32 0, i32 0
  %28 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull align 8 dereferenceable(32) %26)
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.R3PlanarGrid, ptr %25, i32 0, i32 3
  %31 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %30, ptr noundef nonnull align 8 dereferenceable(56) %29)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds ptr, ptr %33, i64 13
  %35 = load ptr, ptr %34, align 8
  call void %35(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(56) %32)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(32) %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %37)
  %39 = call noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  store i32 %39, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %40)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %41)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %42 = load i32, ptr %10, align 4, !tbaa !13
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad, i32 noundef %42)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #6
  call void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72) %14, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.start.p0(i64 96, ptr %15) #6
  call void @_ZN13R3CoordSystemC1ERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96) %15, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(72) %14)
  %44 = getelementptr inbounds %class.R3PlanarGrid, ptr %25, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 128, ptr %16) #6
  call void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8 %16, ptr noundef nonnull align 8 dereferenceable(96) %15)
  call void @_ZN8R3Affine5ResetERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272) %44, ptr noundef nonnull align 8 dereferenceable(128) %16, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #6
  call void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %17, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %45

45:                                               ; preds = %63, %4
  %46 = load i32, ptr %18, align 4, !tbaa !13
  %47 = icmp slt i32 %46, 8
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %75

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i32, ptr %18, align 4, !tbaa !13
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %19, ptr noundef nonnull align 8 dereferenceable(56) %50, i32 noundef %51)
          to label %52 unwind label %66

52:                                               ; preds = %49
  %53 = getelementptr inbounds %class.R3PlanarGrid, ptr %25, i32 0, i32 1
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(8) %53)
          to label %54 unwind label %66

54:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %19, i32 noundef 0)
          to label %56 unwind label %70

56:                                               ; preds = %54
  %57 = load double, ptr %55, align 8, !tbaa !9
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %19, i32 noundef 1)
          to label %59 unwind label %70

59:                                               ; preds = %56
  %60 = load double, ptr %58, align 8, !tbaa !9
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %22, double noundef %57, double noundef %60)
          to label %61 unwind label %70

61:                                               ; preds = %59
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %17, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %62 unwind label %70

62:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %18, align 4, !tbaa !13
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %18, align 4, !tbaa !13
  br label %45, !llvm.loop !15

66:                                               ; preds = %52, %49
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %20, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %21, align 4
  br label %74

70:                                               ; preds = %61, %59, %56, %54
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %20, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  br label %74

74:                                               ; preds = %70, %66
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %111

75:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %76 = invoke noundef double @_ZNK5R2Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %77 unwind label %91

77:                                               ; preds = %75
  %78 = load double, ptr %8, align 8, !tbaa !9
  %79 = fdiv double %76, %78
  %80 = fadd double %79, 5.000000e-01
  %81 = fptosi double %80 to i32
  store i32 %81, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %82 = invoke noundef double @_ZNK5R2Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %83 unwind label %95

83:                                               ; preds = %77
  %84 = load double, ptr %8, align 8, !tbaa !9
  %85 = fdiv double %82, %84
  %86 = fadd double %85, 5.000000e-01
  %87 = fptosi double %86 to i32
  store i32 %87, ptr %24, align 4, !tbaa !13
  %88 = load i32, ptr %23, align 4, !tbaa !13
  %89 = icmp slt i32 %88, 2
  br i1 %89, label %90, label %99

90:                                               ; preds = %83
  store i32 2, ptr %23, align 4, !tbaa !13
  br label %99

91:                                               ; preds = %75
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %20, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %21, align 4
  br label %110

95:                                               ; preds = %107, %103, %77
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %20, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %110

99:                                               ; preds = %90, %83
  %100 = load i32, ptr %24, align 4, !tbaa !13
  %101 = icmp slt i32 %100, 2
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  store i32 2, ptr %24, align 4, !tbaa !13
  br label %103

103:                                              ; preds = %102, %99
  %104 = getelementptr inbounds %class.R3PlanarGrid, ptr %25, i32 0, i32 2
  %105 = load i32, ptr %23, align 4, !tbaa !13
  %106 = load i32, ptr %24, align 4, !tbaa !13
  invoke void @_ZN6R2Grid8ResampleEii(ptr noundef nonnull align 8 dereferenceable(208) %104, i32 noundef %105, i32 noundef %106)
          to label %107 unwind label %95

107:                                              ; preds = %103
  %108 = getelementptr inbounds %class.R3PlanarGrid, ptr %25, i32 0, i32 2
  invoke void @_ZN6R2Grid28SetWorldToGridTransformationERK5R2Box(ptr noundef nonnull align 8 dereferenceable(208) %108, ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %109 unwind label %95

109:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  ret void

110:                                              ; preds = %95, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %111

111:                                              ; preds = %110, %74
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %20, align 8
  %114 = load i32, ptr %21, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

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

declare void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

declare noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #1 align 2

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare void @_ZN13R3CoordSystemC1ERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3

declare void @_ZN8R3Affine5ResetERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #3

declare void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(96)) #3

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

declare void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3

declare void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3

declare void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3

declare void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1 align 2

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R2Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R2Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

declare void @_ZN6R2Grid8ResampleEii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) #3

declare void @_ZN6R2Grid28SetWorldToGridTransformationERK5R2Box(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(40)) #3

; Function Attrs: nounwind
declare void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 #5 = { 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 #6 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R2Box = type { %class.R2Solid, %class.R2Point, %class.R2Point }
%class.R2Solid = type { %class.R2Shape }
%class.R2Shape = type { ptr }
%class.R2Point = type { [2 x double] }
%class.R3Point = type { [3 x double] }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R4Matrix = type { [4 x [4 x double]] }

@R3xyz_triad = external global %class.R3Triad, align 8
@R2null_box = external global %class.R2Box, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12R3PlanarGrid5ResetERK7R3PlaneRK5R3Boxd(ptr noundef nonnull align 8 dereferenceable(572) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(56) %2, double noundef %3) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R3Vector, align 8
  %7 = alloca %class.R3Vector, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.R3Triad, align 8
  %10 = alloca %class.R3CoordSystem, align 8
  %11 = alloca %class.R4Matrix, align 8
  %12 = alloca %class.R2Box, align 8
  %13 = alloca %class.R3Point, align 8
  %14 = alloca %class.R2Point, align 8
  %15 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %16 = getelementptr inbounds i8, ptr %0, i64 512
  %17 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %16, ptr noundef nonnull align 8 dereferenceable(56) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 104
  %20 = load ptr, ptr %19, align 8
  call void %20(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(56) %2)
  call void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %22 = call noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad, i32 noundef %22)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %9) #7
  call void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72) %9, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %10) #7
  call void @_ZN13R3CoordSystemC1ERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96) %10, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(72) %9)
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %11) #7
  call void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %11, ptr noundef nonnull align 8 dereferenceable(96) %10)
  call void @_ZN8R3Affine5ResetERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272) %25, ptr noundef nonnull align 8 dereferenceable(128) %11, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #7
  call void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 0)
          to label %26 unwind label %107

26:                                               ; preds = %4
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %27 unwind label %107

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %29 unwind label %109

29:                                               ; preds = %27
  %30 = load double, ptr %28, align 8, !tbaa !8
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %32 unwind label %109

32:                                               ; preds = %29
  %33 = load double, ptr %31, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %30, double noundef %33)
          to label %34 unwind label %109

34:                                               ; preds = %32
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %35 unwind label %109

35:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 1)
          to label %36 unwind label %107

36:                                               ; preds = %35
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %37 unwind label %107

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %39 unwind label %109

39:                                               ; preds = %37
  %40 = load double, ptr %38, align 8, !tbaa !8
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %42 unwind label %109

42:                                               ; preds = %39
  %43 = load double, ptr %41, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %40, double noundef %43)
          to label %44 unwind label %109

44:                                               ; preds = %42
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %45 unwind label %109

45:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 2)
          to label %46 unwind label %107

46:                                               ; preds = %45
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %47 unwind label %107

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %49 unwind label %109

49:                                               ; preds = %47
  %50 = load double, ptr %48, align 8, !tbaa !8
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %52 unwind label %109

52:                                               ; preds = %49
  %53 = load double, ptr %51, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %50, double noundef %53)
          to label %54 unwind label %109

54:                                               ; preds = %52
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %55 unwind label %109

55:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 3)
          to label %56 unwind label %107

56:                                               ; preds = %55
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %57 unwind label %107

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %59 unwind label %109

59:                                               ; preds = %57
  %60 = load double, ptr %58, align 8, !tbaa !8
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %62 unwind label %109

62:                                               ; preds = %59
  %63 = load double, ptr %61, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %60, double noundef %63)
          to label %64 unwind label %109

64:                                               ; preds = %62
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %65 unwind label %109

65:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 4)
          to label %66 unwind label %107

66:                                               ; preds = %65
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %67 unwind label %107

67:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %69 unwind label %109

69:                                               ; preds = %67
  %70 = load double, ptr %68, align 8, !tbaa !8
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %72 unwind label %109

72:                                               ; preds = %69
  %73 = load double, ptr %71, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %70, double noundef %73)
          to label %74 unwind label %109

74:                                               ; preds = %72
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %75 unwind label %109

75:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 5)
          to label %76 unwind label %107

76:                                               ; preds = %75
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %77 unwind label %107

77:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %79 unwind label %109

79:                                               ; preds = %77
  %80 = load double, ptr %78, align 8, !tbaa !8
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %82 unwind label %109

82:                                               ; preds = %79
  %83 = load double, ptr %81, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %80, double noundef %83)
          to label %84 unwind label %109

84:                                               ; preds = %82
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %85 unwind label %109

85:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 6)
          to label %86 unwind label %107

86:                                               ; preds = %85
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %87 unwind label %107

87:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %89 unwind label %109

89:                                               ; preds = %87
  %90 = load double, ptr %88, align 8, !tbaa !8
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %92 unwind label %109

92:                                               ; preds = %89
  %93 = load double, ptr %91, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %90, double noundef %93)
          to label %94 unwind label %109

94:                                               ; preds = %92
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %95 unwind label %109

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef 7)
          to label %96 unwind label %107

96:                                               ; preds = %95
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %97 unwind label %107

97:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %99 unwind label %109

99:                                               ; preds = %97
  %100 = load double, ptr %98, align 8, !tbaa !8
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 1)
          to label %102 unwind label %109

102:                                              ; preds = %99
  %103 = load double, ptr %101, align 8, !tbaa !8
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef %100, double noundef %103)
          to label %104 unwind label %109

104:                                              ; preds = %102
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %105 unwind label %109

105:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  %106 = invoke noundef double @_ZNK5R2Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %112 unwind label %122

107:                                              ; preds = %96, %95, %86, %85, %76, %75, %66, %65, %56, %55, %46, %45, %36, %35, %26, %4
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %111

109:                                              ; preds = %104, %102, %99, %97, %94, %92, %89, %87, %84, %82, %79, %77, %74, %72, %69, %67, %64, %62, %59, %57, %54, %52, %49, %47, %44, %42, %39, %37, %34, %32, %29, %27
  %110 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  br label %111

111:                                              ; preds = %109, %107
  %.pn25 = phi { ptr, i32 } [ %110, %109 ], [ %108, %107 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  br label %128

112:                                              ; preds = %105
  %113 = invoke noundef double @_ZNK5R2Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %114 unwind label %124

114:                                              ; preds = %112
  %115 = fdiv double %106, %3
  %116 = fadd double %115, 5.000000e-01
  %117 = fptosi double %116 to i32
  %118 = fdiv double %113, %3
  %119 = fadd double %118, 5.000000e-01
  %120 = fptosi double %119 to i32
  %spec.store.select = call i32 @llvm.smax.i32(i32 %117, i32 2)
  %spec.store.select1 = call i32 @llvm.smax.i32(i32 %120, i32 2)
  %121 = getelementptr inbounds i8, ptr %0, i64 304
  invoke void @_ZN6R2Grid8ResampleEii(ptr noundef nonnull align 8 dereferenceable(208) %121, i32 noundef %spec.store.select, i32 noundef %spec.store.select1)
          to label %126 unwind label %124

122:                                              ; preds = %105
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %128

124:                                              ; preds = %126, %114, %112
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %128

126:                                              ; preds = %114
  invoke void @_ZN6R2Grid28SetWorldToGridTransformationERK5R2Box(ptr noundef nonnull align 8 dereferenceable(208) %121, ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %127 unwind label %124

127:                                              ; preds = %126
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  ret void

128:                                              ; preds = %122, %124, %111
  %.pn25.pn = phi { ptr, i32 } [ %.pn25, %111 ], [ %125, %124 ], [ %123, %122 ]
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn25.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

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

declare void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

declare noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare void @_ZN13R3CoordSystemC1ERK7R3PointRK7R3Triad(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3

declare void @_ZN8R3Affine5ResetERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #3

declare void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

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

declare void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3

declare void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3

declare void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R2Box7XLengthEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK5R2Box7YLengthEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

declare void @_ZN6R2Grid8ResampleEii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN6R2Grid28SetWorldToGridTransformationERK5R2Box(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass