	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function calculate_orientation
LCPI0_0:
	.long	0xbf800000                      ## float -1
LCPI0_1:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_calculate_orientation
	.p2align	4, 0x90
_calculate_orientation:                 ## @calculate_orientation
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %rbx
	movl	$0, (%rdx)
	cvtsi2ssl	(%rdi), %xmm0
	cvtsi2ssl	4(%rdi), %xmm4
	movl	%ecx, %r15d
	movq	%rsi, %r12
	cvtsi2ssq	8(%rdi), %xmm1
	movq	8(%rsi), %rdi
	cvtsi2ss	%rdi, %xmm3
	movq	24(%rbx), %rax
	cvtsi2ss	%rax, %xmm2
	subss	%xmm2, %xmm3
	xorps	%xmm2, %xmm2
	cvtsi2ssq	(%rsi), %xmm2
	divss	%xmm0, %xmm3
	xorps	%xmm0, %xmm0
	cvtsi2ssq	16(%rbx), %xmm0
	subss	%xmm0, %xmm2
	xorps	%xmm0, %xmm0
	cvtsi2ssq	16(%rsi), %xmm0
	divss	%xmm4, %xmm2
	xorps	%xmm4, %xmm4
	cvtsi2ssq	32(%rbx), %xmm4
	subss	%xmm4, %xmm0
	movss	LCPI0_0(%rip), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	ucomiss	%xmm3, %xmm4
	movaps	%xmm4, %xmm5
	ja	LBB0_3
## %bb.1:
	ucomiss	LCPI0_1(%rip), %xmm3
	movaps	%xmm3, %xmm5
	jbe	LBB0_3
## %bb.2:
	movss	LCPI0_1(%rip), %xmm5            ## xmm5 = mem[0],zero,zero,zero
LBB0_3:
	divss	%xmm1, %xmm0
	ucomiss	%xmm2, %xmm4
	movaps	%xmm4, %xmm1
	ja	LBB0_6
## %bb.4:
	ucomiss	LCPI0_1(%rip), %xmm2
	movaps	%xmm2, %xmm1
	jbe	LBB0_6
## %bb.5:
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
LBB0_6:
	movss	%xmm5, -40(%rbp)                ## 4-byte Spill
	movss	%xmm1, -44(%rbp)                ## 4-byte Spill
	ucomiss	%xmm0, %xmm4
	ja	LBB0_9
## %bb.7:
	ucomiss	LCPI0_1(%rip), %xmm0
	movaps	%xmm0, %xmm4
	jbe	LBB0_9
## %bb.8:
	movss	LCPI0_1(%rip), %xmm4            ## xmm4 = mem[0],zero,zero,zero
LBB0_9:
	movss	%xmm4, -36(%rbp)                ## 4-byte Spill
	subq	%rax, %rdi
	callq	_abs
	movl	(%rbx), %ecx
	addl	$10, %ecx
	cmpl	%ecx, %eax
	jg	LBB0_12
