	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function guillemot_read_packet
_guillemot_read_packet:                 ## @guillemot_read_packet
	.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	%rsi, %r12
	movq	%rdi, %r14
	movq	_GUILLEMOT_MAX_LENGTH@GOTPCREL(%rip), %rdx
	cmpl	$0, (%rdx)
	jle	LBB0_3
## %bb.1:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movb	$0, (%r12,%rax)
	incq	%rax
	movslq	(%rdx), %rcx
	cmpq	%rcx, %rax
	jl	LBB0_2
LBB0_3:
	movq	_GUILLEMOT_MAX_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gameport_time
	movl	%eax, %r13d
	movq	_GUILLEMOT_MAX_STROBE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gameport_time
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	callq	_local_irq_save
	movq	%r14, %rdi
	callq	_gameport_trigger
	movq	%r14, %rdi
	callq	_gameport_read
	xorl	%ebx, %ebx
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.4:
	movl	%eax, %r15d
	movq	_GUILLEMOT_MAX_LENGTH@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_gameport_read
	notb	%r15b
	andb	%al, %r15b
	testb	$16, %r15b
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, %ecx
	shrb	$5, %cl
	andb	$1, %cl
	movzbl	%cl, %edx
	movl	%ebx, %ecx
	andb	$7, %cl
	shll	%cl, %edx
	movl	%ebx, %ecx
	sarl	$3, %ecx
	movslq	%ecx, %rcx
	orb	%dl, (%r12,%rcx)
	incl	%ebx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_6 Depth=1
	decl	%r13d
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	testl	%r13d, %r13d
	movq	_GUILLEMOT_MAX_LENGTH@GOTPCREL(%rip), %rcx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	(%rcx), %ecx
	shll	$3, %ecx
	movl	%eax, %r15d
	cmpl	%ecx, %ebx
	jl	LBB0_6
LBB0_11:
	callq	_local_irq_restore
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GUILLEMOT_MAX_LENGTH,4,2       ## @GUILLEMOT_MAX_LENGTH
	.comm	_GUILLEMOT_MAX_START,4,2        ## @GUILLEMOT_MAX_START
	.comm	_GUILLEMOT_MAX_STROBE,4,2       ## @GUILLEMOT_MAX_STROBE
	.no_dead_strip	_guillemot_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function guillemot_read_packet
_guillemot_read_packet:                 ; @guillemot_read_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _GUILLEMOT_MAX_LENGTH@GOTPAGE
Lloh1:
	ldr	x25, [x25, _GUILLEMOT_MAX_LENGTH@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x8, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	strb	wzr, [x19, x8]
	add	x8, x8, #1
	ldrsw	x9, [x25]
	cmp	x8, x9
	b.lt	LBB0_2
LBB0_3:
Lloh2:
	adrp	x8, _GUILLEMOT_MAX_START@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GUILLEMOT_MAX_START@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_gameport_time
	mov	x22, x0
Lloh5:
	adrp	x8, _GUILLEMOT_MAX_STROBE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GUILLEMOT_MAX_STROBE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_gameport_time
	mov	x21, x0
	bl	_local_irq_save
	mov	x0, x20
	bl	_gameport_trigger
	mov	x0, x20
	bl	_gameport_read
	ldr	w8, [x25]
	cmp	w22, #0
	ccmp	w8, #1, #8, ne
	b.ge	LBB0_5
; %bb.4:
	mov	w23, #0
	b	LBB0_10
LBB0_5:
	mov	x24, x0
	mov	w23, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_gameport_read
	bic	w8, w0, w24
	tbz	w8, #4, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ubfx	w8, w0, #5, #1
	and	w9, w23, #0x7
	sbfx	x10, x23, #3, #29
	ldrb	w11, [x19, x10]
	lsl	w8, w8, w9
	orr	w8, w11, w8
	strb	w8, [x19, x10]
	add	w23, w23, #1
	mov	x22, x21
	cbnz	w22, LBB0_9
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	sub	w22, w22, #1
	cbz	w22, LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x25]
	lsl	w8, w8, #3
	mov	x24, x0
	cmp	w23, w8
	b.lt	LBB0_6
LBB0_10:
	bl	_local_irq_restore
	mov	x0, x23
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_GUILLEMOT_MAX_LENGTH,4,2       ; @GUILLEMOT_MAX_LENGTH
	.comm	_GUILLEMOT_MAX_START,4,2        ; @GUILLEMOT_MAX_START
	.comm	_GUILLEMOT_MAX_STROBE,4,2       ; @GUILLEMOT_MAX_STROBE
	.no_dead_strip	_guillemot_read_packet
.subsections_via_symbols
