	.file	"extr_timer.c_calc_wheel_index.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	calc_wheel_index, @function
calc_wheel_index:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	edi, 1
	sub	r12, rsi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	call	LVL_START@PLT
	xor	esi, esi
	cmp	rax, r12
	ja	.L15
	mov	edi, 2
	call	LVL_START@PLT
	mov	esi, 1
	cmp	rax, r12
	ja	.L15
	mov	edi, 3
	call	LVL_START@PLT
	mov	esi, 2
	cmp	rax, r12
	ja	.L15
	mov	edi, 4
	call	LVL_START@PLT
	mov	esi, 3
	cmp	rax, r12
	ja	.L15
	mov	edi, 5
	call	LVL_START@PLT
	mov	esi, 4
	cmp	rax, r12
	ja	.L15
	mov	edi, 6
	call	LVL_START@PLT
	mov	esi, 5
	cmp	rax, r12
	ja	.L15
	mov	edi, 7
	call	LVL_START@PLT
	mov	esi, 6
	cmp	rax, r12
	ja	.L15
	cmp	DWORD PTR LVL_DEPTH[rip], 8
	jg	.L17
.L9:
	test	r12, r12
	js	.L18
	cmp	QWORD PTR WHEEL_TIMEOUT_CUTOFF[rip], rbp
	ja	.L12
	mov	rbp, QWORD PTR WHEEL_TIMEOUT_MAX[rip]
.L12:
	mov	eax, DWORD PTR LVL_DEPTH[rip]
	lea	esi, -1[rax]
.L15:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	calc_index@PLT
.L18:
	.cfi_restore_state
	mov	eax, DWORD PTR LVL_MASK[rip]
	and	eax, ebx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	mov	edi, 8
	call	LVL_START@PLT
	mov	esi, 7
	cmp	rax, r12
	jbe	.L9
	jmp	.L15
	.cfi_endproc
.LFE0:
	.size	calc_wheel_index, .-calc_wheel_index
	.comm	WHEEL_TIMEOUT_MAX,8,8
	.comm	WHEEL_TIMEOUT_CUTOFF,8,8
	.comm	LVL_MASK,8,8
	.comm	LVL_DEPTH,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_timer.c_calc_wheel_index.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	calc_wheel_index, %function
calc_wheel_index:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	mov	r5, r1
	mov	r0, #1
	bl	LVL_START
	sub	r6, r4, r5
	cmp	r0, r6
	bls	.L2
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #0
	b	calc_index
.L2:
	mov	r0, #2
	bl	LVL_START
	cmp	r0, r6
	bls	.L3
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #1
	b	calc_index
.L3:
	mov	r0, #3
	bl	LVL_START
	cmp	r0, r6
	bhi	.L16
	mov	r0, #4
	bl	LVL_START
	cmp	r0, r6
	bls	.L5
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #3
	b	calc_index
.L16:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #2
	b	calc_index
.L5:
	mov	r0, #5
	bl	LVL_START
	cmp	r0, r6
	bhi	.L17
	mov	r0, #6
	bl	LVL_START
	cmp	r0, r6
	bls	.L7
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #5
	b	calc_index
.L17:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #4
	b	calc_index
.L7:
	mov	r0, #7
	bl	LVL_START
	cmp	r0, r6
	bhi	.L18
	ldr	r7, .L21
	ldr	r3, [r7]
	cmp	r3, #8
	bgt	.L19
.L9:
	cmp	r6, #0
	blt	.L20
	ldr	r3, .L21+4
	ldr	r1, [r7]
	ldr	r3, [r3]
	sub	r1, r1, #1
	cmp	r3, r4
	ldrls	r3, .L21+8
	ldrls	r4, [r3]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	calc_index
.L18:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #6
	b	calc_index
.L20:
	ldr	r3, .L21+12
	ldr	r0, [r3]
	and	r0, r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	mov	r0, #8
	bl	LVL_START
	cmp	r0, r6
	bls	.L9
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #7
	b	calc_index
.L22:
	.align	2
.L21:
	.word	LVL_DEPTH
	.word	WHEEL_TIMEOUT_CUTOFF
	.word	WHEEL_TIMEOUT_MAX
	.word	LVL_MASK
	.size	calc_wheel_index, .-calc_wheel_index
	.comm	WHEEL_TIMEOUT_MAX,4,4
	.comm	WHEEL_TIMEOUT_CUTOFF,4,4
	.comm	LVL_MASK,4,4
	.comm	LVL_DEPTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
