; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Arc.ll (ZNK5R2Arc4BBoxEv)

; 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.R2Arc = type { %class.R2Curve, %class.R2Circle, double, double }
%class.R2Curve = type { %class.R2Shape }
%class.R2Circle = type { %class.R2Solid, %class.R2Point, double }

@R2null_box = external global %class.R2Box, align 8
@R2posx_point = external global %class.R2Point, align 8
@RN_PI_OVER_TWO = external constant double, align 8
@R2posy_point = external global %class.R2Point, align 8
@RN_PI = external constant double, align 8
@R2negx_point = external global %class.R2Point, align 8
@RN_THREE_PI_OVER_TWO = external constant double, align 8
@R2negy_point = external global %class.R2Point, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK5R2Arc4BBoxEv(ptr dead_on_unwind noalias writable sret(%class.R2Box) align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca %class.R2Point, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.R2Point, align 8
  %10 = alloca %class.R2Point, align 8
  %11 = alloca %class.R2Point, align 8
  %12 = alloca %class.R2Point, align 8
  %13 = alloca %class.R2Point, align 8
  %14 = alloca %class.R2Point, align 8
  %15 = alloca %class.R2Point, align 8
  %16 = alloca %class.R2Point, align 8
  %17 = alloca %class.R2Point, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  invoke void @_ZNK5R2Arc10StartPointEv(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %19 unwind label %38

19:                                               ; preds = %2
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %20 unwind label %38

20:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  invoke void @_ZNK5R2Arc9StopPointEv(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %21 unwind label %42

21:                                               ; preds = %20
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %22 unwind label %42

22:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  %23 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 2
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = fcmp olt double %24, 0.000000e+00
  br i1 %25, label %26, label %55

26:                                               ; preds = %22
  %27 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 3
  %28 = load double, ptr %27, align 8, !tbaa !17
  %29 = fcmp ogt double %28, 0.000000e+00
  br i1 %29, label %30, label %55

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %31 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %32 unwind label %46

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %33 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %34 unwind label %50

34:                                               ; preds = %32
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) @R2posx_point, double noundef %33)
          to label %35 unwind label %50

35:                                               ; preds = %34
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %36 unwind label %50

36:                                               ; preds = %35
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %37 unwind label %50

37:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %55

38:                                               ; preds = %19, %2
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %7, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  br label %140

42:                                               ; preds = %21, %20
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %7, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %140

46:                                               ; preds = %30
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %7, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %8, align 4
  br label %54

50:                                               ; preds = %36, %35, %34, %32
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %7, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %140

55:                                               ; preds = %37, %26, %22
  %56 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 2
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = load double, ptr @RN_PI_OVER_TWO, align 8, !tbaa !18
  %59 = fcmp olt double %57, %58
  br i1 %59, label %60, label %82

60:                                               ; preds = %55
  %61 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 3
  %62 = load double, ptr %61, align 8, !tbaa !17
  %63 = load double, ptr @RN_PI_OVER_TWO, align 8, !tbaa !18
  %64 = fcmp ogt double %62, %63
  br i1 %64, label %65, label %82

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %66 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %67 unwind label %73

67:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %68 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %69 unwind label %77

69:                                               ; preds = %67
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) @R2posy_point, double noundef %68)
          to label %70 unwind label %77

70:                                               ; preds = %69
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %71 unwind label %77

71:                                               ; preds = %70
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %72 unwind label %77

72:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %82

73:                                               ; preds = %65
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  br label %81

77:                                               ; preds = %71, %70, %69, %67
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %7, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  br label %81

81:                                               ; preds = %77, %73
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %140

82:                                               ; preds = %72, %60, %55
  %83 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 2
  %84 = load double, ptr %83, align 8, !tbaa !9
  %85 = load double, ptr @RN_PI, align 8, !tbaa !18
  %86 = fcmp olt double %84, %85
  br i1 %86, label %87, label %109

87:                                               ; preds = %82
  %88 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 3
  %89 = load double, ptr %88, align 8, !tbaa !17
  %90 = load double, ptr @RN_PI, align 8, !tbaa !18
  %91 = fcmp ogt double %89, %90
  br i1 %91, label %92, label %109

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %93 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %94 unwind label %100

94:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %95 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %96 unwind label %104

96:                                               ; preds = %94
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) @R2negx_point, double noundef %95)
          to label %97 unwind label %104

97:                                               ; preds = %96
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %93, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %98 unwind label %104

98:                                               ; preds = %97
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %99 unwind label %104

99:                                               ; preds = %98
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %109

100:                                              ; preds = %92
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %7, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %8, align 4
  br label %108

104:                                              ; preds = %98, %97, %96, %94
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %7, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %108

108:                                              ; preds = %104, %100
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %140

109:                                              ; preds = %99, %87, %82
  %110 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 2
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = load double, ptr @RN_THREE_PI_OVER_TWO, align 8, !tbaa !18
  %113 = fcmp olt double %111, %112
  br i1 %113, label %114, label %136

