	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvp5150_selmux
_tvp5150_selmux:                        ## @tvp5150_selmux
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_to_tvp5150
	movq	%rax, %rbx
	movl	(%rax), %eax
	xorl	%r14d, %r14d
	cmpl	$20817, %eax                    ## imm = 0x5151
	je	LBB0_3
## %bb.1:
	cmpl	$20816, %eax                    ## imm = 0x5150
	jne	LBB0_5
## %bb.2:
	cmpl	$1024, 4(%rbx)                  ## imm = 0x400
	je	LBB0_4
	jmp	LBB0_5
LBB0_3:
	cmpl	$256, 4(%rbx)                   ## imm = 0x100
	jne	LBB0_5
LBB0_4:
	xorl	%r14d, %r14d
	cmpl	$0, 20(%rbx)
	sete	%r14b
	shll	$3, %r14d
LBB0_5:
	movl	8(%rbx), %r8d
	cmpl	$130, %r8d
	je	LBB0_9
## %bb.6:
	cmpl	$129, %r8d
	jne	LBB0_8
## %bb.7:
	orl	$2, %r14d
	jmp	LBB0_9
LBB0_8:
	orl	$1, %r14d
LBB0_9:
	movl	(%r15), %edi
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%rbx), %r9d
	leaq	L_.str(%rip), %rcx
	movl	$1, %esi
	pushq	$0
	pushq	%r14
	callq	_dev_dbg_lvl
	addq	$16, %rsp
	movl	12(%rbx), %edi
	movq	_TVP5150_OP_MODE_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_regmap_write
	movl	12(%rbx), %edi
	movq	_TVP5150_VD_IN_SRC_SEL_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_regmap_write
	movq	_TVP5150_MISC_CTL_GPCL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_TVP5150_MISC_CTL_HVLK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	$128, 8(%rbx)
	movl	%eax, %ecx
	cmovel	%edx, %ecx
	movl	12(%rbx), %edi
	orl	%eax, %edx
	movq	_TVP5150_MISC_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_update_bits             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Selecting video route: route input=%i, output=%i => tvp5150 input=%i, opmode=%i\n"

	.comm	_TVP5150_OP_MODE_CTL,4,2        ## @TVP5150_OP_MODE_CTL
	.comm	_TVP5150_VD_IN_SRC_SEL_1,4,2    ## @TVP5150_VD_IN_SRC_SEL_1
	.comm	_TVP5150_MISC_CTL_GPCL,4,2      ## @TVP5150_MISC_CTL_GPCL
	.comm	_TVP5150_MISC_CTL_HVLK,4,2      ## @TVP5150_MISC_CTL_HVLK
	.comm	_TVP5150_MISC_CTL,4,2           ## @TVP5150_MISC_CTL
	.no_dead_strip	_tvp5150_selmux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvp5150_selmux
_tvp5150_selmux:                        ; @tvp5150_selmux
	.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, x0
	bl	_to_tvp5150
	mov	x19, x0
	ldr	w8, [x0]
	mov	w9, #20817
	cmp	w8, w9
	b.eq	LBB0_4
; %bb.1:
	mov	w9, #20816
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.2:
	ldr	w8, [x19, #4]
	cmp	w8, #1024
	b.ne	LBB0_5
LBB0_3:
	ldr	w8, [x19, #20]
	cmp	w8, #0
	cset	w8, eq
	lsl	w8, w8, #3
	b	LBB0_6
LBB0_4:
	ldr	w8, [x19, #4]
	cmp	w8, #256
	b.eq	LBB0_3
LBB0_5:
	mov	w8, #0
LBB0_6:
	ldr	w4, [x19, #8]
	orr	w9, w8, #0x1
	orr	w10, w8, #0x2
	cmp	w4, #129
	csel	w9, w9, w10, ne
	cmp	w4, #130
	csel	w21, w8, w9, eq
	ldr	w0, [x20]
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	ldr	w5, [x19, #16]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	w1, #1
	mov	x6, x21
	mov	w7, #0
	bl	_dev_dbg_lvl
	ldr	w0, [x19, #12]
Lloh5:
	adrp	x8, _TVP5150_OP_MODE_CTL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TVP5150_OP_MODE_CTL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_regmap_write
	ldr	w0, [x19, #12]
Lloh8:
	adrp	x8, _TVP5150_VD_IN_SRC_SEL_1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TVP5150_VD_IN_SRC_SEL_1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_regmap_write
Lloh11:
	adrp	x8, _TVP5150_MISC_CTL_GPCL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TVP5150_MISC_CTL_GPCL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _TVP5150_MISC_CTL_HVLK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _TVP5150_MISC_CTL_HVLK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	ldp	w10, w0, [x19, #8]
	cmp	w10, #128
	csel	w3, w9, w8, eq
Lloh17:
	adrp	x10, _TVP5150_MISC_CTL@GOTPAGE
Lloh18:
	ldr	x10, [x10, _TVP5150_MISC_CTL@GOTPAGEOFF]
	orr	w2, w9, w8
Lloh19:
	ldr	w1, [x10]
	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
	b	_regmap_update_bits
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Selecting video route: route input=%i, output=%i => tvp5150 input=%i, opmode=%i\n"

	.comm	_TVP5150_OP_MODE_CTL,4,2        ; @TVP5150_OP_MODE_CTL
	.comm	_TVP5150_VD_IN_SRC_SEL_1,4,2    ; @TVP5150_VD_IN_SRC_SEL_1
	.comm	_TVP5150_MISC_CTL_GPCL,4,2      ; @TVP5150_MISC_CTL_GPCL
	.comm	_TVP5150_MISC_CTL_HVLK,4,2      ; @TVP5150_MISC_CTL_HVLK
	.comm	_TVP5150_MISC_CTL,4,2           ; @TVP5150_MISC_CTL
	.no_dead_strip	_tvp5150_selmux
.subsections_via_symbols
