	.file	"extr_atrac9dec.c_calc_precision.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	calc_precision, @function
calc_precision:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdx
	mov	edx, 8
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rdi, QWORD PTR [r12]
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	xor	esi, esi
	call	memset@PLT
	mov	edx, DWORD PTR [rbx]
	cmp	edx, 1
	jle	.L2
	xor	ebp, ebp
	mov	r13d, 1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 8[r12]
	mov	r14, rbp
	add	rbp, 8
	mov	rdi, QWORD PTR [rax+rbp]
	sub	rdi, QWORD PTR [rax+r14]
	call	FFABS@PLT
	lea	edi, -1[rax]
	test	edi, edi
	jle	.L3
	mov	rax, QWORD PTR 8[r12]
	mov	esi, 5
	mov	rcx, QWORD PTR [rax+rbp]
	cmp	QWORD PTR [rax+r14], rcx
	setg	r14b
	call	FFMIN@PLT
	movzx	r14d, r14b
	mov	rdx, QWORD PTR [r12]
	mov	r8, rax
	mov	eax, r13d
	sub	eax, r14d
	cdqe
	add	QWORD PTR [rdx+rax*8], r8
.L3:
	mov	edx, DWORD PTR [rbx]
	add	r13d, 1
	cmp	edx, r13d
	jg	.L4
.L2:
	mov	esi, DWORD PTR 4[rbx]
	test	esi, esi
	jne	.L5
	test	edx, edx
	jle	.L7
	mov	r8, QWORD PTR 8[r12]
	mov	rdi, QWORD PTR 8[rbx]
	lea	esi, -1[rdx]
	xor	eax, eax
	mov	rcx, QWORD PTR 16[r12]
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdx, QWORD PTR [r8+rax*8]
	sub	rdx, QWORD PTR [rdi+rax*8]
	mov	QWORD PTR [rcx+rax*8], rdx
	mov	rdx, rax
	add	rax, 1
	cmp	rsi, rdx
	jne	.L13
.L12:
	xor	ebp, ebp
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rcx, QWORD PTR 16[r12]
.L14:
	lea	r13, [rcx+rbp*8]
	mov	esi, 1
	add	rbp, 1
	mov	rdi, QWORD PTR 0[r13]
	call	FFMAX@PLT
	mov	edx, DWORD PTR [rbx]
	mov	QWORD PTR 0[r13], rax
	cmp	edx, ebp
	jg	.L31
	mov	esi, DWORD PTR 16[rbx]
	test	esi, esi
	jle	.L15
.L21:
	mov	rcx, QWORD PTR 16[r12]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L16:
	add	QWORD PTR [rcx+rax*8], 1
	add	rax, 1
	cmp	esi, eax
	jg	.L16
.L15:
	test	edx, edx
	jle	.L1
	mov	rsi, QWORD PTR 24[r12]
	mov	rcx, QWORD PTR 16[r12]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rdx, QWORD PTR [rcx+rax*8]
	mov	DWORD PTR [rsi+rax*4], 0
	cmp	rdx, 15
	jle	.L18
	sub	edx, 15
	mov	DWORD PTR [rsi+rax*4], edx
	mov	QWORD PTR [rcx+rax*8], 15
.L18:
	add	rax, 1
	cmp	DWORD PTR [rbx], eax
	jg	.L19
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	test	edx, edx
	jle	.L7
	lea	r10d, -1[rdx]
	mov	r9, QWORD PTR 8[r12]
	mov	rcx, QWORD PTR 16[r12]
	xor	edx, edx
	mov	r8, QWORD PTR [r12]
	mov	rdi, QWORD PTR 8[rbx]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L33:
	cmp	esi, 1
	je	.L32
.L8:
	lea	rax, 1[rdx]
	cmp	r10, rdx
	je	.L12
	mov	rdx, rax
.L11:
	mov	rax, QWORD PTR [r9+rdx*8]
	mov	QWORD PTR [rcx+rdx*8], rax
	add	rax, QWORD PTR [r8+rdx*8]
	sub	rax, QWORD PTR [rdi+rdx*8]
	mov	QWORD PTR [rcx+rdx*8], rax
	js	.L8
	cmp	esi, 2
	je	.L9
	cmp	esi, 3
	jne	.L33
	sar	rax, 2
	mov	QWORD PTR [rcx+rdx*8], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L32:
	sar	rax
	mov	QWORD PTR [rcx+rdx*8], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rax, [rax+rax*2]
	sar	rax, 3
	mov	QWORD PTR [rcx+rdx*8], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR 16[rbx]
	test	esi, esi
	jg	.L21
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	calc_precision, .-calc_precision
	.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_atrac9dec.c_calc_precision.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	calc_precision, %function
