	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7842_s_ctrl
_adv7842_s_ctrl:                        ## @adv7842_s_ctrl
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_sd
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_to_state
	movl	(%rbx), %ecx
	addl	$-128, %ecx
	cmpl	$7, %ecx
	ja	LBB0_3
## %bb.1:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_2:
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$59, %esi
	callq	_cp_write
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$21, %esi
	jmp	LBB0_10
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_4:
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$61, %esi
	callq	_cp_write
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$22, %esi
	jmp	LBB0_10
LBB0_5:
	movl	4(%rbx), %ecx
	movl	%ecx, (%rax)
	movq	%r13, %rdi
	callq	_set_rgb_quantization_range
	jmp	LBB0_11
LBB0_6:
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$58, %esi
	callq	_cp_write
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$19, %esi
	jmp	LBB0_10
LBB0_7:
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$60, %esi
	callq	_cp_write
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$20, %esi
	jmp	LBB0_10
LBB0_8:
	movl	4(%rbx), %ecx
	shll	$2, %ecx
	movq	%r13, %rdi
	movl	$191, %esi
	movl	$-5, %edx
	callq	_cp_write_and_or
	movl	4(%rbx), %ecx
	shll	$2, %ecx
	movq	%r13, %rdi
	movl	$221, %esi
	movl	$-5, %edx
	callq	_sdp_write_and_or
	jmp	LBB0_11
LBB0_9:
	movl	4(%rbx), %eax
	movzbl	%ah, %ecx
	movzbl	%al, %edx
	shrl	$16, %eax
	movzbl	%al, %r15d
	movl	%r15d, %eax
	shll	$6, %eax
	leal	(%rax,%r15,2), %r8d
	movl	%ecx, %eax
	shll	$7, %ecx
	addl	%eax, %ecx
	movl	%eax, %ebx
	movq	%rdx, %rax
	leal	(%rdx,%rdx,4), %edx
	leal	(%rdx,%rdx,4), %edx
	addl	%ecx, %edx
	imull	$-38, %r15d, %ecx
	imull	$-74, %ebx, %esi
	imull	$112, %eax, %edi
	addl	%ecx, %edi
	imull	$112, %r15d, %ecx
	imull	$-94, %ebx, %r10d
	movl	%ebx, %r9d
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	leal	(%rax,%rax), %ebx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	(%rbx,%rbx,8), %ebx
	subl	%ebx, %ecx
	leal	(%rdx,%r8), %ebx
	addl	$128, %ebx
	shrl	$8, %ebx
	leal	(%rsi,%rdi), %r12d
	addl	$128, %r12d
	sarl	$8, %r12d
	leal	(%rcx,%r10), %r14d
	addl	$128, %r14d
	sarl	$8, %r14d
	addl	$16, %ebx
	subl	$-128, %r12d
	subl	$-128, %r14d
	movq	_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r13, %rdx
	movl	%r15d, %r8d
	callq	_v4l2_dbg
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, (%rsp)
	leaq	L_.str.1(%rip), %rcx
	movl	$1, %edi
	movq	%r13, %rdx
	movl	%ebx, %r8d
	movl	%r12d, %r9d
	callq	_v4l2_dbg
	movq	%r13, %rdi
	movl	$193, %esi
	movl	%r15d, %edx
	callq	_cp_write
	movq	%r13, %rdi
	movl	$192, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_cp_write
	movq	%r13, %rdi
	movl	$194, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_cp_write
	movq	%r13, %rdi
	movl	$222, %esi
	movl	%ebx, %edx
	callq	_sdp_write
	andl	$240, %r14d
	shrl	$4, %r12d
	orl	%r14d, %r12d
	movq	%r13, %rdi
	movl	$223, %esi
	movl	%r12d, %edx
LBB0_10:
	callq	_sdp_write
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	4(%rbx), %edx
	movq	%r13, %rdi
	movl	$200, %esi
	callq	_afe_write
	jmp	LBB0_11
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_13
	.end_data_region
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"R %x, G %x, B %x\n"

