	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wbsd_finish_data
_wbsd_finish_data:                      ## @wbsd_finish_data
	.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, %r14
	movq	%rdi, %r13
	xorl	%edi, %edi
	cmpq	$0, 8(%r13)
	sete	%dil
	callq	_WARN_ON
	movq	16(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_wbsd_send_command
LBB0_2:
	movq	_WBSD_IDX_STATUS@GOTPCREL(%rip), %r15
	movq	_WBSD_BLOCK_READ@GOTPCREL(%rip), %r12
	movq	_WBSD_BLOCK_WRITE@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_wbsd_read_index
	movl	(%rbx), %ecx
	orl	(%r12), %ecx
	testl	%eax, %ecx
	jne	LBB0_3
## %bb.4:
	cmpq	$0, (%r13)
	js	LBB0_13
## %bb.5:
	movq	_WBSD_IDX_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_wbsd_write_index
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r12
	movq	(%r13), %rdi
	callq	_disable_dma
	movq	(%r13), %rdi
	callq	_clear_dma_ff
	movq	(%r13), %rdi
	callq	_get_dma_residue
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_release_dma_lock
	movq	8(%r13), %rax
	movq	(%rax), %rax
	movl	4(%rax), %ecx
	imull	(%rax), %ecx
	subl	%r15d, %ecx
	movl	%ecx, %eax
	cltd
	idivl	4(%r14)
	subl	%edx, %ecx
	movl	%ecx, (%r14)
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.6:
	movl	16(%r13), %edi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_pr_err
	cmpl	$0, 8(%r14)
	jne	LBB0_10
## %bb.7:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 8(%r14)
	jmp	LBB0_10
LBB0_8:
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%r14)
	je	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_wbsd_dma_to_sg
LBB0_10:
	cmpl	$0, 8(%r14)
	je	LBB0_13
## %bb.11:
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	subl	4(%r14), %eax
	movl	%eax, (%r14)
LBB0_13:
	movq	8(%r13), %rsi
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wbsd_request_end               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WBSD_IDX_STATUS,4,2            ## @WBSD_IDX_STATUS
	.comm	_WBSD_BLOCK_READ,4,2            ## @WBSD_BLOCK_READ
	.comm	_WBSD_BLOCK_WRITE,4,2           ## @WBSD_BLOCK_WRITE
	.comm	_WBSD_IDX_DMA,4,2               ## @WBSD_IDX_DMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Incomplete DMA transfer. %d bytes left.\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.no_dead_strip	_wbsd_finish_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wbsd_finish_data
_wbsd_finish_data:                      ; @wbsd_finish_data
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	ldr	x1, [x20, #16]
	cbz	x1, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_wbsd_send_command
LBB0_2:
Lloh0:
	adrp	x21, _WBSD_IDX_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _WBSD_IDX_STATUS@GOTPAGEOFF]
Lloh2:
	adrp	x22, _WBSD_BLOCK_READ@GOTPAGE
Lloh3:
	ldr	x22, [x22, _WBSD_BLOCK_READ@GOTPAGEOFF]
Lloh4:
	adrp	x23, _WBSD_BLOCK_WRITE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _WBSD_BLOCK_WRITE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	bl	_wbsd_read_index
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w8, w9, w8
	tst	w8, w0
	b.ne	LBB0_3
; %bb.4:
	ldr	x8, [x19]
	tbnz	x8, #63, LBB0_13
; %bb.5:
Lloh6:
	adrp	x8, _WBSD_IDX_DMA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WBSD_IDX_DMA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_wbsd_write_index
	bl	_claim_dma_lock
	mov	x22, x0
	ldr	x0, [x19]
	bl	_disable_dma
	ldr	x0, [x19]
	bl	_clear_dma_ff
	ldr	x0, [x19]
	bl	_get_dma_residue
	mov	x21, x0
	mov	x0, x22
	bl	_release_dma_lock
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldp	w9, w8, [x8]
	neg	w10, w21
	madd	w8, w8, w9, w10
	ldr	w9, [x20, #4]
	sdiv	w8, w8, w9
	mul	w8, w8, w9
	str	w8, [x20]
	cbz	w21, LBB0_8
; %bb.6:
	ldr	w0, [x19, #16]
	bl	_mmc_hostname
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	bl	_pr_err
	ldr	w8, [x20, #8]
	cbnz	w8, LBB0_10
; %bb.7:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20, #8]
	b	LBB0_10
LBB0_8:
	ldr	w8, [x20, #12]
Lloh14:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_wbsd_dma_to_sg
LBB0_10:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_13
; %bb.11:
	ldr	w8, [x20]
	cbz	w8, LBB0_13
; %bb.12:
	ldr	w9, [x20, #4]
	sub	w8, w8, w9
	str	w8, [x20]
LBB0_13:
	ldr	x1, [x19, #8]
	mov	x0, x19
	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
	b	_wbsd_request_end
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_WBSD_IDX_STATUS,4,2            ; @WBSD_IDX_STATUS
	.comm	_WBSD_BLOCK_READ,4,2            ; @WBSD_BLOCK_READ
	.comm	_WBSD_BLOCK_WRITE,4,2           ; @WBSD_BLOCK_WRITE
	.comm	_WBSD_IDX_DMA,4,2               ; @WBSD_IDX_DMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Incomplete DMA transfer. %d bytes left.\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.no_dead_strip	_wbsd_finish_data
.subsections_via_symbols
