	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alps_poll
_alps_poll:                             ## @alps_poll
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	16(%rdi), %rbx
	movq	_ALPS_PASS@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_alps_passthrough_mode_v2
LBB0_2:
	leaq	12(%r13), %r14
	movq	_PSMOUSE_CMD_POLL@GOTPCREL(%rip), %rax
	movl	(%r13), %edx
	shll	$8, %edx
	orl	(%rax), %edx
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ps2_command
	movq	%rax, %r12
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_alps_passthrough_mode_v2
LBB0_4:
	movl	$-1, %r15d
	testq	%r12, %r12
	js	LBB0_9
## %bb.5:
	movb	4(%rbx), %al
	andb	-44(%rbp), %al
	cmpb	5(%rbx), %al
	jne	LBB0_9
## %bb.6:
	movl	$200, %eax
	andl	4(%r13), %eax
	cmpl	$8, %eax
	jne	LBB0_8
## %bb.7:
	movl	$768, %edx                      ## imm = 0x300
	movq	_PSMOUSE_CMD_POLL@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_9
LBB0_8:
	movl	8(%r13), %edi
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	xorl	%r15d, %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ALPS_PASS,4,2                  ## @ALPS_PASS
	.comm	_PSMOUSE_CMD_POLL,4,2           ## @PSMOUSE_CMD_POLL
	.no_dead_strip	_alps_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alps_poll
_alps_poll:                             ; @alps_poll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [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 w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x22, [x0, #16]
	ldr	w8, [x22]
Lloh0:
	adrp	x24, _ALPS_PASS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ALPS_PASS@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_alps_passthrough_mode_v2
LBB0_2:
	mov	x20, x19
	ldr	w8, [x20], #12
Lloh2:
	adrp	x23, _PSMOUSE_CMD_POLL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PSMOUSE_CMD_POLL@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w2, w9, w8, lsl #8
	add	x1, sp, #12
	mov	x0, x20
	bl	_ps2_command
	mov	x21, x0
	ldr	w8, [x22]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_alps_passthrough_mode_v2
LBB0_4:
	tbnz	x21, #63, LBB0_8
; %bb.5:
	ldrb	w8, [sp, #12]
	ldrb	w9, [x22, #4]
	and	w8, w9, w8
	ldrb	w9, [x22, #5]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	ldr	w8, [x19, #4]
	mov	w9, #200
	and	w8, w8, w9
	cmp	w8, #8
	b.ne	LBB0_9
; %bb.7:
	ldr	w8, [x23]
	orr	w2, w8, #0x300
	add	x1, sp, #12
	mov	x0, x20
	bl	_ps2_command
	cbz	x0, LBB0_9
LBB0_8:
	mov	w0, #-1
	b	LBB0_10
LBB0_9:
	ldr	w0, [x19, #8]
	add	x1, sp, #12
	mov	w2, #4
	bl	_memcpy
	mov	w0, #0
LBB0_10:
	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	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_ALPS_PASS,4,2                  ; @ALPS_PASS
	.comm	_PSMOUSE_CMD_POLL,4,2           ; @PSMOUSE_CMD_POLL
	.no_dead_strip	_alps_poll
.subsections_via_symbols
