	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmdc_poll
_tmdc_poll:                             ## @tmdc_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, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_TMDC_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	(%r15,%r15), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%rbx, %rdi
	callq	_gameport_get_drvdata
	movq	%rax, %rbx
	incl	20(%rax)
	movl	16(%rax), %edi
	movq	%r14, %rsi
	callq	_tmdc_read_packet
	movb	$1, %r12b
	cmpb	(%rbx), %al
	jne	LBB0_6
## %bb.1:
	movzbl	%al, %r13d
	testb	$1, %al
	jne	LBB0_3
## %bb.2:
	xorl	%r12d, %r12d
	movl	%r13d, %eax
	jmp	LBB0_4
LBB0_3:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_tmdc_parse_packet
	testq	%rax, %rax
	setne	%r12b
	movzbl	(%rbx), %eax
LBB0_4:
	andl	%eax, %r13d
	testb	$2, %r13b
	je	LBB0_6
## %bb.5:
	movq	8(%rbx), %rax
	movl	4(%rax), %edi
	addq	%r15, %r14
	movq	%r14, %rsi
	callq	_tmdc_parse_packet
	testq	%rax, %rax
	movzbl	%r12b, %eax
	movl	$1, %r12d
	cmovel	%eax, %r12d
LBB0_6:
	addb	%r12b, 1(%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TMDC_MAX_LENGTH,4,2            ## @TMDC_MAX_LENGTH
	.no_dead_strip	_tmdc_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmdc_poll
_tmdc_poll:                             ; @tmdc_poll
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	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, #-56]
Lloh3:
	adrp	x8, _TMDC_MAX_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TMDC_MAX_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	lsl	x8, x22, #1
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x3fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	bl	_gameport_get_drvdata
	mov	x19, x0
	ldp	w0, w8, [x0, #16]
	add	w8, w8, #1
	str	w8, [x19, #20]
	mov	x1, x20
	bl	_tmdc_read_packet
	ldrb	w8, [x19]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.1:
	mov	x21, x0
	tbnz	w0, #0, LBB0_4
; %bb.2:
	mov	w23, #0
	mov	x8, x21
	and	w8, w21, w8
	tbnz	w8, #1, LBB0_5
	b	LBB0_6
LBB0_3:
	mov	w23, #1
	b	LBB0_6
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_tmdc_parse_packet
	cmp	x0, #0
	cset	w23, ne
	ldrb	w8, [x19]
	and	w8, w21, w8
	tbz	w8, #1, LBB0_6
LBB0_5:
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #4]
	add	x1, x20, x22
	bl	_tmdc_parse_packet
	cmp	x0, #0
	csinc	w23, w23, wzr, eq
LBB0_6:
	ldrb	w8, [x19, #1]
	add	w8, w8, w23
	strb	w8, [x19, #1]
	ldur	x8, [x29, #-56]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_TMDC_MAX_LENGTH,4,2            ; @TMDC_MAX_LENGTH
	.no_dead_strip	_tmdc_poll
.subsections_via_symbols
