	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7511_set_link_config
_adv7511_set_link_config:               ## @adv7511_set_link_config
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	(%rsi), %eax
	movl	4(%rsi), %edx
	movq	8(%rsi), %rdi
	movq	_HDMI_COLORSPACE_YUV422@GOTPCREL(%rip), %rbx
	movq	16(%rsi), %rcx
	movq	_ADV7511_INPUT_CLOCK_DDR@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpq	(%rbx), %rdi
	jne	LBB0_1
## %bb.2:
	cmpq	%rsi, %rcx
	jne	LBB0_4
## %bb.3:
	cmpq	$1, 48(%r15)
	movl	$8, %ecx
	jmp	LBB0_7
LBB0_1:
	xorl	%edi, %edi
	cmpq	%rsi, %rcx
	sete	%dil
	leal	(%rdi,%rdi,4), %ecx
	jmp	LBB0_8
LBB0_4:
	movq	_ADV7511_INPUT_CLOCK_2X@GOTPCREL(%rip), %rdi
	movq	48(%r15), %rsi
	cmpq	(%rdi), %rcx
	jne	LBB0_6
## %bb.5:
	cmpq	$1, %rsi
	movl	$4, %ecx
	jmp	LBB0_7
LBB0_6:
	cmpq	$1, %rsi
	movl	$2, %ecx
LBB0_7:
	sbbl	$0, %ecx
