	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_amd_dma_map
_i2c_amd_dma_map:                       ## @i2c_amd_dma_map
	.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	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %r15
	callq	_amd_i2c_dev_common
	movq	%rax, %r14
	movq	8(%rbx), %rdi
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rdi), %eax
	jne	LBB0_1
## %bb.2:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r13d
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_i2c_get_dma_safe_msg_buf
	movl	%eax, (%rbx)
	movq	8(%rbx), %rcx
	movl	4(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%r13d, %ecx
	callq	_dma_map_single
	movl	%eax, 4(%rbx)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	(%r14), %rdi
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_5:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error while mapping dma buffer %p\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_i2c_amd_dma_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_amd_dma_map
_i2c_amd_dma_map:                       ; @i2c_amd_dma_map
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x21, [x8]
	bl	_amd_i2c_dev_common
	mov	x20, x0
	ldr	x0, [x19, #8]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	adrp	x10, _DMA_FROM_DEVICE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x11, _DMA_TO_DEVICE@GOTPAGE
Lloh6:
	ldr	x11, [x11, _DMA_TO_DEVICE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w22, [x8]
	mov	w1, #0
	bl	_i2c_get_dma_safe_msg_buf
	mov	x1, x0
	str	w0, [x19]
	ldr	x8, [x19, #8]
	ldr	w2, [x8, #4]
	mov	x0, x21
	mov	x3, x22
	bl	_dma_map_single
	mov	x1, x0
	str	w0, [x19, #4]
	mov	x0, x21
	bl	_dma_mapping_error
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x20]
	ldr	w2, [x19]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error while mapping dma buffer %p\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_i2c_amd_dma_map
.subsections_via_symbols
