	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_conn_mode_valid
_mtk_hdmi_conn_mode_valid:              ## @mtk_hdmi_conn_mode_valid
	.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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_hdmi_ctx_from_conn
	movq	%rax, %r14
	movl	8(%rax), %edi
	movl	16(%rbx), %edx
	movl	8(%rbx), %r8d
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r9d, %r9d
	andl	(%rbx), %eax
	movl	12(%rbx), %ecx
	setne	%r9b
	imull	$1000, 4(%rbx), %eax            ## imm = 0x3E8
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	cmpq	$0, (%r14)
	je	LBB0_3
## %bb.1:
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_drm_mode_copy
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_drm_bridge_mode_fixup
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movl	4(%rbx), %eax
	cmpl	$26999, %eax                    ## imm = 0x6977
	jg	LBB0_5
## %bb.4:
	movq	_MODE_CLOCK_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_5:
	cmpl	$297001, %eax                   ## imm = 0x48829
	jb	LBB0_7
## %bb.6:
	movq	_MODE_CLOCK_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_2:
	movq	_MODE_BAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_7:
	movq	%rbx, %rdi
	movl	$8191, %esi                     ## imm = 0x1FFF
	movl	$8191, %edx                     ## imm = 0x1FFF
	callq	_drm_mode_validate_size
LBB0_8:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n"

	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_MODE_BAD,4,2                   ## @MODE_BAD
	.comm	_MODE_CLOCK_LOW,4,2             ## @MODE_CLOCK_LOW
	.comm	_MODE_CLOCK_HIGH,4,2            ## @MODE_CLOCK_HIGH
	.no_dead_strip	_mtk_hdmi_conn_mode_valid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hdmi_conn_mode_valid
_mtk_hdmi_conn_mode_valid:              ; @mtk_hdmi_conn_mode_valid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_hdmi_ctx_from_conn
	mov	x20, x0
	ldr	w0, [x0, #8]
	ldp	w3, w2, [x19, #12]
	ldp	w10, w4, [x19, #4]
Lloh0:
	adrp	x8, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	tst	w8, w9
	cset	w5, ne
	mov	w8, #1000
	mul	w6, w10, w8
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x20]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, sp, #8
	mov	x1, x19
	bl	_drm_mode_copy
	ldr	x0, [x20]
	add	x2, sp, #8
	mov	x1, x19
	bl	_drm_bridge_mode_fixup
	cbz	w0, LBB0_6
LBB0_2:
	ldr	w8, [x19, #4]
	mov	w9, #26999
	cmp	w8, w9
	b.gt	LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _MODE_CLOCK_LOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MODE_CLOCK_LOW@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_4:
	mov	w9, #34857
	movk	w9, #4, lsl #16
	cmp	w8, w9
	b.lo	LBB0_7
; %bb.5:
Lloh8:
	adrp	x8, _MODE_CLOCK_HIGH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MODE_CLOCK_HIGH@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_6:
Lloh11:
	adrp	x8, _MODE_BAD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MODE_BAD@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	w1, #8191
	mov	w2, #8191
	bl	_drm_mode_validate_size
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n"

	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_MODE_BAD,4,2                   ; @MODE_BAD
	.comm	_MODE_CLOCK_LOW,4,2             ; @MODE_CLOCK_LOW
	.comm	_MODE_CLOCK_HIGH,4,2            ; @MODE_CLOCK_HIGH
	.no_dead_strip	_mtk_hdmi_conn_mode_valid
.subsections_via_symbols
