	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_prime_import           ## -- Begin function drm_gem_prime_import
	.p2align	4, 0x90
_drm_gem_prime_import:                  ## @drm_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	%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), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	16(%rsi), %rax
	cmpq	_drm_gem_prime_dmabuf_ops@GOTPCREL(%rip), %rax
	jne	LBB0_6
## %bb.4:
	movq	8(%r15), %r13
	cmpq	%rbx, 8(%r13)
	je	LBB0_5
LBB0_6:
	movl	8(%rbx), %esi
	movq	%r15, %rdi
	callq	_dma_buf_attach
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %edi
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_8:
	movq	%r15, %rdi
	callq	_get_dma_buf
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_dma_buf_map_attachment
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_5:
	movq	%r13, %rdi
	callq	_drm_gem_object_reference
	jmp	LBB0_14
LBB0_10:
	movq	(%rbx), %rax
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	*(%rax)
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_dma_buf_unmap_attachment
LBB0_12:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_dma_buf_detach
	movq	%r15, %rdi
	callq	_dma_buf_put
	movl	%ebx, %edi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_13:
	movq	%r14, (%r13)
LBB0_14:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_drm_gem_prime_dmabuf_ops,4,2   ## @drm_gem_prime_dmabuf_ops
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_prime_import           ; -- Begin function drm_gem_prime_import
	.p2align	2
_drm_gem_prime_import:                  ; @drm_gem_prime_import
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x21, x0
	ldr	x8, [x1, #16]
Lloh0:
	adrp	x9, _drm_gem_prime_dmabuf_ops@GOTPAGE
Lloh1:
	ldr	x9, [x9, _drm_gem_prime_dmabuf_ops@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x23, [x19, #8]
	ldr	x8, [x23, #8]
	cmp	x8, x21
	b.eq	LBB0_8
LBB0_3:
	ldr	w1, [x21, #8]
	mov	x0, x19
	bl	_dma_buf_attach
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_PTR_ERR
	b	LBB0_12
LBB0_5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_6:
	mov	x0, x19
	bl	_get_dma_buf
Lloh5:
	adrp	x24, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh6:
	ldr	x24, [x24, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x20
	bl	_dma_buf_map_attachment
	mov	x22, x0
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_11
LBB0_8:
	mov	x0, x23
	bl	_drm_gem_object_reference
	b	LBB0_14
LBB0_9:
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	w1, [x19]
	mov	x0, x21
	mov	x2, x22
	blr	x8
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.10:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x21, x0
	ldr	w2, [x24]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_buf_unmap_attachment
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	bl	_dma_buf_detach
	mov	x0, x19
	bl	_dma_buf_put
	mov	x0, x21
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_13:
	str	x20, [x23]
LBB0_14:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_drm_gem_prime_dmabuf_ops,4,2   ; @drm_gem_prime_dmabuf_ops
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
.subsections_via_symbols
