	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kmx61_read_raw
_kmx61_read_raw:                        ## @kmx61_read_raw
	.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	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	callq	_kmx61_get_data
	movq	%rax, %r14
	cmpq	$129, %r15
	je	LBB0_14
## %bb.1:
	movq	%rax, %r13
	cmpq	$130, %r15
	je	LBB0_17
## %bb.2:
	cmpq	$131, %r15
	jne	LBB0_19
## %bb.3:
	movl	(%r12), %eax
	cmpl	$132, %eax
	je	LBB0_4
## %bb.5:
	cmpl	$128, %eax
	jne	LBB0_19
## %bb.6:
	movq	_KMX61_MAG_XOUT_L@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_14:
	movl	(%r12), %eax
	cmpl	$128, %eax
	je	LBB0_20
## %bb.15:
	cmpl	$132, %eax
	jne	LBB0_19
## %bb.16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	movq	_kmx61_uscale_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_21
LBB0_17:
	movl	(%r12), %eax
	orl	$4, %eax
	cmpl	$132, %eax
	jne	LBB0_19
## %bb.18:
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movl	4(%r12), %ecx
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_kmx61_get_odr
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_21
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_4:
	movq	_KMX61_ACC_XOUT_L@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r15d
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movl	4(%r12), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_kmx61_set_power_state
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %ebx
LBB0_9:
	movq	%r13, %rdi
	callq	_mutex_unlock
	jmp	LBB0_23
LBB0_20:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	movl	$1465, (%rbx)                   ## imm = 0x5B9
LBB0_21:
	movq	_IIO_VAL_INT_PLUS_MICRO@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	16(%r12), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_kmx61_read_measurement
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movb	8(%r12), %cl
	shrl	%cl, %ebx
	movl	12(%r12), %esi
	decl	%esi
	movl	%ebx, %edi
	callq	_sign_extend32
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	4(%r12), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_kmx61_set_power_state
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	jne	LBB0_23
## %bb.13:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_11:
	movl	4(%r12), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_kmx61_set_power_state
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_KMX61_ACC_XOUT_L,4,2           ## @KMX61_ACC_XOUT_L
	.comm	_KMX61_MAG_XOUT_L,4,2           ## @KMX61_MAG_XOUT_L
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_kmx61_uscale_table,8,3         ## @kmx61_uscale_table
	.comm	_IIO_VAL_INT_PLUS_MICRO,4,2     ## @IIO_VAL_INT_PLUS_MICRO
	.no_dead_strip	_kmx61_read_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kmx61_read_raw
_kmx61_read_raw:                        ; @kmx61_read_raw
	.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
	mov	x23, x4
	mov	x22, x3
	mov	x20, x2
	mov	x21, x1
	bl	_kmx61_get_data
	mov	x19, x0
	cmp	x23, #129
	b.eq	LBB0_6
; %bb.1:
	cmp	x23, #130
	b.eq	LBB0_9
; %bb.2:
	cmp	x23, #131
	b.ne	LBB0_11
; %bb.3:
	ldr	w8, [x21]
	cmp	w8, #132
	b.eq	LBB0_12
; %bb.4:
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.5:
Lloh0:
	adrp	x8, _KMX61_MAG_XOUT_L@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KMX61_MAG_XOUT_L@GOTPAGEOFF]
	b	LBB0_13
LBB0_6:
	ldr	w8, [x21]
	cmp	w8, #128
	b.eq	LBB0_16
; %bb.7:
	cmp	w8, #132
	b.ne	LBB0_11
; %bb.8:
	str	wzr, [x20]
Lloh2:
	adrp	x8, _kmx61_uscale_table@GOTPAGE
Lloh3:
	ldr	x8, [x8, _kmx61_uscale_table@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x9, [x19]
	ldr	w8, [x8, x9, lsl #2]
	b	LBB0_17
LBB0_9:
	ldr	w8, [x21]
	orr	w8, w8, #0x4
	cmp	w8, #132
	b.ne	LBB0_11
; %bb.10:
	add	x23, x19, #8
	mov	x0, x23
	bl	_mutex_lock
	ldr	w3, [x21, #4]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_kmx61_get_odr
	mov	x19, x0
	mov	x0, x23
	bl	_mutex_unlock
	cbz	w19, LBB0_18
LBB0_11:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_19
LBB0_12:
Lloh8:
	adrp	x8, _KMX61_ACC_XOUT_L@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KMX61_ACC_XOUT_L@GOTPAGEOFF]
LBB0_13:
	ldr	w24, [x8]
	add	x23, x19, #8
	mov	x0, x23
	bl	_mutex_lock
	ldr	w2, [x21, #4]
	mov	x0, x19
	mov	w1, #1
	bl	_kmx61_set_power_state
	cbz	w0, LBB0_20
; %bb.14:
	mov	x22, x0
LBB0_15:
	mov	x0, x23
	bl	_mutex_unlock
	b	LBB0_19
LBB0_16:
	str	wzr, [x20]
	mov	w8, #1465
LBB0_17:
	str	w8, [x22]
LBB0_18:
Lloh10:
	adrp	x8, _IIO_VAL_INT_PLUS_MICRO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IIO_VAL_INT_PLUS_MICRO@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
LBB0_19:
	mov	x0, x22
	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
LBB0_20:
	ldr	w2, [x21, #16]
	mov	x0, x19
	mov	x1, x24
	bl	_kmx61_read_measurement
	mov	x22, x0
	tbnz	w0, #31, LBB0_22
; %bb.21:
	ldp	w8, w9, [x21, #8]
	lsr	w0, w22, w8
	sub	w1, w9, #1
	bl	_sign_extend32
	str	w0, [x20]
	ldr	w2, [x21, #4]
	mov	x0, x19
	mov	w1, #0
	bl	_kmx61_set_power_state
	mov	x19, x0
	mov	x0, x23
	bl	_mutex_unlock
Lloh13:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w19, #0
	csel	w22, w8, w19, eq
	b	LBB0_19
LBB0_22:
	ldr	w2, [x21, #4]
	mov	x0, x19
	mov	w1, #0
	bl	_kmx61_set_power_state
	b	LBB0_15
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_KMX61_ACC_XOUT_L,4,2           ; @KMX61_ACC_XOUT_L
	.comm	_KMX61_MAG_XOUT_L,4,2           ; @KMX61_MAG_XOUT_L
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_kmx61_uscale_table,8,3         ; @kmx61_uscale_table
	.comm	_IIO_VAL_INT_PLUS_MICRO,4,2     ; @IIO_VAL_INT_PLUS_MICRO
	.no_dead_strip	_kmx61_read_raw
.subsections_via_symbols
