	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mdp5_get_scanoutpos
_mdp5_get_scanoutpos:                   ## @mdp5_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	%rcx, %r15
	movl	%esi, %ebx
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movl	%esi, %ecx
	movq	(%rax,%rcx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movq	%r9, %r12
	movq	%r8, %r14
	callq	_get_encoder_from_crtc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r13
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rbp), %rax
	movl	8(%rax), %ebx
	movl	12(%rax), %ecx
	movl	%ebx, %r14d
	subl	4(%rax), %r14d
	leal	(%rcx,%r14), %r15d
	incl	%r15d
	testq	%r12, %r12
	je	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, (%r12)
LBB0_7:
	movq	%r13, %rdi
	callq	_mdp5_encoder_get_linecount
	xorl	%ecx, %ecx
	cmpl	%r15d, %eax
	cmovlel	%ecx, %ebx
	cmpl	%r14d, %eax
	cmovlel	%ecx, %ebx
	notl	%r14d
	addl	%eax, %r14d
	subl	%ebx, %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	movl	$1, %ebx
	movq	16(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, (%r14)
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	movl	%ebx, %esi
	callq	_DRM_ERROR
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	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 %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"no encoder found for crtc %d\n"

	.no_dead_strip	_mdp5_get_scanoutpos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mdp5_get_scanoutpos
_mdp5_get_scanoutpos:                   ; @mdp5_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	x24, x1
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x0, [x8, w1, uxtw #3]
	cbz	x0, LBB0_7
; %bb.1:
	mov	x23, x7
	mov	x19, x6
	mov	x22, x5
	mov	x20, x4
	mov	x21, x3
	bl	_get_encoder_from_crtc
	cbz	x0, LBB0_8
; %bb.2:
	mov	x25, x0
	ldp	w8, w24, [x23, #4]
	ldr	w9, [x23, #12]
	sub	w23, w24, w8
	add	w8, w23, w9
	add	w26, w8, #1
	cbz	x22, LBB0_4
; %bb.3:
	bl	_ktime_get
	str	w0, [x22]
LBB0_4:
	mov	x0, x25
	bl	_mdp5_encoder_get_linecount
	cmp	w0, w26
	ccmp	w0, w23, #4, gt
	csel	w8, w24, wzr, gt
	mvn	w9, w23
	add	w9, w0, w9
	sub	w8, w9, w8
	str	w8, [x21]
	str	wzr, [x20]
	cbz	x19, LBB0_6
; %bb.5:
	bl	_ktime_get
	str	w0, [x19]
LBB0_6:
	mov	w0, #1
	b	LBB0_10
LBB0_7:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	mov	x1, x24
	bl	_DRM_ERROR
	mov	w0, #0
LBB0_10:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid crtc %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"no encoder found for crtc %d\n"

	.no_dead_strip	_mdp5_get_scanoutpos
.subsections_via_symbols
