	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7182_select_input
_adv7182_select_input:                  ## @adv7182_select_input
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_ADV7180_REG_INPUT_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r14d, %edx
	callq	_adv7180_write
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movq	_ADV7180_REG_RST_CLAMP@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_adv7180_write
	movq	(%rbx), %rsi
	movq	%r12, %rdi
	movl	$255, %edx
	callq	_adv7180_write
	movl	%r14d, %edi
	callq	_adv7182_get_input_type
	movl	%eax, %ebx
	andl	$-2, %eax
	xorl	%edx, %edx
	cmpl	$128, %eax
	sete	%dl
	movq	_ADV7180_REG_SHAP_FILTER_CTL_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	shll	$6, %edx
	orl	$1, %edx
	movq	%r12, %rdi
	callq	_adv7180_write
	movq	(%r12), %rsi
	movq	_ADV7180_FLAG_V2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %eax
	movq	_adv7182_lbias_settings@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	%rcx, %rdx
	andl	(%rsi), %edi
	je	LBB0_3
## %bb.2:
	movq	_adv7280_lbias_settings@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
LBB0_3:
	movq	(%rdx,%rax,8), %r13
	movq	(%rcx), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	movq	_ADV7180_REG_CVBS_TRIM@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	addq	%rbx, %rsi
	movl	(%r13,%rbx,4), %edx
	movq	%r12, %rdi
	callq	_adv7180_write
	incq	%rbx
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %rbx
	jb	LBB0_5
LBB0_6:
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	cmpl	$128, -44(%rbp)                 ## 4-byte Folded Reload
	setne	%r13b
	movq	_ADV7180_REG_RES_CIR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	$168, %eax
	movl	$240, %edx
	cmovel	%eax, %edx
	movl	$176, %eax
	movl	$16, %r14d
	cmovel	%eax, %r14d
	movl	$8, %eax
	movl	$156, %ebx
	cmovel	%eax, %ebx
	movl	$160, %eax
	cmovnel	%r15d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	shll	$6, %r13d
	orl	$144, %r13d
	movq	%r12, %rdi
	callq	_adv7180_write
	movq	_ADV7180_REG_CLAMP_ADJ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_adv7180_write
	movq	_ADV7180_REG_DIFF_MODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_adv7180_write
	movq	_ADV7180_REG_AGC_ADJ1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_adv7180_write
	movq	_ADV7180_REG_AGC_ADJ2@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_adv7180_write
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADV7180_REG_INPUT_CONTROL,8,3  ## @ADV7180_REG_INPUT_CONTROL
	.comm	_ADV7180_REG_RST_CLAMP,8,3      ## @ADV7180_REG_RST_CLAMP
	.comm	_ADV7180_REG_SHAP_FILTER_CTL_1,8,3 ## @ADV7180_REG_SHAP_FILTER_CTL_1
	.comm	_ADV7180_FLAG_V2,4,2            ## @ADV7180_FLAG_V2
	.comm	_adv7280_lbias_settings,8,3     ## @adv7280_lbias_settings
	.comm	_adv7182_lbias_settings,8,3     ## @adv7182_lbias_settings
	.comm	_ADV7180_REG_CVBS_TRIM,8,3      ## @ADV7180_REG_CVBS_TRIM
	.comm	_ADV7180_REG_RES_CIR,8,3        ## @ADV7180_REG_RES_CIR
	.comm	_ADV7180_REG_CLAMP_ADJ,8,3      ## @ADV7180_REG_CLAMP_ADJ
	.comm	_ADV7180_REG_DIFF_MODE,8,3      ## @ADV7180_REG_DIFF_MODE
	.comm	_ADV7180_REG_AGC_ADJ1,8,3       ## @ADV7180_REG_AGC_ADJ1
	.comm	_ADV7180_REG_AGC_ADJ2,8,3       ## @ADV7180_REG_AGC_ADJ2
	.no_dead_strip	_adv7182_select_input
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7182_select_input
_adv7182_select_input:                  ; @adv7182_select_input
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ADV7180_REG_INPUT_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADV7180_REG_INPUT_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
	mov	x2, x20
	bl	_adv7180_write
	cbnz	w0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x21, _ADV7180_REG_RST_CLAMP@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ADV7180_REG_RST_CLAMP@GOTPAGEOFF]
	ldr	x1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_adv7180_write
	ldr	x1, [x21]
	mov	x0, x19
	mov	w2, #255
	bl	_adv7180_write
	mov	x0, x20
	bl	_adv7182_get_input_type
	mov	x20, x0
	and	w8, w0, #0xfffffffe