114:                                              ; preds = %109
  %115 = getelementptr inbounds %class.R2Arc, ptr %18, i32 0, i32 3
  %116 = load double, ptr %115, align 8, !tbaa !17
  %117 = load double, ptr @RN_THREE_PI_OVER_TWO, align 8, !tbaa !18
  %118 = fcmp ogt double %116, %117
  br i1 %118, label %119, label %136

119:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %120 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %121 unwind label %127

121:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %122 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %123 unwind label %131

123:                                              ; preds = %121
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) @R2negy_point, double noundef %122)
          to label %124 unwind label %131

124:                                              ; preds = %123
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %16, ptr noundef nonnull align 8 dereferenceable(16) %120, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %125 unwind label %131

125:                                              ; preds = %124
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %126 unwind label %131

126:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  br label %136

127:                                              ; preds = %119
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %7, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %8, align 4
  br label %135

131:                                              ; preds = %125, %124, %123, %121
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %7, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %135

135:                                              ; preds = %131, %127
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  br label %140

136:                                              ; preds = %126, %114, %109
  store i1 true, ptr %5, align 1
  %137 = load i1, ptr %5, align 1
  br i1 %137, label %139, label %138

138:                                              ; preds = %136
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #5
  br label %139

139:                                              ; preds = %138, %136
  ret void

140:                                              ; preds = %135, %108, %81, %54, %42, %38
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #5
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %7, align 8
  %143 = load i32, ptr %8, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5R2Arc10StartPointEv(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5R2Arc9StopPointEv(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

declare void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

declare void @_ZmlRK7R2Pointd(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 #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, !16, i64 40}
!10 = !{!"_ZTS5R2Arc", !11, i64 0, !13, i64 8, !16, i64 40, !16, i64 48}
!11 = !{!"_ZTS7R2Curve", !12, i64 0}
!12 = !{!"_ZTS7R2Shape"}
!13 = !{!"_ZTS8R2Circle", !14, i64 0, !15, i64 8, !16, i64 24}
!14 = !{!"_ZTS7R2Solid", !12, i64 0}
!15 = !{!"_ZTS7R2Point", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!10, !16, i64 48}
!18 = !{!16, !16, 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.R2Box = type { %class.R2Solid, %class.R2Point, %class.R2Point }
%class.R2Solid = type { %class.R2Shape }
%class.R2Shape = type { ptr }
%class.R2Point = type { [2 x double] }

@R2null_box = external global %class.R2Box, align 8
@R2posx_point = external global %class.R2Point, align 8
@RN_PI_OVER_TWO = external local_unnamed_addr constant double, align 8
@R2posy_point = external global %class.R2Point, align 8
@RN_PI = external local_unnamed_addr constant double, align 8
@R2negx_point = external global %class.R2Point, align 8
@RN_THREE_PI_OVER_TWO = external local_unnamed_addr constant double, align 8
@R2negy_point = external global %class.R2Point, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK5R2Arc4BBoxEv(ptr dead_on_unwind noalias nonnull writable sret(%class.R2Box) align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.R2Point, align 8
  %4 = alloca %class.R2Point, align 8
  %5 = alloca %class.R2Point, align 8
  %6 = alloca %class.R2Point, align 8
  %7 = alloca %class.R2Point, align 8
  %8 = alloca %class.R2Point, align 8
  %9 = alloca %class.R2Point, align 8
  %10 = alloca %class.R2Point, align 8
  %11 = alloca %class.R2Point, align 8
  %12 = alloca %class.R2Point, align 8
  tail call void @_ZN5R2BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) @R2null_box)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  invoke void @_ZNK5R2Arc10StartPointEv(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %3, ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %13 unwind label %31

13:                                               ; preds = %2
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %14 unwind label %31

14:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  invoke void @_ZNK5R2Arc9StopPointEv(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %4, ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %15 unwind label %33

15:                                               ; preds = %14
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %16 unwind label %33

16:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %17 = getelementptr inbounds i8, ptr %1, i64 40
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = fcmp olt double %18, 0.000000e+00
  %20 = getelementptr inbounds i8, ptr %1, i64 48
  %21 = load double, ptr %20, align 8
  %22 = fcmp ogt double %21, 0.000000e+00
  %or.cond = select i1 %19, i1 %22, i1 false
  br i1 %or.cond, label %23, label %40

23:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %25 unwind label %35

25:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %26 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %27 unwind label %37

27:                                               ; preds = %25
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) @R2posx_point, double noundef %26)
          to label %28 unwind label %37

28:                                               ; preds = %27
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %29 unwind label %37

29:                                               ; preds = %28
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %30 unwind label %37

30:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %.pre = load double, ptr %17, align 8, !tbaa !5
  %.pre30 = load double, ptr %20, align 8
  br label %40

31:                                               ; preds = %13, %2
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  br label %98

33:                                               ; preds = %15, %14
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %98

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %29, %28, %27, %25
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %39

39:                                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %98

40:                                               ; preds = %30, %16
  %41 = phi double [ %.pre30, %30 ], [ %21, %16 ]
  %42 = phi double [ %.pre, %30 ], [ %18, %16 ]
  %43 = load double, ptr @RN_PI_OVER_TWO, align 8, !tbaa !15
  %44 = fcmp olt double %42, %43
  %45 = fcmp ogt double %41, %43
  %or.cond23 = select i1 %44, i1 %45, i1 false
  br i1 %or.cond23, label %46, label %59

46:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  %47 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %48 unwind label %54

48:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %49 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %50 unwind label %56

50:                                               ; preds = %48
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %8, ptr noundef nonnull align 8 dereferenceable(16) @R2posy_point, double noundef %49)
          to label %51 unwind label %56

51:                                               ; preds = %50
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %52 unwind label %56

52:                                               ; preds = %51
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %53 unwind label %56

53:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  %.pre31 = load double, ptr %17, align 8, !tbaa !5
  %.pre32 = load double, ptr %20, align 8
  br label %59

54:                                               ; preds = %46
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %52, %51, %50, %48
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  br label %58

58:                                               ; preds = %56, %54
  %.pn12 = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %98

59:                                               ; preds = %53, %40
  %60 = phi double [ %.pre32, %53 ], [ %41, %40 ]
  %61 = phi double [ %.pre31, %53 ], [ %42, %40 ]
  %62 = load double, ptr @RN_PI, align 8, !tbaa !15
  %63 = fcmp olt double %61, %62
  %64 = fcmp ogt double %60, %62
  %or.cond26 = select i1 %63, i1 %64, i1 false
  br i1 %or.cond26, label %65, label %78

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %66 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %67 unwind label %73

67:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %68 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %69 unwind label %75

69:                                               ; preds = %67
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) @R2negx_point, double noundef %68)
          to label %70 unwind label %75

