	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function input_change
_input_change:                          ## @input_change
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%ebx, %eax
	setne	%cl
	leal	(%rcx,%rcx,2), %edx
	addl	$17, %edx
	movl	$1183, %esi                     ## imm = 0x49F
	callq	_cx18_av_write
	movq	%r14, %rdi
	movl	$1025, %esi                     ## imm = 0x401
	movl	$-97, %edx
	xorl	%ecx, %ecx
	callq	_cx18_av_and_or
	movq	%r14, %rdi
	movl	$1025, %esi                     ## imm = 0x401
	movl	$-97, %edx
	movl	$96, %ecx
	callq	_cx18_av_and_or
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.1:
	movq	_V4L2_STD_NTSC_M_JP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	movl	$2056, %esi                     ## imm = 0x808
	movl	$247, %edx
	movl	$247, %ecx
	movl	$255, %r8d
	callq	_cx18_av_write_expect
	movq	%r14, %rdi
	movl	$2059, %esi                     ## imm = 0x80B
	movl	$2, %edx
	movl	$2, %ecx
	jmp	LBB0_10
LBB0_6:
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_8
## %bb.7:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_11
LBB0_8:
	movq	%r14, %rdi
	movl	$2056, %esi                     ## imm = 0x808
	movl	$255, %edx
	movl	$255, %ecx
	jmp	LBB0_9
LBB0_3:
	movq	_V4L2_STD_NTSC_M_KR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	movl	$2056, %esi                     ## imm = 0x808
	movl	$248, %edx
	movl	$248, %ecx
LBB0_9:
	movl	$255, %r8d
	callq	_cx18_av_write_expect
	movq	%r14, %rdi
	movl	$2059, %esi                     ## imm = 0x80B
	movl	$3, %edx
	movl	$3, %ecx
	jmp	LBB0_10
LBB0_5:
	movq	%r14, %rdi
	movl	$2056, %esi                     ## imm = 0x808
	movl	$246, %edx
	movl	$246, %ecx
	movl	$255, %r8d
	callq	_cx18_av_write_expect
	movq	%r14, %rdi
	movl	$2059, %esi                     ## imm = 0x80B
	movl	$1, %edx
	movl	$1, %ecx
LBB0_10:
	movl	$63, %r8d
	callq	_cx18_av_write_expect
LBB0_11:
	movq	%r14, %rdi
	movl	$2051, %esi                     ## imm = 0x803
	callq	_cx18_av_read
	movl	%eax, %ebx
	testb	$16, %bl
	jne	LBB0_13
## %bb.12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_13:
	movl	%ebx, %ecx
	andl	$-17, %ecx
	movq	%r14, %rdi
	movl	$2051, %esi                     ## imm = 0x803
	movl	%ecx, %edx
	movl	$31, %r8d
	callq	_cx18_av_write_expect
	orl	$16, %ebx
	movq	%r14, %rdi
	movl	$2051, %esi                     ## imm = 0x803
	movl	%ebx, %edx
	movl	%ebx, %ecx
	movl	$31, %r8d
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_cx18_av_write_expect           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.comm	_V4L2_STD_NTSC_M_JP,4,2         ## @V4L2_STD_NTSC_M_JP
	.comm	_V4L2_STD_NTSC_M_KR,4,2         ## @V4L2_STD_NTSC_M_KR
	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
	.no_dead_strip	_input_change
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function input_change
_input_change:                          ; @input_change
	.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	x19, x0
Lloh0:
	adrp	x8, _V4L2_STD_NTSC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_STD_NTSC@GOTPAGEOFF]
	ldr	w20, [x0]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	mov	w8, #20
	mov	w9, #17
	csel	w2, w9, w8, eq
	mov	w1, #1183
	bl	_cx18_av_write
	mov	x0, x19
	mov	w1, #1025
	mov	w2, #-97
	mov	w3, #0
	bl	_cx18_av_and_or
	mov	x0, x19
	mov	w1, #1025
	mov	w2, #-97
	mov	w3, #96
	bl	_cx18_av_and_or
Lloh3:
	adrp	x8, _V4L2_STD_525_60@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _V4L2_STD_NTSC_M_JP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_STD_NTSC_M_JP@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_6
; %bb.2:
	mov	x0, x19
	mov	w1, #2056
	mov	w2, #247
	mov	w3, #247
	mov	w4, #255
	bl	_cx18_av_write_expect
	mov	x0, x19
	mov	w1, #2059
	mov	w2, #2
	mov	w3, #2
	b	LBB0_10
LBB0_3:
Lloh9:
	adrp	x8, _V4L2_STD_PAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _V4L2_STD_SECAM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_11
LBB0_5:
	mov	x0, x19
	mov	w1, #2056
	mov	w2, #255
	mov	w3, #255
	b	LBB0_8
LBB0_6:
Lloh15:
	adrp	x8, _V4L2_STD_NTSC_M_KR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _V4L2_STD_NTSC_M_KR@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	mov	x0, x19
	mov	w1, #2056
	cmp	w20, w8
	b.ne	LBB0_9
; %bb.7:
	mov	w2, #248
	mov	w3, #248
LBB0_8:
	mov	w4, #255
	bl	_cx18_av_write_expect
	mov	x0, x19
	mov	w1, #2059
	mov	w2, #3
	mov	w3, #3
	b	LBB0_10
LBB0_9:
	mov	w2, #246
	mov	w3, #246
	mov	w4, #255
	bl	_cx18_av_write_expect
	mov	x0, x19
	mov	w1, #2059
	mov	w2, #1
	mov	w3, #1
LBB0_10:
	mov	w4, #63
	bl	_cx18_av_write_expect
LBB0_11:
	mov	x0, x19
	mov	w1, #2051
	bl	_cx18_av_read
	tbnz	w0, #4, LBB0_13
; %bb.12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	x20, x0
	and	w2, w0, #0xffffffef
	mov	x0, x19
	mov	w1, #2051
	mov	x3, x2
	mov	w4, #31
	bl	_cx18_av_write_expect
	orr	w2, w20, #0x10
	mov	x0, x19
	mov	w1, #2051
	mov	x3, x2
	mov	w4, #31
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cx18_av_write_expect
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.comm	_V4L2_STD_NTSC_M_JP,4,2         ; @V4L2_STD_NTSC_M_JP
	.comm	_V4L2_STD_NTSC_M_KR,4,2         ; @V4L2_STD_NTSC_M_KR
	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
	.no_dead_strip	_input_change
.subsections_via_symbols
