	.file	"extr_mma8452.c_mma8452_read_raw.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mma8452_read_raw, @function
mma8452_read_raw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rcx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	iio_priv@PLT
	lea	r8, -128[rbx]
	cmp	r8, 5
	ja	.L2
	lea	rdx, .L4[rip]
	mov	r15, rax
	movsx	rax, DWORD PTR [rdx+r8*4]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR [r15]
	test	DWORD PTR MMA8452_DATA_CFG_HPF_MASK[rip], eax
	jne	.L18
	mov	DWORD PTR 0[rbp], 0
	mov	DWORD PTR [r12], 0
.L16:
	mov	r12d, DWORD PTR IIO_VAL_INT_PLUS_MICRO[rip]
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[r15]
	mov	rsi, QWORD PTR MMA8452_OFF_X[rip]
	add	rsi, QWORD PTR 0[r13]
	call	i2c_smbus_read_byte_data@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	esi, 7
	mov	edi, eax
	call	sign_extend32@PLT
	mov	DWORD PTR 0[rbp], eax
	mov	r12d, DWORD PTR IIO_VAL_INT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdx, QWORD PTR 8[r15]
	mov	eax, DWORD PTR [r15]
	and	eax, DWORD PTR MMA8452_DATA_CFG_FS_MASK[rip]
	mov	rdx, QWORD PTR [rdx]
	cdqe
.L15:
	mov	rax, QWORD PTR [rdx+rax*8]
	mov	edx, DWORD PTR [rax]
	mov	DWORD PTR 0[rbp], edx
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR [r12], eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r15
	call	mma8452_get_odr_index@PLT
	mov	rdx, QWORD PTR mma8452_samp_freq[rip]
	cdqe
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, r14
	call	iio_device_claim_direct_mode@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	lea	rbx, 16[r15]
	mov	rdi, rbx
	call	mutex_lock@PLT
	lea	rsi, 12[rsp]
	mov	rdi, r15
	call	mma8452_read@PLT
	mov	rdi, rbx
	mov	r12d, eax
	call	mutex_unlock@PLT
	mov	rdi, r14
	call	iio_device_release_direct_mode@PLT
	test	r12d, r12d
	js	.L1
	mov	eax, DWORD PTR 12[r13]
	lea	r12d, -1[rax]
	mov	rax, QWORD PTR 0[r13]
	mov	edi, DWORD PTR 12[rsp+rax*4]
	call	be16_to_cpu@PLT
	mov	ecx, DWORD PTR 8[r13]
	mov	esi, r12d
	sar	eax, cl
	mov	edi, eax
	call	sign_extend32@PLT
	mov	DWORD PTR 0[rbp], eax
	mov	r12d, DWORD PTR IIO_VAL_INT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, r15
	call	mma8452_get_power_mode@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rdi, r15
	call	mma8452_get_odr_index@PLT
	mov	rcx, QWORD PTR mma8452_os_ratio[rip]
	movsx	rdx, eax
	movsx	rax, r12d
	mov	rax, QWORD PTR [rcx+rax*8]
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	DWORD PTR 0[rbp], eax
	mov	r12d, DWORD PTR IIO_VAL_INT[rip]
	jmp	.L1
.L2:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdx, r12
	mov	rsi, rbp
	mov	rdi, r15
	call	mma8452_read_hp_filter@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L16
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mma8452_read_raw, .-mma8452_read_raw
	.comm	mma8452_samp_freq,8,8
	.comm	mma8452_os_ratio,8,8
	.comm	MMA8452_OFF_X,8,8
	.comm	MMA8452_DATA_CFG_HPF_MASK,4,4
	.comm	MMA8452_DATA_CFG_FS_MASK,4,4
	.comm	IIO_VAL_INT_PLUS_MICRO,4,4
	.comm	IIO_VAL_INT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mma8452.c_mma8452_read_raw.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mma8452_read_raw, %function
