	.file	"extr_esp_adc_cal.c_calculate_voltage_lut.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	calculate_voltage_lut, @function
calculate_voltage_lut:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	eax, edi
	mov	r9d, DWORD PTR LUT_ADC_STEP_SIZE[rip]
	mov	r11, rdx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, DWORD PTR LUT_LOW_THRESH[rip]
	mov	r10, rcx
	mov	ecx, DWORD PTR LUT_VREF_HIGH[rip]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	sub	eax, r12d
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, DWORD PTR LUT_VREF_LOW[rip]
	cdq
	mov	ebp, ecx
	idiv	r9d
	sub	ebp, esi
	sub	esi, ebx
	sub	ecx, ebx
	pop	rbx
	.cfi_def_cfa_offset 32
	imul	ecx, r9d
	lea	r8d, 1[rax]
	cdqe
	imul	r8d, r9d
	mov	edx, DWORD PTR [r11+rax*4]
	imul	edx, ebp
	imul	ebp, DWORD PTR 4[r11+rax*4]
	lea	r13d, [r12+r8]
	sub	r8d, r9d
	add	r8d, r12d
	sub	r13d, edi
	sub	edi, r8d
	mov	r8d, DWORD PTR [r10+rax*4]
	imul	ebp, edi
	imul	r8d, esi
	imul	esi, DWORD PTR 4[r10+rax*4]
	mov	eax, ecx
	shr	eax, 31
	add	edx, r8d
	add	eax, ecx
	imul	edx, r13d
	sar	eax
	imul	esi, edi
	lea	edx, [rdx+rbp]
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	add	esi, edx
	pop	r13
	.cfi_def_cfa_offset 8
	add	eax, esi
	cdq
	idiv	ecx
	ret
	.cfi_endproc
.LFE0:
	.size	calculate_voltage_lut, .-calculate_voltage_lut
	.comm	LUT_VREF_LOW,4,4
	.comm	LUT_VREF_HIGH,4,4
	.comm	LUT_LOW_THRESH,4,4
	.comm	LUT_ADC_STEP_SIZE,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_esp_adc_cal.c_calculate_voltage_lut.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculate_voltage_lut, %function
calculate_voltage_lut:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r0
	mov	r4, r1
	ldr	r0, .L4
	ldr	r1, .L4+4
	ldr	r5, [r0]
	ldr	r6, [r1]
	sub	r0, r7, r5
	mov	r1, r6
	mov	fp, r2
	mov	r9, r3
	bl	__aeabi_idiv
	ldr	r1, .L4+8
	lsl	r3, r0, #2
	ldr	ip, [r1]
	add	r2, r0, #1
	add	r3, r3, #4
	ldr	r1, [fp, r0, lsl #2]
	mul	r10, r6, r2
	ldr	r8, [fp, r3]
	sub	r2, ip, r4
	mul	r8, r2, r8
	mul	r2, r1, r2
	ldr	r1, .L4+12
	sub	lr, r10, r6
	ldr	r1, [r1]
	ldr	fp, [r9, r0, lsl #2]
	add	lr, lr, r5
	sub	lr, r7, lr
	sub	r4, r4, r1
	mla	fp, r4, fp, r2
	mul	r8, lr, r8
	ldr	r3, [r9, r3]
	add	r2, r5, r10
	sub	r0, r2, r7
	mla	r0, fp, r0, r8
	mul	r4, r3, r4
	sub	r3, ip, r1
	mul	r1, r6, r3
	mla	r4, lr, r4, r0
	add	r0, r1, r1, lsr #31
	add	r0, r4, r0, asr #1
	bl	__aeabi_idiv
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	.align	2
.L4:
	.word	LUT_LOW_THRESH
	.word	LUT_ADC_STEP_SIZE
	.word	LUT_VREF_HIGH
	.word	LUT_VREF_LOW
	.size	calculate_voltage_lut, .-calculate_voltage_lut
	.comm	LUT_VREF_LOW,4,4
	.comm	LUT_VREF_HIGH,4,4
	.comm	LUT_LOW_THRESH,4,4
	.comm	LUT_ADC_STEP_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
