	.file	"extr_mod2gbt.c_mod_get_index_from_period.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"\nPattern %d, Step %d, Channel %d. Note too high!\n"
	.align 8
.LC1:
	.string	"\nPattern %d, Step %d, Channel %d. Note too low!\n"
	.text
	.p2align 4
	.globl	mod_get_index_from_period
	.type	mod_get_index_from_period, @function
mod_get_index_from_period:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	jle	.L10
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, ecx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r10, QWORD PTR mod_period[rip]
	cmp	QWORD PTR 568[r10], rdi
	jle	.L3
	cmp	ecx, 4
	jne	.L26
.L3:
	mov	rdi, QWORD PTR [r10]
	cmp	rdi, rbx
	jl	.L27
.L4:
	mov	rdx, rdi
	xor	eax, eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L28:
	add	rax, 1
	cmp	rax, 72
	je	.L6
	mov	rdx, QWORD PTR [r10+rax*8]
.L7:
	mov	r8d, eax
	cmp	rbx, rdx
	jne	.L28
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r8d
	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
.L27:
	.cfi_restore_state
	cmp	r12d, 4
	je	.L4
.L5:
	lea	rdi, .LC1[rip]
	mov	ecx, r12d
	mov	edx, r13d
	mov	esi, ebp
	call	printf@PLT
	mov	r10, QWORD PTR mod_period[rip]
	mov	rdi, QWORD PTR [r10]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L26:
	lea	rdi, .LC0[rip]
	call	printf@PLT
	mov	r10, QWORD PTR mod_period[rip]
	mov	rdi, QWORD PTR [r10]
	cmp	rbx, rdi
	jg	.L5
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	r11d, ebx
	xor	ecx, ecx
	xor	r8d, r8d
	mov	esi, 65535
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdi, QWORD PTR [r10+rcx*8]
.L9:
	mov	edx, r11d
	sub	edx, edi
	mov	eax, edx
	sar	eax, 31
	xor	edx, eax
	sub	edx, eax
	mov	eax, ebx
	sub	eax, esi
	mov	r9d, eax
	sar	r9d, 31
	xor	eax, r9d
	sub	eax, r9d
	cmp	edx, eax
	cmovl	r8d, ecx
	cmovl	rsi, rdi
	add	rcx, 1
	cmp	rcx, 72
	jne	.L29
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	eax, r8d
	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
.L10:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	mov	r8d, -1
	mov	eax, r8d
	ret
	.cfi_endproc
.LFE0:
	.size	mod_get_index_from_period, .-mod_get_index_from_period
	.comm	mod_period,8,8
	.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_mod2gbt.c_mod_get_index_from_period.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\012Pattern %d, Step %d, Channel %d. Note too high!"
	.ascii	"\012\000"
	.align	2
.LC1:
	.ascii	"\012Pattern %d, Step %d, Channel %d. Note too low!\012"
	.ascii	"\000"
	.text
	.align	2
	.global	mod_get_index_from_period
	.syntax unified
	.arm
	.fpu softvfp
	.type	mod_get_index_from_period, %function
mod_get_index_from_period:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r4, r0, #0
	ble	.L9
	ldr	r8, .L21
	mov	r7, r1
	ldr	r5, [r8]
	mov	r9, r2
	ldr	r0, [r5, #284]
	mov	r6, r3
	cmp	r3, #4
	cmpne	r0, r4
	bgt	.L18
	ldr	ip, [r5]
	cmp	ip, r4
	blt	.L19
.L4:
	mov	r3, ip
	mov	r2, r5
	mov	r0, #0
	b	.L7
.L20:
	ldr	r3, [r2, #4]!
.L7:
	cmp	r4, r3
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	add	r0, r0, #1
	cmp	r0, #72
	bne	.L20
	mov	r0, #0
	mov	r3, r0
	ldr	lr, .L21+4
.L6:
	sub	r1, r4, ip
	sub	r2, r4, lr
	cmp	r1, #0
	rsblt	r1, r1, #0
	cmp	r2, #0
	rsblt	r2, r2, #0
	cmp	r1, r2
	movlt	r0, r3
	add	r3, r3, #1
	movlt	lr, ip
	cmp	r3, #72
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	ip, [r5, #4]!
	b	.L6
.L19:
	cmp	r3, #4
	beq	.L4
.L5:
	mov	r3, r6
	mov	r2, r9
	mov	r1, r7
	ldr	r0, .L21+8
	bl	printf
	ldr	r5, [r8]
	ldr	ip, [r5]
	b	.L4
.L18:
	ldr	r0, .L21+12
	bl	printf
	ldr	r5, [r8]
	ldr	ip, [r5]
	cmp	r4, ip
	bgt	.L5
	b	.L4
.L9:
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	.align	2
.L21:
	.word	mod_period
	.word	65535
	.word	.LC1
	.word	.LC0
	.size	mod_get_index_from_period, .-mod_get_index_from_period
	.comm	mod_period,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
