	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oa_buffer_check_unlocked
_oa_buffer_check_unlocked:              ## @oa_buffer_check_unlocked
	.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
	movq	%rdi, %rbx
	movq	48(%rdi), %r13
	movl	(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addq	$24, %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movl	4(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	8(%rbx), %r14d
	xorl	%eax, %eax
	testq	%r14, %r14
	sete	%al
	movq	32(%rbx), %rcx
	movl	(%rcx,%r14,4), %r15d
	movl	(%rcx,%rax,4), %r12d
	movq	%rbx, %rdi
	callq	*(%r13)
	movl	%eax, %r13d
	xorl	%eax, %eax
	callq	_ktime_get_mono_fast_ns
	movq	_INVALID_TAIL_PTR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	%esi, %r12d
	jne	LBB0_2
## %bb.1:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
LBB0_2:
	movq	%rax, %rcx
	subq	16(%rbx), %rcx
	movq	_OA_TAIL_MARGIN_NSEC@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jle	LBB0_10
## %bb.3:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	xorl	$1, %r14d
	movl	%r14d, 8(%rbx)
	movq	32(%rbx), %rdx
	sete	%cl
	movl	%esi, (%rdx,%rcx,4)
	movl	%r12d, %r15d
	movq	_INVALID_TAIL_PTR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_4:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	negl	%eax
	andl	%eax, %r13d
	cmpl	%r12d, %r15d
	je	LBB0_6
## %bb.5:
	movl	%r13d, %edi
	movl	%r15d, %esi
	callq	_OA_TAKEN
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jl	LBB0_10
LBB0_6:
	movq	40(%rbx), %rdi
	callq	_i915_ggtt_offset
	cmpl	%eax, %r13d
	jl	LBB0_9
## %bb.7:
	movq	_OA_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	cmpl	%eax, %r13d
	jge	LBB0_9
## %bb.8:
	movq	32(%rbx), %rax
	xorl	%ecx, %ecx
	testl	%r14d, %r14d
	sete	%cl
	movl	%r13d, (%rax,%rcx,4)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%rbx)
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_DRM_ERROR
LBB0_10:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	movq	_INVALID_TAIL_PTR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r15d
	je	LBB0_12
## %bb.11:
	movl	%r15d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_OA_TAKEN
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	setge	%al
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INVALID_TAIL_PTR,4,2           ## @INVALID_TAIL_PTR
	.comm	_OA_TAIL_MARGIN_NSEC,8,3        ## @OA_TAIL_MARGIN_NSEC
	.comm	_OA_BUFFER_SIZE,4,2             ## @OA_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Ignoring spurious out of range OA buffer tail pointer = %u\n"

	.no_dead_strip	_oa_buffer_check_unlocked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oa_buffer_check_unlocked
_oa_buffer_check_unlocked:              ; @oa_buffer_check_unlocked
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	ldr	x23, [x0, #48]
	ldr	w25, [x0]
	add	x20, x0, #24
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldp	w19, w27, [x21, #4]
	cmp	x27, #0
	cset	w8, eq
	ldr	x9, [x21, #32]
	ldr	w22, [x9, x27, lsl #2]
	ldr	w28, [x9, w8, uxtw #2]
	ldr	x8, [x23]
	mov	x0, x21
	blr	x8
	mov	x24, x0
	bl	_ktime_get_mono_fast_ns
	mov	x23, x0
Lloh0:
	adrp	x26, _INVALID_TAIL_PTR@GOTPAGE
Lloh1:
	ldr	x26, [x26, _INVALID_TAIL_PTR@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w28, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	x9, [x21, #16]
Lloh2:
	adrp	x10, _OA_TAIL_MARGIN_NSEC@GOTPAGE
Lloh3:
	ldr	x10, [x10, _OA_TAIL_MARGIN_NSEC@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	sub	x9, x23, x9
	cmp	x9, x10
	b.le	LBB0_9
; %bb.2:
	eor	w27, w27, #0x1
	str	w27, [x21, #8]
	ldr	x9, [x21, #32]
	cmp	w27, #0
	cset	w10, eq
	str	w8, [x9, w10, uxtw #2]
	mov	x22, x28
	ldr	w28, [x26]
LBB0_3:
	neg	w8, w25
	and	w24, w24, w8
	cmp	w22, w28
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x24
	mov	x1, x22
	bl	_OA_TAKEN
	cmp	w0, w25
	b.lt	LBB0_9
LBB0_5:
	ldr	x0, [x21, #40]
	bl	_i915_ggtt_offset
	cmp	w24, w0
	b.lt	LBB0_8
; %bb.6:
Lloh5:
	adrp	x8, _OA_BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OA_BUFFER_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w8, w8, w0
	cmp	w24, w8
	b.ge	LBB0_8
; %bb.7:
	ldr	x8, [x21, #32]
	cmp	w27, #0
	cset	w9, eq
	str	w24, [x8, w9, uxtw #2]
	str	x23, [x21, #16]
	b	LBB0_9
LBB0_8:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_DRM_ERROR
LBB0_9:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w8, [x26]
	cmp	w22, w8
	b.ne	LBB0_11
; %bb.10:
	mov	w0, #0
	b	LBB0_12
LBB0_11:
	mov	x0, x22
	mov	x1, x19
	bl	_OA_TAKEN
	cmp	w0, w25
	cset	w0, ge
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_INVALID_TAIL_PTR,4,2           ; @INVALID_TAIL_PTR
	.comm	_OA_TAIL_MARGIN_NSEC,8,3        ; @OA_TAIL_MARGIN_NSEC
	.comm	_OA_BUFFER_SIZE,4,2             ; @OA_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Ignoring spurious out of range OA buffer tail pointer = %u\n"

	.no_dead_strip	_oa_buffer_check_unlocked
.subsections_via_symbols
