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

; 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.R2Circle = type { %class.R2Solid, %class.R2Point, double }
%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.R3Sphere = type { %class.R3Solid, %class.R3Point, double }
%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
@R2infinite_circle = external global %class.R2Circle, 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8R3Viewer15ViewportBCircleERK7R3Shape(ptr dead_on_unwind noalias writable sret(%class.R2Circle) 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 %class.R3Sphere, align 8
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.R4Matrix, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca %class.R2Point, align 8
  %16 = alloca double, align 8
  %17 = alloca double, 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
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 18
  %22 = load ptr, ptr %21, align 8
  call void %22(ptr dead_on_unwind writable sret(%class.R3Sphere) align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #5
  %23 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %24 unwind label %39

24:                                               ; preds = %3
  %25 = invoke noundef nonnull align 8 dereferenceable(96) ptr @_ZNK8R3Camera11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(144) %23)
          to label %26 unwind label %39

26:                                               ; preds = %24
  invoke void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8 %9, ptr noundef nonnull align 8 dereferenceable(96) %25)
          to label %27 unwind label %39

27:                                               ; preds = %26
  %28 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Sphere6CenterEv(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %29 unwind label %39

29:                                               ; preds = %27
  invoke void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(128) %9, ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %30 unwind label %39

30:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #5
  %31 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %32 unwind label %43

32:                                               ; preds = %30
  %33 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %34 = invoke noundef i32 @_Z18RNIsPositiveOrZerodd(double noundef %31, double noundef %33)
          to label %35 unwind label %43

35:                                               ; preds = %32
  %36 = icmp ne i32 %34, 0
  br i1 %36, label %37, label %47

37:                                               ; preds = %35
  invoke void @_ZN8R2CircleC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R2infinite_circle)
          to label %38 unwind label %43

38:                                               ; preds = %37
  store i32 1, ptr %12, align 4
  br label %158

39:                                               ; preds = %29, %27, %26, %24, %3
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %10, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #5
  br label %159

43:                                               ; preds = %37, %32, %30
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %10, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %11, align 4
  br label %159

47:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %48 = getelementptr inbounds %class.R3Viewer, ptr %18, i32 0, i32 2
  %49 = invoke noundef i32 @_ZNK10R2Viewport7XCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %48)
          to label %50 unwind label %134

50:                                               ; preds = %47
  %51 = sitofp i32 %49 to double
  %52 = getelementptr inbounds %class.R3Viewer, ptr %18, i32 0, i32 2
  %53 = invoke noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %52)
          to label %54 unwind label %134

54:                                               ; preds = %50
  %55 = sitofp i32 %53 to double
  %56 = fmul double 5.000000e-01, %55
  %57 = invoke noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %58 unwind label %134

58:                                               ; preds = %54
  %59 = fmul double %56, %57
  %60 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %61 unwind label %134

61:                                               ; preds = %58
  %62 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %63 unwind label %134

63:                                               ; preds = %61
  %64 = invoke noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %62)
          to label %65 unwind label %134

65:                                               ; preds = %63
  %66 = call double @tan(double noundef %64) #5
  %67 = fmul double %60, %66
  %68 = fneg double %67
  %69 = fdiv double %59, %68
  %70 = fadd double %51, %69
  store double %70, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %71 = getelementptr inbounds %class.R3Viewer, ptr %18, i32 0, i32 2
  %72 = invoke noundef i32 @_ZNK10R2Viewport7YCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %71)
          to label %73 unwind label %138

73:                                               ; preds = %65
  %74 = sitofp i32 %72 to double
  %75 = getelementptr inbounds %class.R3Viewer, ptr %18, i32 0, i32 2
  %76 = invoke noundef i32 @_ZNK10R2Viewport6HeightEv(ptr noundef nonnull align 4 dereferenceable(16) %75)
          to label %77 unwind label %138

77:                                               ; preds = %73
  %78 = sitofp i32 %76 to double
  %79 = fmul double 5.000000e-01, %78
  %80 = invoke noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %81 unwind label %138

81:                                               ; preds = %77
  %82 = fmul double %79, %80
  %83 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %84 unwind label %138

