	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_av_s_std
_cx18_av_s_std:                         ## @cx18_av_s_std
	.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, %r13d
	movq	%rdi, %r15
	callq	_to_cx18_av_state
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %r14
	cmpq	$0, (%rbx)
	jne	LBB0_2
## %bb.1:
	cmpl	%r13d, 8(%rbx)
	je	LBB0_15
LBB0_2:
	movq	$0, (%rbx)
	movl	%r13d, 8(%rbx)
	movq	_V4L2_STD_NTSC_M_JP@GOTPCREL(%rip), %rax
	movl	$2, %ebx
	cmpl	%r13d, (%rax)
	je	LBB0_13
## %bb.3:
	movq	_V4L2_STD_NTSC_443@GOTPCREL(%rip), %rax
	movl	$3, %ebx
	cmpl	%r13d, (%rax)
	jne	LBB0_4
LBB0_13:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CX18_DEBUG_INFO_DEV
	xorl	%r12d, %r12d
	jmp	LBB0_14
LBB0_4:
	movq	_V4L2_STD_PAL_M@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_7
## %bb.5:
	movl	$1, %r12d
	movl	$5, %ebx
	jmp	LBB0_6
LBB0_7:
	movq	_V4L2_STD_PAL_N@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	movl	$6, %ebx
	cmpl	%r13d, (%rax)
	je	LBB0_6
## %bb.8:
	movq	_V4L2_STD_PAL_Nc@GOTPCREL(%rip), %rax
	movl	$7, %ebx
	cmpl	%r13d, (%rax)
	jne	LBB0_9
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CX18_DEBUG_INFO_DEV
	movq	%r14, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	$-16, %edx
	movl	$1, %ecx
	callq	_cx18_av_and_or
	movq	%r14, %rdi
	movl	$1147, %esi                     ## imm = 0x47B
	movl	$-7, %edx
	xorl	%ecx, %ecx
	callq	_cx18_av_and_or
LBB0_14:
	orl	$32, %ebx
	movq	%r14, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	$-48, %edx
	movl	%ebx, %ecx
	callq	_cx18_av_and_or
	movq	%r14, %rdi
	movl	$1027, %esi                     ## imm = 0x403
	movl	$-4, %edx
	movl	%r12d, %ecx
	callq	_cx18_av_and_or
	movq	%r14, %rdi
	callq	_cx18_av_std_setup
	movq	%r14, %rdi
	callq	_input_change
LBB0_15:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_V4L2_STD_PAL_60@GOTPCREL(%rip), %rax
	movl	$8, %ebx
	cmpl	%r13d, (%rax)
	je	LBB0_13
## %bb.10:
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	movl	$1, %ebx
	testl	%r13d, (%rax)
	jne	LBB0_13
## %bb.11:
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rax
	movl	$4, %ebx
	testl	%r13d, (%rax)
	jne	LBB0_6
## %bb.12:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	andl	(%rax), %r13d
	movl	$12, %ebx
	cmovel	%r13d, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_NTSC_M_JP,4,2         ## @V4L2_STD_NTSC_M_JP
	.comm	_V4L2_STD_NTSC_443,4,2          ## @V4L2_STD_NTSC_443
	.comm	_V4L2_STD_PAL_M,4,2             ## @V4L2_STD_PAL_M
	.comm	_V4L2_STD_PAL_N,4,2             ## @V4L2_STD_PAL_N
	.comm	_V4L2_STD_PAL_Nc,4,2            ## @V4L2_STD_PAL_Nc
	.comm	_V4L2_STD_PAL_60,4,2            ## @V4L2_STD_PAL_60
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"changing video std to fmt %i\n"

	.no_dead_strip	_cx18_av_s_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_av_s_std
_cx18_av_s_std:                         ; @cx18_av_s_std
	.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	x21, x1
	mov	x20, x0
	bl	_to_cx18_av_state
	mov	x22, x0
	mov	x0, x20
	bl	_v4l2_get_subdevdata
	mov	x19, x0
	ldr	x8, [x22]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x22, #8]
	cmp	w8, w21
	b.eq	LBB0_15
