	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grip_gpp_read_packet
_grip_gpp_read_packet:                  ## @grip_gpp_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	_GRIP_STROBE_GPP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_gameport_time
	movl	%eax, %r12d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$0, (%rbx)
	callq	_local_irq_save
	movq	%r13, %rdi
	callq	_gameport_read
	movl	%eax, %r14d
	movl	%r15d, %ecx
	sarl	%cl, %r14d
	xorl	%ebx, %ebx
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_gameport_read
	movl	%r15d, %ecx
	sarl	%cl, %eax
	movl	%eax, %edx
	andl	$3, %edx
	movl	%edx, %ecx
	notl	%ecx
	andb	$1, %r14b
	movzbl	%r14b, %esi
	testl	%ecx, %esi
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	shrl	%edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	leal	1(%rbx), %ecx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	orl	%edx, (%rsi)
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	%ecx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	decl	%r12d
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_GRIP_LENGTH_GPP@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jge	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	andb	$3, %al
	movl	%eax, %r14d
	testl	%r12d, %r12d
	jne	LBB0_1
LBB0_6:
	callq	_local_irq_restore
	movq	_GRIP_LENGTH_GPP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$-1, %eax
	cmpl	%ecx, %ebx
	jl	LBB0_13
## %bb.7:
	testl	%ecx, %ecx
	jle	LBB0_8
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %esi
	andl	$16663056, %esi                 ## imm = 0xFE4210
	cmpl	$8126464, %esi                  ## imm = 0x7C0000
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, %esi
	shrl	%esi
	andl	$1, %eax
	decb	%cl
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	orl	%esi, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	incl	%edx
	movq	_GRIP_LENGTH_GPP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %edx
	jl	LBB0_10
	jmp	LBB0_12
LBB0_8:
	xorl	%edx, %edx
LBB0_12:
	xorl	%eax, %eax
	cmpl	%ecx, %edx
	sete	%al
	negl	%eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRIP_STROBE_GPP,4,2            ## @GRIP_STROBE_GPP
	.comm	_GRIP_LENGTH_GPP,4,2            ## @GRIP_LENGTH_GPP
	.no_dead_strip	_grip_gpp_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grip_gpp_read_packet
_grip_gpp_read_packet:                  ; @grip_gpp_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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _GRIP_STROBE_GPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRIP_STROBE_GPP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_gameport_time
	mov	x22, x0
	str	wzr, [x19]
	bl	_local_irq_save
	mov	x0, x21
	bl	_gameport_read
	mov	w24, #0
	asr	w26, w0, w20
Lloh3:
	adrp	x23, _GRIP_LENGTH_GPP@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GRIP_LENGTH_GPP@GOTPAGEOFF]
	mov	x25, x22
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	lsr	w9, w8, #1
	lsl	w9, w9, w24
	add	w24, w24, #1
	ldr	w10, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
	mov	x25, x22
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x23]
	cmp	w24, w9
	ccmp	w25, #0, #4, lt
	mov	x26, x8
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_gameport_read
	asr	w9, w0, w20
	and	w8, w9, #0x3
	bic	w9, w26, w9
	tbnz	w9, #0, LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w25, w25, #1
	b	LBB0_2
LBB0_5:
	bl	_local_irq_restore
	ldr	w8, [x23]
	cmp	w24, w8
	b.ge	LBB0_7
; %bb.6:
	mov	w0, #-1
	b	LBB0_13
LBB0_7:
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.8:
	mov	w9, #0
	ldr	w10, [x19]
	mov	w11, #16912
	movk	w11, #254, lsl #16
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	and	w12, w10, w11
	cmp	w12, #1984, lsl #12             ; =8126464
	b.eq	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	and	w12, w10, #0x1
	sub	w8, w8, #1
	lsl	w8, w12, w8
	orr	w10, w8, w10, lsr #1
	str	w10, [x19]
	add	w9, w9, #1
	ldr	w8, [x23]
	cmp	w9, w8
	b.lt	LBB0_9
	b	LBB0_12
LBB0_11:
	mov	w9, #0
LBB0_12:
	cmp	w9, w8
	csetm	w0, eq
LBB0_13:
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GRIP_STROBE_GPP,4,2            ; @GRIP_STROBE_GPP
	.comm	_GRIP_LENGTH_GPP,4,2            ; @GRIP_LENGTH_GPP
	.no_dead_strip	_grip_gpp_read_packet
.subsections_via_symbols
