	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_bo_alloc
_tegra_bo_alloc:                        ## @tegra_bo_alloc
	.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, %r12
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_4
## %bb.1:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_tegra_bo_get_pages
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_tegra_bo_iommu_map
	movl	%eax, %ebx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jns	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_tegra_bo_free
	movl	%ebx, %eax
	jmp	LBB0_6
LBB0_4:
	movq	8(%r12), %r15
	movl	(%r14), %edi
	leaq	4(%r12), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r15, %rsi
	callq	_dma_alloc_wc
	movl	%eax, %ecx
	movl	%eax, (%r12)
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_6
## %bb.5:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate buffer of size %zu\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_tegra_bo_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_bo_alloc
_tegra_bo_alloc:                        ; @tegra_bo_alloc
	.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	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	ldr	x8, [x22]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_tegra_bo_get_pages
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x0, x22
	mov	x1, x20
	bl	_tegra_bo_iommu_map
	tbz	w0, #31, LBB0_5
; %bb.3:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_tegra_bo_free
	b	LBB0_8
LBB0_4:
	ldr	x21, [x20, #8]
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
	add	x2, x20, #4
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x1, x21
	bl	_dma_alloc_wc
	str	w0, [x20]
	cbz	w0, LBB0_7
LBB0_5:
	mov	w21, #0
	b	LBB0_8
LBB0_6:
	mov	x21, x0
	b	LBB0_8
LBB0_7:
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate buffer of size %zu\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_tegra_bo_alloc
.subsections_via_symbols
