	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dce4_wait_for_vblank           ## -- Begin function dce4_wait_for_vblank
	.p2align	4, 0x90
_dce4_wait_for_vblank:                  ## @dce4_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_13
## %bb.1:
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_EVERGREEN_CRTC_CONTROL@GOTPCREL(%rip), %rax
	movq	_crtc_offsets@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%esi, %rdx
	movq	(%rcx,%rdx,8), %rdi
	addq	(%rax), %rdi
	callq	_RREG32
	movq	_EVERGREEN_CRTC_MASTER_EN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.2:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dce4_is_in_vblank
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	movl	$1, %ecx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dce4_is_in_vblank
	leal	1(%r12), %ecx
	incl	%ebx
	testq	%rax, %rax
	je	LBB0_8
LBB0_5:                                 ## =>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_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dce4_is_counter_moving
	testl	%eax, %eax
	jne	LBB0_7
	jmp	LBB0_8
LBB0_3:
	xorl	%r12d, %r12d
LBB0_8:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dce4_is_in_vblank
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dce4_is_in_vblank
	incl	%r12d
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rax, %rax
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%r12d, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	imull	$100, %eax, %eax
	cmpl	%eax, %r12d
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dce4_is_counter_moving
	testl	%eax, %eax
	jne	LBB0_12
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVERGREEN_CRTC_CONTROL,8,3     ## @EVERGREEN_CRTC_CONTROL
	.comm	_crtc_offsets,8,3               ## @crtc_offsets
	.comm	_EVERGREEN_CRTC_MASTER_EN,4,2   ## @EVERGREEN_CRTC_MASTER_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dce4_wait_for_vblank           ; -- Begin function dce4_wait_for_vblank
	.p2align	2
_dce4_wait_for_vblank:                  ; @dce4_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_10
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _EVERGREEN_CRTC_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EVERGREEN_CRTC_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _crtc_offsets@GOTPAGE
Lloh4:
	ldr	x9, [x9, _crtc_offsets@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x9, [x9, w1, sxtw #3]
	add	x0, x9, x8
	bl	_RREG32
Lloh6:
	adrp	x8, _EVERGREEN_CRTC_MASTER_EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EVERGREEN_CRTC_MASTER_EN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_10
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	bl	_dce4_is_in_vblank
	cbz	x0, LBB0_8
; %bb.3:
	mov	w8, #0
	mov	w21, #34079
	movk	w21, #20971, lsl #16
	mov	w22, #100
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_dce4_is_in_vblank
	add	w8, w23, #1
	cbz	x0, LBB0_7
LBB0_5:                                 ; =>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_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_dce4_is_counter_moving
	cbnz	w0, LBB0_4
LBB0_7:
	add	w21, w23, #1
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	bl	_dce4_is_in_vblank
	cbz	x0, LBB0_11
LBB0_10:
	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_11:
	mov	w22, #34079
	movk	w22, #20971, lsl #16
	mov	w23, #100
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_dce4_is_in_vblank
	add	w21, w21, #1
	cbnz	x0, LBB0_10
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	umull	x8, w21, w22
	lsr	x8, x8, #37
	msub	w8, w8, w23, w21
	cbnz	w8, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_dce4_is_counter_moving
	cbnz	w0, LBB0_12
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EVERGREEN_CRTC_CONTROL,8,3     ; @EVERGREEN_CRTC_CONTROL
	.comm	_crtc_offsets,8,3               ; @crtc_offsets
	.comm	_EVERGREEN_CRTC_MASTER_EN,4,2   ; @EVERGREEN_CRTC_MASTER_EN
.subsections_via_symbols
