	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function calc_joystick_state
LCPI0_0:
	.long	0xbf800000                      ## float -1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_calc_joystick_state
	.p2align	4, 0x90
_calc_joystick_state:                   ## @calc_joystick_state
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movss	16(%rdi), %xmm2                 ## xmm2 = mem[0],zero,zero,zero
	xorps	%xmm4, %xmm4
	ucomiss	%xmm0, %xmm2
	xorps	%xmm3, %xmm3
	jne	LBB0_1
	jnp	LBB0_5
LBB0_1:
	ucomiss	%xmm2, %xmm0
	jae	LBB0_2
## %bb.3:
	movss	8(%rbx), %xmm3                  ## xmm3 = mem[0],zero,zero,zero
	subss	%xmm3, %xmm0
	subss	%xmm3, %xmm2
	divss	%xmm2, %xmm0
	addss	LCPI0_0(%rip), %xmm0
	jmp	LBB0_4
LBB0_2:
	subss	%xmm2, %xmm0
	movss	24(%rbx), %xmm3                 ## xmm3 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm3
	divss	%xmm3, %xmm0
LBB0_4:
	movaps	%xmm0, %xmm3
LBB0_5:
	movss	20(%rbx), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jne	LBB0_6
	jnp	LBB0_10
LBB0_6:
	ucomiss	%xmm0, %xmm1
	jae	LBB0_7
## %bb.8:
	movss	12(%rbx), %xmm2                 ## xmm2 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm1
	subss	%xmm2, %xmm0
	divss	%xmm0, %xmm1
	addss	LCPI0_0(%rip), %xmm1
	jmp	LBB0_9
LBB0_7:
	subss	%xmm0, %xmm1
	movss	28(%rbx), %xmm2                 ## xmm2 = mem[0],zero,zero,zero
	subss	%xmm0, %xmm2
	divss	%xmm2, %xmm1
LBB0_9:
	movaps	%xmm1, %xmm4
LBB0_10:
	movss	%xmm4, -16(%rbp)                ## 4-byte Spill
	movaps	%xmm3, %xmm0
	movaps	%xmm4, %xmm1
	movss	%xmm3, -12(%rbp)                ## 4-byte Spill
	callq	_atan2f
	movl	%eax, %edi
	callq	_RAD_TO_DEGREE
	movl	%eax, 4(%rbx)
	movss	-12(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	-16(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_hypotf
	movl	%eax, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_calc_joystick_state            ; -- Begin function calc_joystick_state
	.p2align	2
_calc_joystick_state:                   ; @calc_joystick_state
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-48]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset b8, -40
	.cfi_offset b9, -48
	mov	x19, x0
	ldr	s2, [x0, #16]
	movi	d8, #0000000000000000
	fcmp	s2, s0
	movi	d9, #0000000000000000
	b.eq	LBB0_4
; %bb.1:
	b.ls	LBB0_3
; %bb.2:
	ldr	s3, [x19, #8]
	fsub	s0, s0, s3
	fsub	s2, s2, s3
	fdiv	s0, s0, s2
	fmov	s2, #-1.00000000
	fadd	s9, s0, s2
	b	LBB0_4
LBB0_3:
	fsub	s0, s0, s2
	ldr	s3, [x19, #24]
	fsub	s2, s3, s2
	fdiv	s9, s0, s2
LBB0_4:
	ldr	s0, [x19, #20]
	fcmp	s0, s1
	b.eq	LBB0_8
; %bb.5:
	b.ls	LBB0_7
; %bb.6:
	ldr	s2, [x19, #12]
	fsub	s1, s1, s2
	fsub	s0, s0, s2
	fdiv	s0, s1, s0
	fmov	s1, #-1.00000000
	fadd	s8, s0, s1
	b	LBB0_8
LBB0_7:
	fsub	s1, s1, s0
	ldr	s2, [x19, #28]
	fsub	s0, s2, s0
	fdiv	s8, s1, s0
LBB0_8:
	fmov	s0, s9
	fmov	s1, s8
	bl	_atan2f
	bl	_RAD_TO_DEGREE
	str	w0, [x19, #4]
	fmov	s0, s9
	fmov	s1, s8
	bl	_hypotf
	str	w0, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #48               ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
