	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_vblank_restore             ## -- Begin function drm_vblank_restore
	.p2align	4, 0x90
_drm_vblank_restore:                    ## @drm_vblank_restore
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_DRM_TIMESTAMP_MAXRETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%edi, %edi
	cmpl	%esi, (%r12)
	setbe	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_11
## %bb.1:
	leaq	20(%r12), %rdi
	callq	_assert_spin_locked
	leaq	16(%r12), %rdi
	callq	_assert_spin_locked
	movq	8(%r12), %rcx
	movl	%r14d, %eax
	leaq	(%rax,%rax,2), %rax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rax,8), %r15
	movq	_drm_debug@GOTPCREL(%rip), %rax
	movq	_DRM_UT_VBL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.3:
	xorl	%edi, %edi
	cmpl	$0, (%r15)
	sete	%dil
	jmp	LBB0_4
LBB0_2:
	xorl	%edi, %edi
LBB0_4:
	leaq	L_.str(%rip), %rsi
	callq	_WARN_ONCE
	movl	(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	-48(%rbp), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	___get_vblank_counter
	movq	%rax, %r15
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_drm_get_last_vbltimestamp
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	___get_vblank_counter
	cmpq	%rax, %r15
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	-1(%rbx), %eax
	cmpl	$1, %ebx
	movl	%eax, %ebx
	jg	LBB0_5
LBB0_7:
	movl	-48(%rbp), %edi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	16(%rax,%rcx,8), %esi
	callq	_ktime_sub
	movl	%eax, %edi
	callq	_ktime_to_ns
	movl	%eax, %edx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.9:
	movl	%edx, %edi
	movl	%ebx, %esi
	movl	%edx, %ebx
	callq	_DIV_ROUND_CLOSEST_ULL
	movl	%ebx, %edx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	%rax, %r13
	jmp	LBB0_10
LBB0_8:
	movl	$1, %r13d
LBB0_10:
	movq	%r15, %r8
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	subq	8(%rax,%rcx,8), %r8
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	movl	%ebx, %ecx
	callq	_DRM_DEBUG_VBL
	movl	-48(%rbp), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	movq	%r15, %r8
	callq	_store_vblank
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_TIMESTAMP_MAXRETRIES,4,2   ## @DRM_TIMESTAMP_MAXRETRIES
	.comm	_drm_debug,4,2                  ## @drm_debug
	.comm	_DRM_UT_VBL,4,2                 ## @DRM_UT_VBL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot compute missed vblanks without frame duration\n"

L_.str.1:                               ## @.str.1
	.asciz	"missed %d vblanks in %lld ns, frame duration=%d ns, hw_diff=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_vblank_restore             ; -- Begin function drm_vblank_restore
	.p2align	2
_drm_vblank_restore:                    ; @drm_vblank_restore
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DRM_TIMESTAMP_MAXRETRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_TIMESTAMP_MAXRETRIES@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	ldr	w8, [x0]
	cmp	w8, w1
	cset	w0, ls
	bl	_WARN_ON
	cbnz	x0, LBB0_11
; %bb.1:
	add	x0, x20, #20
	bl	_assert_spin_locked
	add	x0, x20, #16
	bl	_assert_spin_locked
	ldr	x25, [x20, #8]
	mov	w26, w19
	mov	w8, #24
Lloh3:
	adrp	x9, _drm_debug@GOTPAGE
Lloh4:
	ldr	x9, [x9, _drm_debug@GOTPAGEOFF]
	umaddl	x21, w19, w8, x25
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _DRM_UT_VBL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DRM_UT_VBL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	w8, [x21]
	cmp	w8, #0
	cset	w0, eq
	b	LBB0_4
LBB0_3:
	mov	w0, #0
LBB0_4:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN_ONCE
	ldr	w21, [x21]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	___get_vblank_counter
	mov	x22, x0
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	mov	w3, #0
	bl	_drm_get_last_vbltimestamp
	mov	x0, x20
	mov	x1, x19
	bl	___get_vblank_counter
	cmp	x22, x0
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w8, w23, #1
	cmp	w23, #1
	mov	x23, x8
	b.gt	LBB0_5
LBB0_7:
	ldr	w0, [sp, #12]
	mov	w8, #24
	madd	x8, x26, x8, x25
	ldr	w1, [x8, #16]
	bl	_ktime_sub
	bl	_ktime_to_ns
	mov	x23, x0
	cbz	w21, LBB0_9
; %bb.8:
	mov	x0, x23
	mov	x1, x21
	bl	_DIV_ROUND_CLOSEST_ULL
	mov	x24, x0
	b	LBB0_10
LBB0_9:
	mov	w24, #1
LBB0_10:
	mov	w8, #24
	madd	x8, x26, x8, x25
	ldr	x8, [x8, #8]
	sub	x4, x22, x8
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x24
	mov	x2, x23
	mov	x3, x21
	bl	_DRM_DEBUG_VBL
	ldr	w3, [sp, #12]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x24
	mov	x4, x22
	bl	_store_vblank
LBB0_11:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_TIMESTAMP_MAXRETRIES,4,2   ; @DRM_TIMESTAMP_MAXRETRIES
	.comm	_drm_debug,4,2                  ; @drm_debug
	.comm	_DRM_UT_VBL,4,2                 ; @DRM_UT_VBL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot compute missed vblanks without frame duration\n"

l_.str.1:                               ; @.str.1
	.asciz	"missed %d vblanks in %lld ns, frame duration=%d ns, hw_diff=%d\n"

.subsections_via_symbols
