	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_stop_queue
_goya_stop_queue:                       ## @goya_stop_queue
	.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
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movl	%esi, %eax
	movq	%rdi, %r15
	movq	_TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %esi
	shll	%cl, %esi
	movl	%eax, %edi
	callq	_WREG32
	movl	%r12d, %edi
	callq	_RREG32
	movl	%eax, %ebx
	movq	_TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_QMAN_FENCE_TIMEOUT_USEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_hl_poll_timeout
	testl	%eax, %eax
	jne	LBB0_5
LBB0_2:
	movq	_TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%ebx, %ecx
	movq	_QMAN_STOP_TIMEOUT_USEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_hl_poll_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_5
LBB0_3:
	xorl	%r13d, %r13d
LBB0_5:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT,4,2 ## @TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT
	.comm	_TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK,4,2 ## @TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK
	.comm	_QMAN_FENCE_TIMEOUT_USEC,4,2    ## @QMAN_FENCE_TIMEOUT_USEC
	.comm	_TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK,4,2 ## @TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK
	.comm	_QMAN_STOP_TIMEOUT_USEC,4,2     ## @QMAN_STOP_TIMEOUT_USEC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout while waiting for QMAN to stop\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_goya_stop_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_stop_queue
_goya_stop_queue:                       ; @goya_stop_queue
	.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, x3
	mov	x22, x2
	mov	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x9, _TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w1, w10, w9
	mov	x0, x8
	bl	_WREG32
	mov	x0, x22
	bl	_RREG32
	mov	x21, x0
Lloh3:
	adrp	x8, _TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _QMAN_FENCE_TIMEOUT_USEC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _QMAN_FENCE_TIMEOUT_USEC@GOTPAGEOFF]
Lloh8:
	ldr	w5, [x8]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	w3, #0
	mov	w4, #1000
	bl	_hl_poll_timeout
	mov	x8, x0
	mov	w0, #0
	cbnz	w8, LBB0_4
LBB0_2:
Lloh9:
	adrp	x8, _TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w3, w8, w21
Lloh12:
	adrp	x8, _QMAN_STOP_TIMEOUT_USEC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _QMAN_STOP_TIMEOUT_USEC@GOTPAGEOFF]
Lloh14:
	ldr	w5, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	w4, #1000
	bl	_hl_poll_timeout
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT,4,2 ; @TPC0_QM_GLBL_CFG1_CP_STOP_SHIFT
	.comm	_TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK,4,2 ; @TPC0_QM_CP_STS_FENCE_IN_PROGRESS_MASK
	.comm	_QMAN_FENCE_TIMEOUT_USEC,4,2    ; @QMAN_FENCE_TIMEOUT_USEC
	.comm	_TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK,4,2 ; @TPC0_QM_GLBL_STS0_CP_IS_STOP_MASK
	.comm	_QMAN_STOP_TIMEOUT_USEC,4,2     ; @QMAN_STOP_TIMEOUT_USEC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout while waiting for QMAN to stop\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_goya_stop_queue
.subsections_via_symbols
