	.file	"extr_mlpenc.c_determine_bits.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	determine_bits, @function
determine_bits:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 120
	.cfi_def_cfa_offset 176
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 40[rdi]
	mov	QWORD PTR 48[rsp], rax
	mov	rax, QWORD PTR 32[rdi]
	mov	QWORD PTR 56[rsp], rax
	.p2align 4,,10
	.p2align 3
.L7:
	mov	r9d, r13d
	mov	r8, QWORD PTR 16[r15]
	mov	rdx, QWORD PTR FIR[rip]
	lea	rax, 0[0+r9*8]
	mov	r12, QWORD PTR INT32_MAX[rip]
	mov	rbp, QWORD PTR INT32_MIN[rip]
	mov	QWORD PTR 32[rsp], rax
	add	r8, rax
	mov	rax, QWORD PTR 24[r15]
	mov	rax, QWORD PTR [rax+r9*8]
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	DWORD PTR 28[rsp], eax
	mov	rax, QWORD PTR 48[rsp]
	mov	r10d, DWORD PTR [rax]
	test	r10d, r10d
	jle	.L12
	mov	rax, QWORD PTR 8[rax]
	movsx	rdx, DWORD PTR 8[r15]
	xor	edi, edi
	mov	ecx, DWORD PTR [rax+r9*8]
	sal	rdx, 3
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rsi, QWORD PTR [r8]
	sar	rsi, cl
	cmp	r12, rsi
	cmovg	r12, rsi
	cmp	rbp, rsi
	cmovl	rbp, rsi
	add	edi, 1
	add	eax, esi
	add	r8, rdx
	cmp	edi, r10d
	jne	.L3
	cdq
	idiv	edi
	mov	r14d, eax
.L2:
	mov	rax, QWORD PTR [r15]
	mov	esi, DWORD PTR 28[rsp]
	mov	r8, QWORD PTR [rax+r9*8]
	test	esi, esi
	jne	.L4
	mov	rcx, rbp
	mov	rdx, r12
	mov	esi, r13d
	mov	rdi, r15
	call	no_codebook_bits@PLT
	mov	edx, DWORD PTR HUFF_OFFSET_MAX[rip]
	mov	esi, DWORD PTR HUFF_OFFSET_MIN[rip]
	mov	edi, r14d
	call	av_clip@PLT
	mov	DWORD PTR 40[rsp], eax
.L5:
	lea	rax, 64[rsp]
	cmp	DWORD PTR NUM_CODEBOOKS[rip], 1
	mov	ebx, 40
	mov	r14d, 1
	mov	QWORD PTR 16[rsp], rax
	jg	.L6
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, QWORD PTR [r15]
	mov	rcx, QWORD PTR 32[rsp]
	add	r14d, 1
	movdqa	xmm1, XMMWORD PTR 64[rsp]
	mov	rax, QWORD PTR [rax+rcx]
	movups	XMMWORD PTR [rax+rbx], xmm1
	movdqa	xmm2, XMMWORD PTR 80[rsp]
	movups	XMMWORD PTR 16[rax+rbx], xmm2
	mov	rdx, QWORD PTR 96[rsp]
	mov	QWORD PTR 32[rax+rbx], rdx
	add	rbx, 40
	cmp	DWORD PTR NUM_CODEBOOKS[rip], r14d
	jle	.L10
