	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_get_vblank_counter_kms  ## -- Begin function radeon_get_vblank_counter_kms
	.p2align	4, 0x90
_radeon_get_vblank_counter_kms:         ## @radeon_get_vblank_counter_kms
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	(%rdi), %rbx
	cmpl	%esi, (%rbx)
	jbe	LBB0_1
## %bb.2:
	movq	8(%rbx), %rax
	movl	%r14d, %r12d
	cmpq	$0, (%rax,%r12,8)
	je	LBB0_7
## %bb.3:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_radeon_get_vblank_counter
	movq	%rax, %r15
	movq	_GET_DISTANCE_TO_VBLANKSTART@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%rbx), %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	leaq	-44(%rbp), %rcx
	leaq	-60(%rbp), %r8
	xorl	%r9d, %r9d
	pushq	(%rax,%r12,8)
	pushq	$0
	callq	_radeon_get_crtc_scanoutpos
	addq	$16, %rsp
	movl	%eax, %r13d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_radeon_get_vblank_counter
	cmpq	%rax, %r15
	jne	LBB0_4
## %bb.5:
	movq	_DRM_SCANOUTPOS_VALID@GOTPCREL(%rip), %rax
	movq	_DRM_SCANOUTPOS_ACCURATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%r13d, %eax
	notl	%eax
	testl	%eax, %ecx
	jne	LBB0_6
## %bb.8:
	movl	-44(%rbp), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_VBL
	movl	-44(%rbp), %eax
	notl	%eax
	shrl	$31, %eax
	addq	%rax, %r15
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subq	(%rax), %r15
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_radeon_get_vblank_counter
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_VBL
	movq	%rbx, %rax
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_VBL
LBB0_9:
	movq	%r15, %rax
LBB0_10:
	addq	$24, %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	"Invalid crtc %u\n"

	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_GET_DISTANCE_TO_VBLANKSTART,4,2 ## @GET_DISTANCE_TO_VBLANKSTART
	.comm	_DRM_SCANOUTPOS_VALID,4,2       ## @DRM_SCANOUTPOS_VALID
	.comm	_DRM_SCANOUTPOS_ACCURATE,4,2    ## @DRM_SCANOUTPOS_ACCURATE
L_.str.1:                               ## @.str.1
	.asciz	"Query failed! stat %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"crtc %u: dist from vblank start %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"NULL mode info! Returned count may be wrong.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_get_vblank_counter_kms  ; -- Begin function radeon_get_vblank_counter_kms
	.p2align	2
_radeon_get_vblank_counter_kms:         ; @radeon_get_vblank_counter_kms
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	ldr	x21, [x0]
	ldr	w8, [x21]
	cmp	w8, w1
	b.ls	LBB0_6
; %bb.1:
	ldr	x8, [x21, #8]
	ldr	x8, [x8, w19, uxtw #3]
	cbz	x8, LBB0_7
; %bb.2:
	mov	x22, x0
	mov	w24, w19
Lloh0:
	adrp	x25, _GET_DISTANCE_TO_VBLANKSTART@GOTPAGE
Lloh1:
	ldr	x25, [x25, _GET_DISTANCE_TO_VBLANKSTART@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x19
	bl	_radeon_get_vblank_counter
	mov	x20, x0
	ldr	w2, [x25]
	ldr	x8, [x21, #8]
	ldr	x7, [x8, x24, lsl #3]
	add	x3, sp, #28
	add	x4, sp, #24
	mov	x0, x22
	mov	x1, x19
	mov	x5, #0
	mov	x6, #0
	bl	_radeon_get_crtc_scanoutpos
	mov	x23, x0
	mov	x0, x21
	mov	x1, x19
	bl	_radeon_get_vblank_counter
	cmp	x20, x0
	b.ne	LBB0_3
; %bb.4:
Lloh2:
	adrp	x8, _DRM_SCANOUTPOS_VALID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DRM_SCANOUTPOS_VALID@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _DRM_SCANOUTPOS_ACCURATE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DRM_SCANOUTPOS_ACCURATE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bics	wzr, w8, w23
	b.ne	LBB0_8
; %bb.5:
	ldr	w8, [sp, #28]
	stp	x19, x8, [sp]
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_VBL
	ldr	w8, [sp, #28]
	mvn	w8, w8
	lsr	w8, w8, #31
	add	x20, x20, x8
	b	LBB0_9
LBB0_6:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_DRM_ERROR
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	neg	x20, x8
	b	LBB0_9
LBB0_7:
	mov	x0, x21
	mov	x1, x19
	bl	_radeon_get_vblank_counter
	mov	x19, x0
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_DEBUG_VBL
	mov	x0, x19
	b	LBB0_10
LBB0_8:
	str	x23, [sp]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_VBL
LBB0_9:
	mov	x0, x20
LBB0_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid crtc %u\n"

	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_GET_DISTANCE_TO_VBLANKSTART,4,2 ; @GET_DISTANCE_TO_VBLANKSTART
	.comm	_DRM_SCANOUTPOS_VALID,4,2       ; @DRM_SCANOUTPOS_VALID
	.comm	_DRM_SCANOUTPOS_ACCURATE,4,2    ; @DRM_SCANOUTPOS_ACCURATE
l_.str.1:                               ; @.str.1
	.asciz	"Query failed! stat %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"crtc %u: dist from vblank start %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"NULL mode info! Returned count may be wrong.\n"

.subsections_via_symbols
