	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mi0343_set_ctrl
_mi0343_set_ctrl:                       ## @mi0343_set_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_sn9c102_get_sensor
	movq	%rax, %r14
	movl	(%rbx), %ecx
	xorl	%eax, %eax
	leal	-129(%rcx), %edx
	cmpl	$5, %edx
	ja	LBB0_7
## %bb.1:
	movl	$53, %esi
	btl	%edx, %esi
	jae	LBB0_7
## %bb.2:
	movl	4(%rbx), %eax
	cmpl	$47, %eax
	jg	LBB0_4
## %bb.3:
	addl	$16, %eax
	jmp	LBB0_7
LBB0_4:
	cmpl	$78, %eax
	ja	LBB0_6
## %bb.5:
	addl	$49, %eax
	jmp	LBB0_7
LBB0_6:
	addl	$146, %eax
LBB0_7:
	addl	$-128, %ecx
	cmpl	$6, %ecx
	ja	LBB0_17
## %bb.8:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_14:
	movl	(%r14), %ecx
	xorl	%r9d, %r9d
	cmpl	$0, 4(%rbx)
	setne	%r9b
	shll	$7, %r9d
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$32, %r8d
	pushq	$0
	pushq	$0
	pushq	%r9
	jmp	LBB0_12
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	jmp	LBB0_20
LBB0_15:
	movl	(%r14), %ecx
	movl	%eax, %r9d
	sarl	$8, %r9d
	movzbl	%al, %eax
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$45, %r8d
	jmp	LBB0_11
LBB0_13:
	xorl	%eax, %eax
	cmpl	$0, 4(%rbx)
	movl	(%r14), %ecx
	setne	%al
	movl	%eax, %r9d
	shll	$6, %r9d
	shll	$5, %eax
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$32, %r8d
	jmp	LBB0_11
LBB0_10:
	movl	(%r14), %ecx
	movl	%eax, %r9d
	sarl	$8, %r9d
	movzbl	%al, %eax
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$53, %r8d
	jmp	LBB0_11
LBB0_9:
	movl	(%r14), %ecx
	movl	4(%rbx), %r9d
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$9, %r8d
	pushq	$0
	pushq	$0
	pushq	$0
	jmp	LBB0_12
LBB0_16:
	movl	(%r14), %ecx
	movl	%eax, %r9d
	sarl	$8, %r9d
	movzbl	%al, %eax
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$44, %r8d
LBB0_11:
	pushq	$0
	pushq	$0
	pushq	%rax
LBB0_12:
	callq	_sn9c102_i2c_try_raw_write
	addq	$32, %rsp
LBB0_19:
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	subl	(%rdx), %ecx
	testl	%eax, %eax
	cmovel	%eax, %ecx
LBB0_20:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	(%r14), %ecx
	movl	%eax, %ebx
	sarl	$8, %ebx
	movzbl	%al, %r13d
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$43, %r8d
	movl	%ebx, %r9d
	pushq	$0
	pushq	$0
	pushq	%r13
	callq	_sn9c102_i2c_try_raw_write
	addq	$32, %rsp
	movl	%eax, %r12d
	movl	(%r14), %ecx
	subq	$8, %rsp
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	movl	$46, %r8d
	movl	%ebx, %r9d
	pushq	$0
	pushq	$0
	pushq	%r13
	callq	_sn9c102_i2c_try_raw_write
	addq	$32, %rsp
	addl	%r12d, %eax
	jmp	LBB0_19
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
LJTI0_0:
	.long	L0_0_set_14
	.long	L0_0_set_15
	.long	L0_0_set_13
	.long	L0_0_set_10
	.long	L0_0_set_9
	.long	L0_0_set_16
	.long	L0_0_set_18
	.end_data_region
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_mi0343_set_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mi0343_set_ctrl
_mi0343_set_ctrl:                       ; @mi0343_set_ctrl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	mov	x20, x0
	bl	_sn9c102_get_sensor
	mov	x19, x0
	ldr	w9, [x21]
	sub	w8, w9, #129
	cmp	w8, #5
	mov	w10, #1
	lsl	w8, w10, w8
	mov	w10, #53
	and	w8, w8, w10
	ccmp	w8, #0, #4, ls
	b.eq	LBB0_5
; %bb.1:
	ldr	w8, [x21, #4]
	add	w10, w8, #146
	add	w11, w8, #49
	cmp	w8, #78
	csel	w10, w10, w11, hi
	add	w11, w8, #16
	cmp	w8, #47
	csel	w8, w10, w11, gt
LBB0_2:
	sub	w9, w9, #128
	cmp	w9, #6
	b.hi	LBB0_6
; %bb.3:
Lloh0:
	adrp	x10, lJTI0_0@PAGE
Lloh1:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_4
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_4:
	ldr	w3, [x19]
	ldr	w8, [x21, #4]
	cmp	w8, #0
	cset	w8, ne
	lsl	w5, w8, #7
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #32
	mov	x6, x5
	b	LBB0_12
LBB0_5:
	mov	w8, #0
	b	LBB0_2
LBB0_6:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_7:
	ldr	w3, [x19]
	asr	w5, w8, #8
	and	w6, w8, #0xff
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #45
	b	LBB0_12
LBB0_8:
	ldr	w3, [x19]
	ldr	w8, [x21, #4]
	cmp	w8, #0
	cset	w8, ne
	lsl	w5, w8, #6
	lsl	w6, w8, #5
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #32
	b	LBB0_12
LBB0_9:
	ldr	w3, [x19]
	asr	w5, w8, #8
	and	w6, w8, #0xff
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #53
	b	LBB0_12
LBB0_10:
	ldr	w3, [x19]
	ldr	w5, [x21, #4]
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #9
	mov	w6, #0
	b	LBB0_12
LBB0_11:
	ldr	w3, [x19]
	asr	w5, w8, #8
	and	w6, w8, #0xff
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #44
LBB0_12:
	mov	w7, #0
	bl	_sn9c102_i2c_try_raw_write
LBB0_13:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w0, wzr, w8, eq
LBB0_14:
	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
	add	sp, sp, #80
	ret
LBB0_15:
	ldr	w3, [x19]
	asr	w21, w8, #8
	and	w22, w8, #0xff
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #43
	mov	x5, x21
	mov	x6, x22
	mov	w7, #0
	bl	_sn9c102_i2c_try_raw_write
	mov	x23, x0
	ldr	w3, [x19]
	str	wzr, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4
	mov	w4, #46
	mov	x5, x21
	mov	x6, x22
	mov	w7, #0
	bl	_sn9c102_i2c_try_raw_write
	add	w0, w0, w23
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_7-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
	.byte	(LBB0_9-LBB0_4)>>2
	.byte	(LBB0_10-LBB0_4)>>2
	.byte	(LBB0_11-LBB0_4)>>2
	.byte	(LBB0_15-LBB0_4)>>2
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_mi0343_set_ctrl
.subsections_via_symbols
