	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_crtc_get_scanoutpos        ## -- Begin function vc4_crtc_get_scanoutpos
	.p2align	4, 0x90
_vc4_crtc_get_scanoutpos:               ## @vc4_crtc_get_scanoutpos
	.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	%r9, %r12
	movq	%r8, %r14
	movq	%rcx, %r13
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_to_vc4_dev
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_drm_crtc_from_index
	movq	%rax, %rdi
	callq	_to_vc4_crtc
	movq	%rax, %r15
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, (%r12)
LBB0_2:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r15), %edi
	callq	_SCALER_DISPSTATX
	movl	%eax, %edi
	callq	_HVS_READ
	movl	%eax, %r12d
	movq	16(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, (%rbx)
LBB0_4:
	movq	_SCALER_DISPSTATX_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_VC4_GET_FIELD
	movl	%eax, (%r13)
	movl	$0, (%r14)
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	24(%rbp), %rbx
	testl	%eax, (%rbx)
	je	LBB0_7
## %bb.5:
	movl	(%r13), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, (%r13)
	movq	_SCALER_DISPSTATX_FRAME_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_VC4_GET_FIELD
	testb	$1, %al
	je	LBB0_7
## %bb.6:
	movl	4(%rbx), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%ecx, (%r14)
LBB0_7:
	movl	(%r15), %eax
	cltd
	idivl	8(%rbx)
	movl	(%r13), %ecx
	cmpl	%eax, %ecx
	jle	LBB0_9
## %bb.8:
	movl	%eax, %edx
	notl	%edx
	addl	%edx, %ecx
	movl	%ecx, (%r13)
	jmp	LBB0_15
LBB0_9:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_14
## %bb.10:
	movl	16(%rbx), %ecx
	subl	12(%rbx), %ecx
	movl	%ecx, (%r13)
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.11:
	movl	4(%r15), %ecx
	movl	%ecx, (%rdx)
LBB0_12:
	movq	16(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.13:
	movl	4(%r15), %ecx
	movl	%ecx, (%rdx)
	jmp	LBB0_15
LBB0_14:
	movl	$0, (%r13)
LBB0_15:
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setg	%cl
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCALER_DISPSTATX_LINE,4,2      ## @SCALER_DISPSTATX_LINE
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_SCALER_DISPSTATX_FRAME_COUNT,4,2 ## @SCALER_DISPSTATX_FRAME_COUNT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_crtc_get_scanoutpos        ; -- Begin function vc4_crtc_get_scanoutpos
	.p2align	2
_vc4_crtc_get_scanoutpos:               ; @vc4_crtc_get_scanoutpos
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x7
	mov	x19, x6
	mov	x20, x5
	mov	x25, x4
	mov	x21, x3
	mov	x23, x2
	mov	x24, x1
	mov	x26, x0
	bl	_to_vc4_dev
	mov	x0, x26
	mov	x1, x24
	bl	_drm_crtc_from_index
	bl	_to_vc4_crtc
	mov	x24, x0
	cbz	x20, LBB0_2
; %bb.1:
	bl	_ktime_get
	str	w0, [x20]
LBB0_2:
	ldr	w0, [x24, #8]
	bl	_SCALER_DISPSTATX
	bl	_HVS_READ
	mov	x26, x0
	cbz	x19, LBB0_4
; %bb.3:
	bl	_ktime_get
	str	w0, [x19]
LBB0_4:
Lloh0:
	adrp	x8, _SCALER_DISPSTATX_LINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCALER_DISPSTATX_LINE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x26
	bl	_VC4_GET_FIELD
	str	w0, [x21]
	str	wzr, [x25]
	ldr	w8, [x22]
Lloh3:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	ldr	w8, [x21]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	str	w8, [x21]
Lloh6:
	adrp	x8, _SCALER_DISPSTATX_FRAME_COUNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SCALER_DISPSTATX_FRAME_COUNT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x26
	bl	_VC4_GET_FIELD
	tbz	w0, #0, LBB0_7
; %bb.6:
	ldr	w8, [x22, #4]
	cmp	w8, #0
	cinc	w8, w8, lt
	ldr	w9, [x25]
	add	w8, w9, w8, asr #1
	str	w8, [x25]
LBB0_7:
	ldr	w8, [x24]
	ldr	w9, [x22, #8]
	sdiv	w8, w8, w9
	ldr	w9, [x21]
	cmp	w9, w8
	b.le	LBB0_9
; %bb.8:
	mvn	w10, w8
	add	w9, w9, w10
	str	w9, [x21]
	b	LBB0_15
LBB0_9:
	cbz	w23, LBB0_14
; %bb.10:
	ldp	w9, w10, [x22, #12]
	sub	w9, w10, w9
	str	w9, [x21]
	cbz	x20, LBB0_12
; %bb.11:
	ldr	w9, [x24, #4]
	str	w9, [x20]
LBB0_12:
	cbz	x19, LBB0_15
; %bb.13:
	ldr	w9, [x24, #4]
	str	w9, [x19]
	b	LBB0_15
LBB0_14:
	str	wzr, [x21]
LBB0_15:
	cmp	w8, #0
	cset	w0, gt
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SCALER_DISPSTATX_LINE,4,2      ; @SCALER_DISPSTATX_LINE
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_SCALER_DISPSTATX_FRAME_COUNT,4,2 ; @SCALER_DISPSTATX_FRAME_COUNT
.subsections_via_symbols