84:                                               ; preds = %81
  %85 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %86 unwind label %138

86:                                               ; preds = %84
  %87 = invoke noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %85)
          to label %88 unwind label %138

88:                                               ; preds = %86
  %89 = call double @tan(double noundef %87) #5
  %90 = fmul double %83, %89
  %91 = fneg double %90
  %92 = fdiv double %82, %91
  %93 = fadd double %74, %92
  store double %93, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %94 = load double, ptr %13, align 8, !tbaa !11
  %95 = load double, ptr %14, align 8, !tbaa !11
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %15, double noundef %94, double noundef %95)
          to label %96 unwind label %142

96:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %97 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %98 unwind label %146

98:                                               ; preds = %96
  %99 = invoke noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %97)
          to label %100 unwind label %146

100:                                              ; preds = %98
  %101 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %102 unwind label %146

102:                                              ; preds = %100
  %103 = invoke noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %101)
          to label %104 unwind label %146

104:                                              ; preds = %102
  %105 = fcmp ogt double %99, %103
  br i1 %105, label %106, label %111

106:                                              ; preds = %104
  %107 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %108 unwind label %146

108:                                              ; preds = %106
  %109 = invoke noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %107)
          to label %110 unwind label %146

110:                                              ; preds = %108
  br label %116

111:                                              ; preds = %104
  %112 = invoke noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %18)
          to label %113 unwind label %146

113:                                              ; preds = %111
  %114 = invoke noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %112)
          to label %115 unwind label %146

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115, %110
  %117 = phi double [ %109, %110 ], [ %114, %115 ]
  store double %117, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %118 = getelementptr inbounds %class.R3Viewer, ptr %18, i32 0, i32 2
  %119 = invoke noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %118)
          to label %120 unwind label %150

120:                                              ; preds = %116
  %121 = sitofp i32 %119 to double
  %122 = fmul double 5.000000e-01, %121
  %123 = invoke noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %124 unwind label %150

124:                                              ; preds = %120
  %125 = fmul double %122, %123
  %126 = invoke noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %127 unwind label %150

127:                                              ; preds = %124
  %128 = load double, ptr %16, align 8, !tbaa !11
  %129 = fmul double %126, %128
  %130 = fneg double %129
  %131 = fdiv double %125, %130
  store double %131, ptr %17, align 8, !tbaa !11
  %132 = load double, ptr %17, align 8, !tbaa !11
  invoke void @_ZN8R2CircleC1ERK7R2Pointd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %15, double noundef %132)
          to label %133 unwind label %150

133:                                              ; preds = %127
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %158

134:                                              ; preds = %63, %61, %58, %54, %50, %47
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %10, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %11, align 4
  br label %157

138:                                              ; preds = %86, %84, %81, %77, %73, %65
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %10, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %11, align 4
  br label %156

142:                                              ; preds = %88
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %10, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %11, align 4
  br label %155

146:                                              ; preds = %113, %111, %108, %106, %102, %100, %98, %96
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %10, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %11, align 4
  br label %154

150:                                              ; preds = %127, %124, %120, %116
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %10, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %154

154:                                              ; preds = %150, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %155

155:                                              ; preds = %154, %142
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %156

156:                                              ; preds = %155, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %157

157:                                              ; preds = %156, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %159

158:                                              ; preds = %133, %38
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #5
  ret void

159:                                              ; preds = %157, %43, %39
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #5
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %10, align 8
  %162 = load i32, ptr %11, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

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

declare void @_ZN8R2CircleC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

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

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

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


; 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.R2Circle = type { %class.R2Solid, %class.R2Point, double }
%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.R3Sphere = type { %class.R3Solid, %class.R3Point, double }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

@RN_EPSILON = external local_unnamed_addr global double, align 8
@R2infinite_circle = external global %class.R2Circle, 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8R3Viewer15ViewportBCircleERK7R3Shape(ptr dead_on_unwind noalias writable sret(%class.R2Circle) 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.R3Sphere, align 8
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R4Matrix, align 8
  %7 = alloca %class.R2Point, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 144
  %10 = load ptr, ptr %9, align 8
  call void %10(ptr dead_on_unwind nonnull writable sret(%class.R3Sphere) align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #6
  %11 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %12 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK8R3Camera11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(144) %11)
  invoke void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %6, ptr noundef nonnull align 8 dereferenceable(96) %12)
          to label %13 unwind label %20

