	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armada_gem_map_import          ## -- Begin function armada_gem_map_import
	.p2align	4, 0x90
_armada_gem_map_import:                 ## @armada_gem_map_import
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	32(%rdi), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dma_buf_map_attachment
	movq	%rax, 8(%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	8(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	callq	_PTR_ERR
	movl	%eax, %r14d
	movq	$0, 8(%rbx)
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_2:
	cmpl	$2, (%rdi)
	jl	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_5:
	movl	4(%rdi), %edi
	callq	_sg_dma_len
	cmpq	24(%rbx), %rax
	jge	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_8
LBB0_7:
	movq	8(%rbx), %rax
	movl	4(%rax), %edi
	callq	_sg_dma_address
	movl	%eax, 16(%rbx)
	movl	$1, (%rbx)
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma_buf_map_attachment() error: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"dma_buf_map_attachment() returned an (unsupported) scattered list\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"dma_buf_map_attachment() returned a small buffer\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armada_gem_map_import          ; -- Begin function armada_gem_map_import
	.p2align	2
_armada_gem_map_import:                 ; @armada_gem_map_import
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0, #32]
Lloh0:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_dma_buf_map_attachment
	str	x0, [x19, #8]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_PTR_ERR
	mov	x20, x0
	str	xzr, [x19, #8]
	str	x20, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_8
LBB0_2:
	ldr	w8, [x0]
	cmp	w8, #2
	b.lt	LBB0_4
; %bb.3:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	w0, [x0, #4]
	bl	_sg_dma_len
	ldr	x8, [x19, #24]
	cmp	x0, x8
	b.ge	LBB0_7
; %bb.5:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_6:
	bl	_DRM_ERROR
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #4]
	bl	_sg_dma_address
	mov	w20, #0
	str	w0, [x19, #16]
	mov	w8, #1
	str	w8, [x19]
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma_buf_map_attachment() error: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"dma_buf_map_attachment() returned an (unsupported) scattered list\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"dma_buf_map_attachment() returned a small buffer\n"

.subsections_via_symbols
