	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_alloc_new_pages
_ttm_alloc_new_pages:                   ## @ttm_alloc_new_pages
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	sarl	$3, %esi
	movl	%r8d, %edi
	callq	_min
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leal	(,%rax,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r13
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.4:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_list_add
	incl	%r13d
	cmpl	%r13d, %ebx
	je	LBB0_14
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r14
	movl	%r15d, %eax
	incl	%r15d
	movq	%r14, (%r12,%rax,8)
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	cmpl	%edx, %r15d
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ttm_set_pages_caching
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r12, %rcx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_ttm_handle_caching_state_failure
	movq	%r12, %r13
	jmp	LBB0_18
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_2:
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_pr_err
	testl	%r15d, %r15d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_9
## %bb.7:
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_ttm_set_pages_caching
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	movq	%r13, %rcx
	movl	%r15d, %r8d
	callq	_ttm_handle_caching_state_failure
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_14:
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.16:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movl	%r15d, %edx
	callq	_ttm_set_pages_caching
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r14d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movq	%r13, %rcx
	movl	%r15d, %r8d
	callq	_ttm_handle_caching_state_failure
	movl	%r14d, %ebx
	jmp	LBB0_18
LBB0_15:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_18:
	movq	%r13, %rdi
	callq	_kfree
LBB0_19:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to allocate table for new pages\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Unable to get page %u\n"

	.no_dead_strip	_ttm_alloc_new_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttm_alloc_new_pages
_ttm_alloc_new_pages:                   ; @ttm_alloc_new_pages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x25, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	asr	w1, w8, #3
	mov	x0, x4
	bl	_min
	mov	x26, x0
	lsl	w0, w0, #3
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	cbz	w23, LBB0_16
; %bb.2:
	str	w21, [sp, #12]                  ; 4-byte Folded Spill
	mov	w24, #0
	mov	w21, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x28
	mov	x1, x22
	bl	_list_add
	add	w21, w21, #1
	cmp	w23, w21
	b.eq	LBB0_13
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_alloc_page
	cbz	x0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x28, x0
	str	x0, [x19, w24, uxtw #3]
	add	w8, w24, #1
	mov	x24, x8
	cmp	w8, w26
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x26
	bl	_ttm_set_pages_caching
	cbnz	w0, LBB0_17
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w24, #0
	b	LBB0_3
LBB0_8:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_20
LBB0_9:
	str	x21, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	cbz	w24, LBB0_12
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	bl	_ttm_set_pages_caching
	cbz	w0, LBB0_12
; %bb.11:
	mov	x0, x22
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	mov	x2, x20
	mov	x3, x19
	mov	x4, x24
	bl	_ttm_handle_caching_state_failure
LBB0_12:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_19
LBB0_13:
	cbz	w24, LBB0_16
; %bb.14:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	bl	_ttm_set_pages_caching
	mov	x27, x0
	cbz	w0, LBB0_19
; %bb.15:
	mov	x0, x22
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	mov	x2, x20
	mov	x3, x19
	mov	x4, x24
	b	LBB0_18
LBB0_16:
	mov	w27, #0
	b	LBB0_19
LBB0_17:
	mov	x27, x0
	mov	x0, x22
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	mov	x2, x20
	mov	x3, x19
	mov	x4, x26
LBB0_18:
	bl	_ttm_handle_caching_state_failure
LBB0_19:
	mov	x0, x19
	bl	_kfree
LBB0_20:
	mov	x0, x27
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to allocate table for new pages\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Unable to get page %u\n"

	.no_dead_strip	_ttm_alloc_new_pages
.subsections_via_symbols
