; LLVM IR from niessner/Matterport :: code/gaps/apps/mpview/mpview.ll (Z12GLUTMainLoopv)

; 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.R3Vector = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Camera = type { %class.R3CoordSystem, double, double, double, double, double, ptr }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R2Viewport = type { i32, i32, i32, i32 }
%struct.MPHouse = type { %class.RNArray.5, %class.RNArray.0, %class.RNArray.6, %class.RNArray.4, %class.RNArray.2, %class.RNArray.7, %class.RNArray.1, %class.RNArray.8, %class.RNArray.3, %class.RNArray.9, %class.RGBDConfiguration, ptr, ptr, %class.R3Box, ptr, ptr }
%class.RNArray.5 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNArray.6 = type { %class.RNVArray }
%class.RNArray.4 = type { %class.RNVArray }
%class.RNArray.2 = type { %class.RNVArray }
%class.RNArray.7 = type { %class.RNVArray }
%class.RNArray.1 = type { %class.RNVArray }
%class.RNArray.8 = type { %class.RNVArray }
%class.RNArray.3 = type { %class.RNVArray }
%class.RNArray.9 = type { %class.RNVArray }
%class.RGBDConfiguration = type { ptr, %class.RNArray.10, %class.RNArray.11, ptr, ptr, ptr, ptr, %class.R3Box }
%class.RNArray.10 = type { %class.RNVArray }
%class.RNArray.11 = type { %class.RNVArray }

@_ZL22initial_camera_towards = external hidden global %class.R3Vector, align 8
@_ZL17initial_camera_up = external hidden global %class.R3Vector, align 8
@_ZL21initial_camera_origin = external hidden global %class.R3Point, align 8
@_ZL8clip_box = external hidden global %class.R3Box, align 8
@_ZL6center = external hidden global %class.R3Point, align 8
@_ZL6viewer = external hidden global ptr, align 8
@_ZL5house = external hidden global ptr, align 8
@_ZL16GLUTwindow_width = external hidden global i32, align 4
@_ZL17GLUTwindow_height = external hidden global i32, align 4
@.str.23 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [27 x i8], align 1
@_ZL14initial_camera = external hidden global i32, align 4

; 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(...)

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12GLUTMainLoopv() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.R3Point, align 8
  %2 = alloca double, align 8
  %3 = alloca %class.R3Point, align 8
  %4 = alloca %class.R3Point, align 8
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.R3Camera, align 8
  %7 = alloca %class.R2Viewport, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.MPHouse, ptr %10, i32 0, i32 13
  %12 = call noundef i32 @_ZNK5R3Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(56) %11)
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %0
  br label %56

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr %1) #7
  %16 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 13
  call void @_ZNK5R3Box8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %1, ptr noundef nonnull align 8 dereferenceable(56) %17)
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) @_ZL6center, ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #7
  %19 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.MPHouse, ptr %19, i32 0, i32 13
  %21 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) @_ZL8clip_box, ptr noundef nonnull align 8 dereferenceable(56) %20)
  %22 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.MPHouse, ptr %22, i32 0, i32 13
  %24 = call noundef i32 @_ZNK5R3Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(56) %23)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %15
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str.23, ptr noundef @.str.24, i32 noundef 1233, ptr noundef @.str.25)
  br label %27

27:                                               ; preds = %26, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %28 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.MPHouse, ptr %28, i32 0, i32 13
  %30 = call noundef double @_ZNK5R3Box14DiagonalRadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %29)
  store double %30, ptr %2, align 8, !tbaa !9
  %31 = load double, ptr %2, align 8, !tbaa !9
  %32 = fcmp ogt double %31, 0.000000e+00
  br i1 %32, label %33, label %37

33:                                               ; preds = %27
  %34 = load double, ptr %2, align 8, !tbaa !9
  %35 = call noundef i32 @_Z10RNIsFinited(double noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %33, %27
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str.23, ptr noundef @.str.26, i32 noundef 1235, ptr noundef @.str.25)
  br label %38

38:                                               ; preds = %37, %33
  %39 = load i32, ptr @_ZL14initial_camera, align 4, !tbaa !11
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %47, label %41

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #7
  %42 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.MPHouse, ptr %42, i32 0, i32 13
  call void @_ZNK5R3Box8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %4, ptr noundef nonnull align 8 dereferenceable(56) %43)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  %44 = load double, ptr %2, align 8, !tbaa !9
  %45 = fmul double 2.500000e+00, %44
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) @_ZL22initial_camera_towards, double noundef %45)
  call void @_ZmiRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) @_ZL21initial_camera_origin, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  br label %47

