	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_calc_vbltimestamp_from_scanoutpos ## -- Begin function drm_calc_vbltimestamp_from_scanoutpos
	.p2align	4, 0x90
_drm_calc_vbltimestamp_from_scanoutpos: ## @drm_calc_vbltimestamp_from_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rcx, %r14
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	16(%rdi), %r15
	movq	_DRIVER_MODESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_drm_crtc_from_index
	cmpl	%r12d, (%r13)
	jbe	LBB0_4
## %bb.3:
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	8(%r13), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.7:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %r12d
	movq	%r13, %rdi
	callq	_drm_drv_uses_atomic_modeset
	shlq	$4, %r12
	addq	%r12, %r15
	testq	%rax, %rax
	cmoveq	%r14, %r15
	cmpq	$0, (%r15)
	je	LBB0_10
## %bb.8:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	_DRM_TIMESTAMP_MAXRETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%r12d, %r12d
	testl	%r8d, %r8d
	jle	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %r15d
	movl	%ebx, %edx
	leaq	-64(%rbp), %rcx
	leaq	-60(%rbp), %r8
	leaq	-68(%rbp), %r9
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	leaq	-48(%rbp), %rbx
	pushq	%rbx
	callq	*(%rax)
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	-48(%rbp), %edi
	callq	_ktime_to_ns
	movl	%eax, %r14d
	movl	-68(%rbp), %edi
	callq	_ktime_to_ns
	subl	%eax, %r14d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r14d
	jle	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	incl	%r12d
	movq	_DRM_TIMESTAMP_MAXRETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	cmpl	%r8d, %r12d
	movl	%r15d, %ebx
	jl	LBB0_11
	jmp	LBB0_16
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_20
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	%r13, %rdi
	callq	_drm_drv_uses_atomic_modeset
	movq	%rax, %rdi
	callq	_WARN_ON_ONCE
	jmp	LBB0_20
LBB0_9:
                                        ## implicit-def: $r14d
	jmp	LBB0_16
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_20
LBB0_14:
	movq	_DRM_TIMESTAMP_MAXRETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
LBB0_16:
	movslq	%r14d, %r13
	cmpl	%r8d, %r12d
	jne	LBB0_18
## %bb.17:
	imulq	$274877907, %r13, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	leaq	L_.str.4(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
LBB0_18:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	movslq	-64(%rbp), %rax
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movslq	8(%rdx), %rcx
	imulq	%rax, %rcx
	movslq	-60(%rbp), %rax
	addq	%rcx, %rax
	imulq	$1000000, %rax, %rdi            ## imm = 0xF4240
	movq	(%rdx), %rsi
	callq	_div_s64
	movl	-48(%rbp), %edi
	movl	%eax, %esi
	callq	_ktime_sub_ns
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx)
	movq	_drm_debug@GOTPCREL(%rip), %rax
	movq	_DRM_UT_VBL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$1, %r15d
	testl	%ecx, (%rax)
	je	LBB0_20
