	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cb710_mmc_command
_cb710_mmc_command:                     ## @cb710_mmc_command
	.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, %r15
	movq	%rdi, %rbx
	callq	_cb710_mmc_to_slot
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_mmc_priv
	movq	24(%r15), %r14
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_cb710_encode_cmd_flags
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_cb710_slot_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r12d, %edx
	callq	_dev_dbg
	testq	%r14, %r14
	je	LBB0_5
## %bb.1:
	movq	%r14, %rdi
	callq	_cb710_is_transfer_size_supported
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movl	4(%r14), %edx
	movl	8(%r14), %esi
	movq	%r13, %rdi
	callq	_cb710_mmc_set_transfer_size
LBB0_5:
	movq	_CB710_MMC_S2_BUSY_20@GOTPCREL(%rip), %rbx
	movq	_CB710_MMC_S2_BUSY_10@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_cb710_wait_while_busy
	movq	_CB710_MMC_CMD_TYPE_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_cb710_write_port_16
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_cb710_wait_while_busy
	movq	_CB710_MMC_CMD_PARAM_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r15), %edx
	movq	%r13, %rdi
	callq	_cb710_write_port_32
	movq	%r13, %rdi
	callq	_cb710_mmc_reset_events
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_cb710_wait_while_busy
	movq	_CB710_MMC_CONFIG0_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_cb710_modify_port_8
	movq	_CB710_MMC_S1_COMMAND_SENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_cb710_wait_for_event
	movq	%rax, %rcx
	movq	%rax, 8(%r15)
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_12
## %bb.6:
	movq	_MMC_RSP_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_10
## %bb.7:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_cb710_receive_response
	movq	8(%r15), %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	setne	%al
	negl	%eax
	testq	%rcx, %rcx
	jne	LBB0_12
## %bb.8:
	testq	%r14, %r14
	jne	LBB0_9
	jmp	LBB0_12
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	$-1, %eax
	movl	%ecx, (%r14)
	jmp	LBB0_12
LBB0_10:
	testq	%r14, %r14
	je	LBB0_11
LBB0_9:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_cb710_mmc_transfer_data
	movl	%eax, %ecx
	xorl	%eax, %eax
	movl	%ecx, (%r14)
	jmp	LBB0_12
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmd request: 0x%04X\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CB710_MMC_S2_BUSY_20,4,2       ## @CB710_MMC_S2_BUSY_20
	.comm	_CB710_MMC_S2_BUSY_10,4,2       ## @CB710_MMC_S2_BUSY_10
	.comm	_CB710_MMC_CMD_TYPE_PORT,4,2    ## @CB710_MMC_CMD_TYPE_PORT
	.comm	_CB710_MMC_CMD_PARAM_PORT,4,2   ## @CB710_MMC_CMD_PARAM_PORT
	.comm	_CB710_MMC_CONFIG0_PORT,4,2     ## @CB710_MMC_CONFIG0_PORT
	.comm	_CB710_MMC_S1_COMMAND_SENT,4,2  ## @CB710_MMC_S1_COMMAND_SENT
	.comm	_MMC_RSP_PRESENT,4,2            ## @MMC_RSP_PRESENT
	.no_dead_strip	_cb710_mmc_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cb710_mmc_command
_cb710_mmc_command:                     ; @cb710_mmc_command
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_cb710_mmc_to_slot
	mov	x20, x0
	mov	x0, x19
	bl	_mmc_priv
	ldr	x19, [x21, #24]
	mov	x1, x21
	bl	_cb710_encode_cmd_flags
	mov	x22, x0
	mov	x0, x20
	bl	_cb710_slot_dev
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
	cbz	x19, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_cb710_is_transfer_size_supported
	cbz	w0, LBB0_8
; %bb.2:
	ldp	w2, w1, [x19, #4]
	mov	x0, x20
	bl	_cb710_mmc_set_transfer_size
LBB0_3:
Lloh2:
	adrp	x23, _CB710_MMC_S2_BUSY_20@GOTPAGE
Lloh3:
	ldr	x23, [x23, _CB710_MMC_S2_BUSY_20@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh4:
	adrp	x9, _CB710_MMC_S2_BUSY_10@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CB710_MMC_S2_BUSY_10@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_cb710_wait_while_busy
Lloh7:
	adrp	x8, _CB710_MMC_CMD_TYPE_PORT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CB710_MMC_CMD_TYPE_PORT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_cb710_write_port_16
	ldr	w1, [x23]
	mov	x0, x20
	bl	_cb710_wait_while_busy
Lloh10:
	adrp	x8, _CB710_MMC_CMD_PARAM_PORT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CB710_MMC_CMD_PARAM_PORT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w2, [x21, #16]
	mov	x0, x20
	bl	_cb710_write_port_32
	mov	x0, x20
	bl	_cb710_mmc_reset_events
	ldr	w1, [x23]
	mov	x0, x20
	bl	_cb710_wait_while_busy
Lloh13:
	adrp	x8, _CB710_MMC_CONFIG0_PORT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CB710_MMC_CONFIG0_PORT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	mov	w3, #0
	bl	_cb710_modify_port_8
Lloh16:
	adrp	x8, _CB710_MMC_S1_COMMAND_SENT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CB710_MMC_S1_COMMAND_SENT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cb710_wait_for_event
	str	x0, [x21, #8]
	cbz	x0, LBB0_5
; %bb.4:
	mov	w0, #-1
	b	LBB0_12
LBB0_5:
	ldr	w8, [x21]
Lloh19:
	adrp	x9, _MMC_RSP_PRESENT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MMC_RSP_PRESENT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.6:
	mov	x0, x20
	mov	x1, x21
	bl	_cb710_receive_response
	ldr	x8, [x21, #8]
	cmp	x8, #0
	csetm	w0, ne
	cbnz	x8, LBB0_12
; %bb.7:
	cbnz	x19, LBB0_10
	b	LBB0_12
LBB0_8:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w8, w8
	mov	w0, #-1
	str	w8, [x19]
	b	LBB0_12
LBB0_9:
	cbz	x19, LBB0_11
LBB0_10:
	mov	x0, x20
	mov	x1, x19
	bl	_cb710_mmc_transfer_data
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_12
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmd request: 0x%04X\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CB710_MMC_S2_BUSY_20,4,2       ; @CB710_MMC_S2_BUSY_20
	.comm	_CB710_MMC_S2_BUSY_10,4,2       ; @CB710_MMC_S2_BUSY_10
	.comm	_CB710_MMC_CMD_TYPE_PORT,4,2    ; @CB710_MMC_CMD_TYPE_PORT
	.comm	_CB710_MMC_CMD_PARAM_PORT,4,2   ; @CB710_MMC_CMD_PARAM_PORT
	.comm	_CB710_MMC_CONFIG0_PORT,4,2     ; @CB710_MMC_CONFIG0_PORT
	.comm	_CB710_MMC_S1_COMMAND_SENT,4,2  ; @CB710_MMC_S1_COMMAND_SENT
	.comm	_MMC_RSP_PRESENT,4,2            ; @MMC_RSP_PRESENT
	.no_dead_strip	_cb710_mmc_command
.subsections_via_symbols
