; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Graphics/R3Viewer.ll (ZNK8R3Viewer12ViewportBBoxERK7R3Shape)

; 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.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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Viewer = type { ptr, %class.R3Camera, %class.R2Viewport }
%class.R3Camera = type { %class.R3CoordSystem, double, double, double, double, double, ptr }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R2Viewport = type { i32, i32, i32, i32 }

@RN_EPSILON = external global double, align 8
@R2null_box = external global %class.R2Box, align 8
@RN_INFINITY = external global double, align 8

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport6HeightEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: nounwind
declare double @tan(double noundef) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport7XCenterEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport7YCenterEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK8R3Camera11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(144)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsPositiveOrZerodd(double noundef, double noundef) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8R3Viewer12ViewportBBoxERK7R3Shape(ptr dead_on_unwind noalias writable sret(%class.R2Box) align 8 %0, ptr noundef nonnull align 8 dereferenceable(168) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.R3Box, align 8
  %9 = alloca %class.R2Box, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %class.R4Matrix, align 8
  %13 = alloca i32, align 4
  %14 = alloca %class.R3Point, align 8
  %15 = alloca %class.R3Point, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca %class.R2Point, align 8
  %19 = alloca i32, align 4
  %20 = alloca %class.R2Box, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #6
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds ptr, ptr %23, i64 17
  %25 = load ptr, ptr %24, align 8
  call void %25(ptr dead_on_unwind writable sret(%class.R3Box) align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %22)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #6
  invoke void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
          to label %26 unwind label %36

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #6
  %27 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %28 unwind label %40

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 8 dereferenceable(96) ptr @_ZNK8R3Camera11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(144) %27)
          to label %30 unwind label %40

30:                                               ; preds = %28
  invoke void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8 %12, ptr noundef nonnull align 8 dereferenceable(96) %29)
          to label %31 unwind label %40

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %185, %31
  %33 = load i32, ptr %13, align 4, !tbaa !9
  %34 = icmp sle i32 %33, 7
  br i1 %34, label %44, label %35

35:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %189

36:                                               ; preds = %3
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %10, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %11, align 4
  br label %229

40:                                               ; preds = %192, %30, %28, %26
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %10, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %11, align 4
  br label %228

44:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  %45 = load i32, ptr %13, align 4, !tbaa !9
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %15, ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %45)
          to label %46 unwind label %68

46:                                               ; preds = %44
  invoke void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(128) %12, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %47 unwind label %68

47:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  %48 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %49 unwind label %72

49:                                               ; preds = %47
  %50 = load double, ptr @RN_EPSILON, align 8, !tbaa !13
  %51 = invoke noundef i32 @_Z18RNIsPositiveOrZerodd(double noundef %48, double noundef %50)
          to label %52 unwind label %72

52:                                               ; preds = %49
  %53 = icmp ne i32 %51, 0
  br i1 %53, label %54, label %119

54:                                               ; preds = %52
  %55 = invoke noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %56 unwind label %72

56:                                               ; preds = %54
  %57 = load double, ptr @RN_EPSILON, align 8, !tbaa !13
  %58 = invoke noundef i32 @_Z12RNIsNegativedd(double noundef %55, double noundef %57)
          to label %59 unwind label %72

59:                                               ; preds = %56
  %60 = icmp ne i32 %58, 0
  br i1 %60, label %61, label %76

61:                                               ; preds = %59
  %62 = load double, ptr @RN_INFINITY, align 8, !tbaa !13
  %63 = fneg double %62
  %64 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef 0)
          to label %65 unwind label %72

65:                                               ; preds = %61
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %64, i32 noundef 0)
          to label %67 unwind label %72

67:                                               ; preds = %65
  store double %63, ptr %66, align 8, !tbaa !13
  br label %90

68:                                               ; preds = %46, %44
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %10, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  br label %188

72:                                               ; preds = %114, %111, %106, %104, %101, %97, %92, %90, %86, %83, %78, %76, %65, %61, %56, %54, %49, %47
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %10, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %11, align 4
  br label %188

76:                                               ; preds = %59
  %77 = invoke noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %78 unwind label %72

78:                                               ; preds = %76
  %79 = load double, ptr @RN_EPSILON, align 8, !tbaa !13
  %80 = invoke noundef i32 @_Z12RNIsPositivedd(double noundef %77, double noundef %79)
          to label %81 unwind label %72

81:                                               ; preds = %78
  %82 = icmp ne i32 %80, 0
  br i1 %82, label %83, label %89

