	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_gui_wait_for_idle         ## -- Begin function r100_gui_wait_for_idle
	.p2align	4, 0x90
_r100_gui_wait_for_idle:                ## @r100_gui_wait_for_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
	movq	%rdi, %r13
	movl	$64, %esi
	callq	_r100_rbbm_fifo_wait_for_entry
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
LBB0_2:
	movl	$-1, %r14d
	cmpl	$0, (%r13)
	je	LBB0_7
## %bb.3:
	movq	_RADEON_RBBM_STATUS@GOTPCREL(%rip), %r15
	movq	_RADEON_RBBM_ACTIVE@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_RREG32
	testl	%eax, (%r12)
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	cmpl	(%r13), %ebx
	jb	LBB0_4
	jmp	LBB0_7
LBB0_5:
	xorl	%r14d, %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: wait for empty RBBM fifo failed! Bad things might happen.\n"

	.comm	_RADEON_RBBM_STATUS,4,2         ## @RADEON_RBBM_STATUS
	.comm	_RADEON_RBBM_ACTIVE,4,2         ## @RADEON_RBBM_ACTIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_gui_wait_for_idle         ; -- Begin function r100_gui_wait_for_idle
	.p2align	2
_r100_gui_wait_for_idle:                ; @r100_gui_wait_for_idle
	.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
	mov	w1, #64
	bl	_r100_rbbm_fifo_wait_for_entry
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_2:
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.3:
	mov	w20, #0
Lloh2:
	adrp	x21, _RADEON_RBBM_STATUS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _RADEON_RBBM_STATUS@GOTPAGEOFF]
Lloh4:
	adrp	x22, _RADEON_RBBM_ACTIVE@GOTPAGE
Lloh5:
	ldr	x22, [x22, _RADEON_RBBM_ACTIVE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_RREG32
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lo	LBB0_4
LBB0_6:
	mov	w0, #-1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: wait for empty RBBM fifo failed! Bad things might happen.\n"

	.comm	_RADEON_RBBM_STATUS,4,2         ; @RADEON_RBBM_STATUS
	.comm	_RADEON_RBBM_ACTIVE,4,2         ; @RADEON_RBBM_ACTIVE
.subsections_via_symbols
