	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw28_get_ctrl_val              ## -- Begin function tw28_get_ctrl_val
	.p2align	4, 0x90
_tw28_get_ctrl_val:                     ## @tw28_get_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
	addl	$-128, %esi
	cmpl	$4, %esi
	ja	LBB0_4
## %bb.1:
	movq	%rcx, %r14
	movq	%rdi, %r15
	movl	%eax, %r12d
	sarl	$2, %r12d
	andl	$-4, %eax
	subl	%eax, %ebx
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rsi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_is_tw286x
	testl	%eax, %eax
	je	LBB0_14
## %bb.3:
	movq	_SOLO_I2C_TW@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r12d, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_TW286x_SHARPNESS
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_solo_i2c_readbyte
	andl	$15, %eax
	jmp	LBB0_12
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_5:
	movl	%ebx, %edi
	callq	_TW286x_SATURATIONU_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW_SATURATION_ADDR
	jmp	LBB0_8
LBB0_6:
	movl	%ebx, %edi
	callq	_TW286x_HUE_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW_HUE_ADDR
	jmp	LBB0_10
LBB0_7:
	movl	%ebx, %edi
	callq	_TW286x_CONTRAST_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW_CONTRAST_ADDR
LBB0_8:
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_tw_readbyte
	movl	%eax, (%r14)
	jmp	LBB0_15
LBB0_9:
	movl	%ebx, %edi
	callq	_TW286x_BRIGHTNESS_ADDR
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_TW_BRIGHTNESS_ADDR
LBB0_10:
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_tw_readbyte
	movq	%rax, %rbx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_is_tw286x
	testl	%eax, %eax
	je	LBB0_13
## %bb.11:
	movsbl	%bl, %eax
	subl	$-128, %eax
LBB0_12:
	movl	%eax, (%r14)
	jmp	LBB0_15
LBB0_13:
	movl	%ebx, (%r14)
	jmp	LBB0_15
LBB0_14:
	movl	$0, (%r14)
LBB0_15:
	xorl	%eax, %eax
LBB0_16:
	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_2, LBB0_2-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_9, LBB0_9-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_5
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_9
	.end_data_region
                                        ## -- End function
	.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_get_ctrl_val              ; -- Begin function tw28_get_ctrl_val
	.p2align	2
_tw28_get_ctrl_val:                     ; @tw28_get_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	w9, w8, w2, lt
	sub	w8, w1, #128
	cmp	w8, #4
	b.hi	LBB0_4
; %bb.1:
	mov	x19, x3
	mov	x20, x0
	asr	w21, w9, #2
	and	w9, w9, #0xfffffffc
	sub	w22, w2, w9
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:
	mov	x0, x20
	mov	x1, x21
	bl	_is_tw286x
	cbz	w0, LBB0_13
; %bb.3:
Lloh2:
	adrp	x8, _SOLO_I2C_TW@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SOLO_I2C_TW@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x23, x0
	mov	x0, x21
	bl	_TW286x_SHARPNESS
	mov	x3, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_solo_i2c_readbyte
	mov	x8, x0
	mov	w0, #0
	and	w8, w8, #0xf
	str	w8, [x19]
	b	LBB0_14
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_5:
	mov	x0, x22
	bl	_TW286x_SATURATIONU_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_SATURATION_ADDR
	b	LBB0_8
LBB0_6:
	mov	x0, x22
	bl	_TW286x_HUE_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_HUE_ADDR
	b	LBB0_10
LBB0_7:
	mov	x0, x22
	bl	_TW286x_CONTRAST_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_CONTRAST_ADDR
LBB0_8:
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_tw_readbyte
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_14
LBB0_9:
	mov	x0, x22
	bl	_TW286x_BRIGHTNESS_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_BRIGHTNESS_ADDR
LBB0_10:
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_tw_readbyte
	mov	x22, x0
	mov	x0, x20
	mov	x1, x21
	bl	_is_tw286x
	cbz	w0, LBB0_12
; %bb.11:
	mov	w0, #0
	sxtb	w8, w22
	add	w8, w8, #128
	str	w8, [x19]
	b	LBB0_14
LBB0_12:
	str	w22, [x19]
	b	LBB0_14
LBB0_13:
	str	wzr, [x19]
LBB0_14:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
                                        ; -- End function
	.comm	_SOLO_I2C_TW,4,2                ; @SOLO_I2C_TW
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