47:                                               ; preds = %41, %38
  call void @llvm.lifetime.start.p0(i64 144, ptr %6) #7
  %48 = load double, ptr %2, align 8, !tbaa !9
  %49 = fmul double 1.000000e-02, %48
  %50 = load double, ptr %2, align 8, !tbaa !9
  %51 = fmul double 1.000000e+02, %50
  call void @_ZN8R3CameraC1ERK7R3PointRK8R3VectorS5_dddd(ptr noundef nonnull align 8 dereferenceable(144) %6, ptr noundef nonnull align 8 dereferenceable(24) @_ZL21initial_camera_origin, ptr noundef nonnull align 8 dereferenceable(24) @_ZL22initial_camera_towards, ptr noundef nonnull align 8 dereferenceable(24) @_ZL17initial_camera_up, double noundef 5.400000e-01, double noundef 4.500000e-01, double noundef %49, double noundef %51)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %52 = load i32, ptr @_ZL16GLUTwindow_width, align 4, !tbaa !11
  %53 = load i32, ptr @_ZL17GLUTwindow_height, align 4, !tbaa !11
  call void @_ZN10R2ViewportC1Eiiii(ptr noundef nonnull align 4 dereferenceable(16) %7, i32 noundef 0, i32 noundef 0, i32 noundef %52, i32 noundef %53)
  %54 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 168) #8
  invoke void @_ZN8R3ViewerC1ERK8R3CameraRK10R2Viewport(ptr noundef nonnull align 8 dereferenceable(168) %54, ptr noundef nonnull align 8 dereferenceable(144) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %55 unwind label %57

55:                                               ; preds = %47
  store ptr %54, ptr @_ZL6viewer, align 8, !tbaa !5
  call void @glutMainLoop()
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %56

56:                                               ; preds = %55, %14
  ret void

57:                                               ; preds = %47
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %8, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %54, i64 noundef 168) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %61

61:                                               ; preds = %57
  %62 = load ptr, ptr %8, align 8
  %63 = load i32, ptr %9, align 4
  %64 = insertvalue { ptr, i32 } poison, ptr %62, 0
  %65 = insertvalue { ptr, i32 } %64, i32 %63, 1
  resume { ptr, i32 } %65
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5R3Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

declare void @_ZNK5R3Box8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #1

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10RNIsFinited(double noundef) #4

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

declare void @_ZmlRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), double noundef) #1

declare void @_ZN8R3CameraC1ERK7R3PointRK8R3VectorS5_dddd(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef, double noundef) unnamed_addr #1

declare void @_ZN10R2ViewportC1Eiiii(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #5

declare void @_ZN8R3ViewerC1ERK8R3CameraRK10R2Viewport(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

declare void @glutMainLoop() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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 = { 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 #5 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R3Vector = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Camera = type { %class.R3CoordSystem, double, double, double, double, double, ptr }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R2Viewport = type { i32, i32, i32, i32 }

@_ZL22initial_camera_towards = external hidden global %class.R3Vector, align 8
@_ZL17initial_camera_up = external hidden global %class.R3Vector, align 8
@_ZL21initial_camera_origin = external hidden global %class.R3Point, align 8
@_ZL8clip_box = external hidden global %class.R3Box, align 8
@_ZL6center = external hidden global %class.R3Point, align 8
@_ZL6viewer = external hidden local_unnamed_addr global ptr, align 8
@_ZL5house = external hidden local_unnamed_addr global ptr, align 8
@_ZL16GLUTwindow_width = external hidden local_unnamed_addr global i32, align 4
@_ZL17GLUTwindow_height = external hidden local_unnamed_addr global i32, align 4
@.str.23 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [27 x i8], align 1
@_ZL14initial_camera = external hidden local_unnamed_addr global i32, align 4

; 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(...)

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12GLUTMainLoopv() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.R3Point, align 8
  %2 = alloca %class.R3Point, align 8
  %3 = alloca %class.R3Point, align 8
  %4 = alloca %class.R3Vector, align 8
  %5 = alloca %class.R3Camera, align 8
  %6 = alloca %class.R2Viewport, align 4
  %7 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 304
  %9 = tail call noundef i32 @_ZNK5R3Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(56) %8)
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %43

10:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  %11 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 304
  call void @_ZNK5R3Box8CentroidEv(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %1, ptr noundef nonnull align 8 dereferenceable(56) %12)
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) @_ZL6center, ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %14 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 304
  %16 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) @_ZL8clip_box, ptr noundef nonnull align 8 dereferenceable(56) %15)
  %17 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 304
  %19 = call noundef i32 @_ZNK5R3Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
  %.not6 = icmp eq i32 %19, 0
  br i1 %.not6, label %21, label %20

