	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grip_xt_read_packet
_grip_xt_read_packet:                   ## @grip_xt_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_GRIP_STROBE_XT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_gameport_time
	movl	%eax, %r13d
	xorps	%xmm0, %xmm0
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movups	%xmm0, (%r15)
	callq	_local_irq_save
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_gameport_read
	movl	%eax, %r15d
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movl	%r14d, %ecx
	sarl	%cl, %r15d
	andb	$3, %r15b
	xorl	%r14d, %r14d
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	%r15d, %r12d
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edi, %ebx
	decl	%esi
	movl	%esi, %r13d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_gameport_read
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movl	%eax, %r8d
	andb	$3, %r8b
	movl	%r8d, %ecx
	xorb	%r15b, %cl
	je	LBB0_9
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testb	$1, %cl
	movl	%ebx, %edi
	jne	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r12d, %edx
	xorb	%r15b, %dl
	andb	%dl, %cl
	shrb	%cl
	orb	%r15b, %r12b
	orb	%al, %r12b
	notb	%r12b
	andb	%cl, %r12b
	testb	$1, %r12b
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	cmpl	$20, %edi
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, %ecx
	shrl	$7, %ecx
	xorl	%r14d, %ecx
	movl	%r14d, %edx
	shrl	$14, %edx
	xorl	%ecx, %edx
	movl	%edx, %ecx
	shrb	$2, %cl
	andb	$28, %cl
	movl	$634101360, %edi                ## imm = 0x25CB9E70
	shrl	%cl, %edi
	xorl	%edx, %edi
	testb	$15, %dil
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, %ecx
	shrl	$4, %ecx
	shrl	$18, %r14d
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx,%r14,4)
	movl	$1, %edx
	movl	%r14d, %ecx
	shll	%cl, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orb	%dl, %cl
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	-48(%rbp)                       ## 4-byte Folded Spill
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r15d, %r12d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edi, %edi
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, %eax
	movl	%r15d, %r8d
	movl	%ebx, %edi
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r8d, %eax
	shrb	%al
	movzbl	%al, %eax
	leal	(%rax,%r14,2), %eax
	incl	%edi
	movl	%r15d, %r12d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, %eax
	movl	%r15d, %r12d
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %esi
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$15, -56(%rbp)                  ## 1-byte Folded Reload
	setne	%r13b
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_GRIP_MAX_BITS_XT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edi
	jae	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	movb	$1, %r13b
	movq	_GRIP_MAX_CHUNKS_XT@GOTPCREL(%rip), %rcx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmpl	(%rcx), %edx
	jae	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %r14d
	movl	%r8d, %r15d
	testl	%esi, %esi
	jne	LBB0_1
LBB0_17:
	callq	_local_irq_restore
	movzbl	%r13b, %eax
	negl	%eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRIP_STROBE_XT,4,2             ## @GRIP_STROBE_XT
	.comm	_GRIP_MAX_BITS_XT,4,2           ## @GRIP_MAX_BITS_XT
	.comm	_GRIP_MAX_CHUNKS_XT,4,2         ## @GRIP_MAX_CHUNKS_XT
	.no_dead_strip	_grip_xt_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_xt_read_packet
_grip_xt_read_packet:                   ; @grip_xt_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _GRIP_STROBE_XT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRIP_STROBE_XT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_gameport_time
	mov	x26, x0
	stp	xzr, xzr, [x19]
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	bl	_local_irq_save
	mov	x0, x21
	bl	_gameport_read
	mov	w28, #0
	mov	w23, #0
	mov	w24, #0
	mov	w27, #0
	asr	w8, w0, w20
	and	w19, w8, #0x3
	mov	x25, x19
	mov	x22, x26
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	sub	w22, w22, #1
	mov	x0, x21
	bl	_gameport_read
	asr	w9, w0, w20
	and	w8, w9, #0x3
	eor	w10, w8, w19
	cbz	w10, LBB0_8
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	tbnz	w10, #0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w9, w9, #0xff
	eor	w11, w25, w19
	and	w10, w10, w11
	orr	w11, w25, w19
	orr	w9, w11, w9
	mvn	w9, w9
	and	w9, w9, w10, lsr #1
	tbz	w9, #0, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w27, #20
	b.ne	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	eor	w9, w28, w28, lsr #7
	eor	w9, w9, w28, lsr #14
	lsr	w10, w9, #2
	and	w10, w10, #0x1c
	mov	w11, #40560
	movk	w11, #9675, lsl #16
	lsr	w10, w11, w10
	eor	w9, w10, w9
	tst	w9, #0xf
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	lsr	w9, w28, #4
	lsr	w10, w28, #18
	ldr	x11, [sp, #8]                   ; 8-byte Folded Reload
	str	w9, [x11, w10, uxtw #2]
	mov	w9, #1
	lsl	w9, w9, w10
	and	w9, w9, #0xff
	orr	w24, w24, w9
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w28, #0
	mov	w27, #0
	add	w23, w23, #1
	b	LBB0_12
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x8, x19
	b	LBB0_13
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	lsr	w9, w8, #1
	bfi	w9, w28, #1, #31
	add	w27, w27, #1
	mov	x28, x9
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x25, x19
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w28, #0
	mov	w27, #0
LBB0_12:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x25, x19
	mov	x22, x26
LBB0_13:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w24, #15
	cset	w19, ne
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_1 Depth=1
Lloh3:
	adrp	x9, _GRIP_MAX_BITS_XT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GRIP_MAX_BITS_XT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w27, w9
	b.hs	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_1 Depth=1
Lloh6:
	adrp	x9, _GRIP_MAX_CHUNKS_XT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GRIP_MAX_CHUNKS_XT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w23, w9
	ccmp	w22, #0, #4, lo
	mov	x19, x8
	b.ne	LBB0_1
; %bb.16:
	mov	w19, #1
LBB0_17:
	bl	_local_irq_restore
	sbfx	w0, w19, #0, #1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GRIP_STROBE_XT,4,2             ; @GRIP_STROBE_XT
	.comm	_GRIP_MAX_BITS_XT,4,2           ; @GRIP_MAX_BITS_XT
	.comm	_GRIP_MAX_CHUNKS_XT,4,2         ; @GRIP_MAX_CHUNKS_XT
	.no_dead_strip	_grip_xt_read_packet
.subsections_via_symbols
