	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ttm_gart_bind           ## -- Begin function amdgpu_ttm_gart_bind
	.p2align	4, 0x90
_amdgpu_ttm_gart_bind:                  ## @amdgpu_ttm_gart_bind
	.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	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_ttm_to_amdgpu_bo
	movq	(%rbx), %r13
	movq	_AMDGPU_GEM_CREATE_MQD_GFX9@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	(%r13), %rsi
	movq	8(%r13), %rcx
	testl	%edx, (%rax)
	je	LBB0_3
## %bb.1:
	movl	$1, %r15d
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%rcx, %r8
	movq	%r12, %r9
	callq	_amdgpu_gart_bind
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	_AMDGPU_PTE_MTYPE_VG10_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	notq	%rbx
	andq	%r12, %rbx
	movq	_AMDGPU_MTYPE_NC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AMDGPU_PTE_MTYPE_VG10
	orq	%rax, %rbx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r15
	movq	(%r13), %rdx
	movq	8(%r13), %rcx
	addq	%rdx, %r15
	decq	%rdx
	addq	$4, %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rcx, %r8
	movq	%rbx, %r9
	jmp	LBB0_4
LBB0_3:
	movq	%r14, %rdi
	movq	%rsi, %rdx
	movq	%rcx, %r8
	movq	%r12, %r9
LBB0_4:
	callq	_amdgpu_gart_bind
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movq	(%r13), %rdx
	leaq	L_.str(%rip), %rdi
	movq	%rdx, %rsi
	callq	_DRM_ERROR
	jmp	LBB0_7
LBB0_5:
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_CREATE_MQD_GFX9,4,2 ## @AMDGPU_GEM_CREATE_MQD_GFX9
	.comm	_AMDGPU_PTE_MTYPE_VG10_MASK,8,3 ## @AMDGPU_PTE_MTYPE_VG10_MASK
	.comm	_AMDGPU_MTYPE_NC,4,2            ## @AMDGPU_MTYPE_NC
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to bind %lu pages at 0x%08llX\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ttm_gart_bind           ; -- Begin function amdgpu_ttm_gart_bind
	.p2align	2
_amdgpu_ttm_gart_bind:                  ; @amdgpu_ttm_gart_bind
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	bl	_ttm_to_amdgpu_bo
	ldr	x22, [x21]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _AMDGPU_GEM_CREATE_MQD_GFX9@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_MQD_GFX9@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ldp	x1, x3, [x22]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	mov	w2, #1
	mov	x4, x3
	mov	x5, x20
	bl	_amdgpu_gart_bind
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _AMDGPU_PTE_MTYPE_VG10_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMDGPU_PTE_MTYPE_VG10_MASK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	bic	x20, x20, x8
Lloh6:
	adrp	x8, _AMDGPU_MTYPE_NC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AMDGPU_MTYPE_NC@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_AMDGPU_PTE_MTYPE_VG10
	orr	x5, x0, x20
Lloh9:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	mov	w9, #1
	lsl	x8, x9, x8
	ldp	x9, x10, [x22]
	add	x1, x8, x9
	sub	x2, x9, #1
	add	x3, x10, #4
	mov	x0, x19
	mov	x4, x3
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	mov	x2, x1
	mov	x4, x3
	mov	x5, x20
LBB0_4:
	bl	_amdgpu_gart_bind
	mov	x21, x0
	cbz	w0, LBB0_6
LBB0_5:
	ldr	x1, [x22]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x1
	bl	_DRM_ERROR
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_CREATE_MQD_GFX9,4,2 ; @AMDGPU_GEM_CREATE_MQD_GFX9
	.comm	_AMDGPU_PTE_MTYPE_VG10_MASK,8,3 ; @AMDGPU_PTE_MTYPE_VG10_MASK
	.comm	_AMDGPU_MTYPE_NC,4,2            ; @AMDGPU_MTYPE_NC
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to bind %lu pages at 0x%08llX\n"

.subsections_via_symbols
