	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function renesas_sdhi_internal_dmac_start_dma
_renesas_sdhi_internal_dmac_start_dma:  ## @renesas_sdhi_internal_dmac_start_dma
	.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
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	16(%rdi), %r12
	movq	_DTRAN_MODE_BUS_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_global_flags@GOTPCREL(%rip), %rsi
	callq	_test_bit
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_DTRAN_MODE_ADDR_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_2:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	8(%r13), %rbx
	movl	4(%r13), %r14d
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_mmc_get_dma_dir
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	movl	$8, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_7
## %bb.4:
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_9
## %bb.5:
	movq	_DTRAN_MODE_CH_NUM_CH1@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_SDHI_INTERNAL_DMAC_ONE_RX_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_global_flags@GOTPCREL(%rip), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	_SDHI_INTERNAL_DMAC_RX_IN_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_global_flags@GOTPCREL(%rip), %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_10
LBB0_7:
	movq	8(%r13), %r15
	movl	4(%r13), %r14d
	movq	%rbx, %rdi
	callq	_mmc_get_dma_dir
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dma_unmap_sg
LBB0_8:
	movq	%r13, %rdi
	xorl	%esi, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_renesas_sdhi_internal_dmac_enable_dma ## TAILCALL
LBB0_9:
	movq	_DTRAN_MODE_CH_NUM_CH0@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_10:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	orl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%r14d, %ebx
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_renesas_sdhi_internal_dmac_enable_dma
	movq	_DM_CM_DTRAN_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_renesas_sdhi_internal_dmac_dm_write
	movq	_DM_DTRAN_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_address
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_renesas_sdhi_internal_dmac_dm_write
	movl	$1, (%r13)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DTRAN_MODE_BUS_WIDTH,4,2       ## @DTRAN_MODE_BUS_WIDTH
	.comm	_SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY,4,2 ## @SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY
	.comm	_global_flags,4,2               ## @global_flags
	.comm	_DTRAN_MODE_ADDR_MODE,4,2       ## @DTRAN_MODE_ADDR_MODE
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_DTRAN_MODE_CH_NUM_CH1,4,2      ## @DTRAN_MODE_CH_NUM_CH1
	.comm	_SDHI_INTERNAL_DMAC_ONE_RX_ONLY,4,2 ## @SDHI_INTERNAL_DMAC_ONE_RX_ONLY
	.comm	_SDHI_INTERNAL_DMAC_RX_IN_USE,4,2 ## @SDHI_INTERNAL_DMAC_RX_IN_USE
	.comm	_DTRAN_MODE_CH_NUM_CH0,4,2      ## @DTRAN_MODE_CH_NUM_CH0
	.comm	_DM_CM_DTRAN_MODE,4,2           ## @DM_CM_DTRAN_MODE
	.comm	_DM_DTRAN_ADDR,4,2              ## @DM_DTRAN_ADDR
	.no_dead_strip	_renesas_sdhi_internal_dmac_start_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function renesas_sdhi_internal_dmac_start_dma
_renesas_sdhi_internal_dmac_start_dma:  ; @renesas_sdhi_internal_dmac_start_dma
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x8, _DTRAN_MODE_BUS_WIDTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DTRAN_MODE_BUS_WIDTH@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, _global_flags@GOTPAGE
Lloh7:
	ldr	x1, [x1, _global_flags@GOTPAGEOFF]
	bl	_test_bit
Lloh8:
	adrp	x8, _DTRAN_MODE_ADDR_MODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DTRAN_MODE_ADDR_MODE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w25, w8, wzr, eq
	ldr	x22, [x19, #8]
	ldr	w23, [x19, #4]
	mov	x0, x21
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x22
	mov	x1, x20
	mov	x2, x23
	bl	_dma_map_sg
	cbz	w0, LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_sg_dma_address
	mov	w1, #8
	bl	_IS_ALIGNED
	cbz	w0, LBB0_5
; %bb.2:
	ldr	w8, [x21]
Lloh11:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
Lloh14:
	adrp	x8, _DTRAN_MODE_CH_NUM_CH1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DTRAN_MODE_CH_NUM_CH1@GOTPAGEOFF]
Lloh16:
	ldr	w22, [x8]
Lloh17:
	adrp	x8, _SDHI_INTERNAL_DMAC_ONE_RX_ONLY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SDHI_INTERNAL_DMAC_ONE_RX_ONLY@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, _global_flags@GOTPAGE
Lloh21:
	ldr	x1, [x1, _global_flags@GOTPAGEOFF]
	bl	_test_bit
	cbz	x0, LBB0_8
; %bb.4:
Lloh22:
	adrp	x8, _SDHI_INTERNAL_DMAC_RX_IN_USE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SDHI_INTERNAL_DMAC_RX_IN_USE@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, _global_flags@GOTPAGE
Lloh26:
	ldr	x1, [x1, _global_flags@GOTPAGEOFF]
	bl	_test_and_set_bit
	cbz	x0, LBB0_8
LBB0_5:
	ldr	x22, [x19, #8]
	ldr	w23, [x19, #4]
	mov	x0, x21
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x22
	mov	x1, x20
	mov	x2, x23
	bl	_dma_unmap_sg
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_renesas_sdhi_internal_dmac_enable_dma
LBB0_7:
Lloh27:
	adrp	x8, _DTRAN_MODE_CH_NUM_CH0@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DTRAN_MODE_CH_NUM_CH0@GOTPAGEOFF]
Lloh29:
	ldr	w22, [x8]
LBB0_8:
	orr	w8, w25, w24
	orr	w21, w8, w22
	mov	w22, #1
	mov	x0, x19
	mov	w1, #1
	bl	_renesas_sdhi_internal_dmac_enable_dma
Lloh30:
	adrp	x8, _DM_CM_DTRAN_MODE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DM_CM_DTRAN_MODE@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_renesas_sdhi_internal_dmac_dm_write
Lloh33:
	adrp	x8, _DM_DTRAN_ADDR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _DM_DTRAN_ADDR@GOTPAGEOFF]
Lloh35:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_sg_dma_address
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_renesas_sdhi_internal_dmac_dm_write
	str	w22, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_DTRAN_MODE_BUS_WIDTH,4,2       ; @DTRAN_MODE_BUS_WIDTH
	.comm	_SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY,4,2 ; @SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY
	.comm	_global_flags,4,2               ; @global_flags
	.comm	_DTRAN_MODE_ADDR_MODE,4,2       ; @DTRAN_MODE_ADDR_MODE
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_DTRAN_MODE_CH_NUM_CH1,4,2      ; @DTRAN_MODE_CH_NUM_CH1
	.comm	_SDHI_INTERNAL_DMAC_ONE_RX_ONLY,4,2 ; @SDHI_INTERNAL_DMAC_ONE_RX_ONLY
	.comm	_SDHI_INTERNAL_DMAC_RX_IN_USE,4,2 ; @SDHI_INTERNAL_DMAC_RX_IN_USE
	.comm	_DTRAN_MODE_CH_NUM_CH0,4,2      ; @DTRAN_MODE_CH_NUM_CH0
	.comm	_DM_CM_DTRAN_MODE,4,2           ; @DM_CM_DTRAN_MODE
	.comm	_DM_DTRAN_ADDR,4,2              ; @DM_DTRAN_ADDR
	.no_dead_strip	_renesas_sdhi_internal_dmac_start_dma
.subsections_via_symbols
