	.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, %rbx
	callq	_to_tvp5150
	movq	%rax, %r14
	movl	(%rax), %r9d
	movq	_TVP5150_BLACK_SCREEN@GOTPCREL(%rip), %rax
	testl	%r9d, (%rax)
	je	LBB0_1
LBB0_2:
	movl	$8, %r15d
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
	cmpl	$0, 8(%r14)
	je	LBB0_2
LBB0_3:
	movl	4(%r14), %r8d
	cmpl	$130, %r8d
	je	LBB0_7
## %bb.4:
	cmpl	$129, %r8d
	jne	LBB0_6
## %bb.5:
	orl	$2, %r15d
	jmp	LBB0_7
LBB0_6:
	orl	$1, %r15d
LBB0_7:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	pushq	$0
	pushq	%r15
	callq	_v4l2_dbg
	addq	$16, %rsp
	movq	_TVP5150_OP_MODE_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_tvp5150_write
	movq	_TVP5150_VD_IN_SRC_SEL_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_tvp5150_write
	movq	_TVP5150_MISC_CTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_tvp5150_read
	andb	$-81, %al
	cmpl	$128, 4(%r14)
	movl	$16, %ecx
	movl	$64, %edx
	cmovel	%ecx, %edx
	orb	%al, %dl
	movl	(%r15), %esi
	movzbl	%dl, %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tvp5150_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TVP5150_BLACK_SCREEN,4,2       ## @TVP5150_BLACK_SCREEN
	.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,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	x19, x0
	bl	_to_tvp5150
	mov	x20, x0
	ldr	w5, [x0]
Lloh0:
	adrp	x8, _TVP5150_BLACK_SCREEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TVP5150_BLACK_SCREEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w5
	b.eq	LBB0_2
LBB0_1:
	mov	w8, #8
	b	LBB0_4
LBB0_2:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_1
; %bb.3:
	mov	w8, #0
LBB0_4:
	ldr	w4, [x20, #4]
	orr	w9, w8, #0x1
	orr	w10, w8, #0x2
	cmp	w4, #129
	csel	w9, w9, w10, ne
	cmp	w4, #130
	csel	w21, w8, w9, eq
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x6, x21
	mov	w7, #0
	bl	_v4l2_dbg
Lloh8:
	adrp	x8, _TVP5150_OP_MODE_CTL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TVP5150_OP_MODE_CTL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_tvp5150_write
Lloh11:
	adrp	x8, _TVP5150_VD_IN_SRC_SEL_1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TVP5150_VD_IN_SRC_SEL_1@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_tvp5150_write
Lloh14:
	adrp	x21, _TVP5150_MISC_CTL@GOTPAGE
Lloh15:
	ldr	x21, [x21, _TVP5150_MISC_CTL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_tvp5150_read
	ldr	w8, [x20, #4]
	mov	w9, #175
	and	w9, w0, w9
	mov	w10, #64
	mov	w11, #16
	cmp	w8, #128
	csel	w8, w11, w10, eq
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, 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
	b	_tvp5150_write
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_TVP5150_BLACK_SCREEN,4,2       ; @TVP5150_BLACK_SCREEN
	.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,4,2           ; @TVP5150_MISC_CTL
	.no_dead_strip	_tvp5150_selmux
.subsections_via_symbols
