	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function LinuxJoyScan
_LinuxJoyScan:                          ## @LinuxJoyScan
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	cmpl	$-1, %edi
	je	LBB0_7
## %bb.1:
	leaq	-32(%rbp), %rsi
	movl	$24, %edx
	callq	_read
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	-32(%rbp), %rax
	movq	_JS_EVENT_AXIS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movq	-24(%rbp), %rax
	cmpq	8(%rbx), %rax
	jae	LBB0_7
## %bb.4:
	movq	16(%rbx), %rcx
	movl	(%rcx,%rax,4), %eax
	movl	-16(%rbp), %ecx
	movl	%eax, %edx
	subl	%ecx, %edx
	movl	%edx, %esi
	negl	%esi
	cmovsl	%edx, %esi
	movq	_THRESHOLD@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %esi
	jge	LBB0_5
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_5:
	xorl	%edx, %edx
	cmpl	%ecx, %eax
	setle	%dl
	leal	(%rdx,%rdx), %eax
	decl	%eax
	movl	%eax, -16(%rbp)
LBB0_6:
	movq	-16(%rbp), %rax
	movq	%rax, 16(%rsp)
	movups	-32(%rbp), %xmm0
	movups	%xmm0, (%rsp)
	callq	_PACKEVENT
LBB0_8:
	addq	$56, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JS_EVENT_AXIS,8,3              ## @JS_EVENT_AXIS
	.comm	_THRESHOLD,4,2                  ## @THRESHOLD
	.no_dead_strip	_LinuxJoyScan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function LinuxJoyScan
_LinuxJoyScan:                          ; @LinuxJoyScan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	ldr	w0, [x0]
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.1:
	add	x1, sp, #24
	mov	w2, #24
	bl	_read
	cbz	x0, LBB0_8
; %bb.2:
	ldr	x8, [sp, #24]
Lloh0:
	adrp	x9, _JS_EVENT_AXIS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _JS_EVENT_AXIS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [sp, #32]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.hs	LBB0_5
; %bb.4:
	ldr	x9, [x19, #16]
	ldr	w8, [x9, x8, lsl #2]
	ldr	w9, [sp, #40]
	subs	w10, w8, w9
	cneg	w10, w10, mi
Lloh3:
	adrp	x11, _THRESHOLD@GOTPAGE
Lloh4:
	ldr	x11, [x11, _THRESHOLD@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	cmp	w10, w11
	b.ge	LBB0_6
LBB0_5:
	mov	w0, #0
	b	LBB0_8
LBB0_6:
	cmp	w8, w9
	mov	w8, #-1
	cneg	w8, w8, le
	str	w8, [sp, #40]
LBB0_7:
	ldur	q0, [sp, #24]
	str	q0, [sp]
	ldr	x8, [sp, #40]
	str	x8, [sp, #16]
	mov	x0, sp
	bl	_PACKEVENT
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_JS_EVENT_AXIS,8,3              ; @JS_EVENT_AXIS
	.comm	_THRESHOLD,4,2                  ; @THRESHOLD
	.no_dead_strip	_LinuxJoyScan
.subsections_via_symbols
