	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movl	%ecx, %r14d
	movl	%r8d, %eax
	movl	%r9d, -68(%rbp)                 ## 4-byte Spill
	movl	%r9d, %ecx
	shll	%cl, %eax
	movl	%edx, %ebx
	movl	%esi, -76(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_NUM_PAGES_TO_ALLOC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r12d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	movl	$8, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r8
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.4:
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movl	%r15d, -72(%rbp)                ## 4-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	-72(%rbp), %r15d                ## 4-byte Reload
	cmpl	%r15d, %eax
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_16
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	-76(%rbp), %edi                 ## 4-byte Reload
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_alloc_pages
	testq	%rax, %rax
	je	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_list_add
	movl	$1, %r13d
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	movl	%r13d, %eax
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	addq	$4, %r15
	incl	%r13d
	testl	%eax, %eax
	jne	LBB0_15
LBB0_11:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ebx, %eax
	incl	%ebx
	movq	%r15, (%r8,%rax,8)
	cmpl	%r12d, %ebx
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%r8, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	callq	_ttm_set_pages_caching
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r14d
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r8, %rcx
	movl	%r12d, %r8d
	callq	_ttm_handle_caching_state_failure
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	jmp	LBB0_19
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_2:
	xorl	%r14d, %r14d
LBB0_19:
	movq	%r8, %rdi
	callq	_kfree
LBB0_20:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_pr_debug
	testl	%ebx, %ebx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_9
## %bb.7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_ttm_set_pages_caching
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%ebx, %r8d
	callq	_ttm_handle_caching_state_failure
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	jmp	LBB0_19
LBB0_16:
	xorl	%r14d, %r14d
	testl	%ebx, %ebx
	je	LBB0_19
## %bb.17:
	movq	%r8, %rdi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_ttm_set_pages_caching
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movl	%eax, %r15d
	movq	%r13, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movq	%r8, %rcx
	movl	%ebx, %r8d
	callq	_ttm_handle_caching_state_failure
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movl	%r15d, %r14d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_PAGES_TO_ALLOC,8,3         ## @NUM_PAGES_TO_ALLOC
	.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, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x5
	mov	x22, x4
	mov	x20, x3
	mov	x21, x2
	mov	x28, x1
	mov	x26, x0
	lsl	w0, w4, w5
Lloh0:
	adrp	x8, _NUM_PAGES_TO_ALLOC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NUM_PAGES_TO_ALLOC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_min
	mov	x27, x0
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #8
	bl	_kmalloc_array
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	cbz	w22, LBB0_20
; %bb.2:
	stp	w21, w22, [sp, #16]             ; 8-byte Folded Spill
	mov	w25, #0
	mov	w22, #0
	str	x26, [sp, #24]                  ; 8-byte Folded Spill
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w22, w22, #1
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cmp	w22, w8
	ldr	x26, [sp, #24]                  ; 8-byte Folded Reload
	mov	x28, x24
	b.eq	LBB0_17
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x24, x28
	mov	x0, x28
	mov	x1, x23
	bl	_alloc_pages
	cbz	x0, LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x28, x0
	mov	x1, x26
	bl	_list_add
	mov	w26, #1
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x28, x28, #4
	lsr	w8, w26, w23
	add	w26, w26, #1
	cbnz	w8, LBB0_3
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	x28, [x19, w25, uxtw #3]
	add	w8, w25, #1
	mov	x25, x8
	cmp	w8, w27
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x27
	bl	_ttm_set_pages_caching
	cbnz	w0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	w25, #0
	b	LBB0_6
LBB0_10:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_22
LBB0_11:
	mov	x21, x0
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w1, [sp, #16]                   ; 4-byte Folded Reload
	mov	x2, x20
	mov	x3, x19
	mov	x4, x27
LBB0_12:
	bl	_ttm_handle_caching_state_failure
	b	LBB0_21
LBB0_13:
	str	x22, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	cbz	w25, LBB0_16
; %bb.14:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x25
	bl	_ttm_set_pages_caching
	cbz	w0, LBB0_16
; %bb.15:
	mov	x0, x26
	ldr	w1, [sp, #16]                   ; 4-byte Folded Reload
	mov	x2, x20
	mov	x3, x19
	mov	x4, x25
	bl	_ttm_handle_caching_state_failure
LBB0_16:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_17:
	cbz	w25, LBB0_20
; %bb.18:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x25
	bl	_ttm_set_pages_caching
	mov	x21, x0
	cbz	w0, LBB0_21
; %bb.19:
	mov	x0, x26
	ldr	w1, [sp, #16]                   ; 4-byte Folded Reload
	mov	x2, x20
	mov	x3, x19
	mov	x4, x25
	b	LBB0_12
LBB0_20:
	mov	w21, #0
LBB0_21:
	mov	x0, x19
	bl	_kfree
LBB0_22:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	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	_NUM_PAGES_TO_ALLOC,8,3         ; @NUM_PAGES_TO_ALLOC
	.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
