	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_davinci_start_dma_transfer
_mmc_davinci_start_dma_transfer:        ## @mmc_davinci_start_dma_transfer
	.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, %r12
	movq	_rw_threshold@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	8(%rdi), %edi
	callq	_mmc_dev
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	8(%r14), %rbx
	movl	(%r14), %r13d
	movq	%r14, %rdi
	callq	_mmc_get_dma_dir
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_dma_map_sg
	movl	%eax, (%r12)
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	decl	%r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	addq	%rbx, %rdi
	callq	_sg_dma_len
	testl	%r15d, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_5:
	movl	$1, 4(%r12)
	movq	%r12, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mmc_davinci_send_dma_request   ## TAILCALL
LBB0_4:
	movl	8(%r12), %edi
	callq	_mmc_dev
	movl	%eax, %ebx
	movq	8(%r14), %r15
	movl	(%r14), %r12d
	movq	%r14, %rdi
	callq	_mmc_get_dma_dir
	movl	%ebx, %edi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_dma_unmap_sg
	movl	$-1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rw_threshold,4,2               ## @rw_threshold
	.no_dead_strip	_mmc_davinci_start_dma_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_davinci_start_dma_transfer
_mmc_davinci_start_dma_transfer:        ; @mmc_davinci_start_dma_transfer
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _rw_threshold@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rw_threshold@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	ldr	w0, [x0, #8]
	bl	_mmc_dev
	mov	x21, x0
	ldr	x22, [x19, #8]
	ldr	w23, [x19]
	mov	x0, x19
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_dma_map_sg
	str	w0, [x20]
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x21, #0
	sub	w22, w24, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x21, x8
	bl	_sg_dma_len
	tst	w0, w22
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x20]
	cmp	x21, x8
	b.lt	LBB0_2
LBB0_4:
	mov	w8, #1
	str	w8, [x20, #4]
	mov	x0, x20
	mov	x1, 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	_mmc_davinci_send_dma_request
LBB0_5:
	ldr	w0, [x20, #8]
	bl	_mmc_dev
	mov	x20, x0
	ldr	x21, [x19, #8]
	ldr	w22, [x19]
	mov	x0, x19
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_dma_unmap_sg
	mov	w0, #-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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_rw_threshold,4,2               ; @rw_threshold
	.no_dead_strip	_mmc_davinci_start_dma_transfer
.subsections_via_symbols