LBB0_8:
	xorl	%esi, %esi
	cmpl	$10, %edx
	setne	%sil
	shll	$4, %esi
	addl	$16, %esi
	cmpl	$8, %edx
	movl	$48, %r12d
	cmovnel	%esi, %r12d
	addl	$1200, %eax                     ## imm = 0x4B0
	cltq
	imulq	$1374389535, %rax, %rbx         ## imm = 0x51EB851F
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$39, %rbx
	addl	%eax, %ebx
	movl	24(%r14), %edi
	movq	_ADV7511_REG_I2C_FREQ_ID_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$15, %edx
	callq	_regmap_update_bits
	movl	24(%r14), %edi
	movq	_ADV7511_REG_VIDEO_INPUT_CFG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%r15), %rax
	leaq	_adv7511_set_link_config.input_styles(%rip), %rcx
	movl	(%rcx,%rax,4), %ecx
	shll	$2, %ecx
	orl	%r12d, %ecx
	movl	$126, %edx
	callq	_regmap_update_bits
	movl	24(%r14), %edi
	movq	_ADV7511_REG_VIDEO_INPUT_CFG2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	32(%r15), %edx
	shll	$3, %edx
	callq	_regmap_write
	movl	24(%r14), %edi
	movq	_ADV7511_REG_TIMING_GEN_SEQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	36(%r15), %edx
	shll	$2, %edx
	callq	_regmap_write
	movl	24(%r14), %edi
	shll	$5, %ebx
	movl	$186, %esi
	movl	%ebx, %edx
	callq	_regmap_write
	movq	48(%r15), %rax
	movq	%rax, 16(%r14)
	movl	44(%r15), %eax
	movl	%eax, 8(%r14)
	movl	40(%r15), %eax
	movl	%eax, 4(%r14)
	movq	8(%r15), %rax
	movq	_HDMI_COLORSPACE_RGB@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movl	%edx, (%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @adv7511_set_link_config.input_styles
_adv7511_set_link_config.input_styles:
	.long	0                               ## 0x0
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	3                               ## 0x3

	.comm	_HDMI_COLORSPACE_YUV422,8,3     ## @HDMI_COLORSPACE_YUV422
	.comm	_ADV7511_INPUT_CLOCK_DDR,8,3    ## @ADV7511_INPUT_CLOCK_DDR
	.comm	_ADV7511_INPUT_CLOCK_2X,8,3     ## @ADV7511_INPUT_CLOCK_2X
	.comm	_ADV7511_REG_I2C_FREQ_ID_CFG,4,2 ## @ADV7511_REG_I2C_FREQ_ID_CFG
	.comm	_ADV7511_REG_VIDEO_INPUT_CFG1,4,2 ## @ADV7511_REG_VIDEO_INPUT_CFG1
	.comm	_ADV7511_REG_VIDEO_INPUT_CFG2,4,2 ## @ADV7511_REG_VIDEO_INPUT_CFG2
	.comm	_ADV7511_REG_TIMING_GEN_SEQ,4,2 ## @ADV7511_REG_TIMING_GEN_SEQ
	.comm	_HDMI_COLORSPACE_RGB,8,3        ## @HDMI_COLORSPACE_RGB
	.no_dead_strip	_adv7511_set_link_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7511_set_link_config
_adv7511_set_link_config:               ; @adv7511_set_link_config
	.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	x20, x1
	mov	x19, x0
	ldp	w8, w9, [x1]
Lloh0:
	adrp	x10, _HDMI_COLORSPACE_YUV422@GOTPAGE
Lloh1:
	ldr	x10, [x10, _HDMI_COLORSPACE_YUV422@GOTPAGEOFF]
Lloh2:
	ldr	x12, [x10]
	ldp	x13, x10, [x1, #8]
Lloh3:
	adrp	x11, _ADV7511_INPUT_CLOCK_DDR@GOTPAGE
Lloh4:
	ldr	x11, [x11, _ADV7511_INPUT_CLOCK_DDR@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	cmp	x13, x12
	b.ne	LBB0_3
; %bb.1:
	cmp	x10, x11
	b.ne	LBB0_4
; %bb.2:
	ldr	x10, [x20, #48]
	cmp	x10, #0
	mov	w10, #7
	cinc	w3, w10, ne
	b	LBB0_5
LBB0_3:
	cmp	x10, x11
	mov	w10, #5
	csel	w3, w10, wzr, eq
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x11, _ADV7511_INPUT_CLOCK_2X@GOTPAGE
Lloh7:
	ldr	x11, [x11, _ADV7511_INPUT_CLOCK_2X@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	ldr	x12, [x20, #48]
	cmp	x12, #0
	mov	w12, #1
	cinc	w12, w12, ne
	mov	w13, #3
	cinc	w13, w13, ne
	cmp	x10, x11
	csel	w3, w12, w13, ne
LBB0_5:
	mov	w10, #32
	mov	w11, #16
	cmp	w9, #10
	csel	w10, w11, w10, eq
	mov	w11, #48
	cmp	w9, #8
	csel	w21, w11, w10, eq
	add	w8, w8, #1200
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w22, w8, w9, asr #7
	ldr	w0, [x19, #24]
Lloh9:
	adrp	x8, _ADV7511_REG_I2C_FREQ_ID_CFG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ADV7511_REG_I2C_FREQ_ID_CFG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w2, #15
	bl	_regmap_update_bits
	ldr	w0, [x19, #24]
Lloh12:
	adrp	x8, _ADV7511_REG_VIDEO_INPUT_CFG1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ADV7511_REG_VIDEO_INPUT_CFG1@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	x8, [x20, #24]
Lloh15:
	adrp	x9, _adv7511_set_link_config.input_styles@PAGE
Lloh16:
	add	x9, x9, _adv7511_set_link_config.input_styles@PAGEOFF
	ldr	w8, [x9, x8, lsl #2]
	orr	w3, w21, w8, lsl #2
	mov	w2, #126
	bl	_regmap_update_bits
	ldr	w0, [x19, #24]
Lloh17:
	adrp	x8, _ADV7511_REG_VIDEO_INPUT_CFG2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ADV7511_REG_VIDEO_INPUT_CFG2@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w8, [x20, #32]
	lsl	w2, w8, #3
	bl	_regmap_write
	ldr	w0, [x19, #24]
Lloh20:
	adrp	x8, _ADV7511_REG_TIMING_GEN_SEQ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ADV7511_REG_TIMING_GEN_SEQ@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w8, [x20, #36]
	lsl	w2, w8, #2
	bl	_regmap_write
	ldr	w0, [x19, #24]
	lsl	w2, w22, #5
	mov	w1, #186
	bl	_regmap_write
	ldr	x8, [x20, #48]
	str	x8, [x19, #16]
	ldr	d0, [x20, #40]
	stur	d0, [x19, #4]
	ldr	x8, [x20, #8]
Lloh23:
	adrp	x9, _HDMI_COLORSPACE_RGB@GOTPAGE
Lloh24:
	ldr	x9, [x9, _HDMI_COLORSPACE_RGB@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, eq
	str	w8, [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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @adv7511_set_link_config.input_styles
_adv7511_set_link_config.input_styles:
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	3                               ; 0x3

	.comm	_HDMI_COLORSPACE_YUV422,8,3     ; @HDMI_COLORSPACE_YUV422
	.comm	_ADV7511_INPUT_CLOCK_DDR,8,3    ; @ADV7511_INPUT_CLOCK_DDR
	.comm	_ADV7511_INPUT_CLOCK_2X,8,3     ; @ADV7511_INPUT_CLOCK_2X
	.comm	_ADV7511_REG_I2C_FREQ_ID_CFG,4,2 ; @ADV7511_REG_I2C_FREQ_ID_CFG
	.comm	_ADV7511_REG_VIDEO_INPUT_CFG1,4,2 ; @ADV7511_REG_VIDEO_INPUT_CFG1
	.comm	_ADV7511_REG_VIDEO_INPUT_CFG2,4,2 ; @ADV7511_REG_VIDEO_INPUT_CFG2
	.comm	_ADV7511_REG_TIMING_GEN_SEQ,4,2 ; @ADV7511_REG_TIMING_GEN_SEQ
	.comm	_HDMI_COLORSPACE_RGB,8,3        ; @HDMI_COLORSPACE_RGB
	.no_dead_strip	_adv7511_set_link_config
.subsections_via_symbols
