	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mi0343_get_ctrl
_mi0343_get_ctrl:                       ## @mi0343_get_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	callq	_sn9c102_get_sensor
	movl	(%r14), %ecx
	addl	$-128, %ecx
	cmpl	$6, %ecx
	ja	LBB0_28
## %bb.1:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_16:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$32, %ecx
	movl	$2, %r8d
	callq	_sn9c102_i2c_try_raw_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.17:
	movl	-28(%rbp), %eax
	shrl	$7, %eax
	jmp	LBB0_14
LBB0_28:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_12:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$32, %ecx
	movl	$2, %r8d
	callq	_sn9c102_i2c_try_raw_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.13:
	movl	-28(%rbp), %eax
	shrl	$5, %eax
LBB0_14:
	andl	$1, %eax
	jmp	LBB0_15
LBB0_6:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$53, %ecx
	jmp	LBB0_7
LBB0_2:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$9, %ecx
	movl	$2, %r8d
	callq	_sn9c102_i2c_try_raw_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	-32(%rbp), %eax
LBB0_15:
	movl	%eax, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_26
LBB0_18:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$45, %ecx
	jmp	LBB0_7
LBB0_19:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$44, %ecx
	jmp	LBB0_7
LBB0_20:
	movl	(%rax), %edx
	leaq	-32(%rbp), %r9
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$46, %ecx
LBB0_7:
	movl	$2, %r8d
	callq	_sn9c102_i2c_try_raw_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.8:
	xorl	%eax, %eax
	movl	$-129, %ecx
	addl	(%r14), %ecx
	cmpl	$5, %ecx
	ja	LBB0_26
## %bb.9:
	movl	$53, %edx
	btl	%ecx, %edx
	jae	LBB0_26
## %bb.10:
	movl	-32(%rbp), %ecx
	shll	$8, %ecx
	orl	-28(%rbp), %ecx
	movl	%ecx, 4(%r14)
	leal	-16(%rcx), %edx
	cmpl	$47, %edx
	ja	LBB0_21
## %bb.11:
	movl	%edx, 4(%r14)
	jmp	LBB0_26
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_26:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_29
## %bb.27:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_21:
	movl	%ecx, %edx
	andl	$-32, %edx
	cmpl	$224, %edx
	je	LBB0_24
## %bb.22:
	cmpl	$96, %edx
	jne	LBB0_26
## %bb.23:
	addl	$-96, %ecx
	jmp	LBB0_25
LBB0_24:
	addl	$-224, %ecx
LBB0_25:
	movl	%ecx, 4(%r14)
	jmp	LBB0_26
LBB0_29:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
LJTI0_0:
	.long	L0_0_set_16
	.long	L0_0_set_18
	.long	L0_0_set_12
	.long	L0_0_set_6
	.long	L0_0_set_2
	.long	L0_0_set_19
	.long	L0_0_set_20
	.end_data_region
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mi0343_get_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mi0343_get_ctrl
_mi0343_get_ctrl:                       ; @mi0343_get_ctrl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	bl	_sn9c102_get_sensor
	ldr	w8, [x19]
	sub	w8, w8, #128
	cmp	w8, #6
	b.hi	LBB0_4
; %bb.1:
	mov	x1, x0
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	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, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #32
	mov	w4, #2
	bl	_sn9c102_i2c_try_raw_read
	tbnz	w0, #31, LBB0_17
; %bb.3:
	mov	w0, #0
	ldr	w8, [sp, #4]
	ubfx	w8, w8, #7, #1
	b	LBB0_24
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_5:
	ldr	w2, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #32
	mov	w4, #2
	bl	_sn9c102_i2c_try_raw_read
	tbnz	w0, #31, LBB0_17
; %bb.6:
	mov	w0, #0
	ldr	w8, [sp, #4]
	ubfx	w8, w8, #5, #1
	b	LBB0_24
LBB0_7:
	ldr	w2, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #53
	b	LBB0_13
LBB0_8:
	ldr	w2, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #9
	mov	w4, #2
	bl	_sn9c102_i2c_try_raw_read
	tbnz	w0, #31, LBB0_17
; %bb.9:
	mov	w0, #0
	ldr	w8, [sp]
	b	LBB0_24
LBB0_10:
	ldr	w2, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #45
	b	LBB0_13
LBB0_11:
	ldr	w2, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #44
	b	LBB0_13
LBB0_12:
	ldr	w2, [x1]
	mov	x5, sp
	mov	x0, x20
	mov	w3, #46
LBB0_13:
	mov	w4, #2
	bl	_sn9c102_i2c_try_raw_read
	tbnz	w0, #31, LBB0_17
; %bb.14:
	ldr	w8, [x19]
	sub	w8, w8, #129
	cmp	w8, #5
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #53
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
	b.eq	LBB0_22
; %bb.15:
	ldp	w9, w8, [sp]
	orr	w8, w8, w9, lsl #8
	str	w8, [x19, #4]
	sub	w9, w8, #16
	cmp	w9, #47
	b.hi	LBB0_19
; %bb.16:
	mov	w0, #0
	str	w9, [x19, #4]
	b	LBB0_25
LBB0_17:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_25
LBB0_19:
	and	w9, w8, #0xffffffe0
	cmp	w9, #224
	b.eq	LBB0_23
; %bb.20:
	cmp	w9, #96
	b.ne	LBB0_22
; %bb.21:
	mov	w0, #0
	sub	w8, w8, #96
	b	LBB0_24
LBB0_22:
	mov	w0, #0
	b	LBB0_25
LBB0_23:
	mov	w0, #0
	sub	w8, w8, #224
LBB0_24:
	str	w8, [x19, #4]
LBB0_25:
	ldr	x8, [sp, #8]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.26:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_12-LBB0_2)>>2
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mi0343_get_ctrl
.subsections_via_symbols
