	.file	"extr_mlpenc.c_codebook_bits_offset.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	codebook_bits_offset, @function
codebook_bits_offset:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rax, rdi
	mov	esi, esi
	sub	rcx, r9
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	sub	r8, r9
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	movsx	rbx, edx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rdi, QWORD PTR codebook_extremes[rip]
	mov	r14, QWORD PTR 8[rax]
	mov	QWORD PTR 24[rsp], r9
	mov	r10d, DWORD PTR INT_MAX[rip]
	mov	rdi, QWORD PTR [rdi+rbx*8]
	mov	rbp, QWORD PTR [rdi]
	mov	r12, QWORD PTR 8[rdi]
	mov	rdi, QWORD PTR 16[rax]
	lea	r11, [rdi+rsi*8]
	mov	edi, 9
	sub	edi, edx
	cmp	rbp, rcx
	jg	.L11
	cmp	r12, r8
	jge	.L8
.L11:
	xor	r9d, r9d
	.p2align 4,,10
	.p2align 3
.L13:
	sar	rcx
	add	r9d, 1
	sar	r8
	cmp	rbp, rcx
	jg	.L13
	cmp	r12, r8
	jl	.L13
	mov	r8d, 1
	mov	ecx, r9d
	sal	r8d, cl
	lea	r13d, -1[r8]
.L2:
	mov	r12, QWORD PTR 24[rsp]
	cmp	edx, 2
	jne	.L5
	movsx	rdx, r8d
	add	r9d, 1
	sub	r12, rdx
.L5:
	mov	ebp, DWORD PTR [r14]
	test	ebp, ebp
	jle	.L10
	mov	rdx, QWORD PTR 8[r14]
	movsx	rdi, edi
	movsx	rax, DWORD PTR [rax]
	mov	QWORD PTR 16[rsp], rdi
	mov	esi, DWORD PTR [rdx+rsi*8]
	mov	rdx, QWORD PTR ff_mlp_huffman_tables[rip]
	lea	r15, 0[0+rax*8]
	mov	r14, QWORD PTR [rdx+rbx*8]
	mov	DWORD PTR 12[rsp], esi
	mov	ebx, r10d
	xor	edx, edx
	xor	esi, esi
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR [r11]
	movzx	ecx, BYTE PTR 12[rsp]
	mov	edi, r8d
	sar	rax, cl
	mov	ecx, r13d
	sub	rax, r12
	and	ecx, eax
	cmp	r10d, ecx
	cmovg	r10d, ecx
	sub	edi, ecx
	mov	ecx, edi
	sub	ecx, 1
	cmp	ebx, ecx
	cmovg	ebx, ecx
	mov	ecx, r9d
	add	edx, 1
	add	r11, r15
	sar	rax, cl
	add	rax, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR [r14+rax*8]
	add	esi, DWORD PTR 8[rax]
	cmp	edx, ebp
	jne	.L7
.L6:
	mov	rdx, QWORD PTR 96[rsp]
	mov	r15, QWORD PTR 24[rsp]
	movsx	r10, r10d
	mov	DWORD PTR [rdx], r9d
	imul	r9d, ebp
	mov	rdi, r15
	mov	QWORD PTR 16[rdx], r15
	sub	rdi, r10
	add	esi, r9d
	mov	DWORD PTR 4[rdx], esi
	mov	esi, DWORD PTR HUFF_OFFSET_MIN[rip]
	call	FFMAX@PLT
	mov	rsi, QWORD PTR 96[rsp]
	movsx	rdi, ebx
	add	rdi, r15
	mov	DWORD PTR 12[rsi], eax
	mov	esi, DWORD PTR HUFF_OFFSET_MAX[rip]
	call	FFMIN@PLT
	mov	rbx, QWORD PTR 96[rsp]
	mov	DWORD PTR 8[rbx], eax
	add	rsp, 40
	.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
.L8:
	.cfi_restore_state
	xor	r13d, r13d
	mov	r8d, 1
	xor	r9d, r9d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L10:
	mov	ebx, r10d
	xor	esi, esi
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	codebook_bits_offset, .-codebook_bits_offset
	.comm	ff_mlp_huffman_tables,8,8
	.comm	codebook_extremes,8,8
	.comm	INT_MAX,4,4
	.comm	HUFF_OFFSET_MIN,4,4
	.comm	HUFF_OFFSET_MAX,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_mlpenc.c_codebook_bits_offset.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	codebook_bits_offset, %function