13:                                               ; preds = %3
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Sphere6CenterEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  invoke void @_ZmlRK8R4MatrixRK7R3Point(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(128) %6, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %15 unwind label %20

15:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #6
  %16 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %17 = load double, ptr @RN_EPSILON, align 8, !tbaa !8
  %18 = call noundef i32 @_Z18RNIsPositiveOrZerodd(double noundef %16, double noundef %17)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %24, label %19

19:                                               ; preds = %15
  invoke void @_ZN8R2CircleC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R2infinite_circle)
          to label %84 unwind label %22

20:                                               ; preds = %13, %3
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #6
  br label %85

22:                                               ; preds = %19
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %85

24:                                               ; preds = %15
  %25 = getelementptr inbounds i8, ptr %1, i64 152
  %26 = call noundef i32 @_ZNK10R2Viewport7XCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %25)
  %27 = sitofp i32 %26 to double
  %28 = call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %25)
  %29 = sitofp i32 %28 to double
  %30 = fmul double %29, 5.000000e-01
  %31 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %32 = fmul double %31, %30
  %33 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %34 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %35 = call noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %34)
  %36 = call double @tan(double noundef %35) #6
  %37 = fneg double %33
  %38 = fmul double %36, %37
  %39 = fdiv double %32, %38
  %40 = fadd double %39, %27
  %41 = call noundef i32 @_ZNK10R2Viewport7YCenterEv(ptr noundef nonnull align 4 dereferenceable(16) %25)
  %42 = sitofp i32 %41 to double
  %43 = call noundef i32 @_ZNK10R2Viewport6HeightEv(ptr noundef nonnull align 4 dereferenceable(16) %25)
  %44 = sitofp i32 %43 to double
  %45 = fmul double %44, 5.000000e-01
  %46 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %47 = fmul double %46, %45
  %48 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %49 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %50 = call noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %49)
  %51 = call double @tan(double noundef %50) #6
  %52 = fneg double %48
  %53 = fmul double %51, %52
  %54 = fdiv double %47, %53
  %55 = fadd double %54, %42
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %40, double noundef %55)
          to label %56 unwind label %79

56:                                               ; preds = %24
  %57 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %58 = call noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %57)
  %59 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  %60 = call noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %59)
  %61 = fcmp ogt double %58, %60
  %62 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNK8R3Viewer6CameraEv(ptr noundef nonnull align 8 dereferenceable(168) %1)
  br i1 %61, label %63, label %65

63:                                               ; preds = %56
  %64 = call noundef double @_ZNK8R3Camera4XFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %62)
  br label %67

65:                                               ; preds = %56
  %66 = call noundef double @_ZNK8R3Camera4YFOVEv(ptr noundef nonnull align 8 dereferenceable(144) %62)
  br label %67

67:                                               ; preds = %65, %63
  %68 = phi double [ %64, %63 ], [ %66, %65 ]
  %69 = call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %25)
  %70 = sitofp i32 %69 to double
  %71 = fmul double %70, 5.000000e-01
  %72 = call noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  %73 = fmul double %72, %71
  %74 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %75 = fneg double %74
  %76 = fmul double %68, %75
  %77 = fdiv double %73, %76
  invoke void @_ZN8R2CircleC1ERK7R2Pointd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %77)
          to label %78 unwind label %81

78:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %84

79:                                               ; preds = %24
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %67
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %83

83:                                               ; preds = %81, %79
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %85

84:                                               ; preds = %19, %78
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  ret void

85:                                               ; preds = %83, %22, %20
  %.pn10 = phi { ptr, i32 } [ %23, %22 ], [ %.pn, %83 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn10
}

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

declare void @_ZN8R2CircleC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

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

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

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

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 = { 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 = !{!"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,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass