	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function igt_ppgtt_alloc
_igt_ppgtt_alloc:                       ## @igt_ppgtt_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	%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	%rdi, %rbx
	callq	_HAS_PPGTT
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	___ppgtt_create
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.18:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	xorl	%r12d, %r12d
	jmp	LBB0_17
LBB0_3:
	cmpq	$0, (%rbx)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.5:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_totalram_pages
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	16(%rbx), %edi
	movl	%eax, %esi
	callq	_min
	cmpl	$4096, %eax                     ## imm = 0x1000
	jl	LBB0_16
## %bb.6:
	movl	%eax, %r15d
	movl	$4096, %ebx                     ## imm = 0x1000
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	*(%r14)
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%eax, %eax
	callq	_cond_resched
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	*8(%r14)
	shll	$2, %ebx
	cmpl	%r15d, %ebx
	jle	LBB0_7
## %bb.11:
	movl	$4096, %ebx                     ## imm = 0x1000
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %r14d
	movl	%ebx, %r15d
	subl	%r13d, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movl	%r15d, %edx
	callq	*(%rdi)
	testl	%eax, %eax
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_cond_resched
	movl	%ebx, %r13d
	leal	(,%rbx,4), %eax
	movl	%eax, %ebx
	movl	%r14d, %r15d
	cmpl	%r14d, %eax
	jle	LBB0_12
	jmp	LBB0_16
LBB0_4:
	xorl	%r12d, %r12d
LBB0_16:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_i915_vm_put
LBB0_17:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %r12d
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_16
## %bb.9:
	movl	%ebx, %edi
	callq	_ilog2
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_16
LBB0_13:
	movl	%eax, %r12d
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_16
## %bb.14:
	movl	%ebx, %edi
	callq	_ilog2
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%r13d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[1] Ran out of memory for va_range [0 + %llx] [bit %d]\n"

L_.str.1:                               ## @.str.1
	.asciz	"[2] Ran out of memory for va_range [%llx + %llx] [bit %d]\n"

	.no_dead_strip	_igt_ppgtt_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function igt_ppgtt_alloc
_igt_ppgtt_alloc:                       ; @igt_ppgtt_alloc
	.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	x19, x0
	bl	_HAS_PPGTT
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	___ppgtt_create
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	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	_PTR_ERR
LBB0_3:
	mov	w22, #0
	b	LBB0_19
LBB0_4:
	ldr	x8, [x19]
	cbz	x8, LBB0_17
; %bb.5:
	bl	_totalram_pages
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w1, w0, w8
	ldr	w0, [x19, #16]
	bl	_min
	cmp	w0, #1, lsl #12                 ; =4096
	b.lt	LBB0_17
; %bb.6:
	mov	x20, x0
	mov	w21, #4096
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	blr	x8
	cbnz	w0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_cond_resched
	ldr	x8, [x19, #8]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	blr	x8
	lsl	w21, w21, #2
	cmp	w21, w20
	b.le	LBB0_7
; %bb.9:
	mov	w21, #0
	mov	w23, #4096
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	sub	w24, w23, w21
	mov	x0, x19
	mov	x1, x21
	mov	x2, x24
	blr	x8
	cbnz	w0, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	bl	_cond_resched
	mov	x21, x23
	lsl	w8, w23, #2
	mov	x23, x8
	cmp	w8, w20
	b.le	LBB0_10
	b	LBB0_17
LBB0_12:
	mov	x22, x0
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_18
; %bb.13:
	mov	x0, x21
	bl	_ilog2
	mov	x2, x0
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	b	LBB0_16
LBB0_14:
	mov	x22, x0
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_18
; %bb.15:
	mov	x0, x23
	bl	_ilog2
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	x2, x24
LBB0_16:
	bl	_pr_info
LBB0_17:
	mov	w22, #0
LBB0_18:
	mov	x0, x19
	bl	_i915_vm_put
LBB0_19:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[1] Ran out of memory for va_range [0 + %llx] [bit %d]\n"

l_.str.1:                               ; @.str.1
	.asciz	"[2] Ran out of memory for va_range [%llx + %llx] [bit %d]\n"

	.no_dead_strip	_igt_ppgtt_alloc
.subsections_via_symbols
