	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_bo_setup_vm
_ttm_bo_setup_vm:                       ## @ttm_bo_setup_vm
	.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	%rdi, %r12
	movq	24(%rdi), %r14
	leaq	4(%r14), %r15
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_drm_mm_pre_get
	movl	%eax, %ebx
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_write_lock
	movl	16(%r12), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_drm_mm_search_free
	movq	%rax, 8(%r12)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r12), %rdi
	movl	16(%r12), %esi
	xorl	%edx, %edx
	callq	_drm_mm_get_block_atomic
	movq	%rax, 8(%r12)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_write_unlock
	jmp	LBB0_1
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_write_unlock
	jmp	LBB0_7
LBB0_6:
	movq	%r12, %rdi
	callq	_ttm_bo_vm_insert_rb
	movq	%r14, %rdi
	callq	_write_unlock
	movq	8(%r12), %rax
	movl	(%rax), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	%eax, (%r12)
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_ttm_bo_setup_vm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttm_bo_setup_vm
_ttm_bo_setup_vm:                       ; @ttm_bo_setup_vm
	.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	x19, x0
	ldr	x20, [x0, #24]
	add	x21, x20, #4
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_drm_mm_pre_get
	mov	x22, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	_write_lock
	ldr	w1, [x19, #16]
	mov	x0, x21
	mov	w2, #0
	mov	w3, #0
	bl	_drm_mm_search_free
	str	x0, [x19, #8]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x19, #8]
	ldr	w1, [x19, #16]
	mov	w2, #0
	bl	_drm_mm_get_block_atomic
	str	x0, [x19, #8]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	_write_unlock
	b	LBB0_1
LBB0_5:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x20
	bl	_write_unlock
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_ttm_bo_vm_insert_rb
	mov	x0, x20
	bl	_write_unlock
	mov	w22, #0
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	str	w8, [x19]
LBB0_7:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_ttm_bo_setup_vm
.subsections_via_symbols