70:                                               ; preds = %69
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %71 unwind label %75

71:                                               ; preds = %70
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %72 unwind label %75

72:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  %.pre33 = load double, ptr %17, align 8, !tbaa !5
  %.pre34 = load double, ptr %20, align 8
  br label %78

73:                                               ; preds = %65
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %77

75:                                               ; preds = %71, %70, %69, %67
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %77

77:                                               ; preds = %75, %73
  %.pn14 = phi { ptr, i32 } [ %76, %75 ], [ %74, %73 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  br label %98

78:                                               ; preds = %72, %59
  %79 = phi double [ %.pre34, %72 ], [ %60, %59 ]
  %80 = phi double [ %.pre33, %72 ], [ %61, %59 ]
  %81 = load double, ptr @RN_THREE_PI_OVER_TWO, align 8, !tbaa !15
  %82 = fcmp olt double %80, %81
  %83 = fcmp ogt double %79, %81
  %or.cond29 = select i1 %82, i1 %83, i1 false
  br i1 %or.cond29, label %84, label %97

84:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  %85 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Arc6CenterEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %86 unwind label %92

86:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %87 = invoke noundef double @_ZNK5R2Arc6RadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %88 unwind label %94

88:                                               ; preds = %86
  invoke void @_ZmlRK7R2Pointd(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) @R2negy_point, double noundef %87)
          to label %89 unwind label %94

89:                                               ; preds = %88
  invoke void @_ZplRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %85, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %90 unwind label %94

90:                                               ; preds = %89
  invoke void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %91 unwind label %94

91:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  br label %97

92:                                               ; preds = %84
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %96

94:                                               ; preds = %90, %89, %88, %86
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %96

96:                                               ; preds = %94, %92
  %.pn16 = phi { ptr, i32 } [ %95, %94 ], [ %93, %92 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  br label %98

97:                                               ; preds = %78, %91
  ret void

98:                                               ; preds = %96, %77, %58, %39, %33, %31
  %.pn16.pn = phi { ptr, i32 } [ %.pn16, %96 ], [ %.pn14, %77 ], [ %.pn12, %58 ], [ %.pn, %39 ], [ %34, %33 ], [ %32, %31 ]
  call void @_ZN7R2SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #5
  resume { ptr, i32 } %.pn16.pn
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5R2Arc10StartPointEv(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5R2Arc9StopPointEv(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

declare void @_ZplRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

declare void @_ZmlRK7R2Pointd(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 #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, !14, i64 40}
!6 = !{!"_ZTS5R2Arc", !7, i64 0, !9, i64 8, !14, i64 40, !14, i64 48}
!7 = !{!"_ZTS7R2Curve", !8, i64 0}
!8 = !{!"_ZTS7R2Shape"}
!9 = !{!"_ZTS8R2Circle", !10, i64 0, !11, i64 8, !14, i64 24}
!10 = !{!"_ZTS7R2Solid", !8, i64 0}
!11 = !{!"_ZTS7R2Point", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"double", !12, i64 0}
!15 = !{!14, !14, i64 0}


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