	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_bo_import
_tegra_bo_import:                       ## @tegra_bo_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
	movq	8(%rdi), %r12
	movl	(%rsi), %esi
	callq	_tegra_bo_alloc_object
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
LBB0_16:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_dma_buf_attach
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_3
LBB0_4:
	movq	%r14, %rdi
	callq	_get_dma_buf
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_dma_buf_map_attachment
	movq	%rax, 16(%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	16(%r13), %rdi
	callq	_PTR_ERR
LBB0_6:
	movl	%eax, %r12d
LBB0_7:
	movq	16(%r13), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	16(%r13), %rsi
	movl	(%rbx), %edx
	movq	%r15, %rdi
	callq	_dma_buf_unmap_attachment
LBB0_9:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_dma_buf_detach
	movq	%r14, %rdi
	callq	_dma_buf_put
LBB0_3:
	movq	%r13, %rdi
	addq	$8, %rdi
	callq	_drm_gem_object_release
	movq	%r13, %rdi
	callq	_kfree
	movl	%r12d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_10:
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.11:
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_tegra_bo_iommu_map
	testl	%eax, %eax
	jns	LBB0_15
	jmp	LBB0_6
LBB0_12:
	movq	16(%r13), %rax
	cmpl	$2, (%rax)
	jl	LBB0_14
## %bb.13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_7
LBB0_14:
	movl	24(%rax), %edi
	callq	_sg_dma_address
	movl	%eax, 28(%r13)
LBB0_15:
	movq	%r15, 8(%r13)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_tegra_bo_import
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_bo_import
_tegra_bo_import:                       ; @tegra_bo_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
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #8]
	ldr	w1, [x1]
	bl	_tegra_bo_alloc_object
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
LBB0_1:
	mov	x0, x19
	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
LBB0_2:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_dma_buf_attach
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_10
LBB0_4:
	mov	x0, x20
	bl	_get_dma_buf
Lloh0:
	adrp	x23, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_dma_buf_map_attachment
	str	x0, [x19, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_11
; %bb.5:
	ldr	x0, [x19, #16]
	bl	_PTR_ERR
LBB0_6:
	mov	x22, x0
LBB0_7:
	ldr	x0, [x19, #16]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	x1, [x19, #16]
	ldr	w2, [x23]
	mov	x0, x21
	bl	_dma_buf_unmap_attachment
LBB0_9:
	mov	x0, x20
	mov	x1, x21
	bl	_dma_buf_detach
	mov	x0, x20
	bl	_dma_buf_put
LBB0_10:
	add	x0, x19, #8
	bl	_drm_gem_object_release
	mov	x0, x19
	bl	_kfree
	mov	x0, x22
	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_11:
	ldr	x8, [x22]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x22
	mov	x1, x19
	bl	_tegra_bo_iommu_map
	tbz	w0, #31, LBB0_16
	b	LBB0_6
LBB0_13:
	ldr	x8, [x19, #16]
	ldr	w9, [x8]
	cmp	w9, #2
	b.lt	LBB0_15
; %bb.14:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_15:
	ldr	w0, [x8, #24]
	bl	_sg_dma_address
	str	w0, [x19, #28]
LBB0_16:
	str	x21, [x19, #8]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_tegra_bo_import
.subsections_via_symbols