Lloh5:
	adrp	x9, _ADV7180_REG_SHAP_FILTER_CTL_1@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ADV7180_REG_SHAP_FILTER_CTL_1@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x9]
	cmp	w8, #128
	mov	w8, #65
	csinc	w2, w8, wzr, eq
	mov	x0, x19
	bl	_adv7180_write
	ldr	x8, [x19]
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _ADV7180_FLAG_V2@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ADV7180_FLAG_V2@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _adv7280_lbias_settings@GOTPAGE
Lloh12:
	ldr	x10, [x10, _adv7280_lbias_settings@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
Lloh14:
	adrp	x21, _adv7182_lbias_settings@GOTPAGE
Lloh15:
	ldr	x21, [x21, _adv7182_lbias_settings@GOTPAGEOFF]
	ldr	x11, [x21]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	x22, [x8, w20, uxtw #3]
	ldr	x0, [x11]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_4
; %bb.2:
	mov	x23, #0
Lloh16:
	adrp	x24, _ADV7180_REG_CVBS_TRIM@GOTPAGE
Lloh17:
	ldr	x24, [x24, _ADV7180_REG_CVBS_TRIM@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x1, x23, x8
	ldr	w2, [x22, x23, lsl #2]
	mov	x0, x19
	bl	_adv7180_write
	add	x23, x23, #1
	ldr	x8, [x21]
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	cmp	x23, w0, uxtw
	b.lo	LBB0_3
LBB0_4:
Lloh18:
	adrp	x8, _ADV7180_REG_RES_CIR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ADV7180_REG_RES_CIR@GOTPAGEOFF]
	mov	w9, #240
	mov	w10, #168
Lloh20:
	ldr	x1, [x8]
	cmp	w20, #128
	csel	w2, w10, w9, eq
	mov	w8, #208
	mov	w9, #144
	csel	w20, w9, w8, eq
	mov	w8, #16
	mov	w9, #176
	csel	w21, w9, w8, eq
	mov	w8, #156
	mov	w9, #8
	csel	w22, w9, w8, eq
	mov	w8, #160
	csel	w23, w8, wzr, eq
	mov	x0, x19
	bl	_adv7180_write
Lloh21:
	adrp	x8, _ADV7180_REG_CLAMP_ADJ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ADV7180_REG_CLAMP_ADJ@GOTPAGEOFF]
Lloh23:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_adv7180_write
Lloh24:
	adrp	x8, _ADV7180_REG_DIFF_MODE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ADV7180_REG_DIFF_MODE@GOTPAGEOFF]
Lloh26:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_adv7180_write
Lloh27:
	adrp	x8, _ADV7180_REG_AGC_ADJ1@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ADV7180_REG_AGC_ADJ1@GOTPAGEOFF]
Lloh29:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_adv7180_write
Lloh30:
	adrp	x8, _ADV7180_REG_AGC_ADJ2@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ADV7180_REG_AGC_ADJ2@GOTPAGEOFF]
Lloh32:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_adv7180_write
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ADV7180_REG_INPUT_CONTROL,8,3  ; @ADV7180_REG_INPUT_CONTROL
	.comm	_ADV7180_REG_RST_CLAMP,8,3      ; @ADV7180_REG_RST_CLAMP
	.comm	_ADV7180_REG_SHAP_FILTER_CTL_1,8,3 ; @ADV7180_REG_SHAP_FILTER_CTL_1
	.comm	_ADV7180_FLAG_V2,4,2            ; @ADV7180_FLAG_V2
	.comm	_adv7280_lbias_settings,8,3     ; @adv7280_lbias_settings
	.comm	_adv7182_lbias_settings,8,3     ; @adv7182_lbias_settings
	.comm	_ADV7180_REG_CVBS_TRIM,8,3      ; @ADV7180_REG_CVBS_TRIM
	.comm	_ADV7180_REG_RES_CIR,8,3        ; @ADV7180_REG_RES_CIR
	.comm	_ADV7180_REG_CLAMP_ADJ,8,3      ; @ADV7180_REG_CLAMP_ADJ
	.comm	_ADV7180_REG_DIFF_MODE,8,3      ; @ADV7180_REG_DIFF_MODE
	.comm	_ADV7180_REG_AGC_ADJ1,8,3       ; @ADV7180_REG_AGC_ADJ1
	.comm	_ADV7180_REG_AGC_ADJ2,8,3       ; @ADV7180_REG_AGC_ADJ2
	.no_dead_strip	_adv7182_select_input
.subsections_via_symbols
