	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a10fb_hdmi_event
_a10fb_hdmi_event:                      ## @a10fb_hdmi_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
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	$0, -32(%rbp)
	movq	$0, -48(%rbp)
	leaq	-32(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	callq	_HDMI_GET_EDID
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movq	-32(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_edid_parse
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_8:
	movq	_FB_DEFAULT_W@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_FB_DEFAULT_H@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FB_DEFAULT_REF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pick_mode_by_ref
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_9
LBB0_10:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movl	(%r15), %edi
	movl	32(%rbx), %ecx
	movl	36(%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_12:
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_HDMI_ENABLE
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_a10fb_enable_tcon
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_a10fb_configure
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_15
LBB0_9:
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_15
LBB0_14:
	movq	32(%rbx), %rax
	movq	%rax, -64(%rbp)
	movups	(%rbx), %xmm0
	movups	16(%rbx), %xmm1
	movaps	%xmm1, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movq	16(%rbx), %rax
	subq	8(%rbx), %rax
	movq	%rax, -72(%rbp)
	movq	_VID_HSKEW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -96(%rbp)
	leaq	-96(%rbp), %rsi
	movl	%r14d, %edi
	callq	_HDMI_SET_VIDEOMODE
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_a10fb_enable_tcon
	movq	_HDMI_ENABLE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DELAY
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_HDMI_ENABLE
LBB0_15:
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	leaq	-40(%rbp), %rdi
	callq	_edid_print
LBB0_7:
	movq	-40(%rbp), %rbx
	testq	%rbx, %rbx
	jne	LBB0_10
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get EDID: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to parse EDID: %d\n"

	.comm	_bootverbose,8,3                ## @bootverbose
	.comm	_FB_DEFAULT_W,4,2               ## @FB_DEFAULT_W
	.comm	_FB_DEFAULT_H,4,2               ## @FB_DEFAULT_H
	.comm	_FB_DEFAULT_REF,4,2             ## @FB_DEFAULT_REF
L_.str.2:                               ## @.str.2
	.asciz	"failed to find usable video mode\n"

L_.str.3:                               ## @.str.3
	.asciz	"using %dx%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to configure FB: %d\n"

	.comm	_VID_HSKEW,4,2                  ## @VID_HSKEW
	.comm	_HDMI_ENABLE_DELAY,4,2          ## @HDMI_ENABLE_DELAY
	.no_dead_strip	_a10fb_hdmi_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a10fb_hdmi_event
_a10fb_hdmi_event:                      ; @a10fb_hdmi_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x19, x1
	mov	x20, x0
	stp	xzr, xzr, [sp, #24]
	add	x1, sp, #32
	add	x2, sp, #24
	mov	x0, x19
	bl	_HDMI_GET_EDID
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x20]
	str	x0, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	x0, [sp, #32]
	add	x1, sp, #40
	bl	_edid_parse
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_13
; %bb.3:
	ldr	w8, [x20]
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x8
	bl	_device_printf
LBB0_5:
Lloh4:
	adrp	x8, _FB_DEFAULT_W@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FB_DEFAULT_W@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _FB_DEFAULT_H@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FB_DEFAULT_H@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _FB_DEFAULT_REF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FB_DEFAULT_REF@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	bl	_pick_mode_by_ref
	mov	x21, x0
	cbz	x0, LBB0_10
LBB0_6:
Lloh13:
	adrp	x8, _bootverbose@GOTPAGE
Lloh14:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	w0, [x20]
	ldp	w9, w8, [x21, #32]
	stp	x8, x9, [sp]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_device_printf
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	bl	_HDMI_ENABLE
	mov	x0, x20
	mov	w1, #0
	bl	_a10fb_enable_tcon
	mov	x0, x20
	mov	x1, x21
	bl	_a10fb_configure
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_11
; %bb.9:
	ldr	w8, [x20]
	str	x0, [sp]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x8
	bl	_device_printf
	b	LBB0_12
LBB0_10:
	ldr	w0, [x20]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_device_printf
	b	LBB0_12
LBB0_11:
	ldp	q0, q1, [x21]
	ldr	x8, [x21, #32]
	str	x8, [sp, #80]
	stp	q0, q1, [sp, #48]
	ldp	x9, x8, [x21, #8]
	sub	x8, x8, x9
	str	x8, [sp, #72]
Lloh22:
	adrp	x8, _VID_HSKEW@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VID_HSKEW@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w9, [sp, #48]
	orr	w8, w9, w8
	str	w8, [sp, #48]
	add	x1, sp, #48
	mov	x0, x19
	bl	_HDMI_SET_VIDEOMODE
	mov	x0, x20
	mov	w1, #1
	bl	_a10fb_enable_tcon
Lloh25:
	adrp	x8, _HDMI_ENABLE_DELAY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _HDMI_ENABLE_DELAY@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_DELAY
	mov	x0, x19
	mov	w1, #1
	bl	_HDMI_ENABLE
LBB0_12:
	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
	add	sp, sp, #144
	ret
LBB0_13:
Lloh28:
	adrp	x8, _bootverbose@GOTPAGE
Lloh29:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
	add	x0, sp, #40
	bl	_edid_print
LBB0_15:
	ldr	x21, [sp, #40]
	cbnz	x21, LBB0_6
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get EDID: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to parse EDID: %d\n"

	.comm	_bootverbose,8,3                ; @bootverbose
	.comm	_FB_DEFAULT_W,4,2               ; @FB_DEFAULT_W
	.comm	_FB_DEFAULT_H,4,2               ; @FB_DEFAULT_H
	.comm	_FB_DEFAULT_REF,4,2             ; @FB_DEFAULT_REF
l_.str.2:                               ; @.str.2
	.asciz	"failed to find usable video mode\n"

l_.str.3:                               ; @.str.3
	.asciz	"using %dx%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to configure FB: %d\n"

	.comm	_VID_HSKEW,4,2                  ; @VID_HSKEW
	.comm	_HDMI_ENABLE_DELAY,4,2          ; @HDMI_ENABLE_DELAY
	.no_dead_strip	_a10fb_hdmi_event
.subsections_via_symbols
