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

; 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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Vector = type { [3 x double] }
%class.RNFlags = type { i64 }
%class.R3Cone = type { %class.R3Solid, %class.R3Span, %class.R3Circle }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Span = type { %class.R3Ray, %class.R3Point, double }
%class.R3Ray = type { %class.R3Line }
%class.R3Line = type { %class.R3Point, %class.R3Vector }
%class.R3Point = type { [3 x double] }
%class.R3Circle = type { %class.R3Surface, %class.R3Point, double, %class.R3Plane }
%class.R3Surface = type { %class.R3Shape }
%class.R3Plane = type { %class.R3Vector, double }

@R4identity_matrix = external global %class.R4Matrix, align 8
@R3posz_vector = external global %class.R3Vector, align 8
@_ZZNK6R3Cone4DrawE7RNFlagsE4cone = external hidden global ptr, align 8
@_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone = external hidden global i64, 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8), i64) #3 align 2

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #4

declare void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

declare void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #5

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #5

declare ptr @gluNewQuadric() #4

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

declare void @gluQuadricNormals(ptr noundef, i32 noundef) #4

declare void @gluQuadricTexture(ptr noundef, i8 noundef zeroext) #4

declare void @gluQuadricDrawStyle(ptr noundef, i32 noundef) #4

declare void @gluCylinder(ptr noundef, double noundef, double noundef, double noundef, i32 noundef, i32 noundef) #4

declare void @gluQuadricOrientation(ptr noundef, i32 noundef) #4

declare void @gluDisk(ptr noundef, double noundef, double noundef, i32 noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R3Cone4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(160) %0, i64 %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %class.R4Matrix, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.RNFlags, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca %class.RNFlags, align 8
  %12 = alloca %class.RNFlags, align 8
  %13 = alloca %class.RNFlags, align 8
  %14 = getelementptr inbounds %class.RNFlags, ptr %3, i32 0, i32 0
  store i64 %1, ptr %14, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  %16 = load atomic i8, ptr @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone acquire, align 8
  %17 = icmp eq i8 %16, 0
  br i1 %17, label %18, label %24, !prof !9

18:                                               ; preds = %2
  %19 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone) #5
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = invoke ptr @gluNewQuadric()
          to label %23 unwind label %40

23:                                               ; preds = %21
  store ptr %22, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @__cxa_guard_release(ptr @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone) #5
  br label %24

24:                                               ; preds = %23, %18, %2
  call void @llvm.lifetime.start.p0(i64 128, ptr %7) #5
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %7, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %25 = getelementptr inbounds %class.R3Cone, ptr %15, i32 0, i32 1
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %7, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  %27 = getelementptr inbounds %class.R3Cone, ptr %15, i32 0, i32 1
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span6VectorEv(ptr noundef nonnull align 8 dereferenceable(80) %27)
  call void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128) %7, ptr noundef nonnull align 8 dereferenceable(24) @R3posz_vector, ptr noundef nonnull align 8 dereferenceable(24) %28)
  call void @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128) %7)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 2)
  %29 = getelementptr inbounds %class.RNFlags, ptr %9, i32 0, i32 0
  %30 = load i64, ptr %29, align 8
  %31 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %30)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %70

33:                                               ; preds = %24
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 256)
  %34 = getelementptr inbounds %class.RNFlags, ptr %10, i32 0, i32 0
  %35 = load i64, ptr %34, align 8
  %36 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %35)
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %44

38:                                               ; preds = %33
  %39 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricNormals(ptr noundef %39, i32 noundef 100000)
  br label %52

40:                                               ; preds = %21
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone) #5
  br label %83

44:                                               ; preds = %33
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 16)
  %45 = getelementptr inbounds %class.RNFlags, ptr %11, i32 0, i32 0
  %46 = load i64, ptr %45, align 8
  %47 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %46)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %44
  %50 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricNormals(ptr noundef %50, i32 noundef 100001)
  br label %51

51:                                               ; preds = %49, %44
  br label %52

52:                                               ; preds = %51, %38
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 512)
  %53 = getelementptr inbounds %class.RNFlags, ptr %12, i32 0, i32 0
  %54 = load i64, ptr %53, align 8
  %55 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %54)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %52
  %58 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricTexture(ptr noundef %58, i8 noundef zeroext 1)
  br label %61

