	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdv_hdmi_mode_set
_cdv_hdmi_mode_set:                     ## @cdv_hdmi_mode_set
	.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	%rdx, %r14
	movq	%rdi, %rbx
	callq	_to_gma_encoder
	movq	(%rax), %r15
	movq	(%rbx), %rdi
	callq	_to_gma_crtc
	movl	(%r14), %ecx
	movq	_DRM_MODE_FLAG_PVSYNC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	andl	%ecx, %esi
	movq	_HDMI_VSYNC_ACTIVE_HIGH@GOTPCREL(%rip), %rdx
	movl	$2048, %edi                     ## imm = 0x800
	movl	(%rdx), %edx
	orl	%edi, %edx
	testl	%esi, %esi
	cmovel	%edi, %edx
	movq	_DRM_MODE_FLAG_PHSYNC@GOTPCREL(%rip), %rsi
	andl	(%rsi), %ecx
	je	LBB0_2
## %bb.1:
	movq	_HDMI_HSYNC_ACTIVE_HIGH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_2:
	orl	%edx, %ecx
	xorl	%edx, %edx
	cmpl	$1, (%rax)
	jne	LBB0_4
## %bb.3:
	movq	_HDMIB_PIPE_B_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_4:
	orl	%edx, %ecx
	movq	_HDMI_AUDIO_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	%ecx, %esi
	movq	_HDMI_NULL_PACKETS_DURING_VSYNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	cmpq	$0, 8(%r15)
	cmovel	%ecx, %esi
	movl	(%r15), %edi
	callq	_REG_WRITE
	movl	(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_READ                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_PVSYNC,4,2       ## @DRM_MODE_FLAG_PVSYNC
	.comm	_HDMI_VSYNC_ACTIVE_HIGH,4,2     ## @HDMI_VSYNC_ACTIVE_HIGH
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ## @DRM_MODE_FLAG_PHSYNC
	.comm	_HDMI_HSYNC_ACTIVE_HIGH,4,2     ## @HDMI_HSYNC_ACTIVE_HIGH
	.comm	_HDMIB_PIPE_B_SELECT,4,2        ## @HDMIB_PIPE_B_SELECT
	.comm	_HDMI_AUDIO_ENABLE,4,2          ## @HDMI_AUDIO_ENABLE
	.comm	_HDMI_NULL_PACKETS_DURING_VSYNC,4,2 ## @HDMI_NULL_PACKETS_DURING_VSYNC
	.no_dead_strip	_cdv_hdmi_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdv_hdmi_mode_set
_cdv_hdmi_mode_set:                     ; @cdv_hdmi_mode_set
	.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, x2
	mov	x20, x0
	bl	_to_gma_encoder
	ldr	x21, [x0]
	ldr	x0, [x20]
	bl	_to_gma_crtc
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_PVSYNC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_PVSYNC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _HDMI_VSYNC_ACTIVE_HIGH@GOTPAGE
Lloh4:
	ldr	x10, [x10, _HDMI_VSYNC_ACTIVE_HIGH@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w10, w10, #0x800
	tst	w9, w8
	mov	w9, #2048
	csel	w9, w9, w10, eq
Lloh6:
	adrp	x10, _DRM_MODE_FLAG_PHSYNC@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DRM_MODE_FLAG_PHSYNC@GOTPAGEOFF]
Lloh8:
	adrp	x11, _HDMI_HSYNC_ACTIVE_HIGH@GOTPAGE
Lloh9:
	ldr	x11, [x11, _HDMI_HSYNC_ACTIVE_HIGH@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w8, wzr, w11, eq
	orr	w8, w8, w9
	ldr	w9, [x0]
Lloh12:
	adrp	x10, _HDMIB_PIPE_B_SELECT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _HDMIB_PIPE_B_SELECT@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	cmp	w9, #1
	csel	w9, w10, wzr, eq
	orr	w8, w8, w9
	ldr	x9, [x21, #8]
Lloh15:
	adrp	x10, _HDMI_AUDIO_ENABLE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _HDMI_AUDIO_ENABLE@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _HDMI_NULL_PACKETS_DURING_VSYNC@GOTPAGE
Lloh19:
	ldr	x11, [x11, _HDMI_NULL_PACKETS_DURING_VSYNC@GOTPAGEOFF]
	orr	w10, w8, w10
Lloh20:
	ldr	w11, [x11]
	orr	w10, w10, w11
	cmp	x9, #0
	csel	w1, w8, w10, eq
	ldr	w0, [x21]
	bl	_REG_WRITE
	ldr	w0, [x21]
	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	_REG_READ
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_PVSYNC,4,2       ; @DRM_MODE_FLAG_PVSYNC
	.comm	_HDMI_VSYNC_ACTIVE_HIGH,4,2     ; @HDMI_VSYNC_ACTIVE_HIGH
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ; @DRM_MODE_FLAG_PHSYNC
	.comm	_HDMI_HSYNC_ACTIVE_HIGH,4,2     ; @HDMI_HSYNC_ACTIVE_HIGH
	.comm	_HDMIB_PIPE_B_SELECT,4,2        ; @HDMIB_PIPE_B_SELECT
	.comm	_HDMI_AUDIO_ENABLE,4,2          ; @HDMI_AUDIO_ENABLE
	.comm	_HDMI_NULL_PACKETS_DURING_VSYNC,4,2 ; @HDMI_NULL_PACKETS_DURING_VSYNC
	.no_dead_strip	_cdv_hdmi_mode_set
.subsections_via_symbols
