	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cb710_mmc_receive
_cb710_mmc_receive:                     ## @cb710_mmc_receive
	.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	%rsi, %rbx
	movq	%rdi, %r15
	movq	(%rsi), %r13
	movl	8(%rsi), %eax
	testb	$15, %al
	je	LBB0_1
## %bb.2:
	movl	$1, %edi
	cmpq	$1, %r13
	jne	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	cmpl	$8, %eax
	setne	%dil
	jmp	LBB0_4
LBB0_1:
	xorl	%edi, %edi
LBB0_4:
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_6:
	movl	12(%rbx), %edx
	movl	16(%rbx), %esi
	movq	_SG_MITER_TO_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdi
	callq	_sg_miter_start
	movq	_CB710_MMC_CONFIG2_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CB710_MMC_C2_READ_PIO_SIZE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$15, %edx
	movq	%r15, %rdi
	callq	_cb710_modify_port_8
	movq	%r15, %rdi
	callq	_cb710_mmc_fifo_hack
	xorl	%r14d, %r14d
	testq	%r13, %r13
	je	LBB0_16
## %bb.7:
	leaq	-48(%rbp), %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movslq	8(%rbx), %r14
	cmpq	$16, %r14
	jb	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$4, %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cb710_mmc_receive_pio
	testl	%eax, %eax
	jne	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	addq	$-16, %r14
	cmpq	$15, %r14
	ja	LBB0_9
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	testq	%r14, %r14
	je	LBB0_12
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_CB710_MMC_CONFIG2_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-1(%r14), %rdx
	movq	_CB710_MMC_C2_READ_PIO_SIZE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_cb710_modify_port_8
	xorl	%eax, %eax
	cmpq	$8, %r14
	setae	%al
	leaq	(%rax,%rax), %rdx
	addq	$2, %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cb710_mmc_receive_pio
	testl	%eax, %eax
	jne	LBB0_15
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	decq	%r13
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_8
## %bb.13:
	xorl	%r14d, %r14d
	jmp	LBB0_16
LBB0_15:
	movl	%eax, %r14d
LBB0_16:
	leaq	-48(%rbp), %rdi
	callq	_sg_miter_stop
LBB0_17:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SG_MITER_TO_SG,4,2             ## @SG_MITER_TO_SG
	.comm	_CB710_MMC_CONFIG2_PORT,4,2     ## @CB710_MMC_CONFIG2_PORT
	.comm	_CB710_MMC_C2_READ_PIO_SIZE_MASK,4,2 ## @CB710_MMC_C2_READ_PIO_SIZE_MASK
	.no_dead_strip	_cb710_mmc_receive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cb710_mmc_receive
_cb710_mmc_receive:                     ; @cb710_mmc_receive
	.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, x1
	mov	x20, x0
	ldr	x22, [x1]
	ldr	w8, [x1, #8]
	mov	w9, #1
	cmp	w8, #8
	cset	w10, ne
	cmp	x22, #1
	csel	w9, w9, w10, ne
	tst	w8, #0xf
	csel	w0, wzr, w9, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_2:
	ldp	w2, w1, [x19, #12]
Lloh3:
	adrp	x8, _SG_MITER_TO_SG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SG_MITER_TO_SG@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x0, sp, #8
	bl	_sg_miter_start
Lloh6:
	adrp	x23, _CB710_MMC_CONFIG2_PORT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _CB710_MMC_CONFIG2_PORT@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh8:
	adrp	x24, _CB710_MMC_C2_READ_PIO_SIZE_MASK@GOTPAGE
Lloh9:
	ldr	x24, [x24, _CB710_MMC_C2_READ_PIO_SIZE_MASK@GOTPAGEOFF]
	ldr	w3, [x24]
	mov	x0, x20
	mov	w2, #15
	bl	_cb710_modify_port_8
	mov	x0, x20
	bl	_cb710_mmc_fifo_hack
	cbz	x22, LBB0_10
; %bb.3:
	mov	w25, #4
	mov	w26, #2
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldrsw	x27, [x19, #8]
	cmp	w27, #16
	b.lo	LBB0_7
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #4
	bl	_cb710_mmc_receive_pio
	cbnz	w0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	sub	x27, x27, #16
	cmp	x27, #15
	b.hi	LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	x27, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x23]
	sub	x2, x27, #1
	ldr	w3, [x24]
	mov	x0, x20
	bl	_cb710_modify_port_8
	cmp	x27, #7
	csel	x2, x25, x26, hi
	add	x1, sp, #8
	mov	x0, x20
	bl	_cb710_mmc_receive_pio
	cbnz	w0, LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	x22, x22, #1
	cbnz	x22, LBB0_4
LBB0_10:
	mov	w21, #0
	b	LBB0_12
LBB0_11:
	mov	x21, x0
LBB0_12:
	add	x0, sp, #8
	bl	_sg_miter_stop
LBB0_13:
	mov	x0, x21
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SG_MITER_TO_SG,4,2             ; @SG_MITER_TO_SG
	.comm	_CB710_MMC_CONFIG2_PORT,4,2     ; @CB710_MMC_CONFIG2_PORT
	.comm	_CB710_MMC_C2_READ_PIO_SIZE_MASK,4,2 ; @CB710_MMC_C2_READ_PIO_SIZE_MASK
	.no_dead_strip	_cb710_mmc_receive
.subsections_via_symbols
