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

; 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.R3Viewer = type { ptr, %class.R3Camera, %class.R2Viewport }
%class.R3Camera = type { %class.R3CoordSystem, double, double, double, double, double, ptr }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R3Point = type { [3 x double] }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R2Viewport = type { i32, i32, i32, i32 }

@RN_EPSILON = external global double, align 8

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Viewer15TranslateCameraERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8R3Viewer9FlyCameraEddddiiiiii(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10) unnamed_addr #5 align 2 {
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca %class.R3Vector, align 8
  %25 = alloca %class.R3Vector, align 8
  store ptr %0, ptr %12, align 8, !tbaa !5
  store double %1, ptr %13, align 8, !tbaa !9
  store double %2, ptr %14, align 8, !tbaa !9
  store double %3, ptr %15, align 8, !tbaa !9
  store double %4, ptr %16, align 8, !tbaa !9
  store i32 %5, ptr %17, align 4, !tbaa !11
  store i32 %6, ptr %18, align 4, !tbaa !11
  store i32 %7, ptr %19, align 4, !tbaa !11
  store i32 %8, ptr %20, align 4, !tbaa !11
  store i32 %9, ptr %21, align 4, !tbaa !11
  store i32 %10, ptr %22, align 4, !tbaa !11
  %26 = load ptr, ptr %12, align 8
  %27 = load double, ptr %13, align 8, !tbaa !9
  %28 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %29 = call noundef i32 @_Z11RNIsNotZerodd(double noundef %27, double noundef %28)
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %40

31:                                               ; preds = %11
  %32 = load double, ptr %13, align 8, !tbaa !9
  %33 = load i32, ptr %19, align 4, !tbaa !11
  %34 = load i32, ptr %20, align 4, !tbaa !11
  %35 = load i32, ptr %21, align 4, !tbaa !11
  %36 = load i32, ptr %22, align 4, !tbaa !11
  %37 = load ptr, ptr %26, align 8, !tbaa !13
  %38 = getelementptr inbounds ptr, ptr %37, i64 4
  %39 = load ptr, ptr %38, align 8
  call void %39(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %32, i32 noundef %33, i32 noundef %34, i32 noundef %35, i32 noundef %36)
  br label %40

40:                                               ; preds = %31, %11
  %41 = load double, ptr %14, align 8, !tbaa !9
  %42 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %43 = call noundef i32 @_Z11RNIsNotZerodd(double noundef %41, double noundef %42)
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %54

45:                                               ; preds = %40
  %46 = load double, ptr %14, align 8, !tbaa !9
  %47 = load i32, ptr %19, align 4, !tbaa !11
  %48 = load i32, ptr %20, align 4, !tbaa !11
  %49 = load i32, ptr %21, align 4, !tbaa !11
  %50 = load i32, ptr %22, align 4, !tbaa !11
  %51 = load ptr, ptr %26, align 8, !tbaa !13
  %52 = getelementptr inbounds ptr, ptr %51, i64 5
  %53 = load ptr, ptr %52, align 8
  call void %53(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %46, i32 noundef %47, i32 noundef %48, i32 noundef %49, i32 noundef %50)
  br label %78

54:                                               ; preds = %40
  %55 = load i32, ptr %17, align 4, !tbaa !11
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %77

57:                                               ; preds = %54
  %58 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %59 = call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %58)
  %60 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %61 = call noundef i32 @_Z11RNIsNotZerodd(double noundef %59, double noundef %60)
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %77

63:                                               ; preds = %57
  %64 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %65 = call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %64)
  %66 = call noundef i32 @_Z8RNIsZerodd(double noundef %65, double noundef 5.000000e-03)
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %72

68:                                               ; preds = %63
  %69 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %70 = call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %69)
  %71 = fmul double -1.000000e+00, %70
  call void @_ZN8R3Viewer15RotateCameraYawEd(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %71)
  br label %76

72:                                               ; preds = %63
  %73 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %74 = call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %73)
  %75 = fmul double -5.000000e-02, %74
  call void @_ZN8R3Viewer15RotateCameraYawEd(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %75)
  br label %76

76:                                               ; preds = %72, %68
  br label %77

77:                                               ; preds = %76, %57, %54
  br label %78

78:                                               ; preds = %77, %45
  %79 = load double, ptr %15, align 8, !tbaa !9
  %80 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %81 = call noundef i32 @_Z11RNIsNotZerodd(double noundef %79, double noundef %80)
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %92

83:                                               ; preds = %78
  %84 = load double, ptr %15, align 8, !tbaa !9
  %85 = load i32, ptr %19, align 4, !tbaa !11
  %86 = load i32, ptr %20, align 4, !tbaa !11
  %87 = load i32, ptr %21, align 4, !tbaa !11
  %88 = load i32, ptr %22, align 4, !tbaa !11
  %89 = load ptr, ptr %26, align 8, !tbaa !13
  %90 = getelementptr inbounds ptr, ptr %89, i64 6
  %91 = load ptr, ptr %90, align 8
  call void %91(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %84, i32 noundef %85, i32 noundef %86, i32 noundef %87, i32 noundef %88)
  br label %115

