	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function joydev_fetch_next_event
_joydev_fetch_next_event:               ## @joydev_fetch_next_event
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movl	(%rbx), %eax
	movslq	4(%rbx), %rcx
	cmpl	%ecx, %eax
	je	LBB0_2
## %bb.1:
	movq	16(%rbx), %rdx
	leal	1(%rcx), %esi
	movl	%esi, 4(%rbx)
	movl	(%rdx,%rcx,4), %edx
	movl	%edx, (%r15)
	movq	_JOYDEV_BUFFER_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	decl	%edx
	andl	%edx, 4(%rbx)
LBB0_2:
	xorl	%ebx, %ebx
	cmpl	%ecx, %eax
	setne	%bl
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JOYDEV_BUFFER_SIZE,4,2         ## @JOYDEV_BUFFER_SIZE
	.no_dead_strip	_joydev_fetch_next_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function joydev_fetch_next_event
_joydev_fetch_next_event:               ; @joydev_fetch_next_event
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [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 w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_spin_lock_irq
	ldp	w8, w9, [x20]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	cmp	w8, w9
	b.eq	LBB0_2
; %bb.1:
	ldr	x10, [x20, #16]
	add	w11, w9, #1
	str	w11, [x20, #4]
	ldr	w10, [x10, x9, lsl #2]
Lloh0:
	adrp	x11, _JOYDEV_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x11, [x11, _JOYDEV_BUFFER_SIZE@GOTPAGEOFF]
	str	w10, [x21]
Lloh2:
	ldr	w10, [x11]
	sub	w10, w10, #1
	ldr	w11, [x20, #4]
	and	w10, w11, w10
	str	w10, [x20, #4]
LBB0_2:
	cmp	w8, w9
	cset	w20, ne
	mov	x0, x19
	bl	_spin_unlock_irq
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_JOYDEV_BUFFER_SIZE,4,2         ; @JOYDEV_BUFFER_SIZE
	.no_dead_strip	_joydev_fetch_next_event
.subsections_via_symbols
