	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx88_video_mux                 ## -- Begin function cx88_video_mux
	.p2align	4, 0x90
_cx88_video_mux:                        ## @cx88_video_mux
	.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
	subq	$488, %rsp                      ## imm = 0x1E8
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	leaq	-528(%rbp), %rdi
	callq	_INPUT
	movl	-528(%rbp), %r15d
	leaq	-496(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-492(%rbp), %r12d
	leaq	-464(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-456(%rbp), %r13d
	leaq	-432(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-420(%rbp), %r14d
	leaq	-400(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-384(%rbp), %eax
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	movl	%r13d, %r9d
	pushq	%rax
	pushq	%r14
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	callq	_dprintk
	addq	$16, %rsp
	movl	%ebx, (%r14)
	movq	_MO_INPUT_FORMAT@GOTPCREL(%rip), %r12
	movl	(%r12), %r15d
	leaq	-368(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-368(%rbp), %edx
	shll	$14, %edx
	movl	%r15d, %edi
	movl	$49152, %esi                    ## imm = 0xC000
	callq	_cx_andor
	movq	_MO_GP3_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	-336(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-320(%rbp), %esi
	movl	%r15d, %edi
	callq	_cx_write
	movq	_MO_GP0_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	-304(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-300(%rbp), %esi
	movl	%r15d, %edi
	callq	_cx_write
	movq	_MO_GP1_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	-272(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-264(%rbp), %esi
	movl	%r15d, %edi
	callq	_cx_write
	movq	_MO_GP2_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	-240(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-228(%rbp), %esi
	movl	%r15d, %edi
	callq	_cx_write
	leaq	-208(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	cmpl	$128, -188(%rbp)
	movq	_MO_AFECFG_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	jne	LBB0_2
## %bb.1:
	callq	_cx_set
	movl	(%r12), %edi
	movl	$65552, %esi                    ## imm = 0x10010
	callq	_cx_set
	movq	_MO_FILTER_EVEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8224, %esi                     ## imm = 0x2020
	callq	_cx_set
	movq	_MO_FILTER_ODD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8224, %esi                     ## imm = 0x2020
	callq	_cx_set
	jmp	LBB0_3
LBB0_2:
	callq	_cx_clear
	movl	(%r12), %edi
	movl	$65552, %esi                    ## imm = 0x10010
	callq	_cx_clear
	movq	_MO_FILTER_EVEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8224, %esi                     ## imm = 0x2020
	callq	_cx_clear
	movq	_MO_FILTER_ODD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8224, %esi                     ## imm = 0x2020
	callq	_cx_clear
LBB0_3:
	leaq	-176(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	cmpq	$0, -152(%rbp)
	je	LBB0_10
## %bb.4:
	cmpq	$0, 8(%r14)
	je	LBB0_6
## %bb.5:
	movq	_audio@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_s_routing@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	-144(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movq	-120(%rbp), %rcx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_call_all
LBB0_6:
	leaq	-112(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-92(%rbp), %eax
	movq	_CX88_VMUX_TELEVISION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_9
## %bb.7:
	leaq	-80(%rbp), %rdi
	movl	%ebx, %esi
	callq	_INPUT
	movl	-60(%rbp), %eax
	movq	_CX88_VMUX_CABLE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_8
LBB0_9:
	movq	_AUD_I2SCNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_cx_write
	movq	_AUD_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EN_I2SIN_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cx_clear
	jmp	LBB0_10
LBB0_8:
	movq	_WW_I2SADC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	%r14, %rdi
	callq	_cx88_set_tvaudio
LBB0_10:
	xorl	%eax, %eax
	addq	$488, %rsp                      ## imm = 0x1E8
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"video_mux: %d [vmux=%d,gpio=0x%x,0x%x,0x%x,0x%x]\n"

	.comm	_MO_INPUT_FORMAT,4,2            ## @MO_INPUT_FORMAT
	.comm	_MO_GP3_IO,4,2                  ## @MO_GP3_IO
	.comm	_MO_GP0_IO,4,2                  ## @MO_GP0_IO
	.comm	_MO_GP1_IO,4,2                  ## @MO_GP1_IO
	.comm	_MO_GP2_IO,4,2                  ## @MO_GP2_IO
	.comm	_MO_AFECFG_IO,4,2               ## @MO_AFECFG_IO
	.comm	_MO_FILTER_EVEN,4,2             ## @MO_FILTER_EVEN
	.comm	_MO_FILTER_ODD,4,2              ## @MO_FILTER_ODD
	.comm	_audio,4,2                      ## @audio
	.comm	_s_routing,4,2                  ## @s_routing
	.comm	_CX88_VMUX_TELEVISION,4,2       ## @CX88_VMUX_TELEVISION
	.comm	_CX88_VMUX_CABLE,4,2            ## @CX88_VMUX_CABLE
	.comm	_WW_I2SADC,4,2                  ## @WW_I2SADC
	.comm	_AUD_I2SCNTL,4,2                ## @AUD_I2SCNTL
	.comm	_AUD_CTL,4,2                    ## @AUD_CTL
	.comm	_EN_I2SIN_ENABLE,4,2            ## @EN_I2SIN_ENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx88_video_mux                 ; -- Begin function cx88_video_mux
	.p2align	2
_cx88_video_mux:                        ; @cx88_video_mux
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w27, -72
	.cfi_offset w28, -80
	sub	sp, sp, #480
	mov	x20, x1
	mov	x19, x0
	sub	x8, x29, #96
	mov	x0, x1
	bl	_INPUT
	ldur	w21, [x29, #-96]
	sub	x8, x29, #128
	mov	x0, x20
	bl	_INPUT
	ldur	w22, [x29, #-124]
	sub	x8, x29, #160
	mov	x0, x20
	bl	_INPUT
	ldur	w23, [x29, #-152]
	sub	x8, x29, #192
	mov	x0, x20
	bl	_INPUT
	ldur	w24, [x29, #-180]
	sub	x8, x29, #224
	mov	x0, x20
	bl	_INPUT
	ldur	w7, [x29, #-208]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	mov	x3, x21
	mov	x4, x22
	mov	x5, x23
	mov	x6, x24
	bl	_dprintk
	str	w20, [x19]
Lloh2:
	adrp	x22, _MO_INPUT_FORMAT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _MO_INPUT_FORMAT@GOTPAGEOFF]
	ldr	w21, [x22]
	sub	x8, x29, #256
	mov	x0, x20
	bl	_INPUT
	ldur	w8, [x29, #-256]
	lsl	w2, w8, #14
	mov	x0, x21
	mov	w1, #49152
	bl	_cx_andor
Lloh4:
	adrp	x8, _MO_GP3_IO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MO_GP3_IO@GOTPAGEOFF]
Lloh6:
	ldr	w21, [x8]
	add	x8, sp, #256
	mov	x0, x20
	bl	_INPUT
	ldr	w1, [sp, #272]
	mov	x0, x21
	bl	_cx_write
Lloh7:
	adrp	x8, _MO_GP0_IO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MO_GP0_IO@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x8]
	add	x8, sp, #224
	mov	x0, x20
	bl	_INPUT
	ldr	w1, [sp, #228]
	mov	x0, x21
	bl	_cx_write
Lloh10:
	adrp	x8, _MO_GP1_IO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MO_GP1_IO@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	add	x8, sp, #192
	mov	x0, x20
	bl	_INPUT
	ldr	w1, [sp, #200]
	mov	x0, x21
	bl	_cx_write
Lloh13:
	adrp	x8, _MO_GP2_IO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MO_GP2_IO@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	add	x8, sp, #160
	mov	x0, x20
	bl	_INPUT
	ldr	w1, [sp, #172]
	mov	x0, x21
	bl	_cx_write
	add	x8, sp, #128
	mov	x0, x20
	bl	_INPUT
	ldr	w8, [sp, #148]
Lloh16:
	adrp	x9, _MO_AFECFG_IO@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MO_AFECFG_IO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x9]
	mov	w1, #1
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.1:
	bl	_cx_set
	ldr	w0, [x22]
	mov	w1, #16
	movk	w1, #1, lsl #16
	bl	_cx_set
Lloh19:
	adrp	x8, _MO_FILTER_EVEN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MO_FILTER_EVEN@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	w1, #8224
	bl	_cx_set
Lloh22:
	adrp	x8, _MO_FILTER_ODD@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MO_FILTER_ODD@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	w1, #8224
	bl	_cx_set
	b	LBB0_3
LBB0_2:
	bl	_cx_clear
	ldr	w0, [x22]
	mov	w1, #16
	movk	w1, #1, lsl #16
	bl	_cx_clear
Lloh25:
	adrp	x8, _MO_FILTER_EVEN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MO_FILTER_EVEN@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	w1, #8224
	bl	_cx_clear
Lloh28:
	adrp	x8, _MO_FILTER_ODD@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MO_FILTER_ODD@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	mov	w1, #8224
	bl	_cx_clear
LBB0_3:
	add	x8, sp, #96
	mov	x0, x20
	bl	_INPUT
	ldr	x8, [sp, #120]
	cbz	x8, LBB0_10
; %bb.4:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh31:
	adrp	x8, _audio@GOTPAGE
Lloh32:
	ldr	x8, [x8, _audio@GOTPAGEOFF]
Lloh33:
	ldr	w21, [x8]
Lloh34:
	adrp	x8, _s_routing@GOTPAGE
Lloh35:
	ldr	x8, [x8, _s_routing@GOTPAGEOFF]
Lloh36:
	ldr	w22, [x8]
	add	x8, sp, #64
	mov	x0, x20
	bl	_INPUT
	ldr	x3, [sp, #88]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	w4, #0
	mov	w5, #0
	bl	_call_all
LBB0_6:
	add	x8, sp, #32
	mov	x0, x20
	bl	_INPUT
	ldr	w8, [sp, #52]
Lloh37:
	adrp	x9, _CX88_VMUX_TELEVISION@GOTPAGE
Lloh38:
	ldr	x9, [x9, _CX88_VMUX_TELEVISION@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_8
; %bb.7:
	mov	x8, sp
	mov	x0, x20
	bl	_INPUT
	ldr	w8, [sp, #20]
Lloh40:
	adrp	x9, _CX88_VMUX_CABLE@GOTPAGE
Lloh41:
	ldr	x9, [x9, _CX88_VMUX_CABLE@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
LBB0_8:
Lloh43:
	adrp	x8, _AUD_I2SCNTL@GOTPAGE
Lloh44:
	ldr	x8, [x8, _AUD_I2SCNTL@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_cx_write
Lloh46:
	adrp	x8, _AUD_CTL@GOTPAGE
Lloh47:
	ldr	x8, [x8, _AUD_CTL@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
Lloh49:
	adrp	x8, _EN_I2SIN_ENABLE@GOTPAGE
Lloh50:
	ldr	x8, [x8, _EN_I2SIN_ENABLE@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
	bl	_cx_clear
	b	LBB0_10
LBB0_9:
Lloh52:
	adrp	x8, _WW_I2SADC@GOTPAGE
Lloh53:
	ldr	x8, [x8, _WW_I2SADC@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_cx88_set_tvaudio
LBB0_10:
	mov	w0, #0
	add	sp, sp, #480
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"video_mux: %d [vmux=%d,gpio=0x%x,0x%x,0x%x,0x%x]\n"

	.comm	_MO_INPUT_FORMAT,4,2            ; @MO_INPUT_FORMAT
	.comm	_MO_GP3_IO,4,2                  ; @MO_GP3_IO
	.comm	_MO_GP0_IO,4,2                  ; @MO_GP0_IO
	.comm	_MO_GP1_IO,4,2                  ; @MO_GP1_IO
	.comm	_MO_GP2_IO,4,2                  ; @MO_GP2_IO
	.comm	_MO_AFECFG_IO,4,2               ; @MO_AFECFG_IO
	.comm	_MO_FILTER_EVEN,4,2             ; @MO_FILTER_EVEN
	.comm	_MO_FILTER_ODD,4,2              ; @MO_FILTER_ODD
	.comm	_audio,4,2                      ; @audio
	.comm	_s_routing,4,2                  ; @s_routing
	.comm	_CX88_VMUX_TELEVISION,4,2       ; @CX88_VMUX_TELEVISION
	.comm	_CX88_VMUX_CABLE,4,2            ; @CX88_VMUX_CABLE
	.comm	_WW_I2SADC,4,2                  ; @WW_I2SADC
	.comm	_AUD_I2SCNTL,4,2                ; @AUD_I2SCNTL
	.comm	_AUD_CTL,4,2                    ; @AUD_CTL
	.comm	_EN_I2SIN_ENABLE,4,2            ; @EN_I2SIN_ENABLE
.subsections_via_symbols
