	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_v4lstd
_set_v4lstd:                            ## @set_v4lstd
	.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
	movq	%rdi, %rbx
	callq	_i2c_get_clientdata
	movl	%eax, %edi
	callq	_to_state
	movq	%rax, %r14
	movl	(%rax), %eax
	movq	_V4L2_STD_NTSC_M_JP@GOTPCREL(%rip), %rcx
	movl	$2, %r15d
	cmpl	(%rcx), %eax
	je	LBB0_11
## %bb.1:
	movq	_V4L2_STD_NTSC_443@GOTPCREL(%rip), %rcx
	movl	$3, %r15d
	cmpl	(%rcx), %eax
	jne	LBB0_2
LBB0_11:
	movq	_cx25840_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	movl	%r15d, %r8d
	callq	_v4l_dbg
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_2:
	movq	_V4L2_STD_PAL_M@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.3:
	movl	$1, %r12d
	movl	$5, %r15d
	jmp	LBB0_4
LBB0_5:
	movq	_V4L2_STD_PAL_N@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	movl	$6, %r15d
	cmpl	(%rcx), %eax
	je	LBB0_4
## %bb.6:
	movq	_V4L2_STD_PAL_Nc@GOTPCREL(%rip), %rcx
	movl	$7, %r15d
	cmpl	(%rcx), %eax
	jne	LBB0_7
LBB0_4:
	movq	_cx25840_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	movl	%r15d, %r8d
	callq	_v4l_dbg
	movq	%rbx, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	$-16, %edx
	movl	$1, %ecx
	callq	_cx25840_and_or
	movq	%rbx, %rdi
	movl	$1147, %esi                     ## imm = 0x47B
	movl	$-7, %edx
	xorl	%ecx, %ecx
	callq	_cx25840_and_or
LBB0_12:
	movq	%rbx, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	$-16, %edx
	movl	%r15d, %ecx
	callq	_cx25840_and_or
	movq	%rbx, %rdi
	movl	$1027, %esi                     ## imm = 0x403
	movl	$-4, %edx
	movl	%r12d, %ecx
	callq	_cx25840_and_or
	movq	%r14, %rdi
	callq	_is_cx23888
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	callq	_cx23888_std_setup
	jmp	LBB0_15
LBB0_14:
	callq	_cx25840_std_setup
LBB0_15:
	movq	%r14, %rdi
	callq	_is_cx2583x
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movq	%rbx, %rdi
	callq	_input_change
LBB0_17:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_V4L2_STD_PAL_60@GOTPCREL(%rip), %rcx
	movl	$8, %r15d
	cmpl	(%rcx), %eax
	je	LBB0_11
## %bb.8:
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rcx
	movl	$1, %r15d
	testl	%eax, (%rcx)
	jne	LBB0_11
## %bb.9:
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rcx
	movl	$4, %r15d
	testl	%eax, (%rcx)
	jne	LBB0_4
## %bb.10:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	$12, %r15d
	cmovel	%eax, %r15d
	jmp	LBB0_11
	.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
	.comm	_cx25840_debug,4,2              ## @cx25840_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"changing video std to fmt %i\n"

	.no_dead_strip	_set_v4lstd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_v4lstd
_set_v4lstd:                            ; @set_v4lstd
	.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, x0
	bl	_i2c_get_clientdata
	bl	_to_state
	mov	x20, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _V4L2_STD_NTSC_M_JP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_STD_NTSC_M_JP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w21, #2
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x9, _V4L2_STD_NTSC_443@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_STD_NTSC_443@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
	mov	w21, #3
LBB0_4:
Lloh6:
	adrp	x8, _cx25840_debug@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cx25840_debug@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x3, l_.str@PAGE
Lloh10:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x21
	bl	_v4l_dbg
	mov	w22, #0
	b	LBB0_12
LBB0_5:
Lloh11:
	adrp	x9, _V4L2_STD_PAL_M@GOTPAGE
Lloh12:
	ldr	x9, [x9, _V4L2_STD_PAL_M@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.6:
	mov	w22, #1
	mov	w21, #5
	b	LBB0_11
LBB0_7:
Lloh14:
	adrp	x9, _V4L2_STD_PAL_N@GOTPAGE
Lloh15:
	ldr	x9, [x9, _V4L2_STD_PAL_N@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.8:
	mov	w22, #0
	mov	w21, #6
	b	LBB0_11
LBB0_9:
Lloh17:
	adrp	x9, _V4L2_STD_PAL_Nc@GOTPAGE
Lloh18:
	ldr	x9, [x9, _V4L2_STD_PAL_Nc@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_18
; %bb.10:
	mov	w22, #0
	mov	w21, #7
LBB0_11:
Lloh20:
	adrp	x8, _cx25840_debug@GOTPAGE
Lloh21:
	ldr	x8, [x8, _cx25840_debug@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x3, l_.str@PAGE
Lloh24:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x21
	bl	_v4l_dbg
	mov	x0, x19
	mov	w1, #1024
	mov	w2, #-16
	mov	w3, #1
	bl	_cx25840_and_or
	mov	x0, x19
	mov	w1, #1147
	mov	w2, #-7
	mov	w3, #0
	bl	_cx25840_and_or
LBB0_12:
	mov	x0, x19
	mov	w1, #1024
	mov	w2, #-16
	mov	x3, x21
	bl	_cx25840_and_or
	mov	x0, x19
	mov	w1, #1027
	mov	w2, #-4
	mov	x3, x22
	bl	_cx25840_and_or
	mov	x0, x20
	bl	_is_cx23888
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_cx23888_std_setup
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_cx25840_std_setup
LBB0_15:
	mov	x0, x20
	bl	_is_cx2583x
	cbnz	w0, LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_input_change
LBB0_17:
	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_18:
Lloh25:
	adrp	x9, _V4L2_STD_PAL_60@GOTPAGE
Lloh26:
	ldr	x9, [x9, _V4L2_STD_PAL_60@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_20
; %bb.19:
	mov	w21, #8
	b	LBB0_4
LBB0_20:
Lloh28:
	adrp	x9, _V4L2_STD_NTSC@GOTPAGE
Lloh29:
	ldr	x9, [x9, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.21:
	mov	w21, #1
	b	LBB0_4
LBB0_22:
Lloh31:
	adrp	x9, _V4L2_STD_PAL@GOTPAGE
Lloh32:
	ldr	x9, [x9, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.23:
	mov	w22, #0
	mov	w21, #4
	b	LBB0_11
LBB0_24:
Lloh34:
	adrp	x9, _V4L2_STD_SECAM@GOTPAGE
Lloh35:
	ldr	x9, [x9, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #12
	csel	w21, wzr, w8, eq
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.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
	.comm	_cx25840_debug,4,2              ; @cx25840_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"changing video std to fmt %i\n"

	.no_dead_strip	_set_v4lstd
.subsections_via_symbols
