	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_udl_gem_prime_import           ## -- Begin function udl_gem_prime_import
	.p2align	4, 0x90
_udl_gem_prime_import:                  ## @udl_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	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_get_device
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_dma_buf_attach
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.8:
	movl	(%rbx), %edi
	callq	_put_device
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
LBB0_1:
	movq	%r14, %rdi
	callq	_get_dma_buf
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dma_buf_map_attachment
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_6
LBB0_3:
	movl	(%r14), %esi
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_udl_prime_create
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %r12d
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_dma_buf_unmap_attachment
LBB0_6:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_dma_buf_detach
	movq	%r14, %rdi
	callq	_dma_buf_put
	movl	(%rbx), %edi
	callq	_put_device
	movl	%r12d, %edi
	callq	_ERR_PTR
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	-48(%rbp), %rax
	movq	%r15, (%rax)
	movq	_UDL_BO_WC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-48(%rbp), %rax
	movl	%ecx, 8(%rax)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_UDL_BO_WC,4,2                  ## @UDL_BO_WC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_udl_gem_prime_import           ; -- Begin function udl_gem_prime_import
	.p2align	2
_udl_gem_prime_import:                  ; @udl_gem_prime_import
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_get_device
	ldr	w1, [x19]
	mov	x0, x20
	bl	_dma_buf_attach
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	bl	_put_device
	mov	x0, x21
	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
	b	_ERR_CAST
LBB0_2:
	mov	x0, x20
	bl	_get_dma_buf
Lloh0:
	adrp	x24, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_dma_buf_map_attachment
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_6
LBB0_4:
	ldr	w1, [x20]
	add	x3, sp, #8
	mov	x0, x19
	mov	x2, x23
	bl	_udl_prime_create
	cbz	w0, LBB0_8
; %bb.5:
	mov	x22, x0
	ldr	w2, [x24]
	mov	x0, x21
	mov	x1, x23
	bl	_dma_buf_unmap_attachment
LBB0_6:
	mov	x0, x20
	mov	x1, x21
	bl	_dma_buf_detach
	mov	x0, x20
	bl	_dma_buf_put
	ldr	w0, [x19]
	bl	_put_device
	mov	x0, x22
	bl	_ERR_PTR
LBB0_7:
	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
LBB0_8:
	ldr	x8, [sp, #8]
	str	x21, [x8]
Lloh2:
	adrp	x8, _UDL_BO_WC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UDL_BO_WC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x0, [sp, #8]
	str	w8, [x0, #8]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_UDL_BO_WC,4,2                  ; @UDL_BO_WC
.subsections_via_symbols
