	.file	"extr_mlx90614.c_mlx90614_write_raw.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mlx90614_write_raw, @function
mlx90614_write_raw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, ecx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, r8
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	iio_priv@PLT
	mov	r13, rax
	cmp	rbx, 128
	je	.L2
	cmp	rbx, 129
	jne	.L3
	test	ebp, ebp
	js	.L3
	cmp	r12d, 1
	ja	.L3
	test	ebp, ebp
	je	.L5
	test	r12b, 1
	je	.L5
.L3:
	mov	r12d, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	test	r12d, r12d
	js	.L3
	test	ebp, ebp
	js	.L3
	xor	esi, esi
	imul	r12d, r12d, 100
	mov	rdi, rax
	call	mlx90614_power_get@PLT
	mov	rdi, r13
	call	mutex_lock@PLT
	movsx	rsi, ebp
	sar	ebp, 31
	mov	edi, DWORD PTR 4[r13]
	imul	rsi, rsi, 1759218605
	sar	rsi, 44
	sub	esi, ebp
	add	esi, r12d
	call	mlx90614_iir_search@PLT
.L14:
	mov	rdi, r13
	mov	r12d, eax
	call	mutex_unlock@PLT
	mov	rdi, r13
	call	mlx90614_power_put@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	eax, ebp
	imul	r12d, DWORD PTR MLX90614_CONST_RAW_EMISSIVITY_MAX[rip]
	xor	esi, esi
	mov	rdi, r13
	cdq
	idiv	DWORD PTR MLX90614_CONST_EMISSIVITY_RESOLUTION[rip]
	add	r12d, eax
	call	mlx90614_power_get@PLT
	mov	rdi, r13
	call	mutex_lock@PLT
	mov	edi, DWORD PTR 4[r13]
	mov	esi, DWORD PTR MLX90614_EMISSIVITY[rip]
	mov	edx, r12d
	call	mlx90614_write_word@PLT
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	mlx90614_write_raw, .-mlx90614_write_raw
	.comm	MLX90614_EMISSIVITY,4,4
	.comm	MLX90614_CONST_RAW_EMISSIVITY_MAX,4,4
	.comm	MLX90614_CONST_EMISSIVITY_RESOLUTION,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_mlx90614.c_mlx90614_write_raw.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlx90614_write_raw, %function
mlx90614_write_raw:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, [sp, #24]
	mov	r4, r2
	mov	r5, r3
	bl	iio_priv
	cmp	r7, #128
	mov	r6, r0
	beq	.L2
	cmp	r7, #129
	bne	.L3
	cmp	r4, #1
	movls	r3, #0
	movhi	r3, #1
	orrs	r3, r3, r5, lsr #31
	beq	.L10
.L3:
	ldr	r3, .L11
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	lsr	r1, r5, #31
	orrs	r1, r1, r4, lsr #31
	bne	.L3
	bl	mlx90614_power_get
	mov	r0, r6
	bl	mutex_lock
	ldr	r1, .L11+4
	add	r4, r4, r4, lsl #2
	smull	r3, r1, r5, r1
	asr	r5, r5, #31
	add	r4, r4, r4, lsl #2
	rsb	r1, r5, r1, asr #12
	ldr	r0, [r6, #4]
	add	r1, r1, r4, lsl #2
	bl	mlx90614_iir_search
.L8:
	mov	r4, r0
	mov	r0, r6
	bl	mutex_unlock
	mov	r0, r6
	bl	mlx90614_power_put
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	cmp	r5, #0
	moveq	r7, #0
	andne	r7, r4, #1
	cmp	r7, #0
	bne	.L3
	ldr	r2, .L11+8
	ldr	r3, .L11+12
	ldr	r2, [r2]
	ldr	r1, [r3]
	mov	r0, r5
	mul	r5, r2, r4
	bl	__aeabi_idiv
	mov	r4, r0
	mov	r1, r7
	mov	r0, r6
	bl	mlx90614_power_get
	mov	r0, r6
	bl	mutex_lock
	ldr	r3, .L11+16
	add	r4, r4, r5
	mov	r2, r4
	ldr	r1, [r3]
	ldr	r0, [r6, #4]
	bl	mlx90614_write_word
	b	.L8
.L12:
	.align	2
.L11:
	.word	EINVAL
	.word	1759218605
	.word	MLX90614_CONST_RAW_EMISSIVITY_MAX
	.word	MLX90614_CONST_EMISSIVITY_RESOLUTION
	.word	MLX90614_EMISSIVITY
	.size	mlx90614_write_raw, .-mlx90614_write_raw
	.comm	MLX90614_EMISSIVITY,4,4
	.comm	MLX90614_CONST_RAW_EMISSIVITY_MAX,4,4
	.comm	MLX90614_CONST_EMISSIVITY_RESOLUTION,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