59:                                               ; preds = %52
  %60 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricTexture(ptr noundef %60, i8 noundef zeroext 0)
  br label %61

61:                                               ; preds = %59, %57
  %62 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricDrawStyle(ptr noundef %62, i32 noundef 100012)
  %63 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  %64 = call noundef double @_ZNK6R3Cone6RadiusEv(ptr noundef nonnull align 8 dereferenceable(160) %15)
  %65 = call noundef double @_ZNK6R3Cone6HeightEv(ptr noundef nonnull align 8 dereferenceable(160) %15)
  call void @gluCylinder(ptr noundef %63, double noundef %64, double noundef 0.000000e+00, double noundef %65, i32 noundef 16, i32 noundef 1)
  %66 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricOrientation(ptr noundef %66, i32 noundef 100021)
  %67 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  %68 = call noundef double @_ZNK6R3Cone6RadiusEv(ptr noundef nonnull align 8 dereferenceable(160) %15)
  call void @gluDisk(ptr noundef %67, double noundef 0.000000e+00, double noundef %68, i32 noundef 16, i32 noundef 1)
  %69 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricOrientation(ptr noundef %69, i32 noundef 100020)
  br label %70

70:                                               ; preds = %61, %24
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef 1)
  %71 = getelementptr inbounds %class.RNFlags, ptr %13, i32 0, i32 0
  %72 = load i64, ptr %71, align 8
  %73 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %72)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %82

75:                                               ; preds = %70
  %76 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricNormals(ptr noundef %76, i32 noundef 100002)
  %77 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricTexture(ptr noundef %77, i8 noundef zeroext 0)
  %78 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  call void @gluQuadricDrawStyle(ptr noundef %78, i32 noundef 100013)
  %79 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !5
  %80 = call noundef double @_ZNK6R3Cone6RadiusEv(ptr noundef nonnull align 8 dereferenceable(160) %15)
  %81 = call noundef double @_ZNK6R3Cone6HeightEv(ptr noundef nonnull align 8 dereferenceable(160) %15)
  call void @gluCylinder(ptr noundef %79, double noundef %80, double noundef 0.000000e+00, double noundef %81, i32 noundef 16, i32 noundef 1)
  br label %82

82:                                               ; preds = %75, %70
  call void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128) %7)
  call void @llvm.lifetime.end.p0(i64 128, ptr %7) #5
  ret void

83:                                               ; preds = %40
  %84 = load ptr, ptr %5, align 8
  %85 = load i32, ptr %6, align 4
  %86 = insertvalue { ptr, i32 } poison, ptr %84, 0
  %87 = insertvalue { ptr, i32 } %86, i32 %85, 1
  resume { ptr, i32 } %87
}

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

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

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


; 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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Vector = type { [3 x double] }
%class.RNFlags = type { i64 }

@R4identity_matrix = external global %class.R4Matrix, align 8
@R3posz_vector = external global %class.R3Vector, align 8
@_ZZNK6R3Cone4DrawE7RNFlagsE4cone = external hidden local_unnamed_addr global ptr, align 8
@_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone = external hidden global i64, 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8), i64) local_unnamed_addr #3 align 2

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #4

declare void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

declare void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #5

declare ptr @gluNewQuadric() local_unnamed_addr #4

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

declare void @gluQuadricNormals(ptr noundef, i32 noundef) local_unnamed_addr #4

declare void @gluQuadricTexture(ptr noundef, i8 noundef zeroext) local_unnamed_addr #4

declare void @gluQuadricDrawStyle(ptr noundef, i32 noundef) local_unnamed_addr #4