83:                                               ; preds = %81
  %84 = load double, ptr @RN_INFINITY, align 8, !tbaa !13
  %85 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef 1)
          to label %86 unwind label %72

86:                                               ; preds = %83
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %85, i32 noundef 0)
          to label %88 unwind label %72

88:                                               ; preds = %86
  store double %84, ptr %87, align 8, !tbaa !13
  br label %89

89:                                               ; preds = %88, %81
  br label %90

90:                                               ; preds = %89, %67
  %91 = invoke noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %92 unwind label %72

92:                                               ; preds = %90
  %93 = load double, ptr @RN_EPSILON, align 8, !tbaa !13
  %94 = invoke noundef i32 @_Z12RNIsNegativedd(double noundef %91, double noundef %93)
          to label %95 unwind label %72

95:                                               ; preds = %92
  %96 = icmp ne i32 %94, 0
  br i1 %96, label %97, label %104

97:                                               ; preds = %95
  %98 = load double, ptr @RN_INFINITY, align 8, !tbaa !13
  %99 = fneg double %98
  %100 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef 0)
          to label %101 unwind label %72

101:                                              ; preds = %97
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %100, i32 noundef 1)
          to label %103 unwind label %72

103:                                              ; preds = %101
  store double %99, ptr %102, align 8, !tbaa !13
  br label %118

104:                                              ; preds = %95
  %105 = invoke noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %106 unwind label %72

106:                                              ; preds = %104
  %107 = load double, ptr @RN_EPSILON, align 8, !tbaa !13
  %108 = invoke noundef i32 @_Z12RNIsPositivedd(double noundef %105, double noundef %107)
          to label %109 unwind label %72

109:                                              ; preds = %106
  %110 = icmp ne i32 %108, 0
  br i1 %110, label %111, label %117

111:                                              ; preds = %109
  %112 = load double, ptr @RN_INFINITY, align 8, !tbaa !13
  %113 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef 1)
          to label %114 unwind label %72

114:                                              ; preds = %111
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %113, i32 noundef 1)
          to label %116 unwind label %72

116:                                              ; preds = %114
  store double %112, ptr %115, align 8, !tbaa !13
  br label %117

117:                                              ; preds = %116, %109
  br label %118

118:                                              ; preds = %117, %103
  br label %184

119:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %120 = getelementptr inbounds %class.R3Viewer, ptr %21, i32 0, i32 2
  %121 = invoke noundef i32 @_ZNK10R2Viewport7XCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %120)
          to label %122 unwind label %170

122:                                              ; preds = %119
  %123 = sitofp i32 %121 to double
  %124 = getelementptr inbounds %class.R3Viewer, ptr %21, i32 0, i32 2
  %125 = invoke noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %124)
          to label %126 unwind label %170

126:                                              ; preds = %122
  %127 = sitofp i32 %125 to double
  %128 = fmul double 5.000000e-01, %127
  %129 = invoke noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %130 unwind label %170

130:                                              ; preds = %126
  %131 = fmul double %128, %129
  %132 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %133 unwind label %170

133:                                              ; preds = %130
  %134 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %135 unwind label %170

135:                                              ; preds = %133
  %136 = invoke noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %134)
          to label %137 unwind label %170

137:                                              ; preds = %135
  %138 = call double @tan(double noundef %136) #6
  %139 = fmul double %132, %138
  %140 = fneg double %139
  %141 = fdiv double %131, %140
  %142 = fadd double %123, %141
  store double %142, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %143 = getelementptr inbounds %class.R3Viewer, ptr %21, i32 0, i32 2
  %144 = invoke noundef i32 @_ZNK10R2Viewport7YCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %143)
          to label %145 unwind label %174

145:                                              ; preds = %137
  %146 = sitofp i32 %144 to double
  %147 = getelementptr inbounds %class.R3Viewer, ptr %21, i32 0, i32 2
  %148 = invoke noundef i32 @_ZNK10R2Viewport6HeightEv(ptr noundef nonnull align 4 dereferenceable(16) %147)
          to label %149 unwind label %174

149:                                              ; preds = %145
  %150 = sitofp i32 %148 to double
  %151 = fmul double 5.000000e-01, %150
  %152 = invoke noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %153 unwind label %174

153:                                              ; preds = %149
  %154 = fmul double %151, %152
  %155 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %156 unwind label %174

156:                                              ; preds = %153
  %157 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %158 unwind label %174

158:                                              ; preds = %156
  %159 = invoke noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %157)
          to label %160 unwind label %174