## %bb.19:
	movl	-48(%rbp), %edi
	callq	_ktime_to_timespec64
	movq	%r13, %r14
	movl	%eax, %r13d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	callq	_ktime_to_timespec64
	movq	%rdx, %r10
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %ecx
	movslq	%r13d, %rsi
	imulq	$274877907, %rsi, %r9           ## imm = 0x10624DD3
	movq	%r9, %rsi
	shrq	$63, %rsi
	sarq	$38, %r9
	addl	%esi, %r9d
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	$38, %rax
	addl	%esi, %eax
	imulq	$274877907, %r14, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rsi
	shrq	$63, %rsi
	sarq	$38, %rbx
	addl	%esi, %ebx
	leaq	L_.str.5(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-56(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	pushq	%r10
	callq	_DRM_DEBUG_VBL
	addq	$32, %rsp
LBB0_20:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRIVER_MODESET,4,2             ## @DRIVER_MODESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid crtc %u\n"

L_.str.1:                               ## @.str.1
	.asciz	"Called from driver w/o get_scanout_position()!?\n"

L_.str.2:                               ## @.str.2
	.asciz	"crtc %u: Noop due to uninitialized mode.\n"

	.comm	_DRM_TIMESTAMP_MAXRETRIES,4,2   ## @DRM_TIMESTAMP_MAXRETRIES
L_.str.3:                               ## @.str.3
	.asciz	"crtc %u : scanoutpos query failed.\n"

L_.str.4:                               ## @.str.4
	.asciz	"crtc %u: Noisy timestamp %d us > %d us [%d reps].\n"

	.comm	_drm_debug,4,2                  ## @drm_debug
	.comm	_DRM_UT_VBL,4,2                 ## @DRM_UT_VBL
L_.str.5:                               ## @.str.5
	.asciz	"crtc %u : v p(%d,%d)@ %lld.%06ld -> %lld.%06ld [e %d us, %d rep]\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_calc_vbltimestamp_from_scanoutpos ; -- Begin function drm_calc_vbltimestamp_from_scanoutpos
	.p2align	2
_drm_calc_vbltimestamp_from_scanoutpos: ; @drm_calc_vbltimestamp_from_scanoutpos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x24, x4
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x23, x0
	ldr	x25, [x0, #16]
Lloh0:
	adrp	x8, _DRIVER_MODESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRIVER_MODESET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_drm_core_check_feature
	cbz	w0, LBB0_13
; %bb.1:
	mov	x0, x23
	mov	x1, x19
	bl	_drm_crtc_from_index
	ldr	w8, [x23]
	cmp	w8, w19
	ccmp	x0, #0, #4, hi
	b.ne	LBB0_3
; %bb.2:
	str	x19, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_3:
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.4:
	mov	x22, x0
	mov	w26, w19
	mov	x0, x23
	bl	_drm_drv_uses_atomic_modeset
	add	x8, x25, x26, lsl #4
	cmp	x0, #0
	csel	x22, x22, x8, eq
	ldr	x8, [x22]
	cbz	x8, LBB0_14
; %bb.5:
Lloh5:
	adrp	x27, _DRM_TIMESTAMP_MAXRETRIES@GOTPAGE
Lloh6:
	ldr	x27, [x27, _DRM_TIMESTAMP_MAXRETRIES@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.6:
	mov	w26, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	add	x3, sp, #36
	add	x4, sp, #32
	add	x5, sp, #44
	add	x6, sp, #40
	mov	x0, x23
	mov	x1, x19
	mov	x2, x24
	mov	x7, x22
	blr	x8
	cbz	w0, LBB0_21
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [sp, #40]
	bl	_ktime_to_ns
	mov	x25, x0
	ldr	w0, [sp, #44]
	bl	_ktime_to_ns
	ldr	w8, [x21]
	sub	w25, w25, w0
	cmp	w25, w8
	b.le	LBB0_22
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w26, w26, #1
	ldr	w8, [x27]
	cmp	w26, w8
	b.lt	LBB0_7
	b	LBB0_16
LBB0_10:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	bl	_DRM_ERROR
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_14:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG
	mov	x0, x23
	bl	_drm_drv_uses_atomic_modeset
	bl	_WARN_ON_ONCE
	b	LBB0_12
LBB0_15:
	mov	w26, #0
                                        ; implicit-def: $w25
LBB0_16:
	cmp	w26, w8
	b.ne	LBB0_18
LBB0_17:
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x10, w25, w9
	lsr	x11, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w11
	ldrsw	x11, [x21]
	mul	x9, x11, x9
	lsr	x11, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w11
	stp	x9, x8, [sp, #8]
	str	x10, [sp]
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG
LBB0_18:
	str	w25, [x21]
	ldpsw	x10, x8, [sp, #32]
	ldrsw	x9, [x22, #8]
	madd	x8, x9, x8, x10
	mov	w9, #16960
	movk	w9, #15, lsl #16
	mul	x0, x8, x9
	ldr	x1, [x22]
	bl	_div_s64
	mov	x1, x0
	ldr	w0, [sp, #40]
	bl	_ktime_sub_ns
Lloh13:
	adrp	x8, _drm_debug@GOTPAGE
Lloh14:
	ldr	x8, [x8, _drm_debug@GOTPAGEOFF]
	str	w0, [x20]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _DRM_UT_VBL@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DRM_UT_VBL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	ldr	w0, [sp, #40]
	bl	_ktime_to_timespec64
	mov	x21, x0
	mov	x22, x1
	ldr	w0, [x20]
	bl	_ktime_to_timespec64
	mov	x6, x1
	ldp	w2, w3, [sp, #32]
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x9, w21, w8
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w5, w9, w10
	smull	x9, w0, w8
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w7, w9, w10
	smull	x8, w25, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	stp	w8, w26, [sp]
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x19
	mov	x4, x22
                                        ; kill: def $w6 killed $w6 killed $x6
	bl	_DRM_DEBUG_VBL
LBB0_20:
	mov	w0, #1
	b	LBB0_13
LBB0_21:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG
	b	LBB0_12
LBB0_22:
	ldr	w8, [x27]
	cmp	w26, w8
	b.eq	LBB0_17
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_DRIVER_MODESET,4,2             ; @DRIVER_MODESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid crtc %u\n"

l_.str.1:                               ; @.str.1
	.asciz	"Called from driver w/o get_scanout_position()!?\n"

l_.str.2:                               ; @.str.2
	.asciz	"crtc %u: Noop due to uninitialized mode.\n"

	.comm	_DRM_TIMESTAMP_MAXRETRIES,4,2   ; @DRM_TIMESTAMP_MAXRETRIES
l_.str.3:                               ; @.str.3
	.asciz	"crtc %u : scanoutpos query failed.\n"

l_.str.4:                               ; @.str.4
	.asciz	"crtc %u: Noisy timestamp %d us > %d us [%d reps].\n"

	.comm	_drm_debug,4,2                  ; @drm_debug
	.comm	_DRM_UT_VBL,4,2                 ; @DRM_UT_VBL
l_.str.5:                               ; @.str.5
	.asciz	"crtc %u : v p(%d,%d)@ %lld.%06ld -> %lld.%06ld [e %d us, %d rep]\n"

.subsections_via_symbols