20:                                               ; preds = %10
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.24, i32 noundef 1233, ptr noundef nonnull @.str.25)
  br label %21

21:                                               ; preds = %20, %10
  %22 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 304
  %24 = call noundef double @_ZNK5R3Box14DiagonalRadiusEv(ptr noundef nonnull align 8 dereferenceable(56) %23)
  %25 = fcmp ogt double %24, 0.000000e+00
  br i1 %25, label %26, label %28

26:                                               ; preds = %21
  %27 = call noundef i32 @_Z10RNIsFinited(double noundef %24)
  %.not7 = icmp eq i32 %27, 0
  br i1 %.not7, label %28, label %29

28:                                               ; preds = %26, %21
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.26, i32 noundef 1235, ptr noundef nonnull @.str.25)
  br label %29

29:                                               ; preds = %28, %26
  %30 = load i32, ptr @_ZL14initial_camera, align 4, !tbaa !9
  %.not8 = icmp eq i32 %30, 0
  br i1 %.not8, label %31, label %36

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %32 = load ptr, ptr @_ZL5house, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 304
  call void @_ZNK5R3Box8CentroidEv(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %3, ptr noundef nonnull align 8 dereferenceable(56) %33)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %34 = fmul double %24, 2.500000e+00
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) @_ZL22initial_camera_towards, double noundef %34)
  call void @_ZmiRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) @_ZL21initial_camera_origin, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  br label %36

36:                                               ; preds = %31, %29
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %5) #7
  %37 = fmul double %24, 1.000000e-02
  %38 = fmul double %24, 1.000000e+02
  call void @_ZN8R3CameraC1ERK7R3PointRK8R3VectorS5_dddd(ptr noundef nonnull align 8 dereferenceable(144) %5, ptr noundef nonnull align 8 dereferenceable(24) @_ZL21initial_camera_origin, ptr noundef nonnull align 8 dereferenceable(24) @_ZL22initial_camera_towards, ptr noundef nonnull align 8 dereferenceable(24) @_ZL17initial_camera_up, double noundef 5.400000e-01, double noundef 4.500000e-01, double noundef %37, double noundef %38)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %39 = load i32, ptr @_ZL16GLUTwindow_width, align 4, !tbaa !9
  %40 = load i32, ptr @_ZL17GLUTwindow_height, align 4, !tbaa !9
  call void @_ZN10R2ViewportC1Eiiii(ptr noundef nonnull align 4 dereferenceable(16) %6, i32 noundef 0, i32 noundef 0, i32 noundef %39, i32 noundef %40)
  %41 = call noalias noundef nonnull dereferenceable(168) ptr @_Znwm(i64 noundef 168) #8
  invoke void @_ZN8R3ViewerC1ERK8R3CameraRK10R2Viewport(ptr noundef nonnull align 8 dereferenceable(168) %41, ptr noundef nonnull align 8 dereferenceable(144) %5, ptr noundef nonnull align 4 dereferenceable(16) %6)
          to label %42 unwind label %44

42:                                               ; preds = %36
  store ptr %41, ptr @_ZL6viewer, align 8, !tbaa !5
  call void @glutMainLoop()
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %5) #7
  br label %43

43:                                               ; preds = %0, %42
  ret void

44:                                               ; preds = %36
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %41, i64 noundef 168) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %5) #7
  resume { ptr, i32 } %45
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5R3Box7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

declare void @_ZNK5R3Box8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #1

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10RNIsFinited(double noundef) local_unnamed_addr #4

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

declare void @_ZmlRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #1

declare void @_ZN8R3CameraC1ERK7R3PointRK8R3VectorS5_dddd(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef, double noundef) unnamed_addr #1

declare void @_ZN10R2ViewportC1Eiiii(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

declare void @_ZN8R3ViewerC1ERK8R3CameraRK10R2Viewport(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #6

declare void @glutMainLoop() local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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 = { 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 #5 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


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