	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_komeda_crtc_handle_event       ## -- Begin function komeda_crtc_handle_event
	.p2align	4, 0x90
_komeda_crtc_handle_event:              ## @komeda_crtc_handle_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	32(%rdi), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %ebx
	movq	_KOMEDA_EVENT_VSYNC@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_drm_crtc_handle_vblank
LBB0_2:
	movq	_KOMEDA_EVENT_EOW@GOTPCREL(%rip), %r15
	testl	%ebx, (%r15)
	je	LBB0_6
## %bb.3:
	movq	24(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	xorl	%esi, %esi
	callq	_drm_writeback_signal_completion
LBB0_6:
	testl	%ebx, (%r15)
	je	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG
LBB0_8:
	movq	_KOMEDA_EVENT_FLIP@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_15
## %bb.9:
	movq	(%r14), %rdi
	callq	_spin_lock_irqsave
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_complete_all
	movq	$0, 16(%r14)
	jmp	LBB0_14
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r14, %rdi
	callq	_drm_crtc_index
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_WARN
	testl	%ebx, (%r15)
	jne	LBB0_7
	jmp	LBB0_8
LBB0_11:
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.12:
	movq	$0, (%rax)
	movq	%r14, %rdi
	callq	_drm_crtc_send_vblank_event
	jmp	LBB0_14
LBB0_13:
	movq	%r14, %rdi
	callq	_drm_crtc_index
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_WARN
LBB0_14:
	movq	(%r14), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_KOMEDA_EVENT_VSYNC,4,2         ## @KOMEDA_EVENT_VSYNC
	.comm	_KOMEDA_EVENT_EOW,4,2           ## @KOMEDA_EVENT_EOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CRTC[%d]: EOW happen but no wb_connector.\n"

L_.str.1:                               ## @.str.1
	.asciz	"EOW.\n"

	.comm	_KOMEDA_EVENT_FLIP,4,2          ## @KOMEDA_EVENT_FLIP
L_.str.2:                               ## @.str.2
	.asciz	"CRTC[%d]: FLIP happen but no pending commit.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_komeda_crtc_handle_event       ; -- Begin function komeda_crtc_handle_event
	.p2align	2
_komeda_crtc_handle_event:              ; @komeda_crtc_handle_event
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x8, [x1]
	ldr	x9, [x0, #32]
	ldr	x9, [x9]
	ldr	w20, [x8, x9, lsl #2]
Lloh0:
	adrp	x8, _KOMEDA_EVENT_VSYNC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KOMEDA_EVENT_VSYNC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_drm_crtc_handle_vblank
LBB0_2:
Lloh3:
	adrp	x21, _KOMEDA_EVENT_EOW@GOTPAGE
Lloh4:
	ldr	x21, [x21, _KOMEDA_EVENT_EOW@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.3:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_5
; %bb.4:
	mov	w1, #0
	bl	_drm_writeback_signal_completion
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_drm_crtc_index
	mov	x1, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_WARN
LBB0_6:
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.7:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG
LBB0_8:
Lloh9:
	adrp	x8, _KOMEDA_EVENT_FLIP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KOMEDA_EVENT_FLIP@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_11
; %bb.9:
	ldr	x0, [x19]
	bl	_spin_lock_irqsave
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_12
; %bb.10:
	bl	_complete_all
	str	xzr, [x19, #16]
	b	LBB0_15
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x8, [x19, #8]
	ldr	x1, [x8]
	cbz	x1, LBB0_14
; %bb.13:
	str	xzr, [x8]
	mov	x0, x19
	bl	_drm_crtc_send_vblank_event
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_drm_crtc_index
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_WARN
LBB0_15:
	ldr	x0, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_KOMEDA_EVENT_VSYNC,4,2         ; @KOMEDA_EVENT_VSYNC
	.comm	_KOMEDA_EVENT_EOW,4,2           ; @KOMEDA_EVENT_EOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CRTC[%d]: EOW happen but no wb_connector.\n"

l_.str.1:                               ; @.str.1
	.asciz	"EOW.\n"

	.comm	_KOMEDA_EVENT_FLIP,4,2          ; @KOMEDA_EVENT_FLIP
l_.str.2:                               ; @.str.2
	.asciz	"CRTC[%d]: FLIP happen but no pending commit.\n"

.subsections_via_symbols
