	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goldfish_mmc_prepare_data
_goldfish_mmc_prepare_data:             ## @goldfish_mmc_prepare_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %rbx
	movq	%rbx, 24(%rdi)
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	_MMC_BLOCK_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %r15d
	movl	4(%rbx), %edx
	decl	%edx
	movq	%r14, %rdi
	callq	_GOLDFISH_MMC_WRITE
	movq	_MMC_BLOCK_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	decl	%r15d
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_GOLDFISH_MMC_WRITE
	movl	$1, %r15d
	cmpl	$1, 4(%rbx)
	je	LBB0_4
## %bb.3:
	movl	8(%rbx), %r15d
LBB0_4:
	movq	%rbx, %rdi
	callq	_mmc_get_dma_dir
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_mmc_from_priv
	movl	%eax, %edi
	callq	_mmc_dev
	movq	16(%rbx), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_dma_map_sg
	movl	%eax, 16(%r14)
	movq	$0, 8(%r14)
	movl	$1, (%r14)
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_5
## %bb.6:
	movq	16(%rbx), %rdi
	movl	4(%r14), %edx
	movl	(%rdi), %ecx
	movl	$1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sg_copy_to_buffer              ## TAILCALL
LBB0_1:
	movq	_MMC_BLOCK_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_GOLDFISH_MMC_WRITE
	movq	_MMC_BLOCK_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_GOLDFISH_MMC_WRITE
	movl	$0, (%r14)
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_BLOCK_LENGTH,4,2           ## @MMC_BLOCK_LENGTH
	.comm	_MMC_BLOCK_COUNT,4,2            ## @MMC_BLOCK_COUNT
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_goldfish_mmc_prepare_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goldfish_mmc_prepare_data
_goldfish_mmc_prepare_data:             ; @goldfish_mmc_prepare_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	x19, x0
	ldr	x20, [x1]
	str	x20, [x0, #24]
	cbz	x20, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _MMC_BLOCK_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MMC_BLOCK_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldp	w21, w8, [x20]
	sub	w2, w8, #1
	mov	x0, x19
	bl	_GOLDFISH_MMC_WRITE
Lloh3:
	adrp	x8, _MMC_BLOCK_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MMC_BLOCK_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	sub	w2, w21, #1
	mov	x0, x19
	bl	_GOLDFISH_MMC_WRITE
	ldr	w8, [x20, #4]
	mov	w23, #1
	mov	w21, #1
	cmp	w8, #1
	b.eq	LBB0_3
; %bb.2:
	ldr	w21, [x20, #8]
LBB0_3:
	mov	x0, x20
	bl	_mmc_get_dma_dir
	mov	x22, x0
	mov	x0, x19
	bl	_mmc_from_priv
	bl	_mmc_dev
	ldr	x1, [x20, #16]
	mov	x2, x21
	mov	x3, x22
	bl	_dma_map_sg
	str	w0, [x19, #16]
	str	xzr, [x19, #8]
	str	w23, [x19]
Lloh6:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_6
; %bb.4:
	ldr	x0, [x20, #16]
	ldr	w2, [x19, #4]
	ldr	w3, [x0]
	mov	w1, #1
	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	_sg_copy_to_buffer
LBB0_5:
Lloh9:
	adrp	x8, _MMC_BLOCK_LENGTH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MMC_BLOCK_LENGTH@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_GOLDFISH_MMC_WRITE
Lloh12:
	adrp	x8, _MMC_BLOCK_COUNT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MMC_BLOCK_COUNT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_GOLDFISH_MMC_WRITE
	str	wzr, [x19]
LBB0_6:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_BLOCK_LENGTH,4,2           ; @MMC_BLOCK_LENGTH
	.comm	_MMC_BLOCK_COUNT,4,2            ; @MMC_BLOCK_COUNT
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_goldfish_mmc_prepare_data
.subsections_via_symbols
