	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_ttm_tt_populate
_amdgpu_ttm_tt_populate:                ## @amdgpu_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	32(%rdi), %edi
	callq	_amdgpu_ttm_adev
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	_TTM_PAGE_FLAG_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	jmp	LBB0_5
LBB0_6:
	movl	(%rbx), %edx
	movq	_TTM_PAGE_FLAG_SG@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_9
## %bb.7:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	movl	16(%rbx), %ecx
	movl	20(%rbx), %esi
	callq	_drm_prime_sg_to_page_addr_arrays
LBB0_5:
	movq	_tt_unbound@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_9:
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ttm_populate_and_map_pages     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PAGE_FLAG_SG,4,2           ## @TTM_PAGE_FLAG_SG
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_tt_unbound,8,3                 ## @tt_unbound
	.no_dead_strip	_amdgpu_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 amdgpu_ttm_tt_populate
_amdgpu_ttm_tt_populate:                ; @amdgpu_ttm_tt_populate
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_amdgpu_ttm_adev
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_7
; %bb.2:
	mov	w0, #0
Lloh3:
	adrp	x8, _TTM_PAGE_FLAG_SG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTM_PAGE_FLAG_SG@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_6
LBB0_3:
	ldr	w2, [x19]
Lloh6:
	adrp	x8, _TTM_PAGE_FLAG_SG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TTM_PAGE_FLAG_SG@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_9
; %bb.4:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_9
; %bb.5:
	ldp	w3, w1, [x19, #16]
	mov	x0, x8
	bl	_drm_prime_sg_to_page_addr_arrays
	mov	w0, #0
LBB0_6:
Lloh9:
	adrp	x8, _tt_unbound@GOTPAGE
Lloh10:
	ldr	x8, [x8, _tt_unbound@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	w0, [x0]
	mov	x1, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ttm_populate_and_map_pages
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PAGE_FLAG_SG,4,2           ; @TTM_PAGE_FLAG_SG
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_tt_unbound,8,3                 ; @tt_unbound
	.no_dead_strip	_amdgpu_ttm_tt_populate
.subsections_via_symbols
