	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __gen6_gt_wait_for_fifo
___gen6_gt_wait_for_fifo:               ## @__gen6_gt_wait_for_fifo
	.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	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_IS_VALLEYVIEW
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_fifo_free_entries
	movq	%rax, %rbx
	jmp	LBB0_3
LBB0_2:
	movq	(%r14), %rbx
LBB0_3:
	movq	_GT_FIFO_NUM_RESERVED_ENTRIES@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rbx
	jg	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_fifo_free_entries
	movq	%rax, %rbx
	xorl	%edi, %edi
	cmpq	(%r15), %rax
	setg	%dil
	movq	_GT_FIFO_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wait_for_atomic
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_DEBUG                      ## TAILCALL
LBB0_5:
	decq	%rbx
	movq	%rbx, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GT_FIFO_NUM_RESERVED_ENTRIES,8,3 ## @GT_FIFO_NUM_RESERVED_ENTRIES
	.comm	_GT_FIFO_TIMEOUT_MS,4,2         ## @GT_FIFO_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GT_FIFO timeout, entries: %u\n"

	.no_dead_strip	___gen6_gt_wait_for_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __gen6_gt_wait_for_fifo
___gen6_gt_wait_for_fifo:               ; @__gen6_gt_wait_for_fifo
	.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	x19, x0
	ldr	w0, [x0, #8]
	bl	_IS_VALLEYVIEW
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_fifo_free_entries
	mov	x20, x0
	b	LBB0_3
LBB0_2:
	ldr	x20, [x19]
LBB0_3:
Lloh0:
	adrp	x21, _GT_FIFO_NUM_RESERVED_ENTRIES@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GT_FIFO_NUM_RESERVED_ENTRIES@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x20, x8
	b.gt	LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_fifo_free_entries
	mov	x20, x0
	ldr	x8, [x21]
	cmp	x0, x8
	cset	w0, gt
Lloh2:
	adrp	x8, _GT_FIFO_TIMEOUT_MS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GT_FIFO_TIMEOUT_MS@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_wait_for_atomic
	cbz	x0, LBB0_6
; %bb.5:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	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
	b	_DRM_DEBUG
LBB0_6:
	sub	x8, x20, #1
	str	x8, [x19]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_GT_FIFO_NUM_RESERVED_ENTRIES,8,3 ; @GT_FIFO_NUM_RESERVED_ENTRIES
	.comm	_GT_FIFO_TIMEOUT_MS,4,2         ; @GT_FIFO_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GT_FIFO timeout, entries: %u\n"

	.no_dead_strip	___gen6_gt_wait_for_fifo
.subsections_via_symbols