## %bb.10:
	movss	-40(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-36(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_atan2f
	movl	%eax, %edi
	callq	_RAD_TO_DEGREE
	movss	%xmm0, -40(%rbp)                ## 4-byte Spill
	callq	_isfinite
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movss	-40(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%r14)
	movss	%xmm0, 8(%r14)
LBB0_12:
	movq	(%r12), %rdi
	subq	16(%rbx), %rdi
	callq	_abs
	movl	4(%rbx), %ecx
	addl	$10, %ecx
	cmpl	%ecx, %eax
	jg	LBB0_15
## %bb.13:
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-36(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_atan2f
	movl	%eax, %edi
	callq	_RAD_TO_DEGREE
	movss	%xmm0, -36(%rbp)                ## 4-byte Spill
	callq	_isfinite
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movss	-36(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 12(%r14)
	movss	%xmm0, 16(%r14)
LBB0_15:
	testl	%r15d, %r15d
	je	LBB0_16
## %bb.17:
	movq	_SMOOTH_ROLL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_apply_smoothing
	movq	_SMOOTH_PITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_apply_smoothing                ## TAILCALL
LBB0_16:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMOOTH_ROLL,4,2                ## @SMOOTH_ROLL
	.comm	_SMOOTH_PITCH,4,2               ## @SMOOTH_PITCH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_calculate_orientation          ; -- Begin function calculate_orientation
	.p2align	2
_calculate_orientation:                 ; @calculate_orientation
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset b8, -56
	.cfi_offset b9, -64
	.cfi_offset b10, -72
	.cfi_offset b11, -80
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	str	wzr, [x2]
	ldp	s0, s1, [x0]
	scvtf	s2, s0
	ldp	x8, x10, [x0, #8]
	scvtf	s0, x8
	ldp	x9, x8, [x1]
	scvtf	s3, x8
	scvtf	s4, x9
	ldp	x9, x11, [x0, #24]
	scvtf	s5, x9
	fsub	s3, s3, s5
	fdiv	s3, s3, s2
	scvtf	s2, x10
	ldr	x10, [x1, #16]
	scvtf	s5, x10
	scvtf	s1, s1
	fsub	s2, s4, s2
	fdiv	s1, s2, s1
	scvtf	s2, x11
	fsub	s2, s5, s2
	fmov	s8, #-1.00000000
	fcmp	s3, s8
	fmov	s10, #-1.00000000
	b.mi	LBB0_3
; %bb.1:
	fmov	s4, #1.00000000
	fcmp	s3, s4
	fmov	s10, s3
	b.le	LBB0_3
; %bb.2:
	fmov	s10, #1.00000000
LBB0_3:
	fcmp	s1, s8
	fdiv	s0, s2, s0
	b.mi	LBB0_6
; %bb.4:
	fmov	s2, #1.00000000
	fcmp	s1, s2
	fmov	s8, s1
	b.le	LBB0_6
; %bb.5:
	fmov	s8, #1.00000000
LBB0_6:
	fmov	s9, #-1.00000000
	fcmp	s0, s9
	b.mi	LBB0_9
; %bb.7:
	fmov	s1, #1.00000000
	fcmp	s0, s1
	fmov	s9, s0
	b.le	LBB0_9
; %bb.8:
	fmov	s9, #1.00000000
LBB0_9:
	sub	x0, x8, x9
	bl	_abs
	ldr	w8, [x20]
	add	w8, w8, #10
	cmp	w0, w8
	b.gt	LBB0_12
; %bb.10:
	fmov	s0, s10
	fmov	s1, s9
	bl	_atan2f
	bl	_RAD_TO_DEGREE
	fmov	s10, s0
	bl	_isfinite
	cbz	x0, LBB0_12
; %bb.11:
	stp	s10, s10, [x19, #4]
LBB0_12:
	ldr	x8, [x22]
	ldr	x9, [x20, #16]
	sub	x0, x8, x9
	bl	_abs
	ldr	w8, [x20, #4]
	add	w8, w8, #10
	cmp	w0, w8
	b.gt	LBB0_15
; %bb.13:
	fmov	s0, s8
	fmov	s1, s9
	bl	_atan2f
	bl	_RAD_TO_DEGREE
	fmov	s8, s0
	bl	_isfinite
	cbz	x0, LBB0_15
; %bb.14:
	stp	s8, s8, [x19, #12]
LBB0_15:
	cbz	w21, LBB0_17
; %bb.16:
Lloh0:
	adrp	x8, _SMOOTH_ROLL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMOOTH_ROLL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_apply_smoothing
Lloh3:
	adrp	x8, _SMOOTH_PITCH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SMOOTH_PITCH@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #80             ; 16-byte Folded Reload
	b	_apply_smoothing
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SMOOTH_ROLL,4,2                ; @SMOOTH_ROLL
	.comm	_SMOOTH_PITCH,4,2               ; @SMOOTH_PITCH
.subsections_via_symbols
