	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_wait_for_vblank           ## -- Begin function r100_wait_for_vblank
	.p2align	4, 0x90
_r100_wait_for_vblank:                  ## @r100_wait_for_vblank
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	%esi, (%rdi)
	jle	LBB0_16
## %bb.1:
	movl	%esi, %r15d
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_2
## %bb.3:
	movq	_RADEON_CRTC2_GEN_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	_RADEON_CRTC2_EN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_5
	jmp	LBB0_16
LBB0_2:
	movq	_RADEON_CRTC_GEN_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	_RADEON_CRTC_EN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
LBB0_5:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_r100_is_in_vblank
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	xorl	%ebx, %ebx
	movl	$1, %ecx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_r100_is_in_vblank
	leal	1(%r12), %ecx
	incl	%ebx
	testq	%rax, %rax
	je	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %r12d
	movl	%ebx, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	imull	$-100, %eax, %eax
	addl	%ecx, %eax
	cmpl	$1, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_r100_is_counter_moving
	testl	%eax, %eax
	jne	LBB0_10
	jmp	LBB0_11
LBB0_6:
	xorl	%r12d, %r12d
LBB0_11:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_r100_is_in_vblank
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_r100_is_in_vblank
	incl	%r12d
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	testq	%rax, %rax
	jne	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%r12d, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	imull	$100, %eax, %eax
	cmpl	%eax, %r12d
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_r100_is_counter_moving
	testl	%eax, %eax
	jne	LBB0_15
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_CRTC_GEN_CNTL,4,2       ## @RADEON_CRTC_GEN_CNTL
	.comm	_RADEON_CRTC_EN,4,2             ## @RADEON_CRTC_EN
	.comm	_RADEON_CRTC2_GEN_CNTL,4,2      ## @RADEON_CRTC2_GEN_CNTL
	.comm	_RADEON_CRTC2_EN,4,2            ## @RADEON_CRTC2_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_wait_for_vblank           ; -- Begin function r100_wait_for_vblank
	.p2align	2
_r100_wait_for_vblank:                  ; @r100_wait_for_vblank
	.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
	ldr	w8, [x0]
	cmp	w8, w1
	b.le	LBB0_13
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	cbz	w1, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _RADEON_CRTC2_GEN_CNTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADEON_CRTC2_GEN_CNTL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RREG32
Lloh3:
	adrp	x8, _RADEON_CRTC2_EN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RADEON_CRTC2_EN@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _RADEON_CRTC_GEN_CNTL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RADEON_CRTC_GEN_CNTL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_RREG32
Lloh8:
	adrp	x8, _RADEON_CRTC_EN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RADEON_CRTC_EN@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_13
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_r100_is_in_vblank
	cbz	x0, LBB0_11
; %bb.6:
	mov	w8, #0
	mov	w21, #34079
	movk	w21, #20971, lsl #16
	mov	w22, #100
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_r100_is_in_vblank
	add	w8, w23, #1
	cbz	x0, LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x8
	umull	x8, w8, w21
	lsr	x8, x8, #37
	mul	w8, w8, w22
	cmp	w8, w23
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_r100_is_counter_moving
	cbnz	w0, LBB0_7
LBB0_10:
	add	w21, w23, #1
	b	LBB0_12
LBB0_11:
	mov	w21, #0
LBB0_12:
	mov	x0, x20
	mov	x1, x19
	bl	_r100_is_in_vblank
	cbz	x0, LBB0_14
LBB0_13:
	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
LBB0_14:
	mov	w22, #34079
	movk	w22, #20971, lsl #16
	mov	w23, #100
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_r100_is_in_vblank
	add	w21, w21, #1
	cbnz	x0, LBB0_13
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	umull	x8, w21, w22
	lsr	x8, x8, #37
	msub	w8, w8, w23, w21
	cbnz	w8, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_r100_is_counter_moving
	cbnz	w0, LBB0_15
	b	LBB0_13
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CRTC_GEN_CNTL,4,2       ; @RADEON_CRTC_GEN_CNTL
	.comm	_RADEON_CRTC_EN,4,2             ; @RADEON_CRTC_EN
	.comm	_RADEON_CRTC2_GEN_CNTL,4,2      ; @RADEON_CRTC2_GEN_CNTL
	.comm	_RADEON_CRTC2_EN,4,2            ; @RADEON_CRTC2_EN
.subsections_via_symbols
