	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_wait_idle
_via_wait_idle:                         ## @via_wait_idle
	.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	$10000000, %ebx                 ## imm = 0x989680
	movq	_VIA_REG_STATUS@GOTPCREL(%rip), %r15
	movq	_VIA_VR_QUEUE_BUSY@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_VIA_READ
	testl	%eax, (%r14)
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	decl	%ebx
	jne	LBB0_1
	jmp	LBB0_8
LBB0_3:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.4:
	movq	_VIA_CMD_RGTR_BUSY@GOTPCREL(%rip), %r12
	movq	_VIA_2D_ENG_BUSY@GOTPCREL(%rip), %r13
	movq	_VIA_3D_ENG_BUSY@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_VIA_READ
	movl	(%r13), %ecx
	orl	(%r12), %ecx
	orl	(%r14), %ecx
	testl	%eax, %ecx
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	decl	%ebx
	jne	LBB0_5
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_6:
	movl	%ebx, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIA_REG_STATUS,4,2             ## @VIA_REG_STATUS
	.comm	_VIA_VR_QUEUE_BUSY,4,2          ## @VIA_VR_QUEUE_BUSY
	.comm	_VIA_CMD_RGTR_BUSY,4,2          ## @VIA_CMD_RGTR_BUSY
	.comm	_VIA_2D_ENG_BUSY,4,2            ## @VIA_2D_ENG_BUSY
	.comm	_VIA_3D_ENG_BUSY,4,2            ## @VIA_3D_ENG_BUSY
	.no_dead_strip	_via_wait_idle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_wait_idle
_via_wait_idle:                         ; @via_wait_idle
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	w19, #38528
	movk	w19, #152, lsl #16
Lloh0:
	adrp	x20, _VIA_REG_STATUS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _VIA_REG_STATUS@GOTPAGEOFF]
Lloh2:
	adrp	x21, _VIA_VR_QUEUE_BUSY@GOTPAGE
Lloh3:
	ldr	x21, [x21, _VIA_VR_QUEUE_BUSY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_VIA_READ
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	subs	w19, w19, #1
	b.ne	LBB0_1
	b	LBB0_7
LBB0_3:
	cbz	w19, LBB0_7
; %bb.4:
Lloh4:
	adrp	x21, _VIA_CMD_RGTR_BUSY@GOTPAGE
Lloh5:
	ldr	x21, [x21, _VIA_CMD_RGTR_BUSY@GOTPAGEOFF]
Lloh6:
	adrp	x22, _VIA_2D_ENG_BUSY@GOTPAGE
Lloh7:
	ldr	x22, [x22, _VIA_2D_ENG_BUSY@GOTPAGEOFF]
Lloh8:
	adrp	x23, _VIA_3D_ENG_BUSY@GOTPAGE
Lloh9:
	ldr	x23, [x23, _VIA_3D_ENG_BUSY@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_VIA_READ
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w8, w8, w9
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	subs	w19, w19, #1
	b.ne	LBB0_5
LBB0_7:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_VIA_REG_STATUS,4,2             ; @VIA_REG_STATUS
	.comm	_VIA_VR_QUEUE_BUSY,4,2          ; @VIA_VR_QUEUE_BUSY
	.comm	_VIA_CMD_RGTR_BUSY,4,2          ; @VIA_CMD_RGTR_BUSY
	.comm	_VIA_2D_ENG_BUSY,4,2            ; @VIA_2D_ENG_BUSY
	.comm	_VIA_3D_ENG_BUSY,4,2            ; @VIA_3D_ENG_BUSY
	.no_dead_strip	_via_wait_idle
.subsections_via_symbols
