	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7175_s_routing
_adv7175_s_routing:                     ## @adv7175_s_routing
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_to_adv7175
	movq	%rax, %r15
	cmpl	$2, %r14d
	je	LBB0_9
## %bb.1:
	cmpl	$1, %r14d
	je	LBB0_6
## %bb.2:
	testl	%r14d, %r14d
	jne	LBB0_13
## %bb.3:
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_adv7175_write
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_set_subcarrier_freq
LBB0_5:
	movq	_TR1CAPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$12, %esi
	callq	_adv7175_write
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	movl	$79, %eax
	movl	$73, %ebx
	cmovel	%eax, %ebx
	jmp	LBB0_11
LBB0_9:
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$128, %edx
	callq	_adv7175_write
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$73, %ebx
	testl	%eax, (%r15)
	je	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_set_subcarrier_freq
	jmp	LBB0_11
LBB0_6:
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_adv7175_write
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_set_subcarrier_freq
LBB0_8:
	movq	_TR1PLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$12, %esi
	callq	_adv7175_write
	movl	$73, %ebx
LBB0_11:
	movq	%r12, %rdi
	movl	$13, %esi
	movl	%ebx, %edx
	callq	_adv7175_write
	movq	_TR0MODE@GOTPCREL(%rip), %rbx
	movq	_TR0RST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rbx), %edx
	movq	%r12, %rdi
	movl	$7, %esi
	callq	_adv7175_write
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movl	$7, %esi
	callq	_adv7175_write
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_inputs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r14d, %ecx
	movl	(%rax,%rcx,4), %r8d
	leaq	L_.str.1(%rip), %rcx
	movl	$1, %edi
	movq	%r12, %rdx
	callq	_v4l2_dbg
	movl	%r14d, 4(%r15)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_13:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r12, %rdx
	movl	%r14d, %r8d
	callq	_v4l2_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_TR1CAPT,4,2                    ## @TR1CAPT
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
	.comm	_TR0MODE,4,2                    ## @TR0MODE
	.comm	_TR0RST,4,2                     ## @TR0RST
	.comm	_TR1PLAY,4,2                    ## @TR1PLAY
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"illegal input: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"switched to %s\n"

	.comm	_inputs,8,3                     ## @inputs
	.no_dead_strip	_adv7175_s_routing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7175_s_routing
_adv7175_s_routing:                     ; @adv7175_s_routing
	.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, x1
	mov	x20, x0
	bl	_to_adv7175
	mov	x21, x0
	cmp	w19, #2
	b.eq	LBB0_6
; %bb.1:
	cmp	w19, #1
	b.eq	LBB0_8
; %bb.2:
	cbnz	w19, LBB0_13
; %bb.3:
	mov	x0, x20
	mov	w1, #1
	mov	w2, #0
	bl	_adv7175_write
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _V4L2_STD_NTSC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	w1, #1
	bl	_set_subcarrier_freq
LBB0_5:
Lloh3:
	adrp	x8, _TR1CAPT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TR1CAPT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #12
	bl	_adv7175_write
Lloh6:
	adrp	x8, _V4L2_STD_SECAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_STD_SECAM@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w9
	mov	w8, #73
	mov	w9, #79
	csel	w2, w9, w8, eq
	b	LBB0_12
LBB0_6:
	mov	x0, x20
	mov	w1, #1
	mov	w2, #128
	bl	_adv7175_write
	ldr	w8, [x21]
Lloh9:
	adrp	x9, _V4L2_STD_NTSC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.7:
	mov	x0, x20
	mov	w1, #0
	bl	_set_subcarrier_freq
	b	LBB0_11
LBB0_8:
	mov	x0, x20
	mov	w1, #1
	mov	w2, #0
	bl	_adv7175_write
	ldr	w8, [x21]
Lloh12:
	adrp	x9, _V4L2_STD_NTSC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x20
	mov	w1, #0
	bl	_set_subcarrier_freq
LBB0_10:
Lloh15:
	adrp	x8, _TR1PLAY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TR1PLAY@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #12
	bl	_adv7175_write
LBB0_11:
	mov	w2, #73
LBB0_12:
	mov	x0, x20
	mov	w1, #13
	bl	_adv7175_write
Lloh18:
	adrp	x22, _TR0MODE@GOTPAGE
Lloh19:
	ldr	x22, [x22, _TR0MODE@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh20:
	adrp	x9, _TR0RST@GOTPAGE
Lloh21:
	ldr	x9, [x9, _TR0RST@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	mov	w1, #7
	bl	_adv7175_write
	ldr	w2, [x22]
	mov	x0, x20
	mov	w1, #7
	bl	_adv7175_write
Lloh23:
	adrp	x8, _debug@GOTPAGE
Lloh24:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _inputs@GOTPAGE
Lloh27:
	ldr	x8, [x8, _inputs@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	ldr	w4, [x8, w19, uxtw #2]
Lloh29:
	adrp	x3, l_.str.1@PAGE
Lloh30:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_v4l2_dbg
	mov	w0, #0
	str	w19, [x21, #4]
	b	LBB0_14
LBB0_13:
Lloh31:
	adrp	x8, _debug@GOTPAGE
Lloh32:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x3, l_.str@PAGE
Lloh35:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	mov	x4, x19
	bl	_v4l2_dbg
Lloh36:
	adrp	x8, _EINVAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_TR1CAPT,4,2                    ; @TR1CAPT
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
	.comm	_TR0MODE,4,2                    ; @TR0MODE
	.comm	_TR0RST,4,2                     ; @TR0RST
	.comm	_TR1PLAY,4,2                    ; @TR1PLAY
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"illegal input: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"switched to %s\n"

	.comm	_inputs,8,3                     ; @inputs
	.no_dead_strip	_adv7175_s_routing
.subsections_via_symbols