160:                                              ; preds = %158
  %161 = call double @tan(double noundef %159) #6
  %162 = fmul double %155, %161
  %163 = fneg double %162
  %164 = fdiv double %154, %163
  %165 = fadd double %146, %164
  store double %165, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %166 = load double, ptr %16, align 8, !tbaa !13
  %167 = load double, ptr %17, align 8, !tbaa !13
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %18, double noundef %166, double noundef %167)
          to label %168 unwind label %178

168:                                              ; preds = %160
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %169 unwind label %178

169:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %184

170:                                              ; preds = %135, %133, %130, %126, %122, %119
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %10, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %11, align 4
  br label %183

174:                                              ; preds = %158, %156, %153, %149, %145, %137
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %10, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %11, align 4
  br label %182

178:                                              ; preds = %168, %160
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %10, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %182

182:                                              ; preds = %178, %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %183

183:                                              ; preds = %182, %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %188

184:                                              ; preds = %169, %118
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %13, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %13, align 4, !tbaa !9
  br label %32, !llvm.loop !15

188:                                              ; preds = %183, %72, %68
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %228

189:                                              ; preds = %35
  %190 = load i32, ptr %7, align 4, !tbaa !9
  %191 = icmp ne i32 %190, 0
  br i1 %191, label %194, label %192

192:                                              ; preds = %189
  invoke void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
          to label %193 unwind label %40

193:                                              ; preds = %192
  store i32 1, ptr %19, align 4
  br label %227

194:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #6
  %195 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %196 unwind label %218

196:                                              ; preds = %194
  %197 = invoke noundef i32 @_ZNK10R2Viewport4XMinEv(ptr noundef nonnull align 4 dereferenceable(16) %195)
          to label %198 unwind label %218

198:                                              ; preds = %196
  %199 = sitofp i32 %197 to double
  %200 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %201 unwind label %218

201:                                              ; preds = %198
  %202 = invoke noundef i32 @_ZNK10R2Viewport4YMinEv(ptr noundef nonnull align 4 dereferenceable(16) %200)
          to label %203 unwind label %218

203:                                              ; preds = %201
  %204 = sitofp i32 %202 to double
  %205 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %206 unwind label %218

206:                                              ; preds = %203
  %207 = invoke noundef i32 @_ZNK10R2Viewport4XMaxEv(ptr noundef nonnull align 4 dereferenceable(16) %205)
          to label %208 unwind label %218

208:                                              ; preds = %206
  %209 = sitofp i32 %207 to double
  %210 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %211 unwind label %218

211:                                              ; preds = %208
  %212 = invoke noundef i32 @_ZNK10R2Viewport4YMaxEv(ptr noundef nonnull align 4 dereferenceable(16) %210)
          to label %213 unwind label %218

213:                                              ; preds = %211
  %214 = sitofp i32 %212 to double
  invoke void @_ZN5R2BoxC1Edddd(ptr noundef nonnull align 8 dereferenceable(40) %20, double noundef %199, double noundef %204, double noundef %209, double noundef %214)
          to label %215 unwind label %218

215:                                              ; preds = %213
  invoke void @_ZN5R2Box9IntersectERKS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(40) %20)
          to label %216 unwind label %222

216:                                              ; preds = %215
  invoke void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %217 unwind label %222

217:                                              ; preds = %216
  store i32 1, ptr %19, align 4
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #6
  br label %227

218:                                              ; preds = %213, %211, %208, %206, %203, %201, %198, %196, %194
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %10, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %11, align 4
  br label %226

222:                                              ; preds = %216, %215
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %10, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %11, align 4
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #6
  br label %226

226:                                              ; preds = %222, %218
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #6
  br label %228

227:                                              ; preds = %217, %193
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #6
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void

228:                                              ; preds = %226, %188, %40
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #6
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  br label %229

