	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw2804_s_ctrl
_tw2804_s_ctrl:                         ## @tw2804_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_state_from_ctrl
	movq	%rax, %r15
	leaq	4(%rax), %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %r14
	movl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$9, %eax
	ja	LBB0_17
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_15:
	movq	_TW2804_REG_SATURATION@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_11:
	movq	_TW2804_REG_RED_BALANCE@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_16:
	movq	_TW2804_REG_HUE@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_6:
	movq	_TW2804_REG_GAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_14:
	movq	_TW2804_REG_CONTRAST@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_4:
	movq	_TW2804_REG_COLOR_KILLER@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_read_reg
	testl	%eax, %eax
	js	LBB0_18
## %bb.5:
	andl	$-4, %eax
	cmpl	$1, 4(%rbx)
	sbbl	$0, %eax
	addl	$3, %eax
	movl	(%r15), %ecx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	jmp	LBB0_8
LBB0_9:
	movq	_TW2804_REG_CHROMA_GAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_12:
	movq	_TW2804_REG_BRIGHTNESS@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movl	(%r15), %ecx
	movq	%r14, %rdi
	jmp	LBB0_8
LBB0_10:
	movq	_TW2804_REG_BLUE_BALANCE@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_write_reg                      ## TAILCALL
LBB0_2:
	movq	_TW2804_REG_AUTOGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_read_reg
	testl	%eax, %eax
	js	LBB0_18
## %bb.3:
	xorl	%edx, %edx
	cmpl	$0, 4(%rbx)
	setne	%dl
	andl	$-129, %eax
	shll	$7, %edx
	orl	%eax, %edx
	movl	(%r15), %ecx
	movq	%r14, %rdi
	movl	%r12d, %esi
	jmp	LBB0_8
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_15
	.long	L0_0_set_11
	.long	L0_0_set_16
	.long	L0_0_set_6
	.long	L0_0_set_14
	.long	L0_0_set_4
	.long	L0_0_set_9
	.long	L0_0_set_12
	.long	L0_0_set_10
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_TW2804_REG_AUTOGAIN,4,2        ## @TW2804_REG_AUTOGAIN
	.comm	_TW2804_REG_COLOR_KILLER,4,2    ## @TW2804_REG_COLOR_KILLER
	.comm	_TW2804_REG_GAIN,4,2            ## @TW2804_REG_GAIN
	.comm	_TW2804_REG_CHROMA_GAIN,4,2     ## @TW2804_REG_CHROMA_GAIN
	.comm	_TW2804_REG_BLUE_BALANCE,4,2    ## @TW2804_REG_BLUE_BALANCE
	.comm	_TW2804_REG_RED_BALANCE,4,2     ## @TW2804_REG_RED_BALANCE
	.comm	_TW2804_REG_BRIGHTNESS,4,2      ## @TW2804_REG_BRIGHTNESS
	.comm	_TW2804_REG_CONTRAST,4,2        ## @TW2804_REG_CONTRAST
	.comm	_TW2804_REG_SATURATION,4,2      ## @TW2804_REG_SATURATION
	.comm	_TW2804_REG_HUE,4,2             ## @TW2804_REG_HUE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_tw2804_s_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw2804_s_ctrl
_tw2804_s_ctrl:                         ; @tw2804_s_ctrl
	.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	x20, x0
	bl	_to_state_from_ctrl
	mov	x21, x0
	add	x0, x0, #4
	bl	_v4l2_get_subdevdata
	ldr	w8, [x20]
	sub	w8, w8, #128
	cmp	w8, #9
	b.hi	LBB0_3
; %bb.1:
	mov	x19, x0
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:
Lloh2:
	adrp	x8, _TW2804_REG_SATURATION@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TW2804_REG_SATURATION@GOTPAGEOFF]
	b	LBB0_12
LBB0_3:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w2, w8
	b	LBB0_19
LBB0_4:
Lloh7:
	adrp	x8, _TW2804_REG_RED_BALANCE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TW2804_REG_RED_BALANCE@GOTPAGEOFF]
	b	LBB0_14
LBB0_5:
Lloh9:
	adrp	x8, _TW2804_REG_HUE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TW2804_REG_HUE@GOTPAGEOFF]
	b	LBB0_12
LBB0_6:
Lloh11:
	adrp	x8, _TW2804_REG_GAIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TW2804_REG_GAIN@GOTPAGEOFF]
	b	LBB0_14
LBB0_7:
Lloh13:
	adrp	x8, _TW2804_REG_CONTRAST@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TW2804_REG_CONTRAST@GOTPAGEOFF]
	b	LBB0_12
LBB0_8:
Lloh15:
	adrp	x8, _TW2804_REG_COLOR_KILLER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TW2804_REG_COLOR_KILLER@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x22
	bl	_read_reg
	mov	x2, x0
	tbnz	w0, #31, LBB0_19
; %bb.9:
	and	w8, w2, #0xfffffffc
	ldr	w9, [x20, #4]
	cmp	w9, #0
	mov	w9, #2
	cinc	w9, w9, ne
	orr	w2, w9, w8
	b	LBB0_17
LBB0_10:
Lloh18:
	adrp	x8, _TW2804_REG_CHROMA_GAIN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TW2804_REG_CHROMA_GAIN@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:
Lloh20:
	adrp	x8, _TW2804_REG_BRIGHTNESS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TW2804_REG_BRIGHTNESS@GOTPAGEOFF]
LBB0_12:
	ldr	w1, [x8]
	ldr	w2, [x20, #4]
	ldr	w3, [x21]
	mov	x0, x19
	b	LBB0_18
LBB0_13:
Lloh22:
	adrp	x8, _TW2804_REG_BLUE_BALANCE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TW2804_REG_BLUE_BALANCE@GOTPAGEOFF]
LBB0_14:
	ldr	w1, [x8]
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w3, #0
	b	LBB0_18
LBB0_15:
Lloh24:
	adrp	x8, _TW2804_REG_AUTOGAIN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TW2804_REG_AUTOGAIN@GOTPAGEOFF]
Lloh26:
	ldr	w22, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x22
	bl	_read_reg
	mov	x2, x0
	tbnz	w0, #31, LBB0_19
; %bb.16:
	ldr	w8, [x20, #4]
	cmp	w8, #0
	cset	w8, ne
	bfi	w2, w8, #7, #1
LBB0_17:
	ldr	w3, [x21]
	mov	x0, x19
	mov	x1, x22
LBB0_18:
	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
	b	_write_reg
LBB0_19:
	mov	x0, x2
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.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_10-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_13-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
                                        ; -- End function
	.comm	_TW2804_REG_AUTOGAIN,4,2        ; @TW2804_REG_AUTOGAIN
	.comm	_TW2804_REG_COLOR_KILLER,4,2    ; @TW2804_REG_COLOR_KILLER
	.comm	_TW2804_REG_GAIN,4,2            ; @TW2804_REG_GAIN
	.comm	_TW2804_REG_CHROMA_GAIN,4,2     ; @TW2804_REG_CHROMA_GAIN
	.comm	_TW2804_REG_BLUE_BALANCE,4,2    ; @TW2804_REG_BLUE_BALANCE
	.comm	_TW2804_REG_RED_BALANCE,4,2     ; @TW2804_REG_RED_BALANCE
	.comm	_TW2804_REG_BRIGHTNESS,4,2      ; @TW2804_REG_BRIGHTNESS
	.comm	_TW2804_REG_CONTRAST,4,2        ; @TW2804_REG_CONTRAST
	.comm	_TW2804_REG_SATURATION,4,2      ; @TW2804_REG_SATURATION
	.comm	_TW2804_REG_HUE,4,2             ; @TW2804_REG_HUE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_tw2804_s_ctrl
.subsections_via_symbols
