	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_queue_vblank_event
_drm_queue_vblank_event:                ## @drm_queue_vblank_event
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movq	%rdx, %r12
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	%r15d, (%rax)
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_DRM_EVENT_VBLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	52(%rbx), %rcx
	movl	%eax, 56(%rbx)
	movl	$16, 52(%rbx)
	movl	8(%r12), %eax
	movl	%eax, 60(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r13, 24(%rbx)
	movq	_kfree@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%r13), %eax
	cmpl	$15, %eax
	ja	LBB0_5
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_4:
	negl	%r12d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_drm_vblank_put
	jmp	LBB0_12
LBB0_5:
	addl	$-16, %eax
	movl	%eax, (%r13)
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_drm_vblank_count_and_time
	movl	%eax, %r13d
	movq	__DRM_VBLANK_NEXTONMISS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	4(%r12), %esi
	testl	%eax, (%r12)
	je	LBB0_8
## %bb.6:
	movl	%r13d, %eax
	subl	%esi, %eax
	cmpl	$8388608, %eax                  ## imm = 0x800000
	ja	LBB0_8
## %bb.7:
	movl	%r13d, %esi
	incl	%esi
	movl	%esi, 4(%r12)
	movl	%esi, (%r12)
LBB0_8:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	callq	_DRM_DEBUG
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	4(%r12), %edx
	movl	%r15d, %esi
	callq	_trace_drm_vblank_event_queued
	movl	4(%r12), %eax
	movl	%eax, 48(%rbx)
	movl	%r13d, %eax
	subl	4(%r12), %eax
	cmpl	$8388608, %eax                  ## imm = 0x800000
	ja	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_drm_vblank_put
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_send_vblank_event
	jmp	LBB0_11
LBB0_10:
	addq	$16, %rbx
	leaq	4(%r14), %rsi
	movq	%rbx, %rdi
	callq	_list_add_tail
	movl	4(%r12), %r13d
LBB0_11:
	movl	%r13d, (%r12)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r12d, %r12d
LBB0_12:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_current,8,3                    ## @current
	.comm	_DRM_EVENT_VBLANK,4,2           ## @DRM_EVENT_VBLANK
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	__DRM_VBLANK_NEXTONMISS,4,2     ## @_DRM_VBLANK_NEXTONMISS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"event on vblank count %d, current %d, crtc %d\n"

	.no_dead_strip	_drm_queue_vblank_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_queue_vblank_event
_drm_queue_vblank_event:                ; @drm_queue_vblank_event
	.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	x23, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x22, x0
	str	w20, [x0]
Lloh3:
	adrp	x24, _current@GOTPAGE
Lloh4:
	ldr	x24, [x24, _current@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	w8, [x8]
	str	w8, [x0, #40]
Lloh5:
	adrp	x8, _DRM_EVENT_VBLANK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DRM_EVENT_VBLANK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x0, #56]
	mov	w8, #16
	mov	x9, x0
	str	w8, [x9, #52]!
	ldr	w8, [x21, #8]
	str	w8, [x0, #60]
	stp	x23, x9, [x0, #24]
Lloh8:
	adrp	x8, _kfree@GOTPAGE
Lloh9:
	ldr	x8, [x8, _kfree@GOTPAGEOFF]
	str	x8, [x0, #8]
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x23]
	cmp	w8, #15
	b.hi	LBB0_5
; %bb.2:
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	bl	_kfree
	b	LBB0_4
LBB0_3:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
LBB0_4:
	neg	w21, w21
	mov	x0, x19
	mov	x1, x20
	bl	_drm_vblank_put
	b	LBB0_12
LBB0_5:
	mov	w25, #1
	movk	w25, #128, lsl #16
	sub	w8, w8, #16
	str	w8, [x23]
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_drm_vblank_count_and_time
	mov	x23, x0
Lloh16:
	adrp	x8, __DRM_VBLANK_NEXTONMISS@GOTPAGE
Lloh17:
	ldr	x8, [x8, __DRM_VBLANK_NEXTONMISS@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldp	w9, w1, [x21]
	and	w8, w8, w9
	cbz	w8, LBB0_8
; %bb.6:
	sub	w8, w23, w1
	cmp	w8, w25
	b.hs	LBB0_8
; %bb.7:
	add	w1, w23, #1
	stp	w1, w1, [x21]
LBB0_8:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x23
	mov	x3, x20
	bl	_DRM_DEBUG
	ldr	x8, [x24]
	ldr	w0, [x8]
	ldr	w2, [x21, #4]
	mov	x1, x20
	bl	_trace_drm_vblank_event_queued
	ldr	w8, [x21, #4]
	str	w8, [x22, #48]
	ldr	w8, [x21, #4]
	sub	w8, w23, w8
	cmp	w8, w25
	b.hs	LBB0_10
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_drm_vblank_put
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_send_vblank_event
	b	LBB0_11
LBB0_10:
	add	x0, x22, #16
	add	x1, x19, #4
	bl	_list_add_tail
	ldr	w23, [x21, #4]
LBB0_11:
	str	w23, [x21]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w21, #0
LBB0_12:
	mov	x0, x21
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_current,8,3                    ; @current
	.comm	_DRM_EVENT_VBLANK,4,2           ; @DRM_EVENT_VBLANK
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	__DRM_VBLANK_NEXTONMISS,4,2     ; @_DRM_VBLANK_NEXTONMISS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"event on vblank count %d, current %d, crtc %d\n"

	.no_dead_strip	_drm_queue_vblank_event
.subsections_via_symbols