mma8452_read_raw:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r3
	ldr	r3, .L19
	sub	sp, sp, #20
	ldr	r4, [sp, #48]
	mov	r7, r1
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r8, r0
	bl	iio_priv
	sub	ip, r4, #128
	mov	r4, r0
	cmp	ip, #5
	ldrls	pc, [pc, ip, asl #2]
	b	.L2
.L4:
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L3:
	ldr	r3, .L19+4
	ldr	r1, [r7]
	ldr	r3, [r3]
	ldr	r0, [r0, #4]
	add	r1, r1, r3
	bl	i2c_smbus_read_byte_data
	subs	r5, r0, #0
	blt	.L1
	mov	r1, #7
	bl	sign_extend32
	ldr	r3, .L19+8
	str	r0, [r6]
	ldr	r5, [r3]
.L1:
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	mov	r0, r5
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L9:
	ldr	r3, .L19+12
	ldr	r2, [r0, #8]
	ldr	r1, [r3]
	ldr	r3, [r0]
	ldr	r2, [r2]
	and	r3, r3, r1
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, .L19+16
.L15:
	ldr	r1, [r3]
	str	r1, [r6]
	ldr	r3, [r3, #4]
	str	r3, [r5]
	ldr	r5, [r2]
	b	.L1
.L8:
	bl	mma8452_get_odr_index
	ldr	r3, .L19+20
	ldr	r2, .L19+16
	ldr	r3, [r3]
	ldr	r3, [r3, r0, lsl #2]
	b	.L15
.L7:
	mov	r0, r8
	bl	iio_device_claim_direct_mode
	subs	r5, r0, #0
	bne	.L1
	add	r9, r4, #12
	mov	r0, r9
	bl	mutex_lock
	mov	r1, sp
	mov	r0, r4
	bl	mma8452_read
	mov	r5, r0
	mov	r0, r9
	bl	mutex_unlock
	mov	r0, r8
	bl	iio_device_release_direct_mode
	cmp	r5, #0
	blt	.L1
	ldr	r3, [r7]
	add	r2, sp, #16
	add	r3, r2, r3, lsl #2
	ldr	r0, [r3, #-16]
	bl	be16_to_cpu
	ldr	r3, [r7, #4]
	ldr	r1, [r7, #8]
	asr	r0, r0, r3
	sub	r1, r1, #1
	bl	sign_extend32
	ldr	r3, .L19+8
	str	r0, [r6]
	ldr	r5, [r3]
	b	.L1
.L6:
	bl	mma8452_get_power_mode
	subs	r5, r0, #0
	blt	.L1
	mov	r0, r4
	bl	mma8452_get_odr_index
	ldr	r2, .L19+24
	ldr	r3, .L19+8
	ldr	r2, [r2]
	ldr	r2, [r2, r5, lsl #2]
	ldr	r2, [r2, r0, lsl #2]
	str	r2, [r6]
	ldr	r5, [r3]
	b	.L1
.L5:
	ldr	r2, .L19+28
	ldr	r3, [r0]
	ldr	r2, [r2]
	ands	r3, r3, r2
	streq	r3, [r6]
	streq	r3, [r5]
	bne	.L18
.L12:
	ldr	r3, .L19+16
	ldr	r5, [r3]
	b	.L1
.L18:
	mov	r2, r5
	mov	r1, r6
	bl	mma8452_read_hp_filter
	subs	r5, r0, #0
	bge	.L12
	b	.L1
.L17:
	bl	__stack_chk_fail
.L2:
	ldr	r3, .L19+32
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	MMA8452_OFF_X
	.word	IIO_VAL_INT
	.word	MMA8452_DATA_CFG_FS_MASK
	.word	IIO_VAL_INT_PLUS_MICRO
	.word	mma8452_samp_freq
	.word	mma8452_os_ratio
	.word	MMA8452_DATA_CFG_HPF_MASK
	.word	EINVAL
	.size	mma8452_read_raw, .-mma8452_read_raw
	.comm	mma8452_samp_freq,4,4
	.comm	mma8452_os_ratio,4,4
	.comm	MMA8452_OFF_X,4,4
	.comm	MMA8452_DATA_CFG_HPF_MASK,4,4
	.comm	MMA8452_DATA_CFG_FS_MASK,4,4
	.comm	IIO_VAL_INT_PLUS_MICRO,4,4
	.comm	IIO_VAL_INT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
