	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_get_vblank_counter      ## -- Begin function radeon_get_vblank_counter
	.p2align	4, 0x90
_radeon_get_vblank_counter:             ## @radeon_get_vblank_counter
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	cmpl	$2, %esi
	jb	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_5:
	movq	_RADEON_FAMILY_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	movq	_CHIP_RS600@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jge	LBB0_6
## %bb.10:
	testl	%esi, %esi
	je	LBB0_11
## %bb.12:
	movq	_RADEON_CRTC2_CRNT_FRAME@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	testl	%esi, %esi
	je	LBB0_7
## %bb.9:
	movq	_R500_D2CRTC_FRAME_COUNT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_11:
	movq	_RADEON_CRTC_CRNT_FRAME@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_R500_D1CRTC_FRAME_COUNT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_RADEON_READ                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"called with no initialization\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Invalid crtc %d\n"

	.comm	_RADEON_FAMILY_MASK,4,2         ## @RADEON_FAMILY_MASK
	.comm	_CHIP_RS600,4,2                 ## @CHIP_RS600
	.comm	_R500_D1CRTC_FRAME_COUNT,4,2    ## @R500_D1CRTC_FRAME_COUNT
	.comm	_R500_D2CRTC_FRAME_COUNT,4,2    ## @R500_D2CRTC_FRAME_COUNT
	.comm	_RADEON_CRTC_CRNT_FRAME,4,2     ## @RADEON_CRTC_CRNT_FRAME
	.comm	_RADEON_CRTC2_CRNT_FRAME,4,2    ## @RADEON_CRTC2_CRNT_FRAME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_get_vblank_counter      ; -- Begin function radeon_get_vblank_counter
	.p2align	2
_radeon_get_vblank_counter:             ; @radeon_get_vblank_counter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	cmp	w1, #2
	b.lo	LBB0_5
; %bb.2:
	str	x1, [sp]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	bl	_DRM_ERROR
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
LBB0_5:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _RADEON_FAMILY_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _RADEON_FAMILY_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh10:
	adrp	x9, _CHIP_RS600@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CHIP_RS600@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_8
; %bb.6:
	cbz	w1, LBB0_10
; %bb.7:
Lloh13:
	adrp	x8, _RADEON_CRTC2_CRNT_FRAME@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RADEON_CRTC2_CRNT_FRAME@GOTPAGEOFF]
	b	LBB0_12
LBB0_8:
	cbz	w1, LBB0_11
; %bb.9:
Lloh15:
	adrp	x8, _R500_D2CRTC_FRAME_COUNT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _R500_D2CRTC_FRAME_COUNT@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh17:
	adrp	x8, _RADEON_CRTC_CRNT_FRAME@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RADEON_CRTC_CRNT_FRAME@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh19:
	adrp	x8, _R500_D1CRTC_FRAME_COUNT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _R500_D1CRTC_FRAME_COUNT@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	b	_RADEON_READ
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"called with no initialization\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Invalid crtc %d\n"

	.comm	_RADEON_FAMILY_MASK,4,2         ; @RADEON_FAMILY_MASK
	.comm	_CHIP_RS600,4,2                 ; @CHIP_RS600
	.comm	_R500_D1CRTC_FRAME_COUNT,4,2    ; @R500_D1CRTC_FRAME_COUNT
	.comm	_R500_D2CRTC_FRAME_COUNT,4,2    ; @R500_D2CRTC_FRAME_COUNT
	.comm	_RADEON_CRTC_CRNT_FRAME,4,2     ; @RADEON_CRTC_CRNT_FRAME
	.comm	_RADEON_CRTC2_CRNT_FRAME,4,2    ; @RADEON_CRTC2_CRNT_FRAME
.subsections_via_symbols