calc_precision:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r2
	mov	r2, #0
	ldr	r3, [r6]
	mov	r5, r1
	strb	r2, [r3]
	strb	r2, [r3, #1]
	strb	r2, [r3, #2]
	strb	r2, [r3, #3]
	ldr	r3, [r1]
	cmp	r3, #1
	ble	.L2
	mov	r4, #4
	mov	r7, #1
.L4:
	ldr	r3, [r6, #4]
	sub	r8, r4, #4
	ldr	r0, [r3, r4]
	ldr	r3, [r3, r8]
	sub	r0, r0, r3
	bl	FFABS
	sub	r0, r0, #1
	cmp	r0, #0
	ble	.L3
	ldr	r2, [r6, #4]
	mov	r1, #5
	ldr	r3, [r2, r8]
	ldr	r8, [r2, r4]
	cmp	r3, r8
	movle	r8, #0
	movgt	r8, #1
	bl	FFMIN
	ldr	r1, [r6]
	sub	r3, r7, r8
	ldr	r2, [r1, r3, lsl #2]
	add	r2, r2, r0
	str	r2, [r1, r3, lsl #2]
.L3:
	ldr	r3, [r5]
	add	r7, r7, #1
	cmp	r3, r7
	add	r4, r4, #4
	bgt	.L4
.L2:
	ldr	ip, [r5, #4]
	cmp	ip, #0
	bne	.L5
	cmp	r3, #0
	ble	.L7
	ldr	r1, [r6, #4]
	ldr	r0, [r5, #8]
	ldr	r7, [r6, #8]
	sub	r1, r1, #4
	add	r3, r1, r3, lsl #2
	sub	r0, r0, #4
	sub	ip, r7, #4
.L13:
	ldr	r2, [r1, #4]!
	ldr	lr, [r0, #4]!
	cmp	r3, r1
	sub	r2, r2, lr
	str	r2, [ip, #4]!
	bne	.L13
.L12:
	mov	r4, #0
	b	.L14
.L32:
	ldr	r7, [r6, #8]
.L14:
	ldr	r0, [r7, r4, lsl #2]
	mov	r1, #1
	bl	FFMAX
	ldr	r3, [r5]
	str	r0, [r7, r4, lsl #2]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L32
	ldr	ip, [r5, #12]
	cmp	ip, #0
	ble	.L15
.L21:
	mov	r0, #0
	ldr	r1, [r6, #8]
	sub	r1, r1, #4
.L16:
	ldr	r2, [r1, #4]!
	add	r0, r0, #1
	add	r2, r2, #1
	cmp	ip, r0
	str	r2, [r1]
	bgt	.L16
.L15:
	cmp	r3, #0
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r2, #0
	mov	lr, #15
	mov	ip, r2
	ldr	r0, [r6, #12]
	ldr	r1, [r6, #8]
	sub	r0, r0, #4
	sub	r1, r1, #4
.L19:
	ldr	r3, [r1, #4]!
	str	ip, [r0, #4]!
	cmp	r3, #15
	subgt	r3, r3, #15
	strgt	r3, [r0]
	ldr	r3, [r5]
	add	r2, r2, #1
	strgt	lr, [r1]
	cmp	r3, r2
	bgt	.L19
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	cmp	r3, #0
	ble	.L7
	ldmib	r6, {r1, r7}
	ldr	r4, [r6]
	ldr	lr, [r5, #8]
	sub	r1, r1, #4
	add	r3, r1, r3, lsl #2
	sub	r2, r7, #4
	sub	r4, r4, #4
	sub	lr, lr, #4
	b	.L11
.L33:
	cmp	ip, #1
	asreq	r0, r0, #1
	streq	r0, [r2]
.L8:
	cmp	r1, r3
	beq	.L12
.L11:
	ldr	r8, [r1, #4]!
	str	r8, [r2, #4]!
	ldr	r0, [r4, #4]!
	ldr	r9, [lr, #4]!
	sub	r0, r0, r9
	add	r0, r0, r8
	cmp	r0, #0
	str	r0, [r2]
	blt	.L8
	cmp	ip, #2
	beq	.L9
	cmp	ip, #3
	bne	.L33
	asr	r0, r0, #2
	str	r0, [r2]
	b	.L8
.L9:
	add	r0, r0, r0, lsl #1
	asr	r0, r0, #3
	str	r0, [r2]
	b	.L8
.L7:
	ldr	ip, [r5, #12]
	cmp	ip, #0
	bgt	.L21
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
	.size	calc_precision, .-calc_precision
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
