	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_s_std                     ## -- Begin function cx18_s_std
	.p2align	4, 0x90
_cx18_s_std:                            ## @cx18_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %rdi
	callq	_fh2id
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_1
## %bb.3:
	movq	(%rax), %r14
	xorl	%r15d, %r15d
	cmpl	%ebx, (%r14)
	je	LBB0_8
## %bb.4:
	movq	_CX18_F_I_RADIO_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	44(%r14), %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	leaq	40(%r14), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_7
LBB0_6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%ebx, (%r14)
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	andl	(%rax), %ebx
	sete	%sil
	setne	%cl
	movl	%ecx, 4(%r14)
	movl	%esi, 8(%r14)
	leaq	32(%r14), %rdi
	callq	_cx2341x_handler_set_50hz
	movl	$720, 32(%r14)                  ## imm = 0x2D0
	xorl	%eax, %eax
	cmpl	$0, 8(%r14)
	sete	%al
	movl	$480, %ecx                      ## imm = 0x1E0
	movl	$576, %edx                      ## imm = 0x240
	cmovel	%ecx, %edx
	movl	%edx, 36(%r14)
	movl	$12, %ecx
	movl	$18, %edx
	cmovel	%ecx, %edx
	movl	%edx, 16(%r14)
	leal	6(,%rax,4), %eax
	movq	24(%r14), %rcx
	movl	%eax, (%rcx)
	cmpl	$0, 8(%r14)
	movl	$273, %eax                      ## imm = 0x111
	movl	$318, %edx                      ## imm = 0x13E
	cmovel	%eax, %edx
	movl	%edx, 4(%rcx)
	movslq	(%r14), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	_video@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_s_std@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	movq	%r14, %rdi
	callq	_cx18_call_all
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_ALL,4,2               ## @V4L2_STD_ALL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CX18_F_I_RADIO_USER,4,2        ## @CX18_F_I_RADIO_USER
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Switching standard to %llx.\n"

	.comm	_video,4,2                      ## @video
	.comm	_s_std,4,2                      ## @s_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_s_std                     ; -- Begin function cx18_s_std
	.p2align	2
_cx18_s_std:                            ; @cx18_s_std
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x0, x1
	bl	_fh2id
Lloh0:
	adrp	x8, _V4L2_STD_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.1:
	ldr	x19, [x0]
	ldr	w8, [x19]
	cmp	w8, w20
	b.ne	LBB0_4
LBB0_2:
	mov	w0, #0
	b	LBB0_8
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _CX18_F_I_RADIO_USER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CX18_F_I_RADIO_USER@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x19, #44
	bl	_test_bit
	cbnz	x0, LBB0_6
; %bb.5:
	add	x0, x19, #40
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_9
LBB0_6:
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	str	w20, [x19]
Lloh10:
	adrp	x8, _V4L2_STD_525_60@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w20
	cset	w1, eq
	cset	w8, ne
	stp	w8, w1, [x19, #4]
	add	x0, x19, #32
	bl	_cx2341x_handler_set_50hz
	mov	w8, #720
	ldr	w9, [x19, #8]
	mov	w10, #576
	mov	w11, #480
	cmp	w9, #0
	csel	w9, w11, w10, eq
	stp	w8, w9, [x19, #32]
	mov	w8, #18
	mov	w9, #12
	csel	w8, w9, w8, eq
	str	w8, [x19, #16]
	mov	w8, #6
	mov	w9, #10
	csel	w8, w9, w8, eq
	ldr	x9, [x19, #24]
	str	w8, [x9]
	ldr	w8, [x19, #8]
	mov	w10, #318
	mov	w11, #273
	cmp	w8, #0
	csel	w8, w11, w10, eq
	str	w8, [x9, #4]
	ldrsw	x1, [x19]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_INFO
Lloh15:
	adrp	x8, _video@GOTPAGE
Lloh16:
	ldr	x8, [x8, _video@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _s_std@GOTPAGE
Lloh19:
	ldr	x8, [x8, _s_std@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	ldr	w3, [x19]
	mov	x0, x19
	bl	_cx18_call_all
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_ALL,4,2               ; @V4L2_STD_ALL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CX18_F_I_RADIO_USER,4,2        ; @CX18_F_I_RADIO_USER
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Switching standard to %llx.\n"

	.comm	_video,4,2                      ; @video
	.comm	_s_std,4,2                      ; @s_std
.subsections_via_symbols
