	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_get_vblank_counter        ## -- Begin function i915_get_vblank_counter
	.p2align	4, 0x90
_i915_get_vblank_counter:               ## @i915_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	%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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_i915
	movq	%rax, %r12
	movq	8(%rax), %r15
	movq	%rbx, %rdi
	callq	_drm_crtc_index
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_intel_crtc
	leaq	(%r14,%r14,4), %rcx
	cmpl	$0, (%r15,%rcx,4)
	je	LBB0_1
## %bb.2:
	movl	(%rax), %r14d
	movl	4(%r15,%rcx,4), %r13d
	movl	8(%r15,%rcx,4), %ebx
	movl	12(%r15,%rcx,4), %edi
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15,%rcx,4)
	je	LBB0_3
## %bb.4:
	movl	$2, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_3:
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
LBB0_5:
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	subl	%r13d, %ebx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_PIPEFRAME
	movl	%eax, %r13d
	movl	%r14d, %edi
	callq	_PIPEFRAMEPIXEL
	movl	%eax, %r14d
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	_PIPE_FRAME_HIGH_MASK@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	callq	_I915_READ_FW
	movl	%eax, %ebx
	andl	(%r15), %ebx
	movl	%r14d, %edi
	callq	_I915_READ_FW
	movl	%eax, %r12d
	movl	%r13d, %edi
	callq	_I915_READ_FW
	andl	(%r15), %eax
	cmpl	%eax, %ebx
	jne	LBB0_6
## %bb.7:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	imull	-48(%rbp), %eax                 ## 4-byte Folded Reload
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	addl	%eax, %r14d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movq	_PIPE_FRAME_HIGH_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movq	_PIPE_PIXEL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r12d, %edx
	movq	_PIPE_FRAME_LOW_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r12d
	shll	$8, %ebx
	orl	%r12d, %ebx
	xorl	%eax, %eax
	cmpl	%r14d, %edx
	setge	%al
	addl	%ebx, %eax
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_PIPE_FRAME_HIGH_MASK,4,2       ## @PIPE_FRAME_HIGH_MASK
	.comm	_PIPE_FRAME_HIGH_SHIFT,4,2      ## @PIPE_FRAME_HIGH_SHIFT
	.comm	_PIPE_PIXEL_MASK,4,2            ## @PIPE_PIXEL_MASK
	.comm	_PIPE_FRAME_LOW_SHIFT,4,2       ## @PIPE_FRAME_LOW_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_get_vblank_counter        ; -- Begin function i915_get_vblank_counter
	.p2align	2
_i915_get_vblank_counter:               ; @i915_get_vblank_counter
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	ldr	w0, [x0]
	bl	_to_i915
	mov	x19, x0
	ldr	x22, [x0, #8]
	mov	x0, x21
	bl	_drm_crtc_index
	mov	x20, x0
	mov	x0, x21
	bl	_to_intel_crtc
	mov	w8, #20
	mul	x8, x20, x8
	ldr	w8, [x22, x8]
	cbz	w8, LBB0_6
; %bb.1:
	ldr	w21, [x0]
	mov	w8, #20
	madd	x8, x20, x8, x22
	ldp	w24, w22, [x8, #4]
	ldp	w20, w8, [x8, #12]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x20
	mov	w1, #2
	bl	_DIV_ROUND_UP
	mov	x20, x0
LBB0_3:
	sub	w25, w22, w24
	mov	x0, x21
	bl	_PIPEFRAME
	mov	x22, x0
	mov	x0, x21
	bl	_PIPEFRAMEPIXEL
	mov	x21, x0
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh3:
	adrp	x27, _PIPE_FRAME_HIGH_MASK@GOTPAGE
Lloh4:
	ldr	x27, [x27, _PIPE_FRAME_HIGH_MASK@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_I915_READ_FW
	ldr	w8, [x27]
	and	w26, w8, w0
	mov	x0, x21
	bl	_I915_READ_FW
	mov	x23, x0
	mov	x0, x22
	bl	_I915_READ_FW
	ldr	w8, [x27]
	and	w8, w8, w0
	cmp	w26, w8
	b.ne	LBB0_4
; %bb.5:
	madd	w20, w20, w24, w25
	mov	x0, x19
	bl	_spin_unlock_irqrestore
Lloh5:
	adrp	x8, _PIPE_FRAME_HIGH_SHIFT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PIPE_FRAME_HIGH_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	asr	w8, w26, w8
Lloh8:
	adrp	x9, _PIPE_PIXEL_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PIPE_PIXEL_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	and	w9, w9, w23
Lloh11:
	adrp	x10, _PIPE_FRAME_LOW_SHIFT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PIPE_FRAME_LOW_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	asr	w10, w23, w10
	orr	w8, w10, w8, lsl #8
	cmp	w9, w20
	cinc	w8, w8, ge
	and	w0, w8, #0xffffff
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_PIPE_FRAME_HIGH_MASK,4,2       ; @PIPE_FRAME_HIGH_MASK
	.comm	_PIPE_FRAME_HIGH_SHIFT,4,2      ; @PIPE_FRAME_HIGH_SHIFT
	.comm	_PIPE_PIXEL_MASK,4,2            ; @PIPE_PIXEL_MASK
	.comm	_PIPE_FRAME_LOW_SHIFT,4,2       ; @PIPE_FRAME_LOW_SHIFT
.subsections_via_symbols
