	.file	"extr_dc_link.c_enable_link_hdmi.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	enable_link_hdmi, @function
enable_link_hdmi:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rbx, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 4[rsp], 0
	mov	r12d, DWORD PTR [rbx]
	mov	r13, QWORD PTR 40[rbx]
	mov	r14, QWORD PTR 8[rbx]
	test	r12d, r12d
	jne	.L2
	movsx	r12, DWORD PTR 16[rbx]
	mov	rax, r12
	imul	r12, r12, 1717986919
	sar	eax, 31
	sar	r12, 34
	sub	r12d, eax
	mov	DWORD PTR [rbx], r12d
.L2:
	mov	edi, DWORD PTR 4[rbx]
	call	dc_is_hdmi_signal@PLT
	test	rax, rax
	je	.L18
	mov	rax, QWORD PTR 0[rbp]
	cmp	r12d, 340000
	setg	r12b
	mov	rdx, QWORD PTR 40[rax]
	movzx	r12d, r12b
	movzx	edx, WORD PTR [rdx]
	and	dx, WORD PTR EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK[rip]
	cmp	WORD PTR EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT[rip], dx
	je	.L20
	cmp	WORD PTR EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204[rip], dx
	jne	.L4
	mov	esi, r12d
	mov	rdi, rbp
	call	write_i2c_redriver_setting@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rax, QWORD PTR 0[rbp]
.L4:
	mov	edi, DWORD PTR 4[rax]
	call	dc_is_hdmi_signal@PLT
	test	rax, rax
	jne	.L21
.L7:
	mov	rax, QWORD PTR 40[rbx]
	mov	edx, 4
	xor	esi, esi
	lea	rdi, 16[rax]
	call	memset@PLT
	mov	edx, DWORD PTR 20[rbx]
	mov	rax, QWORD PTR PIXEL_ENCODING_YCBCR422[rip]
	cmp	QWORD PTR 24[rbx], rax
	jne	.L8
	mov	edx, DWORD PTR COLOR_DEPTH_888[rip]
