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

; 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.R3Cylinder = type { %class.R3Solid, %class.R3Span, %class.R3Circle, %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
@_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder = external hidden global ptr, align 8
@_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder = 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10R3Cylinder4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(232) %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 @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder 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 @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder) #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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @__cxa_guard_release(ptr @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder) #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.R3Cylinder, 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.R3Cylinder, 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 %76

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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, 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 @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder) #5
  br label %92

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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, 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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricTexture(ptr noundef %58, i8 noundef zeroext 1)
  br label %61

59:                                               ; preds = %52
  %60 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, 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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricDrawStyle(ptr noundef %62, i32 noundef 100012)
  %63 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  %64 = getelementptr inbounds %class.R3Cylinder, ptr %15, i32 0, i32 2
  %65 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %64)
  %66 = getelementptr inbounds %class.R3Cylinder, ptr %15, i32 0, i32 3
  %67 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %66)
  %68 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %15)
  call void @gluCylinder(ptr noundef %63, double noundef %65, double noundef %67, double noundef %68, i32 noundef 16, i32 noundef 1)
  %69 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricOrientation(ptr noundef %69, i32 noundef 100021)
  %70 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  %71 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %15)
  call void @gluDisk(ptr noundef %70, double noundef 0.000000e+00, double noundef %71, i32 noundef 16, i32 noundef 1)
  %72 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricOrientation(ptr noundef %72, i32 noundef 100020)
  %73 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %15)
  call void @glTranslated(double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %73)
  %74 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  %75 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %15)
  call void @gluDisk(ptr noundef %74, double noundef 0.000000e+00, double noundef %75, i32 noundef 16, i32 noundef 1)
  br label %76

76:                                               ; preds = %61, %24
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef 1)
  %77 = getelementptr inbounds %class.RNFlags, ptr %13, i32 0, i32 0
  %78 = load i64, ptr %77, align 8
  %79 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %78)
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %91

81:                                               ; preds = %76
  %82 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricNormals(ptr noundef %82, i32 noundef 100002)
  %83 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricTexture(ptr noundef %83, i8 noundef zeroext 0)
  %84 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  call void @gluQuadricDrawStyle(ptr noundef %84, i32 noundef 100013)
  %85 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !5
  %86 = getelementptr inbounds %class.R3Cylinder, ptr %15, i32 0, i32 2
  %87 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %86)
  %88 = getelementptr inbounds %class.R3Cylinder, ptr %15, i32 0, i32 3
  %89 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %88)
  %90 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %15)
  call void @gluCylinder(ptr noundef %85, double noundef %87, double noundef %89, double noundef %90, i32 noundef 16, i32 noundef 1)
  br label %91

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

92:                                               ; preds = %40
  %93 = load ptr, ptr %5, align 8
  %94 = load i32, ptr %6, align 4
  %95 = insertvalue { ptr, i32 } poison, ptr %93, 0
  %96 = insertvalue { ptr, i32 } %95, i32 %94, 1
  resume { ptr, i32 } %96
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232)) #3 align 2

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

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

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

declare void @glTranslated(double noundef, double noundef, double noundef) #4

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
@_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder = external hidden local_unnamed_addr global ptr, align 8
@_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder = 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10R3Cylinder4DrawE7RNFlags(ptr noundef nonnull align 8 dereferenceable(232) %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 @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder 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 @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder) #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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder) #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 %51, 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 @_ZGVZNK10R3Cylinder4DrawE7RNFlagsE8cylinder) #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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, 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 @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricTexture(ptr noundef %36, i8 noundef zeroext %.)
  %37 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricDrawStyle(ptr noundef %37, i32 noundef 100012)
  %38 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  %39 = getelementptr inbounds i8, ptr %0, i64 88
  %40 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %39)
  %41 = getelementptr inbounds i8, ptr %0, i64 160
  %42 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %41)
  %43 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @gluCylinder(ptr noundef %38, double noundef %40, double noundef %42, double noundef %43, i32 noundef 16, i32 noundef 1)
  %44 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricOrientation(ptr noundef %44, i32 noundef 100021)
  %45 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  %46 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @gluDisk(ptr noundef %45, double noundef 0.000000e+00, double noundef %46, i32 noundef 16, i32 noundef 1)
  %47 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricOrientation(ptr noundef %47, i32 noundef 100020)
  %48 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @glTranslated(double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %48)
  %49 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  %50 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @gluDisk(ptr noundef %49, double noundef 0.000000e+00, double noundef %50, i32 noundef 16, i32 noundef 1)
  br label %51

51:                                               ; preds = %33, %18
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 1)
  %52 = load i64, ptr %10, align 8
  %53 = call noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %52)
  %.not6 = icmp eq i32 %53, 0
  br i1 %.not6, label %64, label %54

54:                                               ; preds = %51
  %55 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricNormals(ptr noundef %55, i32 noundef 100002)
  %56 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricTexture(ptr noundef %56, i8 noundef zeroext 0)
  %57 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  call void @gluQuadricDrawStyle(ptr noundef %57, i32 noundef 100013)
  %58 = load ptr, ptr @_ZZNK10R3Cylinder4DrawE7RNFlagsE8cylinder, align 8, !tbaa !6
  %59 = getelementptr inbounds i8, ptr %0, i64 88
  %60 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %59)
  %61 = getelementptr inbounds i8, ptr %0, i64 160
  %62 = call noundef double @_ZNK8R3Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(72) %61)
  %63 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @gluCylinder(ptr noundef %58, double noundef %60, double noundef %62, double noundef %63, i32 noundef 16, i32 noundef 1)
  br label %64

64:                                               ; preds = %54, %51
  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
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #3 align 2

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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #2 align 2

declare void @glTranslated(double noundef, double noundef, double noundef) local_unnamed_addr #4

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