	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_ttm_tt_populate
_radeon_ttm_tt_populate:                ## @radeon_ttm_tt_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
	pushq	%rax
	.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	%rdi, %r13
	movq	_TTM_PAGE_FLAG_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_4
## %bb.2:
	movq	40(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	movq	24(%r13), %rsi
	movq	(%r13), %rdx
	movl	16(%r13), %ecx
	callq	_drm_prime_sg_to_page_addr_arrays
	movq	_tt_unbound@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r13)
	jmp	LBB0_14
LBB0_4:
	movl	32(%r13), %edi
	callq	_radeon_get_rdev
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_ttm_pool_populate
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_5
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	$0, 16(%r13)
	movl	$0, %r15d
	je	LBB0_14
## %bb.6:
	xorl	%ebx, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r14), %edi
	movq	24(%r13), %rax
	movl	(%rax,%rbx,4), %esi
	movl	(%r15), %ecx
	movl	(%r12), %r8d
	xorl	%edx, %edx
	callq	_pci_map_page
	movq	(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movl	4(%r14), %edi
	movq	%rax, %rsi
	callq	_pci_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movl	16(%r13), %eax
	cmpq	%rax, %rbx
	jb	LBB0_7
## %bb.13:
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_8:
	cmpl	$1, %ebx
	je	LBB0_11
## %bb.9:
	decq	%rbx
	movl	%ebx, %ebx
	movq	(%r13), %rax
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%r14), %edi
	movq	(%rax,%rbx,8), %rsi
	movl	(%r15), %edx
	movl	(%r12), %ecx
	callq	_pci_unmap_page
	movq	(%r13), %rax
	movq	$0, (%rax,%rbx,8)
	decq	%rbx
	testl	%ebx, %ebx
	jne	LBB0_10
LBB0_11:
	movq	%r13, %rdi
	callq	_ttm_pool_unpopulate
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PAGE_FLAG_SG,4,2           ## @TTM_PAGE_FLAG_SG
	.comm	_tt_unpopulated,8,3             ## @tt_unpopulated
	.comm	_tt_unbound,8,3                 ## @tt_unbound
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ## @PCI_DMA_BIDIRECTIONAL
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_RADEON_IS_AGP,4,2              ## @RADEON_IS_AGP
	.no_dead_strip	_radeon_ttm_tt_populate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_ttm_tt_populate
_radeon_ttm_tt_populate:                ; @radeon_ttm_tt_populate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _tt_unpopulated@GOTPAGE
Lloh1:
	ldr	x9, [x9, _tt_unpopulated@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _TTM_PAGE_FLAG_SG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TTM_PAGE_FLAG_SG@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x1, [x19, #24]
	ldr	x2, [x19]
	ldr	w3, [x19, #16]
	bl	_drm_prime_sg_to_page_addr_arrays
	mov	w0, #0
Lloh6:
	adrp	x8, _tt_unbound@GOTPAGE
Lloh7:
	ldr	x8, [x8, _tt_unbound@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	b	LBB0_10
LBB0_4:
	ldr	w0, [x19, #32]
	bl	_radeon_get_rdev
	mov	x20, x0
	mov	x0, x19
	bl	_ttm_pool_populate
	cbnz	w0, LBB0_10
; %bb.5:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_9
; %bb.6:
	mov	x23, #0
Lloh9:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh10:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
Lloh11:
	adrp	x22, _PCI_DMA_BIDIRECTIONAL@GOTPAGE
Lloh12:
	ldr	x22, [x22, _PCI_DMA_BIDIRECTIONAL@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #4]
	ldr	x8, [x19, #24]
	ldr	w1, [x8, x23, lsl #2]
	ldr	w3, [x21]
	ldr	w4, [x22]
	mov	w2, #0
	bl	_pci_map_page
	mov	x1, x0
	ldr	x8, [x19]
	str	x0, [x8, x23, lsl #3]
	ldr	w0, [x20, #4]
	bl	_pci_dma_mapping_error
	cbnz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x23, x23, #1
	ldr	w8, [x19, #16]
	cmp	x23, x8
	b.lo	LBB0_7
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	cmp	w23, #1
	b.eq	LBB0_14
; %bb.12:
	sub	x8, x23, #1
	and	x23, x8, #0xffffffff
	ldr	x8, [x19]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #4]
	lsl	x24, x23, #3
	ldr	x1, [x8, x24]
	ldr	w2, [x21]
	ldr	w3, [x22]
	bl	_pci_unmap_page
	ldr	x8, [x19]
	str	xzr, [x8, x24]
	sub	x23, x23, #1
	cbnz	w23, LBB0_13
LBB0_14:
	mov	x0, x19
	bl	_ttm_pool_unpopulate
Lloh13:
	adrp	x8, _EFAULT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PAGE_FLAG_SG,4,2           ; @TTM_PAGE_FLAG_SG
	.comm	_tt_unpopulated,8,3             ; @tt_unpopulated
	.comm	_tt_unbound,8,3                 ; @tt_unbound
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ; @PCI_DMA_BIDIRECTIONAL
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_RADEON_IS_AGP,4,2              ; @RADEON_IS_AGP
	.no_dead_strip	_radeon_ttm_tt_populate
.subsections_via_symbols
