	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx88_set_control               ## -- Begin function cx88_set_control
	.p2align	4, 0x90
_cx88_set_control:                      ## @cx88_set_control
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_CX8800_CTLS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_1
## %bb.2:
	movq	_cx8800_ctls@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r12), %r9d
	leaq	-1(%r8), %rsi
	movl	%r8d, %edx
	andl	$3, %edx
	cmpq	$3, %rsi
	jae	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	xorl	%r13d, %r13d
	jmp	LBB0_6
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_9
LBB0_4:
	andl	$-4, %r8d
	leaq	112(%rax), %rsi
	xorl	%edi, %edi
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-112(%rsi), %rcx
	cmpl	%r9d, -88(%rsi)
	cmovneq	%r13, %rcx
	leaq	-56(%rsi), %rbx
	cmpl	%r9d, -32(%rsi)
	cmovneq	%rcx, %rbx
	cmpl	%r9d, 24(%rsi)
	cmoveq	%rsi, %rbx
	leaq	56(%rsi), %r13
	cmpl	%r9d, 80(%rsi)
	cmovneq	%rbx, %r13
	addq	$4, %rdi
	addq	$224, %rsi
	cmpq	%rdi, %r8
	jne	LBB0_5
LBB0_6:
	testq	%rdx, %rdx
	je	LBB0_9
## %bb.7:
	imulq	$56, %rdi, %rcx
	addq	%rcx, %rax
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r9d, 24(%rax)
	cmoveq	%rax, %r13
	addq	$56, %rax
	decq	%rdx
	jne	LBB0_8
LBB0_9:
	xorl	%edi, %edi
	testq	%r13, %r13
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_11
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_29
LBB0_11:
	movq	8(%r12), %r8
	movq	32(%r13), %rax
	cmpq	%rax, %r8
	jge	LBB0_13
## %bb.12:
	movq	%rax, 8(%r12)
	movq	%rax, %r8
LBB0_13:
	movq	40(%r13), %rax
	cmpq	%rax, %r8
	jle	LBB0_15
## %bb.14:
	movq	%rax, 8(%r12)
	movq	%rax, %r8
LBB0_15:
	movl	(%r13), %r15d
	movl	(%r12), %edx
	leal	-128(%rdx), %eax
	cmpl	$3, %eax
	ja	LBB0_24
## %bb.16:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_19:
	movl	4(%r13), %eax
	movq	%r8, %rsi
	subq	%rax, %rsi
	movb	8(%r13), %cl
	shlq	%cl, %rsi
	andl	%esi, %r15d
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r15d, %r12d
	testl	%eax, (%r14)
	jne	LBB0_21
## %bb.20:
	imull	$90, %r15d, %eax
	movslq	%eax, %r12
	imulq	$-2130574327, %r12, %rax        ## imm = 0x81020409
	shrq	$32, %rax
	addl	%eax, %r12d
	movl	%r12d, %eax
	shrl	$31, %eax
	sarl	$6, %r12d
	addl	%eax, %r12d
LBB0_21:
	shll	$8, %r12d
	orl	%r15d, %r12d
	movl	$65535, %r15d                   ## imm = 0xFFFF
	jmp	LBB0_25
LBB0_24:
	movl	4(%r13), %eax
	movq	%r8, %r12
	subq	%rax, %r12
	movb	8(%r13), %cl
	shlq	%cl, %r12
	andl	%r15d, %r12d
	jmp	LBB0_25
LBB0_22:
	movl	4(%r13), %eax
	movq	%r8, %r12
	subq	%rax, %r12
	movb	8(%r13), %cl
	shlq	%cl, %r12
	andl	%r15d, %r12d
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_25
## %bb.23:
	testl	%r12d, %r12d
	jne	LBB0_10
	jmp	LBB0_25
LBB0_18:
	movl	%r8d, %r12d
	notl	%r12d
	andl	$63, %r12d
	jmp	LBB0_25
LBB0_17:
	movl	$127, %eax
	subl	%r8d, %eax
	leal	-64(%r8), %r12d
	cmpq	$64, %r8
	cmovll	%eax, %r12d
LBB0_25:
	movl	12(%r13), %r9d
	movl	48(%r13), %ecx
	cmpq	$0, 16(%r13)
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rbx
	cmoveq	%rax, %rbx
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $r8d killed $r8d killed $r8
	pushq	%rbx
	pushq	%r15
	pushq	%r12
	callq	_dprintk
	addq	$32, %rsp
	movq	16(%r13), %rdi
	movl	12(%r13), %esi
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.26:
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_cx_sandor
	jmp	LBB0_28
LBB0_27:
	movl	%esi, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_cx_andor
LBB0_28:
	xorl	%eax, %eax
LBB0_29:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_22, LBB0_22-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
LJTI0_0:
	.long	L0_0_set_19
	.long	L0_0_set_22
	.long	L0_0_set_18
	.long	L0_0_set_17
	.end_data_region
                                        ## -- End function
	.comm	_CX8800_CTLS,4,2                ## @CX8800_CTLS
	.comm	_cx8800_ctls,8,3                ## @cx8800_ctls
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set_control id=0x%X(%s) ctrl=0x%02x, reg=0x%02x val=0x%02x (mask 0x%02x)%s\n"

