	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msp_s_routing
_msp_s_routing:                         ## @msp_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	%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	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_to_state
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %r14
	cmpl	%ebx, (%r15)
	jne	LBB0_2
## %bb.1:
	cmpl	%r13d, 4(%r15)
	je	LBB0_5
LBB0_2:
	movl	%ebx, %esi
	andl	$7, %esi
	movl	%r13d, %eax
	andl	$15, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r13d, %r12d
	shrl	$4, %r12d
	andl	$15, %r12d
	movl	%ebx, (%r15)
	movl	%r13d, 4(%r15)
	movq	_MSP_MODE_AM_DETECT@GOTPCREL(%rip), %rax
	movq	%rax, %rcx
	testb	$-16, %bl
	je	LBB0_4
## %bb.3:
	movq	_MSP_MODE_EXTERN@GOTPCREL(%rip), %rcx
LBB0_4:
	testl	$3840, %ebx                     ## imm = 0xF00
	cmoveq	%rax, %rcx
	testl	$61440, %ebx                    ## imm = 0xF000
	cmoveq	%rax, %rcx
	testl	$983040, %ebx                   ## imm = 0xF0000
	cmoveq	%rax, %rcx
	testl	$15728640, %ebx                 ## imm = 0xF00000
	cmoveq	%rax, %rcx
	movl	(%rcx), %eax
	movl	%eax, 20(%r15)
	movq	_V4L2_TUNER_SUB_STEREO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_msp_set_scart
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$1, %edx
	callq	_msp_set_scart
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	$2, %edx
	callq	_msp_set_scart
	movq	%r14, %rdi
	callq	_msp_set_audmode
	movq	8(%r15), %rax
	movq	_OPMODE_AUTOSELECT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$48, %eax
	movl	$187, %r15d
	cmovel	%eax, %r15d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_msp_read_dem
	andl	$-257, %eax                     ## imm = 0xFEFF
	andl	$8, %ebx
	shll	$5, %ebx
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_msp_write_dem
	movq	%r14, %rdi
	callq	_msp_wake_thread
LBB0_5:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSP_MODE_EXTERN,4,2            ## @MSP_MODE_EXTERN
	.comm	_MSP_MODE_AM_DETECT,4,2         ## @MSP_MODE_AM_DETECT
	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ## @V4L2_TUNER_SUB_STEREO
	.comm	_OPMODE_AUTOSELECT,8,3          ## @OPMODE_AUTOSELECT
	.no_dead_strip	_msp_s_routing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msp_s_routing
_msp_s_routing:                         ; @msp_s_routing
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_to_state
	mov	x20, x0
	mov	x0, x19
	bl	_v4l2_get_subdevdata
	mov	x19, x0
	ldr	w8, [x20]
	cmp	w8, w22
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x20, #4]
	cmp	w8, w21
	b.eq	LBB0_3
LBB0_2:
	stp	w22, w21, [x20]
	tst	w22, #0xf0
	and	w8, w22, #0xf00
	ccmp	w8, #0, #4, ne
	and	w8, w22, #0xf000
	ccmp	w8, #0, #4, ne
	and	w8, w22, #0xf0000
	ccmp	w8, #0, #4, ne
	and	w8, w22, #0xf00000
Lloh0:
	adrp	x9, _MSP_MODE_EXTERN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MSP_MODE_EXTERN@GOTPAGEOFF]
Lloh2:
	adrp	x10, _MSP_MODE_AM_DETECT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MSP_MODE_AM_DETECT@GOTPAGEOFF]
	ccmp	w8, #0, #4, ne
	csel	x8, x9, x10, ne
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _V4L2_TUNER_SUB_STEREO@GOTPAGE
Lloh5:
	ldr	x9, [x9, _V4L2_TUNER_SUB_STEREO@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	and	w1, w22, #0x7
	and	w23, w21, #0xf
	ubfx	w21, w21, #4, #4
	lsr	w22, w22, #3
	stp	w9, w8, [x20, #16]
	mov	x0, x19
	mov	w2, #0
	bl	_msp_set_scart
	mov	x0, x19
	mov	x1, x23
	mov	w2, #1
	bl	_msp_set_scart
	mov	x0, x19
	mov	x1, x21
	mov	w2, #2
	bl	_msp_set_scart
	mov	x0, x19
	bl	_msp_set_audmode
Lloh7:
	adrp	x8, _OPMODE_AUTOSELECT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OPMODE_AUTOSELECT@GOTPAGEOFF]
	ldr	x9, [x20, #8]
Lloh9:
	ldr	x8, [x8]
	cmp	x9, x8
	mov	w8, #187
	mov	w9, #48
	csel	w20, w9, w8, eq
	mov	x0, x19
	mov	x1, x20
	bl	_msp_read_dem
	mov	x2, x0
	bfi	w2, w22, #8, #1
	mov	x0, x19
	mov	x1, x20
	bl	_msp_write_dem
	mov	x0, x19
	bl	_msp_wake_thread
LBB0_3:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MSP_MODE_EXTERN,4,2            ; @MSP_MODE_EXTERN
	.comm	_MSP_MODE_AM_DETECT,4,2         ; @MSP_MODE_AM_DETECT
	.comm	_V4L2_TUNER_SUB_STEREO,4,2      ; @V4L2_TUNER_SUB_STEREO
	.comm	_OPMODE_AUTOSELECT,8,3          ; @OPMODE_AUTOSELECT
	.no_dead_strip	_msp_s_routing
.subsections_via_symbols