codebook_bits_offset:
	@ args = 12, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L14
	sub	sp, sp, #20
	ldr	ip, [ip]
	ldr	lr, [sp, #60]
	ldr	ip, [ip, r2, lsl #2]
	ldr	r6, [sp, #56]
	ldr	r4, [ip, #4]
	sub	r6, r6, lr
	cmp	r4, r6
	movge	lr, #0
	movlt	lr, #1
	ldr	r7, [ip]
	ldr	ip, [sp, #60]
	mov	r10, r1
	sub	r3, r3, ip
	cmp	r7, r3
	orrgt	lr, lr, #1
	ldr	r5, [r0, #8]
	ldr	r1, .L14+4
	rsb	ip, r2, #9
	cmp	lr, #0
	str	ip, [sp, #4]
	ldr	r9, [r0, #4]
	ldr	ip, [r1]
	add	r5, r5, r10, lsl #2
	beq	.L7
	mov	r1, #0
.L3:
	asr	r6, r6, #1
	cmp	r4, r6
	movge	lr, #0
	movlt	lr, #1
	asr	r3, r3, #1
	cmp	r7, r3
	orrgt	lr, lr, #1
	cmp	lr, #0
	add	r1, r1, #1
	bne	.L3
	mov	r8, #1
	lsl	r8, r8, r1
	sub	r3, r8, #1
	str	r3, [sp, #12]
.L2:
	cmp	r2, #2
	ldreq	r3, [sp, #60]
	ldr	r7, [r9]
	ldrne	r3, [sp, #60]
	subeq	r3, r3, r8
	addeq	r1, r1, #1
	cmp	r7, #0
	str	r3, [sp, #8]
	ble	.L9
	mov	lr, #0
	mov	r4, ip
	mov	r6, lr
	ldr	r3, .L14+8
	ldr	r9, [r9, #4]
	ldr	r3, [r3]
	ldr	fp, [r0]
	ldr	r10, [r9, r10, lsl #2]
	ldr	r9, [r3, r2, lsl #2]
	lsl	fp, fp, #2
.L6:
	ldr	r2, [sp, #8]
	ldr	r3, [r5], fp
	ldr	r0, [sp, #4]
	rsb	r3, r2, r3, asr r10
	ldr	r2, [sp, #12]
	add	lr, lr, #1
	and	r2, r3, r2
	add	r3, r0, r3, asr r1
	ldr	r0, [r9, r3, lsl #2]
	sub	r3, r8, r2
	cmp	ip, r2
	sub	r3, r3, #1
	movge	ip, r2
	cmp	r4, r3
	ldr	r2, [r0, #4]
	movge	r4, r3
	cmp	lr, r7
	add	r6, r6, r2
	bne	.L6
.L5:
	mla	r6, r7, r1, r6
	ldr	r2, [sp, #64]
	ldr	r0, [sp, #60]
	ldr	r3, .L14+12
	str	r6, [r2, #4]
	str	r0, [r2, #16]
	str	r1, [r2]
	sub	r0, r0, ip
	ldr	r1, [r3]
	bl	FFMAX
	ldr	r2, [sp, #64]
	ldr	r3, .L14+16
	str	r0, [r2, #12]
	ldr	r2, [sp, #60]
	ldr	r1, [r3]
	add	r0, r2, r4
	bl	FFMIN
	ldr	r3, [sp, #64]
	str	r0, [r3, #8]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r1, lr
	mov	r8, #1
	str	lr, [sp, #12]
	b	.L2
.L9:
	mov	r4, ip
	mov	r6, #0
	b	.L5
.L15:
	.align	2
.L14:
	.word	codebook_extremes
	.word	INT_MAX
	.word	ff_mlp_huffman_tables
	.word	HUFF_OFFSET_MIN
	.word	HUFF_OFFSET_MAX
	.size	codebook_bits_offset, .-codebook_bits_offset
	.comm	ff_mlp_huffman_tables,4,4
	.comm	codebook_extremes,4,4
	.comm	INT_MAX,4,4
	.comm	HUFF_OFFSET_MIN,4,4
	.comm	HUFF_OFFSET_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