L_.str.1:                               ## @.str.1
	.asciz	" [shadowed]"

L_.str.2:                               ## @.str.2
	.space	1

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx88_set_control               ; -- Begin function cx88_set_control
	.p2align	2
_cx88_set_control:                      ; @cx88_set_control
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _CX8800_CTLS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX8800_CTLS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x22, #0
Lloh3:
	adrp	x9, _cx8800_ctls@GOTPAGE
Lloh4:
	ldr	x9, [x9, _cx8800_ctls@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w10, [x21]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9, #24]
	cmp	w11, w10
	csel	x22, x9, x22, eq
	add	x9, x9, #56
	subs	x8, x8, #1
	b.ne	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	x22, #0
LBB0_4:
	cmp	x22, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_23
LBB0_6:
	ldr	x4, [x21, #8]
	ldr	x8, [x22, #32]
	cmp	x4, x8
	b.ge	LBB0_8
; %bb.7:
	str	x8, [x21, #8]
	mov	x4, x8
LBB0_8:
	ldr	x8, [x22, #40]
	cmp	x4, x8
	b.le	LBB0_10
; %bb.9:
	str	x8, [x21, #8]
	mov	x4, x8
LBB0_10:
	ldr	w19, [x22]
	ldr	w2, [x21]
	sub	w8, w2, #128
	cmp	w8, #3
	b.hi	LBB0_15
; %bb.11:
Lloh9:
	adrp	x9, lJTI0_0@PAGE
Lloh10:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_12
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_12:
	ldp	w8, w9, [x22, #4]
	sub	x8, x4, x8
	lsl	x8, x8, x9
	and	w8, w19, w8
	ldr	w10, [x20]
Lloh11:
	adrp	x9, _V4L2_STD_SECAM@GOTPAGE
Lloh12:
	ldr	x9, [x9, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x9]
	mov	x9, x8
	tst	w11, w10
	b.ne	LBB0_14
; %bb.13:
	mov	w9, #90
	mul	w9, w8, w9
	mov	w10, #1033
	movk	w10, #33026, lsl #16
	smull	x10, w9, w10
	lsr	x10, x10, #32
	add	w9, w10, w9
	asr	w10, w9, #6
	add	w9, w10, w9, lsr #31
LBB0_14:
	orr	w21, w8, w9, lsl #8
	mov	w19, #65535
	b	LBB0_19
LBB0_15:
	ldp	w8, w9, [x22, #4]
	sub	x8, x4, x8
	lsl	x8, x8, x9
	and	w21, w19, w8
	b	LBB0_19
LBB0_16:
	ldp	w8, w9, [x22, #4]
	sub	x8, x4, x8
	lsl	x8, x8, x9
	and	w21, w19, w8
	ldr	w8, [x20]
Lloh14:
	adrp	x9, _V4L2_STD_SECAM@GOTPAGE
Lloh15:
	ldr	x9, [x9, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w21, #0, #4, ne
	b.ne	LBB0_5
	b	LBB0_19
LBB0_17:
	mvn	w8, w4
	and	w21, w8, #0x3f
	b	LBB0_19
LBB0_18:
	mov	w8, #127
	sub	w8, w8, w4
	sub	w9, w4, #64
	cmp	x4, #64
	csel	w21, w8, w9, lt
LBB0_19:
	ldr	w3, [x22, #48]
	ldr	w5, [x22, #12]
	ldr	x8, [x22, #16]
Lloh17:
	adrp	x9, l_.str.1@PAGE
Lloh18:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh19:
	adrp	x10, l_.str.2@PAGE
Lloh20:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
                                        ; kill: def $w4 killed $w4 killed $x4
	mov	x6, x21
	mov	x7, x19
	bl	_dprintk
	ldr	x0, [x22, #16]
	ldr	w1, [x22, #12]
	cbz	x0, LBB0_21
; %bb.20:
	mov	x2, x19
	mov	x3, x21
	bl	_cx_sandor
	b	LBB0_22
LBB0_21:
	mov	x0, x1
	mov	x1, x19
	mov	x2, x21
	bl	_cx_andor
LBB0_22:
	mov	w0, #0
LBB0_23:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_12-LBB0_12)>>2
	.byte	(LBB0_16-LBB0_12)>>2
	.byte	(LBB0_17-LBB0_12)>>2
	.byte	(LBB0_18-LBB0_12)>>2
                                        ; -- End function
	.comm	_CX8800_CTLS,4,2                ; @CX8800_CTLS
	.comm	_cx8800_ctls,8,3                ; @cx8800_ctls
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set_control id=0x%X(%s) ctrl=0x%02x, reg=0x%02x val=0x%02x (mask 0x%02x)%s\n"

l_.str.1:                               ; @.str.1
	.asciz	" [shadowed]"

l_.str.2:                               ; @.str.2
	.space	1

.subsections_via_symbols