.L6:
	movsx	rax, DWORD PTR INT_MAX[rip]
	mov	rcx, r12
	mov	r8, rbp
	mov	esi, r13d
	pxor	xmm0, xmm0
	sub	rsp, 8
	.cfi_def_cfa_offset 184
	lea	edx, -1[r14]
	mov	rdi, r15
	movaps	XMMWORD PTR 72[rsp], xmm0
	movaps	XMMWORD PTR 88[rsp], xmm0
	mov	QWORD PTR 104[rsp], 0
	mov	QWORD PTR 80[rsp], rax
	push	QWORD PTR 24[rsp]
	.cfi_def_cfa_offset 192
	mov	r9d, DWORD PTR 56[rsp]
	mov	DWORD PTR 24[rsp], edx
	call	codebook_bits_offset@PLT
	pop	rax
	.cfi_def_cfa_offset 184
	pop	rdx
	.cfi_def_cfa_offset 176
	mov	ecx, DWORD PTR 28[rsp]
	mov	edx, DWORD PTR 8[rsp]
	test	ecx, ecx
	jne	.L9
	mov	rax, QWORD PTR 72[rsp]
	mov	rdi, QWORD PTR 64[rsp]
	mov	r9, rbp
	mov	r8, r12
	mov	esi, r13d
	mov	QWORD PTR 8[rsp], rax
	lea	rcx, -1[rdi]
	mov	rdi, r15
	push	0
	.cfi_def_cfa_offset 184
	push	QWORD PTR 24[rsp]
	.cfi_def_cfa_offset 192
	mov	DWORD PTR 60[rsp], edx
	call	codebook_bits@PLT
	mov	rax, QWORD PTR 24[rsp]
	push	1
	.cfi_def_cfa_offset 200
	mov	r9, rbp
	push	QWORD PTR 40[rsp]
	.cfi_def_cfa_offset 208
	mov	edx, DWORD PTR 76[rsp]
	mov	r8, r12
	mov	esi, r13d
	lea	rcx, 1[rax]
	mov	rdi, r15
	call	codebook_bits@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 176
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR 56[rsp]
	add	r13d, 1
	cmp	DWORD PTR [rax], r13d
	jnb	.L7
	mov	rax, QWORD PTR 104[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L22
	add	rsp, 120
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	r9, r8
	mov	rcx, r12
	mov	r8, rbp
	xor	edx, edx
	mov	esi, r13d
	mov	rdi, r15
	call	no_codebook_bits_offset@PLT
	mov	DWORD PTR 40[rsp], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	xor	r14d, r14d
	jmp	.L2
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	determine_bits, .-determine_bits
	.comm	NUM_CODEBOOKS,4,4
	.comm	INT_MAX,4,4
	.comm	INT32_MIN,8,8
	.comm	INT32_MAX,8,8
	.comm	HUFF_OFFSET_MIN,4,4
	.comm	HUFF_OFFSET_MAX,4,4
	.comm	FIR,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_mlpenc.c_determine_bits.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	determine_bits, %function
determine_bits:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r9, r0
	mov	fp, #0
	ldr	r3, .L21
	sub	sp, sp, #84
	ldr	r3, [r3]
	str	r3, [sp, #76]
	mov	r3,#0
	ldr	r3, [r0, #20]
	ldr	r10, .L21+4
	str	r3, [sp, #40]
	ldr	r3, [r0, #16]
	str	r3, [sp, #44]
.L7:
	ldr	r2, .L21+8
	ldr	r3, [r9, #12]
	ldr	r1, [r2]
	ldr	r3, [r3, fp, lsl #2]
	ldr	lr, [sp, #40]
	ldr	r3, [r3, r1, lsl #2]
	ldr	ip, [lr]
	str	r3, [sp, #24]
	lsl	r3, fp, #2
	str	r3, [sp, #28]
	ldr	r3, .L21+12
	ldr	r2, [r9, #8]
	ldr	r8, [r3]
	ldr	r3, .L21+16
	cmp	ip, #0
	ldr	r7, [r3]
	add	r2, r2, fp, lsl #2
	ble	.L12
	mov	r1, #0
	mov	r0, r1
	ldr	r3, [lr, #4]
	ldr	r4, [r9, #4]
	ldr	lr, [r3, fp, lsl #2]
	lsl	r4, r4, #2
.L3:
	ldr	r3, [r2], r4
	add	r1, r1, #1
	asr	r3, r3, lr
	cmp	r8, r3
	movge	r8, r3
	cmp	r7, r3
	movlt	r7, r3
	cmp	r1, ip
	add	r0, r0, r3
	bne	.L3
	bl	__aeabi_idiv
	mov	r4, r0
.L2:
	ldr	r2, [sp, #24]
	ldr	r3, [r9]
	cmp	r2, #0
	ldr	r2, [sp, #28]
	ldr	r3, [r3, r2]
	bne	.L4
	mov	r2, r8
	mov	r1, fp
	str	r3, [sp]
	mov	r0, r9
	mov	r3, r7
	bl	no_codebook_bits
	ldr	r3, .L21+20
	mov	r0, r4
	ldr	r2, [r3]
	ldr	r3, .L21+24
	ldr	r1, [r3]
	bl	av_clip
	str	r0, [sp, #32]
.L5:
	ldr	r3, [r10]
	cmp	r3, #1
	movgt	r5, #1
	movgt	r6, #0
	addgt	r4, sp, #48
	strgt	r7, [sp, #20]
	bgt	.L6
	b	.L10
.L9:
	mov	lr, r4
	ldr	r2, [r9]
	ldr	r1, [sp, #28]
	rsb	r3, r5, r5, lsl #3
	ldr	ip, [r2, r1]
	add	r5, r5, #1
	add	ip, ip, r3, lsl #2
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r3, [r10]
	ldm	lr, {r0, r1, r2}
	cmp	r3, r5
	stm	ip, {r0, r1, r2}
	ble	.L10
.L6:
	ldr	r3, .L21+28
	sub	r7, r5, #1
	ldr	ip, [r3]
	ldr	r3, [sp, #32]
	str	r4, [sp, #8]
	str	r3, [sp, #4]
	ldr	r3, [sp, #20]
	mov	r2, r7
	str	r3, [sp]
	mov	r1, fp
	mov	r3, r8
	mov	r0, r9
	str	r6, [r4]
	str	r6, [r4, #8]
	str	r6, [r4, #12]
	str	r6, [r4, #16]
	str	r6, [r4, #20]
	str	r6, [r4, #24]
	str	ip, [sp, #52]
	bl	codebook_bits_offset
	ldr	r3, [sp, #24]
	cmp	r3, #0
	bne	.L9
	ldr	r2, [sp, #52]
	ldr	r1, [sp, #24]
	ldr	r3, [sp, #48]
	str	r2, [sp, #36]
	ldr	r2, [sp, #20]
	str	r1, [sp, #12]
	str	r2, [sp, #4]
	mov	r1, fp
	mov	r2, r7
	mov	r0, r9
	str	r4, [sp, #8]
	str	r8, [sp]
	sub	r3, r3, #1
	bl	codebook_bits
	mov	r1, #1
	ldr	r2, [sp, #20]
	ldr	r3, [sp, #36]
	str	r1, [sp, #12]
	str	r2, [sp, #4]
	mov	r1, fp
	mov	r2, r7
	mov	r0, r9
	add	r3, r3, #1
	str	r4, [sp, #8]
	str	r8, [sp]
	bl	codebook_bits
	b	.L9
.L10:
	ldr	r3, [sp, #44]
	add	fp, fp, #1
	ldr	r3, [r3]
	cmp	r3, fp
	bcs	.L7
	ldr	r3, .L21
	ldr	r2, [r3]
	ldr	r3, [sp, #76]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L20
	add	sp, sp, #84
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	str	r3, [sp, #4]
	mov	r2, #0
	mov	r3, r8
	mov	r1, fp
	mov	r0, r9
	str	r7, [sp]
	bl	no_codebook_bits_offset
	mov	r3, #0
	str	r3, [sp, #32]
	b	.L5
.L12:
	mov	r4, #0
	b	.L2
.L20:
	bl	__stack_chk_fail
.L22:
	.align	2
.L21:
	.word	.LC0
	.word	NUM_CODEBOOKS
	.word	FIR
	.word	INT32_MAX
	.word	INT32_MIN
	.word	HUFF_OFFSET_MAX
	.word	HUFF_OFFSET_MIN
	.word	INT_MAX
	.size	determine_bits, .-determine_bits
	.comm	NUM_CODEBOOKS,4,4
	.comm	INT_MAX,4,4
	.comm	INT32_MIN,4,4
	.comm	INT32_MAX,4,4
	.comm	HUFF_OFFSET_MIN,4,4
	.comm	HUFF_OFFSET_MAX,4,4
	.comm	FIR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