.L8:
	mov	rdi, QWORD PTR 8[r13]
	mov	rax, QWORD PTR 0[rbp]
	mov	rsi, QWORD PTR 8[rbp]
	mov	r8d, DWORD PTR [rbx]
	mov	ecx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR [rdi]
	mov	esi, DWORD PTR [rsi]
	call	[QWORD PTR [rax]]
	mov	rax, QWORD PTR 0[rbp]
	mov	edi, DWORD PTR 4[rax]
	call	dc_is_hdmi_signal@PLT
	test	rax, rax
	jne	.L22
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	rax, QWORD PTR 40[rbx]
	mov	edx, DWORD PTR 32[rbx]
	mov	esi, DWORD PTR [rbx]
	mov	edi, DWORD PTR 4[rax]
	call	dal_ddc_service_write_scdc_data@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR 4[r13]
	call	dal_ddc_service_read_scdc_data@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	movabs	rax, 2061584302720
	xor	r15d, r15d
	mov	rdi, rbp
	cmp	r14, rax
	mov	rax, QWORD PTR 16[rbp]
	lea	r14, 4[rsp]
	mov	rdx, r14
	sete	r15b
	mov	esi, DWORD PTR [rax]
	call	get_ext_hdmi_settings@PLT
	test	rax, rax
	je	.L6
	mov	rcx, r14
	mov	edx, r12d
	mov	esi, r15d
	mov	rdi, rbp
	call	write_i2c_retimer_setting@PLT
	mov	rax, QWORD PTR 0[rbp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edx, r12d
	mov	esi, r15d
	mov	rdi, rbp
	call	write_i2c_default_retimer_setting@PLT
	mov	rax, QWORD PTR 0[rbp]
	jmp	.L4
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	enable_link_hdmi, .-enable_link_hdmi
	.comm	PIXEL_ENCODING_YCBCR422,8,8
	.comm	EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT,2,2
	.comm	EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204,2,2
	.comm	EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK,2,2
	.comm	COLOR_DEPTH_888,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_dc_link.c_enable_link_hdmi.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	enable_link_hdmi, %function
enable_link_hdmi:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r1, #0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L26
	ldr	r4, [r0]
	sub	sp, sp, #16
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r3, [r4, #8]
	str	r1, [sp, #8]
	cmp	r3, #640
	ldreq	r1, [r4, #12]
	ldr	r6, [r4]
	subeq	r8, r1, #480
	clzeq	r8, r8
	movne	r8, r1
	lsreq	r8, r8, #5
	cmp	r6, #0
	mov	r5, r0
	ldr	r7, [r4, #32]
	bne	.L3
	ldr	r3, [r4, #16]
	ldr	r2, .L26+4
	asr	r6, r3, #31
	smull	r1, r3, r2, r3
	rsb	r6, r6, r3, asr #2
	str	r6, [r4]
.L3:
	ldr	r0, [r4, #4]
	bl	dc_is_hdmi_signal
	cmp	r0, #0
	ldr	r3, [r5]
	beq	.L5
	ldr	r2, .L26+8
	ldr	r1, .L26+12
	ldr	r0, [r3, #32]
	ldrh	ip, [r2]
	ldrh	r0, [r0]
	ldrh	r1, [r1]
	ldr	r2, .L26+16
	and	r0, r0, r1
	cmp	r6, r2
	movle	r6, #0
	movgt	r6, #1
	cmp	ip, r0
	beq	.L21
	ldr	r2, .L26+20
	ldrh	r2, [r2]
	cmp	r2, r0
	beq	.L22
.L5:
	ldr	r0, [r3, #4]
	bl	dc_is_hdmi_signal
	cmp	r0, #0
	bne	.L23
.L8:
	mov	r2, #0
	ldr	r3, [r4, #32]
	ldr	r0, .L26+24
	strb	r2, [r3, #12]
	strb	r2, [r3, #13]
	strb	r2, [r3, #14]
	strb	r2, [r3, #15]
	ldr	r1, [r4, #24]
	ldr	r3, [r0]
	ldr	r0, [r7, #8]
	cmp	r1, r3
	ldreq	r3, .L26+28
	ldr	r2, [r4, #20]
	ldr	lr, [r4]
	ldreq	r2, [r3]
	ldr	r1, [r5, #4]
	ldr	r3, [r5]
	ldr	ip, [r0]
	ldr	r3, [r3, #4]
	ldr	r1, [r1]
	str	lr, [sp]
	ldr	r4, [ip]
	blx	r4
	ldr	r3, [r5]
	ldr	r0, [r3, #4]
	bl	dc_is_hdmi_signal
	cmp	r0, #0
	bne	.L24
.L1:
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L24:
	ldr	r0, [r7, #4]
	bl	dal_ddc_service_read_scdc_data
	b	.L1
.L23:
	ldr	r3, [r4, #32]
	ldr	r2, [r4, #28]
	ldr	r0, [r3, #4]
	ldr	r1, [r4]
	bl	dal_ddc_service_write_scdc_data
	b	.L8
.L21:
	ldr	r3, [r5, #8]
	mov	r0, r5
	ldr	r1, [r3]
	add	r2, sp, #8
	bl	get_ext_hdmi_settings
	cmp	r0, #0
	beq	.L7
	add	r3, sp, #8
	mov	r2, r6
	mov	r1, r8
	mov	r0, r5
	bl	write_i2c_retimer_setting
	ldr	r3, [r5]
	b	.L5
.L22:
	mov	r1, r6
	mov	r0, r5
	bl	write_i2c_redriver_setting
	ldr	r3, [r5]
	b	.L5
.L7:
	mov	r2, r6
	mov	r1, r8
	mov	r0, r5
	bl	write_i2c_default_retimer_setting
	ldr	r3, [r5]
	b	.L5
.L25:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	.LC0
	.word	1717986919
	.word	EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT
	.word	EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK
	.word	340000
	.word	EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204
	.word	PIXEL_ENCODING_YCBCR422
	.word	COLOR_DEPTH_888
	.size	enable_link_hdmi, .-enable_link_hdmi
	.comm	PIXEL_ENCODING_YCBCR422,4,4
	.comm	EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT,2,2
	.comm	EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204,2,2
	.comm	EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK,2,2
	.comm	COLOR_DEPTH_888,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
