	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function guillemot_poll
_guillemot_poll:                        ## @guillemot_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_gameport_get_drvdata
	movq	%rax, %r12
	movq	24(%rax), %r14
	movq	_GUILLEMOT_MAX_LENGTH@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	incl	16(%r12)
	movl	12(%r12), %edi
	movq	%r15, %rsi
	callq	_guillemot_read_packet
	movl	(%rbx), %ecx
	shll	$3, %ecx
	cmpl	%ecx, %eax
	jne	LBB0_17
## %bb.1:
	cmpl	$85, (%r15)
	jne	LBB0_17
## %bb.2:
	cmpl	$170, 64(%r15)
	jne	LBB0_17
## %bb.3:
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	(%rcx), %rsi
	testq	%rsi, %rsi
	js	LBB0_10
## %bb.4:
	movl	20(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	8(%rcx), %rsi
	testq	%rsi, %rsi
	js	LBB0_10
## %bb.5:
	movl	24(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	16(%rcx), %rsi
	testq	%rsi, %rsi
	js	LBB0_10
## %bb.6:
	movl	28(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	24(%rcx), %rsi
	testq	%rsi, %rsi
	js	LBB0_10
## %bb.7:
	movl	32(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	32(%rcx), %rsi
	testq	%rsi, %rsi
	js	LBB0_10
## %bb.8:
	movl	36(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	40(%rcx), %rsi
	testq	%rsi, %rsi
	js	LBB0_10
## %bb.9:
	movl	40(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r12), %rax
LBB0_10:
	cmpq	$0, 16(%rax)
	je	LBB0_12
## %bb.11:
	movq	_ABS_HAT0X@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_guillemot_hat_to_axis@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movl	16(%r15), %ecx
	sarl	$4, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,8), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	_ABS_HAT0Y@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	(%rbx), %rax
	movl	16(%r15), %ecx
	sarl	$4, %ecx
	movslq	%ecx, %rcx
	movl	4(%rax,%rcx,8), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
LBB0_12:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movq	(%rax,%rbx,8), %rsi
	testq	%rsi, %rsi
	js	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ebx, %eax
	shrl	$3, %eax
	movl	8(%r15,%rax,4), %eax
	movl	%ebx, %ecx
	andb	$7, %cl
	movzbl	%cl, %ecx
	xorl	%edx, %edx
	btl	%ecx, %eax
	setb	%dl
	movq	%r14, %rdi
	callq	_input_report_key
	incq	%rbx
	cmpq	$16, %rbx
	jne	LBB0_13
	jmp	LBB0_15
LBB0_17:
	incl	8(%r12)
LBB0_15:
	movq	%r14, %rdi
	callq	_input_sync
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_18
## %bb.16:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_GUILLEMOT_MAX_LENGTH,4,2       ## @GUILLEMOT_MAX_LENGTH
	.comm	_ABS_HAT0X,8,3                  ## @ABS_HAT0X
	.comm	_guillemot_hat_to_axis,8,3      ## @guillemot_hat_to_axis
	.comm	_ABS_HAT0Y,8,3                  ## @ABS_HAT0Y
	.no_dead_strip	_guillemot_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function guillemot_poll
_guillemot_poll:                        ; @guillemot_poll
	.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
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_gameport_get_drvdata
	mov	x20, x0
	ldr	x19, [x0, #24]
Lloh3:
	adrp	x22, _GUILLEMOT_MAX_LENGTH@GOTPAGE
Lloh4:
	ldr	x22, [x22, _GUILLEMOT_MAX_LENGTH@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldp	w0, w8, [x0, #12]
	add	w8, w8, #1
	str	w8, [x20, #16]
	mov	x1, x21
	bl	_guillemot_read_packet
	ldr	w8, [x22]
	cmp	w0, w8, lsl #3
	b.ne	LBB0_15
; %bb.1:
	ldr	w8, [x21]
	cmp	w8, #85
	b.ne	LBB0_15
; %bb.2:
	ldr	w8, [x21, #64]
	cmp	w8, #170
	b.ne	LBB0_15
; %bb.3:
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	x1, [x9]
	tbnz	x1, #63, LBB0_10
; %bb.4:
	ldr	w2, [x21, #20]
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	x1, [x9, #8]
	tbnz	x1, #63, LBB0_10
; %bb.5:
	ldr	w2, [x21, #24]
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	x1, [x9, #16]
	tbnz	x1, #63, LBB0_10
; %bb.6:
	ldr	w2, [x21, #28]
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	x1, [x9, #24]
	tbnz	x1, #63, LBB0_10
; %bb.7:
	ldr	w2, [x21, #32]
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	x1, [x9, #32]
	tbnz	x1, #63, LBB0_10
; %bb.8:
	ldr	w2, [x21, #36]
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	x1, [x9, #40]
	tbnz	x1, #63, LBB0_10
; %bb.9:
	ldr	w2, [x21, #40]
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x20]
LBB0_10:
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_12
; %bb.11:
Lloh7:
	adrp	x8, _ABS_HAT0X@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ABS_HAT0X@GOTPAGEOFF]
Lloh9:
	ldr	x1, [x8]
Lloh10:
	adrp	x22, _guillemot_hat_to_axis@GOTPAGE
Lloh11:
	ldr	x22, [x22, _guillemot_hat_to_axis@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w9, [x21, #16]
	asr	w9, w9, #4
	sbfiz	x9, x9, #3, #32
	ldr	w2, [x8, x9]
	mov	x0, x19
	bl	_input_report_abs
Lloh12:
	adrp	x8, _ABS_HAT0Y@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ABS_HAT0Y@GOTPAGEOFF]
Lloh14:
	ldr	x1, [x8]
	ldr	x8, [x22]
	ldr	w9, [x21, #16]
	asr	w9, w9, #4
	add	x8, x8, w9, sxtw #3
	ldr	w2, [x8, #4]
	mov	x0, x19
	bl	_input_report_abs
LBB0_12:
	mov	x22, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	x1, [x8, x22, lsl #3]
	tbnz	x1, #63, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ubfx	x8, x22, #3, #29
	add	w8, w8, #2
	ldr	w8, [x21, w8, uxtw #2]
	and	w9, w22, #0x7
	lsr	w8, w8, w9
	and	w2, w8, #0x1
	mov	x0, x19
	bl	_input_report_key
	add	x22, x22, #1
	cmp	x22, #16
	b.ne	LBB0_13
	b	LBB0_16
LBB0_15:
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	str	w8, [x20, #8]
LBB0_16:
	mov	x0, x19
	bl	_input_sync
	ldur	x8, [x29, #-40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	sub	sp, x29, #32
	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
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GUILLEMOT_MAX_LENGTH,4,2       ; @GUILLEMOT_MAX_LENGTH
	.comm	_ABS_HAT0X,8,3                  ; @ABS_HAT0X
	.comm	_guillemot_hat_to_axis,8,3      ; @guillemot_hat_to_axis
	.comm	_ABS_HAT0Y,8,3                  ; @ABS_HAT0Y
	.no_dead_strip	_guillemot_poll
.subsections_via_symbols