LBB0_2:
	str	xzr, [x22]
	str	w21, [x22, #8]
Lloh0:
	adrp	x8, _V4L2_STD_NTSC_M_JP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_NTSC_M_JP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.3:
	mov	w21, #2
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _V4L2_STD_NTSC_443@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_STD_NTSC_443@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.5:
	mov	w21, #3
LBB0_6:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_CX18_DEBUG_INFO_DEV
	mov	w22, #0
	b	LBB0_14
LBB0_7:
Lloh8:
	adrp	x8, _V4L2_STD_PAL_M@GOTPAGE
Lloh9:
	ldr	x8, [x8, _V4L2_STD_PAL_M@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_9
; %bb.8:
	mov	w22, #1
	mov	w21, #5
	b	LBB0_13
LBB0_9:
Lloh11:
	adrp	x8, _V4L2_STD_PAL_N@GOTPAGE
Lloh12:
	ldr	x8, [x8, _V4L2_STD_PAL_N@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_11
; %bb.10:
	mov	w22, #0
	mov	w21, #6
	b	LBB0_13
LBB0_11:
Lloh14:
	adrp	x8, _V4L2_STD_PAL_Nc@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V4L2_STD_PAL_Nc@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_16
; %bb.12:
	mov	w22, #0
	mov	w21, #7
LBB0_13:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_CX18_DEBUG_INFO_DEV
	mov	x0, x19
	mov	w1, #1024
	mov	w2, #-16
	mov	w3, #1
	bl	_cx18_av_and_or
	mov	x0, x19
	mov	w1, #1147
	mov	w2, #-7
	mov	w3, #0
	bl	_cx18_av_and_or
LBB0_14:
	orr	w3, w21, #0x20
	mov	x0, x19
	mov	w1, #1024
	mov	w2, #-48
	bl	_cx18_av_and_or
	mov	x0, x19
	mov	w1, #1027
	mov	w2, #-4
	mov	x3, x22
	bl	_cx18_av_and_or
	mov	x0, x19
	bl	_cx18_av_std_setup
	mov	x0, x19
	bl	_input_change
LBB0_15:
	mov	w0, #0
	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
LBB0_16:
Lloh19:
	adrp	x8, _V4L2_STD_PAL_60@GOTPAGE
Lloh20:
	ldr	x8, [x8, _V4L2_STD_PAL_60@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_18
; %bb.17:
	mov	w21, #8
	b	LBB0_6
LBB0_18:
Lloh22:
	adrp	x8, _V4L2_STD_NTSC@GOTPAGE
Lloh23:
	ldr	x8, [x8, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_20
; %bb.19:
	mov	w21, #1
	b	LBB0_6
LBB0_20:
Lloh25:
	adrp	x8, _V4L2_STD_PAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_22
; %bb.21:
	mov	w22, #0
	mov	w21, #4
	b	LBB0_13
LBB0_22:
Lloh28:
	adrp	x8, _V4L2_STD_SECAM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w21
	mov	w8, #12
	csel	w21, wzr, w8, eq
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_NTSC_M_JP,4,2         ; @V4L2_STD_NTSC_M_JP
	.comm	_V4L2_STD_NTSC_443,4,2          ; @V4L2_STD_NTSC_443
	.comm	_V4L2_STD_PAL_M,4,2             ; @V4L2_STD_PAL_M
	.comm	_V4L2_STD_PAL_N,4,2             ; @V4L2_STD_PAL_N
	.comm	_V4L2_STD_PAL_Nc,4,2            ; @V4L2_STD_PAL_Nc
	.comm	_V4L2_STD_PAL_60,4,2            ; @V4L2_STD_PAL_60
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"changing video std to fmt %i\n"

	.no_dead_strip	_cx18_av_s_std
.subsections_via_symbols