229:                                              ; preds = %228, %36
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr %10, align 8
  %232 = load i32, ptr %11, align 4
  %233 = insertvalue { ptr, i32 } poison, ptr %231, 0
  %234 = insertvalue { ptr, i32 } %233, i32 %232, 1
  resume { ptr, i32 } %234
}

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsNegativedd(double noundef, double noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsPositivedd(double noundef, double noundef) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4XMinEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4YMinEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4XMaxEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4YMaxEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !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.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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

@RN_EPSILON = external local_unnamed_addr global double, align 8
@R2null_box = external global %class.R2Box, align 8
@RN_INFINITY = external local_unnamed_addr global double, align 8

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport6HeightEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @tan(double noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport7XCenterEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport7YCenterEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK8R3Camera11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #1 align 2

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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsPositiveOrZerodd(double noundef, double noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) 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: mustprogress uwtable
define dso_local void @_ZNK8R3Viewer12ViewportBBoxERK7R3Shape(ptr dead_on_unwind noalias writable sret(%class.R2Box) align 8 %0, ptr noundef nonnull align 8 dereferenceable(168) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.R3Box, align 8
  %5 = alloca %class.R2Box, align 8
  %6 = alloca %class.R4Matrix, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.R2Point, align 8
  %10 = alloca %class.R2Box, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #7
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 136
  %13 = load ptr, ptr %12, align 8
  call void %13(ptr dead_on_unwind nonnull writable sret(%class.R3Box) align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  invoke void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
          to label %14 unwind label %19

14:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #7
  %15 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %16 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK8R3Camera11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(144) %15)
  invoke void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %6, ptr noundef nonnull align 8 dereferenceable(96) %16)
          to label %.preheader unwind label %21

.preheader:                                       ; preds = %14
  %17 = getelementptr inbounds i8, ptr %1, i64 152
  br label %.outer

.outer:                                           ; preds = %.thread, %.preheader
  %.not = phi i1 [ false, %.thread ], [ true, %.preheader ]
  %.01129.ph = phi i32 [ %107, %.thread ], [ 0, %.preheader ]
  br label %23

18:                                               ; preds = %105
  br i1 %.not, label %109, label %.thread34

19:                                               ; preds = %3
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %132

21:                                               ; preds = %109, %14
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %131

23:                                               ; preds = %.outer, %105
  %.01129 = phi i32 [ %106, %105 ], [ %.01129.ph, %.outer ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  invoke void @_ZNK5R3Box6CornerEi(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %.01129)
          to label %24 unwind label %39

24:                                               ; preds = %23
  invoke void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(128) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %25 unwind label %39

25:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  %26 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %27 = load double, ptr @RN_EPSILON, align 8, !tbaa !8
  %28 = call noundef i32 @_Z18RNIsPositiveOrZerodd(double noundef %26, double noundef %27)
  %.not17 = icmp eq i32 %28, 0
  br i1 %.not17, label %71, label %29

29:                                               ; preds = %25
  %30 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %31 = load double, ptr @RN_EPSILON, align 8, !tbaa !8
  %32 = call noundef i32 @_Z12RNIsNegativedd(double noundef %30, double noundef %31)
  %.not18 = icmp eq i32 %32, 0
  br i1 %.not18, label %43, label %33

33:                                               ; preds = %29
  %34 = load double, ptr @RN_INFINITY, align 8, !tbaa !8
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 0)
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %35, i32 noundef 0)
          to label %37 unwind label %41

37:                                               ; preds = %33
  %38 = fneg double %34
  store double %38, ptr %36, align 8, !tbaa !8
  br label %52

39:                                               ; preds = %24, %23
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  br label %108

41:                                               ; preds = %66, %56, %47, %33
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %108

43:                                               ; preds = %29
  %44 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %45 = load double, ptr @RN_EPSILON, align 8, !tbaa !8
  %46 = call noundef i32 @_Z12RNIsPositivedd(double noundef %44, double noundef %45)
  %.not19 = icmp eq i32 %46, 0
  br i1 %.not19, label %52, label %47

47:                                               ; preds = %43
  %48 = load double, ptr @RN_INFINITY, align 8, !tbaa !8
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 1)
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %49, i32 noundef 0)
          to label %51 unwind label %41

51:                                               ; preds = %47
  store double %48, ptr %50, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %43, %51, %37
  %53 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %54 = load double, ptr @RN_EPSILON, align 8, !tbaa !8
  %55 = call noundef i32 @_Z12RNIsNegativedd(double noundef %53, double noundef %54)
  %.not20 = icmp eq i32 %55, 0
  br i1 %.not20, label %62, label %56

56:                                               ; preds = %52
  %57 = load double, ptr @RN_INFINITY, align 8, !tbaa !8
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 0)
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %58, i32 noundef 1)
          to label %60 unwind label %41

60:                                               ; preds = %56
  %61 = fneg double %57
  store double %61, ptr %59, align 8, !tbaa !8
  br label %105

62:                                               ; preds = %52
  %63 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %64 = load double, ptr @RN_EPSILON, align 8, !tbaa !8
  %65 = call noundef i32 @_Z12RNIsPositivedd(double noundef %63, double noundef %64)
  %.not21 = icmp eq i32 %65, 0
  br i1 %.not21, label %105, label %66

66:                                               ; preds = %62
  %67 = load double, ptr @RN_INFINITY, align 8, !tbaa !8
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN5R2BoxixEi(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 1)
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %68, i32 noundef 1)
          to label %70 unwind label %41

