	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_spi_command_send
_mmc_spi_command_send:                  ## @mmc_spi_command_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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r13
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	56(%rdi), %r14
	movq	(%r14), %r15
	movslq	(%rdx), %rbx
	movq	%r15, %rdi
	movl	$255, %esi
	movl	$8, %edx
	callq	_memset
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movslq	4(%r13), %rax
	orq	$64, %rax
	movq	%rax, 8(%r15)
	movl	%ebx, %eax
	sarl	$24, %eax
	cltq
	movq	%rax, 16(%r15)
	movl	%ebx, %eax
	sarl	$16, %eax
	cltq
	movq	%rax, 24(%r15)
	movl	%ebx, %eax
	sarl	$8, %eax
	cltq
	movq	%rax, 32(%r15)
	movq	%rbx, 40(%r15)
	movq	%r14, %rbx
	movq	(%r14), %rsi
	addq	$8, %rsi
	xorl	%edi, %edi
	movl	$5, %edx
	callq	_crc7
                                        ## kill: def $eax killed $eax def $rax
	addl	%eax, %eax
	incl	%eax
	cltq
	movq	%rax, 48(%r15)
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_3
## %bb.1:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_3
## %bb.2:
	addq	$72, %r15
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_3:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	8(%rdi), %eax
	movq	_MMC_RSP_SPI_S2@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	addq	$144, %r15
	jmp	LBB0_10
LBB0_5:
	movq	_MMC_RSP_SPI_B4@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	addq	$168, %r15
	jmp	LBB0_10
LBB0_7:
	movq	_MMC_RSP_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.9:
	movq	(%rbx), %r15
	addq	$64, %r15
	jmp	LBB0_10
LBB0_8:
	addq	$136, %r15
LBB0_10:
	movq	(%r12), %r13
	movl	4(%rdi), %r14d
	callq	_maptype
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	24(%r12), %r13
	movq	%r13, %rdi
	callq	_spi_message_init
	leaq	28(%r12), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	(%rbx), %rax
	movl	%eax, 44(%r12)
	movl	%eax, 48(%r12)
	movl	8(%r12), %ecx
	movl	%ecx, 36(%r12)
	movl	%ecx, 40(%r12)
	subq	%rax, %r15
	shrq	$3, %r15
	movl	%r15d, 28(%r12)
	movl	$1, 32(%r12)
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_spi_message_add_tail
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	movl	$1, 24(%r12)
	movl	8(%r12), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %edx
	callq	_dma_sync_single_for_device
LBB0_12:
	movq	(%r12), %rdi
	movq	%r13, %rsi
	callq	_spi_sync
	movl	%eax, %ebx
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:
	movl	8(%r12), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %edx
	callq	_dma_sync_single_for_cpu
LBB0_14:
	testl	%ebx, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	js	LBB0_15
## %bb.16:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mmc_spi_response_get           ## TAILCALL
LBB0_15:
	movq	(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%ebx, 12(%r14)
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_MMC_RSP_SPI_S2,4,2             ## @MMC_RSP_SPI_S2
	.comm	_MMC_RSP_SPI_B4,4,2             ## @MMC_RSP_SPI_B4
	.comm	_MMC_RSP_BUSY,4,2               ## @MMC_RSP_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  mmc_spi: CMD%d, resp %s\n"

	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
L_.str.1:                               ## @.str.1
	.asciz	"  ... write returned %d\n"

	.no_dead_strip	_mmc_spi_command_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_spi_command_send
_mmc_spi_command_send:                  ; @mmc_spi_command_send
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x3
	mov	x19, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x24, [x0, #56]
	ldr	x22, [x24]
	ldrsw	x25, [x2]
	mov	x26, x25
	mov	x0, x22
	mov	w1, #255
	mov	w2, #8
	bl	_memset
	ldrsw	x8, [x19, #4]
	orr	x8, x8, #0x40
	sbfx	x9, x26, #24, #8
	stp	x8, x9, [x22, #8]
	sbfx	x8, x26, #16, #16
	sbfx	x9, x26, #8, #24
	stp	x8, x9, [x22, #24]
	str	x25, [x22, #40]
	ldr	x8, [x24]
	add	x1, x8, #8
	mov	w0, #0
	mov	w2, #5
	bl	_crc7
	mov	w8, #1
	bfi	w8, w0, #1, #31
	sxtw	x8, w8
	str	x8, [x22, #48]
	cbz	w20, LBB0_3
; %bb.1:
	ldr	x8, [x23]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	add	x25, x22, #72
	b	LBB0_10
LBB0_3:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _MMC_RSP_SPI_S2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_RSP_SPI_S2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	add	x25, x22, #144
	b	LBB0_10
LBB0_5:
Lloh6:
	adrp	x9, _MMC_RSP_SPI_B4@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MMC_RSP_SPI_B4@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	add	x25, x22, #168
	b	LBB0_10
LBB0_7:
Lloh9:
	adrp	x9, _MMC_RSP_BUSY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MMC_RSP_BUSY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [x24]
	add	x25, x8, #64
	b	LBB0_10
LBB0_9:
	add	x25, x22, #136
LBB0_10:
	ldr	x22, [x21]
	ldr	w23, [x19, #4]
	mov	x0, x19
	bl	_maptype
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_dev_dbg
	add	x22, x21, #24
	mov	x0, x22
	bl	_spi_message_init
	add	x23, x21, #28
	mov	x0, x23
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	x8, [x24]
	stp	w8, w8, [x21, #44]
	ldr	w9, [x21, #8]
	stp	w9, w9, [x21, #36]
	sub	x8, x25, x8
	lsr	x8, x8, #3
	mov	w24, #1
	stp	w8, w24, [x21, #28]
	mov	x0, x23
	mov	x1, x22
	bl	_spi_message_add_tail
	ldr	x0, [x21, #16]
Lloh14:
	adrp	x23, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh15:
	ldr	x23, [x23, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
	cbz	x0, LBB0_12
; %bb.11:
	str	w24, [x21, #24]
	ldr	w1, [x21, #8]
	ldr	w3, [x23]
	mov	w2, #8
	bl	_dma_sync_single_for_device
LBB0_12:
	ldr	x0, [x21]
	mov	x1, x22
	bl	_spi_sync
	mov	x22, x0
	ldr	x0, [x21, #16]
	cbz	x0, LBB0_14
; %bb.13:
	ldr	w1, [x21, #8]
	ldr	w3, [x23]
	mov	w2, #8
	bl	_dma_sync_single_for_cpu
LBB0_14:
	tbnz	w22, #31, LBB0_16
; %bb.15:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_mmc_spi_response_get
LBB0_16:
	ldr	x0, [x21]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
	str	w22, [x19, #12]
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_MMC_RSP_SPI_S2,4,2             ; @MMC_RSP_SPI_S2
	.comm	_MMC_RSP_SPI_B4,4,2             ; @MMC_RSP_SPI_B4
	.comm	_MMC_RSP_BUSY,4,2               ; @MMC_RSP_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  mmc_spi: CMD%d, resp %s\n"

	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
l_.str.1:                               ; @.str.1
	.asciz	"  ... write returned %d\n"

	.no_dead_strip	_mmc_spi_command_send
.subsections_via_symbols