92:                                               ; preds = %78
  %93 = load i32, ptr %18, align 4, !tbaa !11
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %114

95:                                               ; preds = %92
  %96 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %97 = call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %96)
  %98 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %99 = call noundef i32 @_Z11RNIsNotZerodd(double noundef %97, double noundef %98)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %114

101:                                              ; preds = %95
  %102 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %103 = call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %102)
  %104 = fcmp olt double %103, 1.000000e-02
  br i1 %104, label %105, label %109

105:                                              ; preds = %101
  %106 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %107 = call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %106)
  %108 = fmul double -1.000000e+00, %107
  call void @_ZN8R3Viewer16RotateCameraRollEd(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %108)
  br label %113

109:                                              ; preds = %101
  %110 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  %111 = call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %110)
  %112 = fmul double -5.000000e-02, %111
  call void @_ZN8R3Viewer16RotateCameraRollEd(ptr noundef nonnull align 8 dereferenceable(168) %26, double noundef %112)
  br label %113

113:                                              ; preds = %109, %105
  br label %114

114:                                              ; preds = %113, %95, %92
  br label %115

115:                                              ; preds = %114, %83
  %116 = load double, ptr %16, align 8, !tbaa !9
  %117 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %118 = call noundef i32 @_Z11RNIsNotZerodd(double noundef %116, double noundef %117)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %148

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %121 = load i32, ptr %19, align 4, !tbaa !11
  %122 = mul nsw i32 2, %121
  %123 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 2
  %124 = call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %123)
  %125 = sub nsw i32 %122, %124
  %126 = sitofp i32 %125 to double
  %127 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 2
  %128 = call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %127)
  %129 = sitofp i32 %128 to double
  %130 = fdiv double %126, %129
  store double %130, ptr %23, align 8, !tbaa !9
  %131 = load double, ptr %23, align 8, !tbaa !9
  %132 = fcmp ogt double %131, 1.000000e+00
  br i1 %132, label %133, label %134

133:                                              ; preds = %120
  store double 1.000000e+00, ptr %23, align 8, !tbaa !9
  br label %139

134:                                              ; preds = %120
  %135 = load double, ptr %23, align 8, !tbaa !9
  %136 = fcmp olt double %135, -1.000000e+00
  br i1 %136, label %137, label %138

137:                                              ; preds = %134
  store double -1.000000e+00, ptr %23, align 8, !tbaa !9
  br label %138

138:                                              ; preds = %137, %134
  br label %139

139:                                              ; preds = %138, %133
  %140 = load double, ptr %23, align 8, !tbaa !9
  %141 = load double, ptr %23, align 8, !tbaa !9
  %142 = fneg double %140
  %143 = call double @llvm.fmuladd.f64(double %142, double %141, double 1.000000e+00)
  %144 = load double, ptr %16, align 8, !tbaa !9
  %145 = fmul double %144, %143
  store double %145, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  %146 = getelementptr inbounds %class.R3Viewer, ptr %26, i32 0, i32 1
  call void @_ZNK8R3Camera7TowardsEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %25, ptr noundef nonnull align 8 dereferenceable(144) %146)
  %147 = load double, ptr %16, align 8, !tbaa !9
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %25, double noundef %147)
  call void @_ZN8R3Viewer15TranslateCameraERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(168) %26, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %148

148:                                              ; preds = %139, %115
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z11RNIsNotZerodd(double noundef, double noundef) #3

declare noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Viewer15RotateCameraYawEd(ptr noundef nonnull align 8 dereferenceable(168), double noundef) #3 align 2

declare noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Viewer16RotateCameraRollEd(ptr noundef nonnull align 8 dereferenceable(168), double noundef) #3 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, 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] }

@RN_EPSILON = external local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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 #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Viewer15TranslateCameraERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8R3Viewer9FlyCameraEddddiiiiii(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10) unnamed_addr #5 align 2 {
  %12 = alloca %class.R3Vector, align 8
  %13 = alloca %class.R3Vector, align 8
  %14 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %15 = tail call noundef i32 @_Z11RNIsNotZerodd(double noundef %1, double noundef %14)
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %20, label %16

16:                                               ; preds = %11
  %17 = load ptr, ptr %0, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = load ptr, ptr %18, align 8
  tail call void %19(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %1, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10)
  br label %20

20:                                               ; preds = %16, %11
  %21 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %22 = tail call noundef i32 @_Z11RNIsNotZerodd(double noundef %2, double noundef %21)
  %.not29 = icmp eq i32 %22, 0
  br i1 %.not29, label %27, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr %0, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %24, i64 40
  %26 = load ptr, ptr %25, align 8
  tail call void %26(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %2, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10)
  br label %41

