	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_pin            ## -- Begin function i915_gem_object_pin
	.p2align	4, 0x90
_i915_gem_object_pin:                   ## @i915_gem_object_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r15d
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	8(%rdi), %rdi
	callq	_to_i915
	movq	%rax, %r13
	movq	8(%r12), %rdi
	callq	_lockdep_assert_held
	movq	%r12, %rdi
	callq	_i915_gem_object_never_bind_ggtt
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_3:
	movl	%ebx, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movq	_PIN_MAPPABLE@GOTPCREL(%rip), %rcx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, (%rcx)
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_12
## %bb.5:
	testq	%r14, %r14
	je	LBB0_7
## %bb.6:
	movq	(%r14), %rax
	movq	_I915_GGTT_VIEW_NORMAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
LBB0_7:
	movl	(%r12), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jle	LBB0_9
## %bb.8:
	movq	_E2BIG@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_9:
	movq	_PIN_NONBLOCK@GOTPCREL(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, (%rdi)
	je	LBB0_12
## %bb.10:
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	cmpl	%esi, %eax
	jg	LBB0_11
LBB0_12:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_i915_vma_instance
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
LBB0_24:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_i915_vma_misplaced
	testq	%rax, %rax
	je	LBB0_20
## %bb.14:
	movq	_PIN_NONBLOCK@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	testl	%r14d, (%rax)
	je	LBB0_19
## %bb.15:
	movq	%r13, %rdi
	callq	_i915_vma_is_pinned
	testq	%rax, %rax
	jne	LBB0_11
## %bb.16:
	movq	%r13, %rdi
	callq	_i915_vma_is_active
	testq	%rax, %rax
	je	LBB0_17
LBB0_11:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_17:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movq	_PIN_MAPPABLE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_19
## %bb.18:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	%ecx, (%r13)
	jg	LBB0_11
LBB0_19:
	movq	%r13, %rdi
	callq	_i915_vma_is_pinned
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_i915_ggtt_offset
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	_PIN_MAPPABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	setne	%r15b
	movq	%r13, %rdi
	callq	_i915_vma_is_map_and_fenceable
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%r15d, %r8d
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%eax, %r9d
	callq	_WARN
	movq	%r13, %rdi
	callq	_i915_vma_unbind
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
LBB0_20:
	cmpq	$0, 16(%r13)
	je	LBB0_23
## %bb.21:
	movq	%r12, %rdi
	callq	_i915_gem_object_is_tiled
	testl	%eax, %eax
	je	LBB0_22
LBB0_23:
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_i915_vma_pin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
	jmp	LBB0_24
LBB0_22:
	movq	8(%r13), %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_i915_vma_revoke_fence
	movl	%eax, %ebx
	movq	8(%r13), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	jne	LBB0_3
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PIN_MAPPABLE,4,2               ## @PIN_MAPPABLE
	.comm	_I915_GGTT_VIEW_NORMAL,8,3      ## @I915_GGTT_VIEW_NORMAL
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_PIN_NONBLOCK,4,2               ## @PIN_NONBLOCK
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bo is already pinned in ggtt with incorrect alignment: offset=%08x, req.alignment=%llx, req.map_and_fenceable=%d, vma->map_and_fenceable=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_pin            ; -- Begin function i915_gem_object_pin
	.p2align	2
_i915_gem_object_pin:                   ; @i915_gem_object_pin
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x25, x1
	mov	x22, x0
	ldr	x0, [x0, #8]
	bl	_to_i915
	mov	x24, x0
	ldr	x0, [x22, #8]
	bl	_lockdep_assert_held
	mov	x0, x22
	bl	_i915_gem_object_never_bind_ggtt
	cbz	x0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_3:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_4:
Lloh2:
	adrp	x26, _PIN_MAPPABLE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _PIN_MAPPABLE@GOTPAGEOFF]
	ldr	w8, [x26]
	tst	w8, w19
	b.eq	LBB0_10
; %bb.5:
	cbz	x23, LBB0_7
; %bb.6:
	ldr	x8, [x23]
Lloh4:
	adrp	x9, _I915_GGTT_VIEW_NORMAL@GOTPAGE
Lloh5:
	ldr	x9, [x9, _I915_GGTT_VIEW_NORMAL@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
LBB0_7:
	ldr	w8, [x22]
	ldr	w9, [x24]
	cmp	w8, w9
	b.le	LBB0_9
; %bb.8:
Lloh7:
	adrp	x8, _E2BIG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_2
LBB0_9:
Lloh9:
	adrp	x10, _PIN_NONBLOCK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _PIN_NONBLOCK@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	and	w10, w10, w19
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	cmp	w10, #0
	ccmp	w8, w9, #4, ne
	b.gt	LBB0_16
LBB0_10:
	mov	x0, x22
	mov	x1, x25
	mov	x2, x23
	bl	_i915_vma_instance
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_12
LBB0_11:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x23
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_i915_vma_misplaced
	cbz	x0, LBB0_20
; %bb.13:
Lloh12:
	adrp	x8, _PIN_NONBLOCK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PIN_NONBLOCK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_19
; %bb.14:
	mov	x0, x23
	bl	_i915_vma_is_pinned
	cbnz	x0, LBB0_16
; %bb.15:
	mov	x0, x23
	bl	_i915_vma_is_active
	cbz	x0, LBB0_17
LBB0_16:
Lloh15:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_2
LBB0_17:
	ldr	w8, [x26]
	tst	w8, w19
	b.eq	LBB0_19
; %bb.18:
	ldr	w8, [x23]
	ldr	w9, [x24]
	cmp	w9, #0
	cinc	w9, w9, lt
	cmp	w8, w9, asr #1
	b.gt	LBB0_16
LBB0_19:
	mov	x0, x23
	bl	_i915_vma_is_pinned
	mov	x24, x0
	mov	x0, x23
	bl	_i915_ggtt_offset
	mov	x25, x0
	ldr	w8, [x26]
	tst	w8, w19
	cset	w26, ne
	mov	x0, x23
	bl	_i915_vma_is_map_and_fenceable
	mov	x5, x0
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x25
	mov	x3, x20
	mov	x4, x26
	bl	_WARN
	mov	x0, x23
	bl	_i915_vma_unbind
	mov	x24, x0
	cbnz	w0, LBB0_3
LBB0_20:
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_22
; %bb.21:
	mov	x0, x22
	bl	_i915_gem_object_is_tiled
	cbz	w0, LBB0_23
LBB0_22:
	mov	x0, x23
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_i915_vma_pin
	mov	x24, x0
	cbnz	w0, LBB0_3
	b	LBB0_11
LBB0_23:
	ldr	x0, [x23, #8]
	bl	_mutex_lock
	mov	x0, x23
	bl	_i915_vma_revoke_fence
	mov	x24, x0
	ldr	x0, [x23, #8]
	bl	_mutex_unlock
	cbnz	w24, LBB0_3
	b	LBB0_22
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PIN_MAPPABLE,4,2               ; @PIN_MAPPABLE
	.comm	_I915_GGTT_VIEW_NORMAL,8,3      ; @I915_GGTT_VIEW_NORMAL
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_PIN_NONBLOCK,4,2               ; @PIN_NONBLOCK
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bo is already pinned in ggtt with incorrect alignment: offset=%08x, req.alignment=%llx, req.map_and_fenceable=%d, vma->map_and_fenceable=%d\n"

.subsections_via_symbols
