	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_dmac_map_slave_addr
_rcar_dmac_map_slave_addr:              ## @rcar_dmac_map_slave_addr
	.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	%esi, %r14d
	movq	%rdi, %r15
	callq	_to_rcar_dmac_chan
	movq	%rax, %rbx
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	24(%rbx), %r12
	movq	%r12, -48(%rbp)
	leaq	32(%rbx), %rax
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_2:
	movq	8(%rbx), %r12
	movq	%r12, -48(%rbp)
	leaq	16(%rbx), %rax
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %r9d
	movq	(%rax), %r14
	movq	56(%rbx), %rdx
	cmpq	48(%rbx), %r12
	jne	LBB0_6
## %bb.4:
	cmpq	%rdx, %r14
	jne	LBB0_6
## %bb.5:
	xorl	%r13d, %r13d
	movq	%r14, %rdx
	cmpl	40(%rbx), %r9d
	je	LBB0_11
LBB0_6:
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.7:
	movq	(%r15), %rax
	movl	(%rax), %edi
	movl	40(%rbx), %ecx
	movl	64(%rbx), %esi
	xorl	%r8d, %r8d
	movl	%r9d, %r13d
	callq	_dma_unmap_resource
	movl	%r13d, %r9d
LBB0_8:
	movq	$0, 56(%rbx)
	movq	(%r15), %rax
	movl	(%rax), %edi
	xorl	%r13d, %r13d
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	%r9d, %ecx
	xorl	%r8d, %r8d
	movl	%r9d, %r12d
	callq	_dma_map_resource
	movl	%eax, 64(%rbx)
	movq	(%r15), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	movq	(%r15), %rcx
	movl	(%rcx), %edi
	movl	(%rbx), %edx
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %r8
	movq	%r14, %rcx
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_11
LBB0_10:
	movq	%rbx, %r9
	addq	$64, %r9
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	leaq	-48(%rbp), %r8
	movq	%r14, %rcx
	callq	_dev_dbg
	movq	-48(%rbp), %rax
	movq	%rax, 48(%rbx)
	movq	%r14, 56(%rbx)
	movl	%r12d, 40(%rbx)
LBB0_11:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chan%u: failed to map %zx@%pap"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"chan%u: map %zx@%pap to %pad dir: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"DMA_TO_DEVICE"

L_.str.3:                               ## @.str.3
	.asciz	"DMA_FROM_DEVICE"

	.no_dead_strip	_rcar_dmac_map_slave_addr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_dmac_map_slave_addr
_rcar_dmac_map_slave_addr:              ; @rcar_dmac_map_slave_addr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	mov	x20, x0
	bl	_to_rcar_dmac_chan
	mov	x19, x0
Lloh0:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_2
; %bb.1:
	ldr	x23, [x19, #24]
	str	x23, [sp, #8]
	add	x8, x19, #32
Lloh3:
	adrp	x9, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_TO_DEVICE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	ldr	x23, [x19, #8]
	str	x23, [sp, #8]
	add	x8, x19, #16
Lloh5:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
LBB0_3:
	ldr	w22, [x9]
	ldr	x21, [x8]
	ldp	x8, x2, [x19, #48]
	cmp	x23, x8
	ccmp	x21, x2, #0, eq
	b.ne	LBB0_6
; %bb.4:
	ldr	w8, [x19, #40]
	mov	x2, x21
	cmp	w22, w8
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #0
	b	LBB0_11
LBB0_6:
	cbz	x2, LBB0_8
; %bb.7:
	ldr	x8, [x20]
	ldr	w0, [x8]
	ldr	w1, [x19, #64]
	ldr	w3, [x19, #40]
	mov	w4, #0
	bl	_dma_unmap_resource
LBB0_8:
	str	xzr, [x19, #56]
	ldr	x8, [x20]
	ldr	w0, [x8]
	mov	x1, x23
	mov	x2, x21
	mov	x3, x22
	mov	w4, #0
	bl	_dma_map_resource
	mov	x1, x0
	mov	x23, x19
	str	w1, [x23, #64]!
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_dma_mapping_error
	mov	x8, x0
	ldr	x9, [x20]
	ldr	w0, [x9]
	ldr	w2, [x19]
	cbz	x8, LBB0_10
; %bb.9:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	add	x4, sp, #8
	mov	x3, x21
	bl	_dev_err
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_10:
Lloh12:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, l_.str.3@PAGE
Lloh16:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh17:
	adrp	x10, l_.str.2@PAGE
Lloh18:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w22, w8
	csel	x6, x10, x9, eq
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x4, sp, #8
	mov	x3, x21
	mov	x5, x23
	bl	_dev_dbg
	mov	w0, #0
	ldr	x8, [sp, #8]
	stp	x8, x21, [x19, #48]
	str	w22, [x19, #40]
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chan%u: failed to map %zx@%pap"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"chan%u: map %zx@%pap to %pad dir: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"DMA_TO_DEVICE"

l_.str.3:                               ; @.str.3
	.asciz	"DMA_FROM_DEVICE"

	.no_dead_strip	_rcar_dmac_map_slave_addr
.subsections_via_symbols