70:                                               ; preds = %66
  store double %67, ptr %69, align 8, !tbaa !8
  br label %105

71:                                               ; preds = %25
  %72 = call noundef i32 @_ZNK10R2Viewport7XCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %73 = sitofp i32 %72 to double
  %74 = call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %75 = sitofp i32 %74 to double
  %76 = fmul double %75, 5.000000e-01
  %77 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %78 = fmul double %77, %76
  %79 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %80 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %81 = call noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %80)
  %82 = call double @tan(double noundef %81) #7
  %83 = fneg double %79
  %84 = fmul double %82, %83
  %85 = fdiv double %78, %84
  %86 = fadd double %85, %73
  %87 = call noundef i32 @_ZNK10R2Viewport7YCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %88 = sitofp i32 %87 to double
  %89 = call noundef i32 @_ZNK10R2Viewport6HeightEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %90 = sitofp i32 %89 to double
  %91 = fmul double %90, 5.000000e-01
  %92 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %93 = fmul double %92, %91
  %94 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %95 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %96 = call noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %95)
  %97 = call double @tan(double noundef %96) #7
  %98 = fneg double %94
  %99 = fmul double %97, %98
  %100 = fdiv double %93, %99
  %101 = fadd double %100, %88
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %9, double noundef %86, double noundef %101)
          to label %102 unwind label %103

102:                                              ; preds = %71
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %.thread unwind label %103

103:                                              ; preds = %102, %71
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  br label %108

105:                                              ; preds = %60, %70, %62
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  %106 = add nuw nsw i32 %.01129, 1
  %exitcond.not = icmp eq i32 %106, 8
  br i1 %exitcond.not, label %18, label %23, !llvm.loop !11

.thread:                                          ; preds = %102
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  %107 = add nuw nsw i32 %.01129, 1
  %exitcond.not32 = icmp eq i32 %107, 8
  br i1 %exitcond.not32, label %.thread34, label %.outer, !llvm.loop !11

108:                                              ; preds = %103, %41, %39
  %.pn22 = phi { ptr, i32 } [ %42, %41 ], [ %104, %103 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %131

109:                                              ; preds = %18
  invoke void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
          to label %130 unwind label %21

.thread34:                                        ; preds = %.thread, %18
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #7
  %110 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %111 = call noundef i32 @_ZNK10R2Viewport4XMinEv(ptr noundef nonnull align 4 dereferenceable(16) %110)
  %112 = sitofp i32 %111 to double
  %113 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %114 = call noundef i32 @_ZNK10R2Viewport4YMinEv(ptr noundef nonnull align 4 dereferenceable(16) %113)
  %115 = sitofp i32 %114 to double
  %116 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %117 = call noundef i32 @_ZNK10R2Viewport4XMaxEv(ptr noundef nonnull align 4 dereferenceable(16) %116)
  %118 = sitofp i32 %117 to double
  %119 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %120 = call noundef i32 @_ZNK10R2Viewport4YMaxEv(ptr noundef nonnull align 4 dereferenceable(16) %119)
  %121 = sitofp i32 %120 to double
  invoke void @_ZN5R2BoxC1Edddd(ptr noundef nonnull align 8 dereferenceable(40) %10, double noundef %112, double noundef %115, double noundef %118, double noundef %121)
          to label %122 unwind label %125

122:                                              ; preds = %.thread34
  invoke void @_ZN5R2Box9IntersectERKS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull align 8 dereferenceable(40) %10)
          to label %123 unwind label %127

123:                                              ; preds = %122
  invoke void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %124 unwind label %127

124:                                              ; preds = %123
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #7
  br label %130

125:                                              ; preds = %.thread34
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %129

127:                                              ; preds = %123, %122
  %128 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #7
  br label %129

129:                                              ; preds = %127, %125
  %.pn = phi { ptr, i32 } [ %128, %127 ], [ %126, %125 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #7
  br label %131

130:                                              ; preds = %109, %124
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #7
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  ret void

131:                                              ; preds = %129, %108, %21
  %.pn22.pn = phi { ptr, i32 } [ %.pn22, %108 ], [ %.pn, %129 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #7
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #7
  br label %132

132:                                              ; preds = %131, %19
  %.pn22.pn.pn = phi { ptr, i32 } [ %.pn22.pn, %131 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn22.pn.pn
}

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsNegativedd(double noundef, double noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsPositivedd(double noundef, double noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNK8R3Viewer8ViewportEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4XMinEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4YMinEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4XMaxEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport4YMaxEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass