	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw28_set_ctrl_val              ## -- Begin function tw28_set_ctrl_val
	.p2align	4, 0x90
_tw28_set_ctrl_val:                     ## @tw28_set_ctrl_val
	.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
	movl	%edx, %ebx
                                        ## kill: def $esi killed $esi def $rsi
	leal	3(%rbx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	cmpl	$256, %ecx                      ## imm = 0x100
	jb	LBB0_3
## %bb.1:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_3:
	addl	$-128, %esi
	cmpl	$4, %esi
	ja	LBB0_7
## %bb.4:
	movl	%ecx, %r12d
	movq	%rdi, %r14
	movl	%eax, %r15d
	sarl	$2, %r15d
	andl	$-4, %eax
	subl	%eax, %ebx
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rsi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_5:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_is_tw286x
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	_SOLO_I2C_TW@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r15d, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_TW286x_SHARPNESS
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_solo_i2c_readbyte
	andl	$240, %eax
	orl	%eax, %r12d
	movq	_SOLO_I2C_TW@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r15d, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_TW286x_SHARPNESS
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	movl	%r12d, %r8d
	callq	_solo_i2c_writebyte
	jmp	LBB0_17
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_8:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_is_tw286x
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_SOLO_I2C_TW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW286x_SATURATIONU_ADDR
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %edx
	movl	%eax, %ecx
	movl	%r12d, %r8d
	callq	_solo_i2c_writebyte
LBB0_10:
	movl	%ebx, %edi
	callq	_TW286x_SATURATIONV_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW_SATURATION_ADDR
	jmp	LBB0_13
LBB0_11:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_is_tw286x
	leal	128(%r12), %r13d
	testl	%eax, %eax
	cmovel	%r12d, %r13d
	movl	%ebx, %edi
	callq	_TW286x_HUE_ADDR
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_TW_HUE_ADDR
	jmp	LBB0_15
LBB0_12:
	movl	%ebx, %edi
	callq	_TW286x_CONTRAST_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW_CONTRAST_ADDR
LBB0_13:
	movsbl	%r12b, %r8d
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	jmp	LBB0_16
LBB0_14:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_is_tw286x
	leal	128(%r12), %r13d
	testl	%eax, %eax
	cmovel	%r12d, %r13d
	movl	%ebx, %edi
	callq	_TW286x_BRIGHTNESS_ADDR
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_TW_BRIGHTNESS_ADDR
LBB0_15:
	movsbl	%r13b, %r8d
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
LBB0_16:
	movl	%eax, %ecx
	callq	_tw_writebyte
LBB0_17:
	xorl	%eax, %eax
LBB0_18:
	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_5, LBB0_5-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_8
	.long	L0_0_set_11
	.long	L0_0_set_12
	.long	L0_0_set_14
	.end_data_region
                                        ## -- End function
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_SOLO_I2C_TW,4,2                ## @SOLO_I2C_TW
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw28_set_ctrl_val              ; -- Begin function tw28_set_ctrl_val
	.p2align	2
_tw28_set_ctrl_val:                     ; @tw28_set_ctrl_val
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	add	w8, w2, #3
	cmp	w2, #0
	csel	w8, w8, w2, lt
	cmp	w3, #256
	b.lo	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _ERANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_3:
	sub	w9, w1, #128
	cmp	w9, #4
	b.hi	LBB0_7
; %bb.4:
	mov	x21, x3
	mov	x19, x0
	asr	w20, w8, #2
	and	w8, w8, #0xfffffffc
	sub	w22, w2, w8
Lloh2:
	adrp	x8, lJTI0_0@PAGE
Lloh3:
	add	x8, x8, lJTI0_0@PAGEOFF
	adr	x10, LBB0_5
	ldrb	w11, [x8, x9]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_5:
	mov	x0, x19
	mov	x1, x20
	bl	_is_tw286x
	cbz	w0, LBB0_7
; %bb.6:
Lloh4:
	adrp	x24, _SOLO_I2C_TW@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SOLO_I2C_TW@GOTPAGEOFF]
	ldr	w22, [x24]
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x23, x0
	mov	x0, x20
	bl	_TW286x_SHARPNESS
	mov	x3, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_solo_i2c_readbyte
	and	w8, w0, #0xf0
	orr	w21, w8, w21
	ldr	w22, [x24]
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x23, x0
	mov	x0, x20
	bl	_TW286x_SHARPNESS
	mov	x3, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	mov	x4, x21
	bl	_solo_i2c_writebyte
	b	LBB0_17
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_is_tw286x
	cbz	w0, LBB0_10
; %bb.9:
Lloh8:
	adrp	x8, _SOLO_I2C_TW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOLO_I2C_TW@GOTPAGEOFF]
Lloh10:
	ldr	w23, [x8]
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x24, x0
	mov	x0, x22
	bl	_TW286x_SATURATIONU_ADDR
	mov	x3, x0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	mov	x4, x21
	bl	_solo_i2c_writebyte
LBB0_10:
	mov	x0, x22
	bl	_TW286x_SATURATIONV_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_SATURATION_ADDR
	b	LBB0_13
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	bl	_is_tw286x
	add	w8, w21, #128
	cmp	w0, #0
	csel	w23, w21, w8, eq
	mov	x0, x22
	bl	_TW286x_HUE_ADDR
	mov	x21, x0
	mov	x0, x22
	bl	_TW_HUE_ADDR
	b	LBB0_15
LBB0_12:
	mov	x0, x22
	bl	_TW286x_CONTRAST_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_CONTRAST_ADDR
LBB0_13:
	mov	x3, x0
	sxtb	w4, w21
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	b	LBB0_16
LBB0_14:
	mov	x0, x19
	mov	x1, x20
	bl	_is_tw286x
	add	w8, w21, #128
	cmp	w0, #0
	csel	w23, w21, w8, eq
	mov	x0, x22
	bl	_TW286x_BRIGHTNESS_ADDR
	mov	x21, x0
	mov	x0, x22
	bl	_TW_BRIGHTNESS_ADDR
LBB0_15:
	mov	x3, x0
	sxtb	w4, w23
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
LBB0_16:
	bl	_tw_writebyte
LBB0_17:
	mov	w0, #0
LBB0_18:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_5)>>2
	.byte	(LBB0_8-LBB0_5)>>2
	.byte	(LBB0_11-LBB0_5)>>2
	.byte	(LBB0_12-LBB0_5)>>2
	.byte	(LBB0_14-LBB0_5)>>2
                                        ; -- End function
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_SOLO_I2C_TW,4,2                ; @SOLO_I2C_TW
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
