	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armada_gem_prime_import        ## -- Begin function armada_gem_prime_import
	.p2align	4, 0x90
_armada_gem_prime_import:               ## @armada_gem_prime_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	16(%rsi), %rax
	cmpq	_armada_gem_prime_dmabuf_ops@GOTPCREL(%rip), %rax
	jne	LBB0_3
## %bb.1:
	movq	8(%rbx), %r12
	cmpq	%r14, 8(%r12)
	je	LBB0_2
LBB0_3:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_dma_buf_attach
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
LBB0_4:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_armada_gem_alloc_private_object
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	%rax, %r12
	movq	%r15, (%rax)
	movq	%rbx, %rdi
	callq	_get_dma_buf
	jmp	LBB0_6
LBB0_2:
	movq	%r12, %rdi
	callq	_drm_gem_object_get
LBB0_6:
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_dma_buf_detach
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_armada_gem_prime_dmabuf_ops,4,2 ## @armada_gem_prime_dmabuf_ops
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armada_gem_prime_import        ; -- Begin function armada_gem_prime_import
	.p2align	2
_armada_gem_prime_import:               ; @armada_gem_prime_import
	.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, x1
	mov	x20, x0
	ldr	x8, [x1, #16]
Lloh0:
	adrp	x9, _armada_gem_prime_dmabuf_ops@GOTPAGE
Lloh1:
	ldr	x9, [x9, _armada_gem_prime_dmabuf_ops@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x21, [x19, #8]
	ldr	x8, [x21, #8]
	cmp	x8, x20
	b.eq	LBB0_6
LBB0_2:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dma_buf_attach
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x22
	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
	b	_ERR_CAST
LBB0_4:
	ldr	w1, [x19]
	mov	x0, x20
	bl	_armada_gem_alloc_private_object
	cbz	x0, LBB0_8
; %bb.5:
	mov	x21, x0
	str	x22, [x0]
	mov	x0, x19
	bl	_get_dma_buf
	b	LBB0_7
LBB0_6:
	mov	x0, x21
	bl	_drm_gem_object_get
LBB0_7:
	mov	x0, x21
	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
LBB0_8:
	mov	x0, x19
	mov	x1, x22
	bl	_dma_buf_detach
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_armada_gem_prime_dmabuf_ops,4,2 ; @armada_gem_prime_dmabuf_ops
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
