	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	8(%rsi), %rdi
	callq	_atop
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, (%rbx)
	leal	(,%rax,8), %edi
	movq	_DRM_MEM_DRIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	callq	_malloc
	leaq	4(%rbx), %rcx
	movl	%eax, 4(%rbx)
	movl	(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VM_MEMATTR_WRITE_COMBINING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_tegra_bo_alloc_contig
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_2:
	movq	%rbx, %rdi
	callq	_tegra_bo_init_pager
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	callq	_DRM_WARNING
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MEM_DRIVER,4,2             ## @DRM_MEM_DRIVER
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_VM_MEMATTR_WRITE_COMBINING,4,2 ## @VM_MEMATTR_WRITE_COMBINING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory for gem object.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot initialize gem object pager.\n"

	.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	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	ldr	x0, [x1, #8]
	bl	_atop
	str	w0, [x19]
	lsl	w0, w0, #3
Lloh0:
	adrp	x8, _DRM_MEM_DRIVER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MEM_DRIVER@GOTPAGEOFF]
Lloh2:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_malloc
	mov	x3, x19
	str	w0, [x3, #4]!
	ldr	w0, [x19]
Lloh9:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _VM_MEMATTR_WRITE_COMBINING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VM_MEMATTR_WRITE_COMBINING@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_tegra_bo_alloc_contig
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_tegra_bo_init_pager
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.3:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_WARNING
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MEM_DRIVER,4,2             ; @DRM_MEM_DRIVER
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_VM_MEMATTR_WRITE_COMBINING,4,2 ; @VM_MEMATTR_WRITE_COMBINING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory for gem object.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot initialize gem object pager.\n"

	.no_dead_strip	_tegra_bo_alloc
.subsections_via_symbols
