	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cb710_mmc_send
_cb710_mmc_send:                        ## @cb710_mmc_send
	.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, %r14
	movq	%rdi, %rbx
	movq	(%rsi), %rax
	xorl	%edi, %edi
	movq	%rax, %r15
	cmpq	$2, %rax
	jb	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	testb	$15, 8(%r14)
	setne	%dil
LBB0_2:
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_4:
	movl	12(%r14), %edx
	movl	16(%r14), %esi
	movq	_SG_MITER_FROM_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
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_cb710_modify_port_8
	testq	%r15, %r15
	je	LBB0_13
## %bb.5:
	movq	%r15, %rax
	movq	_CB710_MMC_S2_FIFO_EMPTY@GOTPCREL(%rip), %r15
	movq	_CB710_MMC_DATA_PORT@GOTPCREL(%rip), %r13
	leaq	-48(%rbp), %r12
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_12
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	decq	%rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %eax
	addl	$15, %eax
	sarl	$4, %eax
	movslq	%eax, %r14
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	(%r13), %rsi
	addq	(%rbx), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	callq	_cb710_sg_dwiter_read_to_io
	decq	%r14
	je	LBB0_11
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_CB710_MMC_STATUS2_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cb710_read_port_8
	testl	%eax, (%r15)
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	_CB710_MMC_S1_PIO_TRANSFER_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cb710_wait_for_event
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r12d
LBB0_13:
	leaq	-48(%rbp), %rdi
	callq	_sg_miter_stop
LBB0_14:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SG_MITER_FROM_SG,4,2           ## @SG_MITER_FROM_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
	.comm	_CB710_MMC_STATUS2_PORT,4,2     ## @CB710_MMC_STATUS2_PORT
	.comm	_CB710_MMC_S2_FIFO_EMPTY,4,2    ## @CB710_MMC_S2_FIFO_EMPTY
	.comm	_CB710_MMC_S1_PIO_TRANSFER_DONE,4,2 ## @CB710_MMC_S1_PIO_TRANSFER_DONE
	.comm	_CB710_MMC_DATA_PORT,8,3        ## @CB710_MMC_DATA_PORT
	.no_dead_strip	_cb710_mmc_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cb710_mmc_send
_cb710_mmc_send:                        ; @cb710_mmc_send
	.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]
	cmp	x22, #2
	b.lo	LBB0_3
; %bb.1:
	ldrb	w8, [x19, #8]
	tst	w8, #0xf
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_3:
	mov	w0, #0
	bl	_unlikely
	cbnz	x0, LBB0_2
LBB0_4:
	ldp	w2, w1, [x19, #12]
Lloh3:
	adrp	x8, _SG_MITER_FROM_SG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SG_MITER_FROM_SG@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x0, sp, #8
	bl	_sg_miter_start
Lloh6:
	adrp	x8, _CB710_MMC_CONFIG2_PORT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CB710_MMC_CONFIG2_PORT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _CB710_MMC_C2_READ_PIO_SIZE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CB710_MMC_C2_READ_PIO_SIZE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_cb710_modify_port_8
	cbz	x22, LBB0_12
; %bb.5:
Lloh12:
	adrp	x23, _CB710_MMC_STATUS2_PORT@GOTPAGE
Lloh13:
	ldr	x23, [x23, _CB710_MMC_STATUS2_PORT@GOTPAGEOFF]
Lloh14:
	adrp	x24, _CB710_MMC_S2_FIFO_EMPTY@GOTPAGE
Lloh15:
	ldr	x24, [x24, _CB710_MMC_S2_FIFO_EMPTY@GOTPAGEOFF]
Lloh16:
	adrp	x25, _CB710_MMC_S1_PIO_TRANSFER_DONE@GOTPAGE
Lloh17:
	ldr	x25, [x25, _CB710_MMC_S1_PIO_TRANSFER_DONE@GOTPAGEOFF]
Lloh18:
	adrp	x26, _CB710_MMC_DATA_PORT@GOTPAGE
Lloh19:
	ldr	x26, [x26, _CB710_MMC_DATA_PORT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	cbz	x22, LBB0_12
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	sub	x22, x22, #1
	ldr	w8, [x19, #8]
	add	w8, w8, #15
	sbfx	x27, x8, #4, #28
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldr	x8, [x20]
	ldr	x9, [x26]
	add	x1, x9, x8
	add	x0, sp, #8
	mov	w2, #4
	bl	_cb710_sg_dwiter_read_to_io
	subs	x27, x27, #1
	b.eq	LBB0_6
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x23]
	mov	x0, x20
	bl	_cb710_read_port_8
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w1, [x25]
	mov	x0, x20
	bl	_cb710_wait_for_event
	cbz	w0, LBB0_8
; %bb.11:
	mov	x21, x0
	b	LBB0_13
LBB0_12:
	mov	w21, #0
LBB0_13:
	add	x0, sp, #8
	bl	_sg_miter_stop
LBB0_14:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SG_MITER_FROM_SG,4,2           ; @SG_MITER_FROM_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
	.comm	_CB710_MMC_STATUS2_PORT,4,2     ; @CB710_MMC_STATUS2_PORT
	.comm	_CB710_MMC_S2_FIFO_EMPTY,4,2    ; @CB710_MMC_S2_FIFO_EMPTY
	.comm	_CB710_MMC_S1_PIO_TRANSFER_DONE,4,2 ; @CB710_MMC_S1_PIO_TRANSFER_DONE
	.comm	_CB710_MMC_DATA_PORT,8,3        ; @CB710_MMC_DATA_PORT
	.no_dead_strip	_cb710_mmc_send
.subsections_via_symbols