L_.str.1:                               ## @.str.1
	.asciz	"Y %x, U %x, V %x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_adv7842_s_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7842_s_ctrl
_adv7842_s_ctrl:                        ; @adv7842_s_ctrl
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	bl	_to_sd
	mov	x19, x0
	bl	_to_state
	ldr	w8, [x20]
	sub	w8, w8, #128
	cmp	w8, #7
	b.hi	LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #59
	bl	_cp_write
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #21
	b	LBB0_10
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_4:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #61
	bl	_cp_write
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #22
	b	LBB0_10
LBB0_5:
	ldr	w8, [x20, #4]
	str	w8, [x0]
	mov	x0, x19
	bl	_set_rgb_quantization_range
	b	LBB0_11
LBB0_6:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #58
	bl	_cp_write
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #19
	b	LBB0_10
LBB0_7:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #60
	bl	_cp_write
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #20
	b	LBB0_10
LBB0_8:
	ldr	w8, [x20, #4]
	lsl	w3, w8, #2
	mov	x0, x19
	mov	w1, #191
	mov	w2, #-5
	bl	_cp_write_and_or
	ldr	w8, [x20, #4]
	lsl	w3, w8, #2
	mov	x0, x19
	mov	w1, #221
	mov	w2, #-5
	bl	_sdp_write_and_or
	b	LBB0_11
LBB0_9:
	ldr	w8, [x20, #4]
	ubfx	w22, w8, #16, #8
	ubfx	w21, w8, #8, #8
	and	w20, w8, #0xff
	mov	w8, #66
	add	w9, w21, w21, lsl #7
	mov	w10, #25
	mov	w11, #-38
	mul	w11, w22, w11
	mov	w12, #-74
	mov	w13, #112
	mul	w14, w22, w13
	mov	w15, #-94
	mov	w16, #-18
	madd	w9, w20, w10, w9
	madd	w8, w22, w8, w9
	add	w8, w8, #128
	lsr	w8, w8, #8
	madd	w9, w20, w13, w11
	madd	w9, w21, w12, w9
	add	w9, w9, #128
	asr	w9, w9, #8
	madd	w10, w20, w16, w14
	madd	w10, w21, w15, w10
	add	w10, w10, #128
	asr	w10, w10, #8
	add	w23, w8, #16
	add	w24, w9, #128
	add	w25, w10, #128
Lloh5:
	adrp	x26, _debug@GOTPAGE
Lloh6:
	ldr	x26, [x26, _debug@GOTPAGEOFF]
	ldr	w1, [x26]
Lloh7:
	adrp	x3, l_.str@PAGE
Lloh8:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x22
	mov	x5, x21
	mov	x6, x20
	bl	_v4l2_dbg
	ldr	w1, [x26]
Lloh9:
	adrp	x3, l_.str.1@PAGE
Lloh10:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x23
	mov	x5, x24
	mov	x6, x25
	bl	_v4l2_dbg
	mov	x0, x19
	mov	w1, #193
	mov	x2, x22
	bl	_cp_write
	mov	x0, x19
	mov	w1, #192
	mov	x2, x21
	bl	_cp_write
	mov	x0, x19
	mov	w1, #194
	mov	x2, x20
	bl	_cp_write
	mov	x0, x19
	mov	w1, #222
	mov	x2, x23
	bl	_sdp_write
	and	w8, w25, #0xf0
	orr	w2, w8, w24, lsr #4
	mov	x0, x19
	mov	w1, #223
LBB0_10:
	bl	_sdp_write
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #200
	bl	_afe_write
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_13-LBB0_2)>>2
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"R %x, G %x, B %x\n"

l_.str.1:                               ; @.str.1
	.asciz	"Y %x, U %x, V %x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_adv7842_s_ctrl
.subsections_via_symbols