27:                                               ; preds = %20
  %.not30 = icmp eq i32 %5, 0
  br i1 %.not30, label %41, label %28

28:                                               ; preds = %27
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = tail call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %29)
  %31 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %32 = tail call noundef i32 @_Z11RNIsNotZerodd(double noundef %30, double noundef %31)
  %.not31 = icmp eq i32 %32, 0
  br i1 %.not31, label %41, label %33

33:                                               ; preds = %28
  %34 = tail call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %29)
  %35 = tail call noundef i32 @_Z8RNIsZerodd(double noundef %34, double noundef 5.000000e-03)
  %.not32 = icmp eq i32 %35, 0
  %36 = tail call noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144) %29)
  br i1 %.not32, label %39, label %37

37:                                               ; preds = %33
  %38 = fneg double %36
  tail call void @_ZN8R3Viewer15RotateCameraYawEd(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %38)
  br label %41

39:                                               ; preds = %33
  %40 = fmul double %36, -5.000000e-02
  tail call void @_ZN8R3Viewer15RotateCameraYawEd(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %40)
  br label %41

41:                                               ; preds = %27, %28, %39, %37, %23
  %42 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %43 = tail call noundef i32 @_Z11RNIsNotZerodd(double noundef %3, double noundef %42)
  %.not33 = icmp eq i32 %43, 0
  br i1 %.not33, label %48, label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr %0, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %45, i64 48
  %47 = load ptr, ptr %46, align 8
  tail call void %47(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %3, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10)
  br label %62

48:                                               ; preds = %41
  %.not34 = icmp eq i32 %6, 0
  br i1 %.not34, label %62, label %49

49:                                               ; preds = %48
  %50 = getelementptr inbounds i8, ptr %0, i64 8
  %51 = tail call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %50)
  %52 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %53 = tail call noundef i32 @_Z11RNIsNotZerodd(double noundef %51, double noundef %52)
  %.not35 = icmp eq i32 %53, 0
  br i1 %.not35, label %62, label %54

54:                                               ; preds = %49
  %55 = tail call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %50)
  %56 = fcmp olt double %55, 1.000000e-02
  %57 = tail call noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144) %50)
  br i1 %56, label %58, label %60

58:                                               ; preds = %54
  %59 = fneg double %57
  tail call void @_ZN8R3Viewer16RotateCameraRollEd(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %59)
  br label %62

60:                                               ; preds = %54
  %61 = fmul double %57, -5.000000e-02
  tail call void @_ZN8R3Viewer16RotateCameraRollEd(ptr noundef nonnull align 8 dereferenceable(168) %0, double noundef %61)
  br label %62

62:                                               ; preds = %48, %49, %60, %58, %44
  %63 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %64 = tail call noundef i32 @_Z11RNIsNotZerodd(double noundef %4, double noundef %63)
  %.not36 = icmp eq i32 %64, 0
  br i1 %.not36, label %83, label %65

65:                                               ; preds = %62
  %66 = shl nsw i32 %7, 1
  %67 = getelementptr inbounds i8, ptr %0, i64 152
  %68 = tail call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %67)
  %69 = sub nsw i32 %66, %68
  %70 = sitofp i32 %69 to double
  %71 = tail call noundef i32 @_ZNK10R2Viewport5WidthEv(ptr noundef nonnull align 4 dereferenceable(16) %67)
  %72 = sitofp i32 %71 to double
  %73 = fdiv double %70, %72
  %74 = fcmp ogt double %73, 1.000000e+00
  br i1 %74, label %78, label %75

75:                                               ; preds = %65
  %76 = fcmp olt double %73, -1.000000e+00
  br i1 %76, label %77, label %78

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %65, %75, %77
  %.0 = phi double [ -1.000000e+00, %77 ], [ %73, %75 ], [ 1.000000e+00, %65 ]
  %79 = fneg double %.0
  %80 = tail call double @llvm.fmuladd.f64(double %79, double %.0, double 1.000000e+00)
  %81 = fmul double %80, %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #6
  %82 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZNK8R3Camera7TowardsEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(144) %82)
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %13, double noundef %81)
  call void @_ZN8R3Viewer15TranslateCameraERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  br label %83

83:                                               ; preds = %78, %62
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z11RNIsNotZerodd(double noundef, double noundef) local_unnamed_addr #3

declare noundef double @_ZNK8R3Camera3YawEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Viewer15RotateCameraYawEd(ptr noundef nonnull align 8 dereferenceable(168), double noundef) local_unnamed_addr #3 align 2

declare noundef double @_ZNK8R3Camera4RollEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Viewer16RotateCameraRollEd(ptr noundef nonnull align 8 dereferenceable(168), double noundef) local_unnamed_addr #3 align 2

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

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

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


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