	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_dma_populate               ## -- Begin function ttm_dma_populate
	.p2align	4, 0x90
_ttm_dma_populate:                      ## @ttm_dma_populate
	.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
	movq	8(%rdi), %rax
	movq	_tt_unpopulated@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.1:
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	40(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %edi
	movl	32(%rbx), %esi
	callq	_ttm_to_type
	movl	%eax, %esi
	movl	16(%rbx), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	_TTM_PAGE_FLAG_DMA32@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_GFP_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_GFP_DMA32@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_GFP_HIGHUSER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_TTM_PAGE_FLAG_ZERO_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	callq	_ttm_dma_find_pool
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_2
LBB0_4:
	movq	%rbx, %rdi
	callq	_INIT_LIST_HEAD
	cmpl	$0, 20(%rbx)
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_10
## %bb.5:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_ttm_dma_pool_get_pages
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	24(%rbx), %rax
	movl	(%rax,%r14,4), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ttm_mem_global_alloc_page
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	incq	%r14
	movl	20(%rbx), %eax
	cmpq	%rax, %r14
	jb	LBB0_8
LBB0_10:
	leaq	8(%rbx), %r14
	movq	_TTM_PAGE_FLAG_SWAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	16(%rbx), %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%r14, %rdi
	callq	_ttm_tt_swapin
	movl	%eax, %r15d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ttm_dma_unpopulate
	jmp	LBB0_14
LBB0_2:
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	andl	%eax, %r12d
	orl	-56(%rbp), %r14d                ## 4-byte Folded Reload
	testl	%eax, -60(%rbp)                 ## 4-byte Folded Reload
	cmovel	-52(%rbp), %r14d                ## 4-byte Folded Reload
	testl	%r12d, %r12d
	cmovel	%r12d, %r15d
	orl	%r14d, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	_ttm_dma_pool_init
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	jne	LBB0_3
	jmp	LBB0_4
LBB0_9:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ttm_dma_unpopulate
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_13:
	movq	_tt_unbound@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	xorl	%r15d, %r15d
LBB0_14:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tt_unpopulated,8,3             ## @tt_unpopulated
	.comm	_TTM_PAGE_FLAG_DMA32,4,2        ## @TTM_PAGE_FLAG_DMA32
	.comm	_GFP_USER,4,2                   ## @GFP_USER
	.comm	_GFP_DMA32,4,2                  ## @GFP_DMA32
	.comm	_GFP_HIGHUSER,4,2               ## @GFP_HIGHUSER
	.comm	_TTM_PAGE_FLAG_ZERO_ALLOC,4,2   ## @TTM_PAGE_FLAG_ZERO_ALLOC
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TTM_PAGE_FLAG_SWAPPED,4,2      ## @TTM_PAGE_FLAG_SWAPPED
	.comm	_tt_unbound,8,3                 ## @tt_unbound
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_dma_populate               ; -- Begin function ttm_dma_populate
	.p2align	2
_ttm_dma_populate:                      ; @ttm_dma_populate
	.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	x21, x0
	ldr	x8, [x21, #8]!
Lloh0:
	adrp	x9, _tt_unpopulated@GOTPAGE
Lloh1:
	ldr	x9, [x9, _tt_unpopulated@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.1:
	mov	x23, x1
	mov	x20, x0
	ldr	x8, [x21, #32]
	ldr	x22, [x8]
	ldr	w0, [x0, #16]
	ldr	w1, [x20, #32]
	bl	_ttm_to_type
	mov	x24, x0
	ldr	w25, [x20, #16]
Lloh3:
	adrp	x8, _TTM_PAGE_FLAG_DMA32@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTM_PAGE_FLAG_DMA32@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
Lloh6:
	adrp	x8, _GFP_USER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_USER@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp]                        ; 4-byte Folded Spill
Lloh9:
	adrp	x8, _GFP_DMA32@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_DMA32@GOTPAGEOFF]
Lloh11:
	ldr	w28, [x8]
Lloh12:
	adrp	x8, _GFP_HIGHUSER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_HIGHUSER@GOTPAGEOFF]
Lloh14:
	ldr	w19, [x8]
Lloh15:
	adrp	x8, _TTM_PAGE_FLAG_ZERO_ALLOC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TTM_PAGE_FLAG_ZERO_ALLOC@GOTPAGEOFF]
Lloh17:
	ldr	w26, [x8]
Lloh18:
	adrp	x8, ___GFP_ZERO@GOTPAGE
Lloh19:
	ldr	x8, [x8, ___GFP_ZERO@GOTPAGEOFF]
Lloh20:
	ldr	w27, [x8]
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x23
	mov	x1, x24
	bl	_ttm_dma_find_pool
	mov	x23, x0
	cbz	x0, LBB0_11
LBB0_2:
	mov	x0, x20
	bl	_INIT_LIST_HEAD
	ldr	w8, [x20, #20]
	cbz	w8, LBB0_7
; %bb.3:
	mov	x24, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x20
	mov	x2, x24
	bl	_ttm_dma_pool_get_pages
	cbnz	w0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #24]
	ldr	w1, [x8, x24, lsl #2]
	mov	x0, x22
	mov	w2, #0
	mov	w3, #0
	bl	_ttm_mem_global_alloc_page
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldr	w8, [x20, #20]
	cmp	x24, x8
	b.lo	LBB0_4
LBB0_7:
	ldr	w8, [x20, #16]
Lloh21:
	adrp	x9, _TTM_PAGE_FLAG_SWAPPED@GOTPAGE
Lloh22:
	ldr	x9, [x9, _TTM_PAGE_FLAG_SWAPPED@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_unlikely
	cbz	x0, LBB0_14
; %bb.8:
	mov	x0, x21
	bl	_ttm_tt_swapin
	mov	x22, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_14
; %bb.9:
	mov	x0, x20
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_ttm_dma_unpopulate
	b	LBB0_15
LBB0_10:
	mov	w22, #0
	b	LBB0_15
LBB0_11:
	ldp	w8, w9, [sp]                    ; 8-byte Folded Reload
	orr	w8, w28, w8
	tst	w9, w25
	csel	w8, w19, w8, eq
	tst	w26, w25
	csel	w9, wzr, w27, eq
	orr	w1, w9, w8
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x24
	bl	_ttm_dma_pool_init
	mov	x23, x0
	bl	_IS_ERR_OR_NULL
	cbnz	x0, LBB0_13
	b	LBB0_2
LBB0_12:
	mov	x0, x20
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_ttm_dma_unpopulate
LBB0_13:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_15
LBB0_14:
	mov	w22, #0
Lloh27:
	adrp	x8, _tt_unbound@GOTPAGE
Lloh28:
	ldr	x8, [x8, _tt_unbound@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	str	x8, [x21]
LBB0_15:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_tt_unpopulated,8,3             ; @tt_unpopulated
	.comm	_TTM_PAGE_FLAG_DMA32,4,2        ; @TTM_PAGE_FLAG_DMA32
	.comm	_GFP_USER,4,2                   ; @GFP_USER
	.comm	_GFP_DMA32,4,2                  ; @GFP_DMA32
	.comm	_GFP_HIGHUSER,4,2               ; @GFP_HIGHUSER
	.comm	_TTM_PAGE_FLAG_ZERO_ALLOC,4,2   ; @TTM_PAGE_FLAG_ZERO_ALLOC
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TTM_PAGE_FLAG_SWAPPED,4,2      ; @TTM_PAGE_FLAG_SWAPPED
	.comm	_tt_unbound,8,3                 ; @tt_unbound
.subsections_via_symbols
