	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_vram_pin               ## -- Begin function drm_gem_vram_pin
	.p2align	4, 0x90
_drm_gem_vram_pin:                      ## @drm_gem_vram_pin
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	$0, -32(%rbp)
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ttm_bo_reserve
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movq	8(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_26
## %bb.2:
	testq	%r15, %r15
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_drm_gem_vram_placement
LBB0_4:
	leaq	16(%r14), %rsi
	movl	16(%r14), %r10d
	testl	%r10d, %r10d
	jle	LBB0_24
## %bb.5:
	movq	24(%r14), %rcx
	cmpl	$8, %r10d
	jb	LBB0_6
## %bb.8:
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %r8
	leaq	4(%r8), %rax
	cmpq	%rax, %rcx
	jae	LBB0_11
## %bb.9:
	leaq	(%rcx,%r10,4), %rax
	cmpq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rax
	jbe	LBB0_11
LBB0_6:
	xorl	%edx, %edx
LBB0_18:
	movq	%rdx, %r8
	notq	%r8
	addq	%r10, %r8
	movq	%r10, %rax
	andq	$3, %rax
	je	LBB0_21
## %bb.19:
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	orl	%edi, (%rcx,%rdx,4)
	incq	%rdx
	decq	%rax
	jne	LBB0_20
LBB0_21:
	cmpq	$3, %r8
	jb	LBB0_24
## %bb.22:
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rax
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax), %edi
	orl	%edi, (%rcx,%rdx,4)
	movl	(%rax), %edi
	orl	%edi, 4(%rcx,%rdx,4)
	movl	(%rax), %edi
	orl	%edi, 8(%rcx,%rdx,4)
	movl	(%rax), %edi
	orl	%edi, 12(%rcx,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %r10
	jne	LBB0_23
	jmp	LBB0_24
LBB0_7:
	movl	%eax, %ebx
	jmp	LBB0_28
LBB0_11:
	movl	%r10d, %edx
	andl	$-8, %edx
	leaq	-8(%rdx), %rax
	movq	%rax, %r9
	shrq	$3, %r9
	incq	%r9
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	%r9, %rdi
	andq	$-2, %rdi
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rbx,4), %xmm1
	movdqu	16(%rcx,%rbx,4), %xmm2
	movdqu	32(%rcx,%rbx,4), %xmm3
	movdqu	48(%rcx,%rbx,4), %xmm4
	por	%xmm0, %xmm1
	por	%xmm0, %xmm2
	movdqu	%xmm1, (%rcx,%rbx,4)
	movdqu	%xmm2, 16(%rcx,%rbx,4)
	por	%xmm0, %xmm3
	por	%xmm0, %xmm4
	movdqu	%xmm3, 32(%rcx,%rbx,4)
	movdqu	%xmm4, 48(%rcx,%rbx,4)
	addq	$16, %rbx
	addq	$-2, %rdi
	jne	LBB0_13
	jmp	LBB0_15
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	testb	$1, %r9b
	je	LBB0_17
## %bb.16:
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqu	(%rcx,%rbx,4), %xmm1
	movdqu	16(%rcx,%rbx,4), %xmm2
	por	%xmm0, %xmm1
	por	%xmm0, %xmm2
	movdqu	%xmm1, (%rcx,%rbx,4)
	movdqu	%xmm2, 16(%rcx,%rbx,4)
LBB0_17:
	cmpq	%r10, %rdx
	jne	LBB0_18
LBB0_24:
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ttm_bo_validate
	testl	%eax, %eax
	js	LBB0_29
## %bb.25:
	movq	8(%r14), %rax
LBB0_26:
	incq	%rax
	movq	%rax, 8(%r14)
	xorl	%ebx, %ebx
LBB0_27:
	movq	%r14, %rdi
	callq	_ttm_bo_unreserve
LBB0_28:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	movl	%eax, %ebx
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ## @TTM_PL_FLAG_NO_EVICT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_vram_pin               ; -- Begin function drm_gem_vram_pin
	.p2align	2
_drm_gem_vram_pin:                      ; @drm_gem_vram_pin
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	mov	w1, #1
	mov	w2, #0
	mov	x3, #0
	bl	_ttm_bo_reserve
	tbnz	w0, #31, LBB0_15
; %bb.1:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_13
; %bb.2:
	cbz	x21, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x21
	bl	_drm_gem_vram_placement
LBB0_4:
	mov	x1, x19
	ldr	w9, [x1, #16]!
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.5:
	ldr	x10, [x19, #24]
Lloh0:
	adrp	x8, _TTM_PL_FLAG_NO_EVICT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_PL_FLAG_NO_EVICT@GOTPAGEOFF]
	cmp	w9, #16
	b.lo	LBB0_8
; %bb.6:
	add	x11, x8, #4
	cmp	x10, x11
	b.hs	LBB0_18
; %bb.7:
	add	x11, x10, x9, lsl #2
	cmp	x11, x8
	b.ls	LBB0_18
LBB0_8:
	mov	x11, #0
LBB0_9:
	add	x10, x10, x11, lsl #2
	sub	x9, x9, x11
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8]
	ldr	w12, [x10]
	orr	w11, w12, w11
	str	w11, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_10
LBB0_11:
	add	x2, sp, #8
	mov	x0, x19
	bl	_ttm_bo_validate
	tbnz	w0, #31, LBB0_17
; %bb.12:
	ldr	x8, [x19, #8]
LBB0_13:
	mov	w20, #0
	add	x8, x8, #1
	str	x8, [x19, #8]
LBB0_14:
	mov	x0, x19
	bl	_ttm_bo_unreserve
	b	LBB0_16
LBB0_15:
	mov	x20, x0
LBB0_16:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_17:
	mov	x20, x0
	b	LBB0_14
LBB0_18:
	and	x11, x9, #0xfffffff0
	ld1r.4s	{ v0 }, [x8]
	add	x12, x10, #32
	mov	x13, x11
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x12, #-32]
	ldp	q3, q4, [x12]
	orr.16b	v1, v1, v0
	orr.16b	v2, v2, v0
	orr.16b	v3, v3, v0
	orr.16b	v4, v4, v0
	stp	q1, q2, [x12, #-32]
	stp	q3, q4, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_19
; %bb.20:
	cmp	x11, x9
	b.eq	LBB0_11
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ; @TTM_PL_FLAG_NO_EVICT
.subsections_via_symbols