declare void @gluCylinder(ptr noundef, double noundef, double noundef, double noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @gluQuadricOrientation(ptr noundef, i32 noundef) local_unnamed_addr #4

declare void @gluDisk(ptr noundef, double noundef, double noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R3Cone4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(160) %0, i64 %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca %class.R4Matrix, align 8
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.RNFlags, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  %9 = alloca %class.RNFlags, align 8
  %10 = alloca %class.RNFlags, align 8
  store i64 %1, ptr %3, align 8
  %11 = load atomic i8, ptr @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone acquire, align 8
  %12 = icmp eq i8 %11, 0
  br i1 %12, label %13, label %18, !prof !5

13:                                               ; preds = %2
  %14 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone) #6
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %18, label %15

15:                                               ; preds = %13
  %16 = invoke ptr @gluNewQuadric()
          to label %17 unwind label %27

17:                                               ; preds = %15
  store ptr %16, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone) #6
  br label %18

18:                                               ; preds = %17, %13, %2
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span5StartEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Span6VectorEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
  call void @_ZN8R4Matrix6RotateERK8R3VectorS2_(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(24) @R3posz_vector, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @_ZNK8R4Matrix4PushEv(ptr noundef nonnull align 8 dereferenceable(128) %4)
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 2)
  %22 = load i64, ptr %6, align 8
  %23 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %22)
  %.not2 = icmp eq i32 %23, 0
  br i1 %.not2, label %45, label %24

24:                                               ; preds = %18
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef 256)
  %25 = load i64, ptr %7, align 8
  %26 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %25)
  %.not3 = icmp eq i32 %26, 0
  br i1 %.not3, label %29, label %.sink.split

27:                                               ; preds = %15
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZNK6R3Cone4DrawE7RNFlagsE4cone) #6
  resume { ptr, i32 } %28

29:                                               ; preds = %24
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 16)
  %30 = load i64, ptr %8, align 8
  %31 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %30)
  %.not4 = icmp eq i32 %31, 0
  br i1 %.not4, label %33, label %.sink.split

.sink.split:                                      ; preds = %29, %24
  %.sink7 = phi i32 [ 100000, %24 ], [ 100001, %29 ]
  %32 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricNormals(ptr noundef %32, i32 noundef %.sink7)
  br label %33

33:                                               ; preds = %.sink.split, %29
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 512)
  %34 = load i64, ptr %9, align 8
  %35 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %34)
  %.not5 = icmp ne i32 %35, 0
  %. = zext i1 %.not5 to i8
  %36 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricTexture(ptr noundef %36, i8 noundef zeroext %.)
  %37 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricDrawStyle(ptr noundef %37, i32 noundef 100012)
  %38 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  %39 = call noundef double @_ZNK6R3Cone6RadiusEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  %40 = call noundef double @_ZNK6R3Cone6HeightEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  call void @gluCylinder(ptr noundef %38, double noundef %39, double noundef 0.000000e+00, double noundef %40, i32 noundef 16, i32 noundef 1)
  %41 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricOrientation(ptr noundef %41, i32 noundef 100021)
  %42 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  %43 = call noundef double @_ZNK6R3Cone6RadiusEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  call void @gluDisk(ptr noundef %42, double noundef 0.000000e+00, double noundef %43, i32 noundef 16, i32 noundef 1)
  %44 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricOrientation(ptr noundef %44, i32 noundef 100020)
  br label %45

45:                                               ; preds = %33, %18
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 1)
  %46 = load i64, ptr %10, align 8
  %47 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %46)
  %.not6 = icmp eq i32 %47, 0
  br i1 %.not6, label %55, label %48

48:                                               ; preds = %45
  %49 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricNormals(ptr noundef %49, i32 noundef 100002)
  %50 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricTexture(ptr noundef %50, i8 noundef zeroext 0)
  %51 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  call void @gluQuadricDrawStyle(ptr noundef %51, i32 noundef 100013)
  %52 = load ptr, ptr @_ZZNK6R3Cone4DrawE7RNFlagsE4cone, align 8, !tbaa !6
  %53 = call noundef double @_ZNK6R3Cone6RadiusEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  %54 = call noundef double @_ZNK6R3Cone6HeightEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  call void @gluCylinder(ptr noundef %52, double noundef %53, double noundef 0.000000e+00, double noundef %54, i32 noundef 16, i32 noundef 1)
  br label %55

55:                                               ; preds = %48, %45
  call void @_ZNK8R4Matrix3PopEv(ptr noundef nonnull align 8 dereferenceable(128) %4)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #6
  ret void
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { "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 = { nofree nounwind }
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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


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