	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa717x_s_video_routing
_saa717x_s_video_routing:               ## @saa717x_s_video_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	%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, %ebx
	movq	%rdi, %r15
	callq	_to_state
	movq	%rax, %r12
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	andl	$127, %ebx
	movq	_debug@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	L_.str(%rip), %rcx
	xorl	%r14d, %r14d
	movl	$1, %edi
	movq	%r15, %rdx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	cmpl	$9, %ebx
	ja	LBB0_2
## %bb.1:
	cmpl	$5, %ebx
	je	LBB0_2
## %bb.3:
	xorl	%r14d, %r14d
	cmpl	%ebx, (%r12)
	je	LBB0_10
## %bb.4:
	movl	%ebx, (%r12)
	movl	(%r13), %esi
	xorl	%r13d, %r13d
	cmpl	$6, %ebx
	setae	%r13b
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %r8
	cmovaeq	%rax, %r8
	leaq	L_.str.1(%rip), %rcx
	xorl	%r14d, %r14d
	movl	$1, %edi
	movq	%r15, %rdx
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	%r15, %rdi
	movl	$258, %esi                      ## imm = 0x102
	callq	_saa717x_read
	andl	$240, %eax
	orl	%ebx, %eax
	movq	%r15, %rdi
	movl	$258, %esi                      ## imm = 0x102
	movl	%eax, %edx
	callq	_saa717x_write
	movq	%r15, %rdi
	movl	$265, %esi                      ## imm = 0x109
	callq	_saa717x_read
	andl	$127, %eax
	shll	$7, %r13d
	orl	%eax, %r13d
	movq	%r15, %rdi
	movl	$265, %esi                      ## imm = 0x109
	movl	%r13d, %edx
	callq	_saa717x_write
	testb	$-128, -44(%rbp)                ## 1-byte Folded Reload
	jne	LBB0_5
## %bb.6:
	movq	_TUNER_AUDIO_STEREO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_set_audio_mode
	cmpl	$6, %ebx
	jb	LBB0_8
## %bb.7:
	movq	_reg_init_svideo_input@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_5:
	movl	4(%r12), %esi
	movq	%r15, %rdi
	callq	_set_audio_mode
	movq	_reg_init_tuner_input@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_reg_init_composite_input@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_saa717x_write_regs
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"decoder set input (%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"now setting %s input %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"S-Video"

L_.str.3:                               ## @.str.3
	.asciz	"Composite"

	.comm	_TUNER_AUDIO_STEREO,4,2         ## @TUNER_AUDIO_STEREO
	.comm	_reg_init_tuner_input,4,2       ## @reg_init_tuner_input
	.comm	_reg_init_svideo_input,4,2      ## @reg_init_svideo_input
	.comm	_reg_init_composite_input,4,2   ## @reg_init_composite_input
	.no_dead_strip	_saa717x_s_video_routing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa717x_s_video_routing
_saa717x_s_video_routing:               ; @saa717x_s_video_routing
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_to_state
	mov	x21, x0
	and	w22, w20, #0x7f
Lloh0:
	adrp	x23, _debug@GOTPAGE
Lloh1:
	ldr	x23, [x23, _debug@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x8, x22
	str	x8, [sp]
Lloh2:
	adrp	x3, l_.str@PAGE
Lloh3:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	cmp	w22, #9
	b.hi	LBB0_6
; %bb.1:
	cmp	w22, #5
	b.eq	LBB0_6
; %bb.2:
	ldr	w8, [x21]
	cmp	w8, w22
	b.eq	LBB0_10
; %bb.3:
	str	w22, [x21]
	ldr	w1, [x23]
	cmp	w22, #5
	cset	w23, hi
Lloh4:
	adrp	x8, l_.str.3@PAGE
Lloh5:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh6:
	adrp	x9, l_.str.2@PAGE
Lloh7:
	add	x9, x9, l_.str.2@PAGEOFF
	csel	x8, x9, x8, hi
	stp	x8, x22, [sp]
Lloh8:
	adrp	x3, l_.str.1@PAGE
Lloh9:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	mov	x0, x19
	mov	w1, #258
	bl	_saa717x_read
	and	w8, w0, #0xf0
	orr	w2, w8, w22
	mov	x0, x19
	mov	w1, #258
	bl	_saa717x_write
	mov	x0, x19
	mov	w1, #265
	bl	_saa717x_read
	and	w2, w0, #0x7f
	bfi	w2, w23, #7, #1
	mov	x0, x19
	mov	w1, #265
	bl	_saa717x_write
	tbnz	w20, #7, LBB0_7
; %bb.4:
Lloh10:
	adrp	x8, _TUNER_AUDIO_STEREO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TUNER_AUDIO_STEREO@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_set_audio_mode
	cmp	w22, #6
	b.lo	LBB0_8
; %bb.5:
Lloh13:
	adrp	x8, _reg_init_svideo_input@GOTPAGE
Lloh14:
	ldr	x8, [x8, _reg_init_svideo_input@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_7:
	ldr	w1, [x21, #4]
	mov	x0, x19
	bl	_set_audio_mode
Lloh18:
	adrp	x8, _reg_init_tuner_input@GOTPAGE
Lloh19:
	ldr	x8, [x8, _reg_init_tuner_input@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh20:
	adrp	x8, _reg_init_composite_input@GOTPAGE
Lloh21:
	ldr	x8, [x8, _reg_init_composite_input@GOTPAGEOFF]
LBB0_9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_saa717x_write_regs
LBB0_10:
	mov	w0, #0
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"decoder set input (%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"now setting %s input %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"S-Video"

l_.str.3:                               ; @.str.3
	.asciz	"Composite"

	.comm	_TUNER_AUDIO_STEREO,4,2         ; @TUNER_AUDIO_STEREO
	.comm	_reg_init_tuner_input,4,2       ; @reg_init_tuner_input
	.comm	_reg_init_svideo_input,4,2      ; @reg_init_svideo_input
	.comm	_reg_init_composite_input,4,2   ; @reg_init_composite_input
	.no_dead_strip	_saa717x_s_video_routing
.subsections_via_symbols
