	.file	"extr_sharedbook.c_vorbis_book_init_decode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	vorbis_book_init_decode
	.type	vorbis_book_init_decode, @function
vorbis_book_init_decode:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	edx, 64
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	.cfi_offset 15, -24
	mov	r15, rsi
	xor	esi, esi
	push	r14
	push	r13
	push	r12
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	memset@PLT
	mov	esi, DWORD PTR [r15]
	test	esi, esi
	jle	.L2
	mov	rdi, QWORD PTR 8[r15]
	lea	edx, -1[rsi]
	xor	r13d, r13d
	mov	rax, rdi
	lea	rcx, 8[rdi+rdx*8]
	.p2align 4,,10
	.p2align 3
.L4:
	xor	edx, edx
	cmp	QWORD PTR [rax], 0
	setg	dl
	add	rax, 8
	add	r13d, edx
	cmp	rcx, rax
	jne	.L4
	mov	eax, DWORD PTR 16[r15]
	mov	DWORD PTR [r12], esi
	mov	DWORD PTR 4[r12], r13d
	mov	DWORD PTR 60[r12], eax
	test	r13d, r13d
	jne	.L52
.L7:
	xor	eax, eax
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L53
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L52:
	.cfi_restore_state
	mov	edx, r13d
	call	_make_words@PLT
	lea	edi, 0[0+r13*8]
	mov	rbx, rax
	call	alloca@PLT
	mov	QWORD PTR -96[rbp], rax
	test	rbx, rbx
	je	.L54
	lea	eax, -1[r13]
	mov	r14, QWORD PTR -96[rbp]
	mov	rdx, rbx
	lea	rax, 4[0+rax*4]
	mov	QWORD PTR -104[rbp], rax
	add	rax, rbx
	mov	r9, r14
	mov	QWORD PTR -88[rbp], rax
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, DWORD PTR [rdx]
	mov	QWORD PTR -80[rbp], r9
	add	r14, 8
	mov	QWORD PTR -72[rbp], rdx
	call	bitreverse@PLT
	mov	rdx, QWORD PTR -72[rbp]
	mov	r9, QWORD PTR -80[rbp]
	mov	DWORD PTR [rdx], eax
	mov	QWORD PTR -8[r14], rdx
	add	rdx, 4
	cmp	QWORD PTR -88[rbp], rdx
	jne	.L9
	mov	ecx, DWORD PTR sort32a[rip]
	mov	rdi, QWORD PTR -96[rbp]
	mov	edx, 8
	mov	esi, r13d
	call	qsort@PLT
	lea	r10d, 0[0+r13*4]
	mov	edi, r10d
	mov	DWORD PTR -72[rbp], r10d
	call	alloca@PLT
	mov	r10d, DWORD PTR -72[rbp]
	mov	r14, rax
	mov	edi, r10d
	call	_ogg_malloc@PLT
	mov	r9, QWORD PTR -80[rbp]
	mov	r10d, DWORD PTR -72[rbp]
	xor	ecx, ecx
	mov	QWORD PTR 8[r12], rax
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdx, QWORD PTR [r9]
	add	r9, 8
	sub	rdx, rbx
	sar	rdx, 2
	movsx	rdx, edx
	mov	DWORD PTR [r14+rdx*4], ecx
	add	ecx, 1
	cmp	r13d, ecx
	jne	.L10
	mov	rsi, QWORD PTR -104[rbp]
	mov	rdi, rbx
	mov	rdx, r14
	sub	rdi, r14
	add	rsi, r14
	.p2align 4,,10
	.p2align 3
.L11:
	mov	r8d, DWORD PTR [rdi+rdx]
	movsx	rcx, DWORD PTR [rdx]
	add	rdx, 4
	mov	DWORD PTR [rax+rcx*4], r8d
	cmp	rsi, rdx
	jne	.L11
	mov	rdi, rbx
	mov	DWORD PTR -72[rbp], r10d
	call	_ogg_free@PLT
	lea	rcx, 52[r12]
	mov	rdx, r14
	mov	esi, r13d
	mov	rdi, r15
	call	_book_unquantize@PLT
	mov	r10d, DWORD PTR -72[rbp]
	mov	DWORD PTR 56[r12], eax
	mov	edi, r10d
	call	_ogg_malloc@PLT
	mov	ecx, DWORD PTR [r15]
	mov	QWORD PTR 16[r12], rax
	test	ecx, ecx
	jle	.L35
	mov	rsi, QWORD PTR 8[r15]
	xor	edx, edx
	xor	edi, edi
	.p2align 4,,10
	.p2align 3
.L14:
	cmp	QWORD PTR [rsi+rdx*8], 0
	jle	.L13
	movsx	rcx, edi
	add	edi, 1
	movsx	rcx, DWORD PTR [r14+rcx*4]
	mov	DWORD PTR [rax+rcx*4], edx
.L13:
	add	rdx, 1
	cmp	DWORD PTR [r15], edx
	jg	.L14
.L12:
	call	_ogg_malloc@PLT
	mov	edx, DWORD PTR [r15]
	mov	QWORD PTR 24[r12], rax
	test	edx, edx
	jle	.L36
	mov	DWORD PTR -88[rbp], 0
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdx, QWORD PTR 8[r15]
	mov	rdx, QWORD PTR [rdx+rax*8]
	test	rdx, rdx
	jle	.L16
	movsx	rcx, DWORD PTR -88[rbp]
	mov	rsi, QWORD PTR 24[r12]
	mov	rbx, rcx
	movsx	rcx, DWORD PTR [r14+rcx*4]
	add	ebx, 1
	mov	BYTE PTR [rsi+rcx], dl
	mov	DWORD PTR -88[rbp], ebx
.L16:
	add	rax, 1
	cmp	DWORD PTR [r15], eax
	jg	.L17
.L15:
	mov	edi, DWORD PTR 4[r12]
	call	_ilog@PLT
	sub	eax, 4
	cmp	eax, 4
	jg	.L18
	mov	DWORD PTR 32[r12], 5
	mov	DWORD PTR -96[rbp], 32
.L19:
	mov	edi, DWORD PTR -96[rbp]
	mov	esi, 4
	call	_ogg_calloc@PLT
	mov	BYTE PTR 48[r12], 0
	mov	edx, DWORD PTR 32[r12]
	mov	QWORD PTR 40[r12], rax
	mov	eax, DWORD PTR -88[rbp]
	test	eax, eax
	je	.L25
	mov	r10, QWORD PTR 24[r12]
	lea	r14d, -1[rax]
	xor	ebx, ebx
	xor	esi, esi
	mov	r13d, 1
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rax, 1[rbx]
	cmp	r14, rbx
	je	.L25
.L55:
	movzx	esi, BYTE PTR 48[r12]
	mov	rbx, rax
.L26:
	lea	rcx, [r10+rbx]
	movsx	eax, BYTE PTR [rcx]
	cmp	al, sil
	jle	.L22
	mov	BYTE PTR 48[r12], al
	movsx	eax, BYTE PTR [rcx]
.L22:
	lea	r15d, 1[rbx]
	cmp	eax, edx
	jg	.L23
	mov	rax, QWORD PTR 8[r12]
	mov	edi, DWORD PTR [rax+rbx*4]
	call	bitreverse@PLT
	mov	r10, QWORD PTR 24[r12]
	mov	edx, DWORD PTR 32[r12]
	mov	esi, r13d
	lea	r8, [r10+rbx]
	mov	ecx, edx
	movsx	edi, BYTE PTR [r8]
	sub	ecx, edi
	sal	esi, cl
	test	esi, esi
	jle	.L23
	mov	r11, QWORD PTR 40[r12]
	xor	esi, esi
	.p2align 4,,10
	.p2align 3
.L24:
	mov	ecx, edi
	mov	edx, esi
	mov	r9d, r13d
	add	esi, 1
	sal	edx, cl
	or	edx, eax
	movsx	rdx, edx
	mov	DWORD PTR [r11+rdx*4], r15d
	mov	edx, DWORD PTR 32[r12]
	movsx	edi, BYTE PTR [r8]
	mov	ecx, edx
	sub	ecx, edi
	sal	r9d, cl
	cmp	r9d, esi
	jg	.L24
	lea	rax, 1[rbx]
	cmp	r14, rbx
	jne	.L55
	.p2align 4,,10
	.p2align 3
.L25:
	mov	ecx, 31
	mov	ebx, 4294967294
	xor	r13d, r13d
	xor	r14d, r14d
	sub	ecx, edx
	xor	r15d, r15d
	sal	rbx, cl
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L27:
	add	r15d, 1
	cmp	r15d, DWORD PTR -96[rbp]
	je	.L7
	mov	edx, DWORD PTR 32[r12]
.L33:
	mov	ecx, 32
	mov	edi, r15d
	sub	ecx, edx
	mov	rdx, QWORD PTR 40[r12]
	sal	edi, cl
	mov	QWORD PTR -80[rbp], rdx
	mov	DWORD PTR -72[rbp], edi
	call	bitreverse@PLT
	mov	rdx, QWORD PTR -80[rbp]
	mov	edi, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR [rdx+rax*4]
	test	eax, eax
	jne	.L27
	movsx	rax, DWORD PTR -88[rbp]
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L56:
	mov	rdx, QWORD PTR 8[r12]
	cmp	DWORD PTR [rdx+r14*4], edi
	jg	.L28
.L29:
	mov	rcx, r14
	add	r14, 1
	cmp	r14, rax
	jl	.L56
.L28:
	cmp	r13, rax
	jge	.L30
	mov	rsi, QWORD PTR 8[r12]
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	add	r13, 1
	cmp	r13, rax
	je	.L30
.L31:
	mov	edx, DWORD PTR [rsi+r13*4]
	and	edx, ebx
	cmp	edx, edi
	jle	.L32
.L30:
	sub	rax, r13
	mov	r14, QWORD PTR 40[r12]
	mov	QWORD PTR -80[rbp], rcx
	mov	QWORD PTR -72[rbp], rax
	call	bitreverse@PLT
	mov	rcx, QWORD PTR -80[rbp]
	mov	edi, 32767
	mov	rdx, QWORD PTR -72[rbp]
	mov	r10, rax
	mov	rax, rdi
	cmp	rcx, 32767
	cmovbe	rax, rcx
	sal	eax, 15
	cmp	rdx, 32767
	cmova	rdx, rdi
	or	eax, edx
	or	eax, -2147483648
	mov	DWORD PTR [r14+r10*4], eax
	mov	r14, rcx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L18:
	cmp	eax, 8
	jle	.L57
	mov	DWORD PTR 32[r12], 8
	mov	DWORD PTR -96[rbp], 256
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L2:
	mov	eax, DWORD PTR 16[r15]
	mov	DWORD PTR [r12], esi
	mov	DWORD PTR 4[r12], 0
	mov	DWORD PTR 60[r12], eax
	xor	eax, eax
	jmp	.L1
.L36:
	mov	DWORD PTR -88[rbp], 0
	jmp	.L15
.L35:
	xor	edi, edi
	jmp	.L12
.L54:
	mov	rdi, r12
	call	vorbis_book_clear@PLT
	or	eax, -1
	jmp	.L1
.L53:
	call	__stack_chk_fail@PLT
.L57:
	mov	r14d, 1
	mov	ecx, eax
	mov	DWORD PTR 32[r12], eax
	sal	r14d, cl
	mov	DWORD PTR -96[rbp], r14d
	jmp	.L19
	.cfi_endproc
.LFE0:
	.size	vorbis_book_init_decode, .-vorbis_book_init_decode
	.comm	sort32a,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_sharedbook.c_vorbis_book_init_decode.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	vorbis_book_init_decode
	.syntax unified
	.arm
	.fpu softvfp
	.type	vorbis_book_init_decode, %function
vorbis_book_init_decode:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #28
	mov	r6, r1
	ldr	r3, .L59
	mov	r1, #0
	mov	r2, #44
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	mov	r4, r0
	bl	memset
	ldr	r1, [r6]
	cmp	r1, #0
	ble	.L2
	mov	r5, #0
	ldr	r0, [r6, #4]
	sub	r3, r0, #4
	add	ip, r3, r1, lsl #2
.L4:
	ldr	r2, [r3, #4]!
	cmp	r2, #0
	addgt	r5, r5, #1
	cmp	ip, r3
	bne	.L4
	ldr	r3, [r6, #8]
	cmp	r5, #0
	stm	r4, {r1, r5}
	str	r3, [r4, #40]
	bne	.L54
.L7:
	mov	r0, #0
.L1:
	ldr	r3, .L59
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L55
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L54:
	mov	r2, r5
	bl	_make_words
	lsl	r3, r5, #2
	str	r3, [fp, #-56]
	add	r3, r3, #7
	str	r3, [fp, #-60]
	bic	r3, r3, #7
	sub	sp, sp, r3
	subs	r8, r0, #0
	str	sp, [fp, #-48]
	beq	.L56
	mov	r10, r8
	ldr	r3, [fp, #-48]
	sub	r9, r3, #4
	ldr	r3, [fp, #-56]
	sub	r9, r9, r8
	add	r3, r3, r8
	str	r3, [fp, #-52]
.L9:
	ldr	r0, [r10]
	bl	bitreverse
	mov	r7, r10
	ldr	r3, [fp, #-52]
	str	r0, [r10], #4
	cmp	r3, r10
	str	r7, [r9, r10]
	ldr	r7, [fp, #-48]
	bne	.L9
	ldr	r3, .L59+4
	mov	r2, #4
	mov	r1, r5
	ldr	r3, [r3]
	mov	r0, r7
	bl	qsort
	ldr	r3, [fp, #-60]
	ldr	r0, [fp, #-56]
	bic	r3, r3, #7
	sub	sp, sp, r3
	bl	_ogg_malloc
	mov	r9, sp
	mov	r3, #0
	str	r0, [r4, #8]
.L10:
	ldr	r2, [r7], #4
	sub	r2, r2, r8
	str	r3, [r9, r2]
	add	r3, r3, #1
	cmp	r5, r3
	bne	.L10
	ldr	r3, [fp, #-56]
	rsb	lr, r8, #4
	sub	ip, r3, #4
	add	ip, r8, ip
	sub	r3, r8, #4
.L11:
	add	r2, r9, r3
	ldr	r1, [r3, #4]!
	ldr	r2, [r2, lr]
	cmp	ip, r3
	str	r1, [r0, r2, lsl #2]
	bne	.L11
	mov	r0, r8
	bl	_ogg_free
	mov	r2, r9
	mov	r1, r5
	add	r3, r4, #32
	mov	r0, r6
	bl	_book_unquantize
	mov	r3, r0
	ldr	r0, [fp, #-56]
	str	r3, [r4, #36]
	bl	_ogg_malloc
	ldr	r2, [r6]
	mov	lr, r0
	cmp	r2, #0
	str	r0, [r4, #12]
	mov	r0, #0
	ble	.L12
	mov	r3, r0
	ldr	r1, [r6, #4]
	sub	r1, r1, #4
.L14:
	ldr	ip, [r1, #4]!
	cmp	ip, #0
	ldrgt	r2, [r9, r0, lsl #2]
	addgt	r0, r0, #1
	strgt	r3, [lr, r2, lsl #2]
	ldrgt	r2, [r6]
	add	r3, r3, #1
	cmp	r2, r3
	bgt	.L14
.L12:
	bl	_ogg_malloc
	ldr	r2, [r6]
	mov	r7, #0
	cmp	r2, #0
	str	r0, [r4, #16]
	ble	.L15
	mov	r3, r7
.L17:
	ldr	r1, [r6, #4]
	ldr	r1, [r1, r3, lsl #2]
	add	r3, r3, #1
	cmp	r1, #0
	ldrgt	r2, [r9, r7, lsl #2]
	ldrgt	r0, [r4, #16]
	addgt	r7, r7, #1
	strbgt	r1, [r0, r2]
	ldrgt	r2, [r6]
	cmp	r2, r3
	bgt	.L17
.L15:
	ldr	r0, [r4, #4]
	bl	_ilog
	sub	r0, r0, #4
	cmp	r0, #4
	bgt	.L18
	mov	r3, #5
	mov	r2, #32
	str	r3, [r4, #20]
	str	r2, [fp, #-52]
.L19:
	mov	r1, #4
	ldr	r0, [fp, #-52]
	bl	_ogg_calloc
	mov	r2, #0
	cmp	r7, r2
	str	r0, [r4, #24]
	strb	r2, [r4, #28]
	beq	.L21
	mov	r10, #1
	mov	r6, r2
	ldr	r5, [r4, #20]
	ldr	ip, [r4, #16]
	b	.L26
.L23:
	cmp	r7, r6
	beq	.L25
.L57:
	ldrb	r2, [r4, #28]	@ zero_extendqisi2
.L26:
	ldrb	r3, [ip, r6]	@ zero_extendqisi2
	mov	r8, r6
	cmp	r3, r2
	strbhi	r3, [r4, #28]
	ldrbhi	r3, [ip, r6]	@ zero_extendqisi2
	add	r6, r6, #1
	cmp	r3, r5
	bgt	.L23
	ldr	r3, [r4, #8]
	add	r3, r3, r6, lsl #2
	ldr	r0, [r3, #-4]
	bl	bitreverse
	ldr	ip, [r4, #16]
	ldr	r5, [r4, #20]
	ldrb	r3, [ip, r8]	@ zero_extendqisi2
	add	r8, ip, r8
	sub	r2, r5, r3
	lsl	r2, r10, r2
	cmp	r2, #0
	ble	.L23
	mov	r2, #0
	ldr	lr, [r4, #24]
.L24:
	orr	r3, r0, r2, lsl r3
	str	r6, [lr, r3, lsl #2]
	ldr	r5, [r4, #20]
	ldrb	r3, [r8]	@ zero_extendqisi2
	add	r2, r2, #1
	sub	r1, r5, r3
	cmp	r2, r10, lsl r1
	blt	.L24
	cmp	r7, r6
	bne	.L57
.L25:
	mov	r9, #0
	mvn	r8, #1
	rsb	r1, r5, #31
	mov	r6, r9
	mov	r10, r9
	lsl	r8, r8, r1
	b	.L33
.L27:
	ldr	r3, [fp, #-52]
	add	r10, r10, #1
	cmp	r10, r3
	beq	.L7
	ldr	r5, [r4, #20]
.L33:
	rsb	r5, r5, #32
	ldr	r1, [r4, #24]
	lsl	r5, r10, r5
	mov	r0, r5
	str	r1, [fp, #-48]
	bl	bitreverse
	ldr	r1, [fp, #-48]
	ldr	r1, [r1, r0, lsl #2]
	cmp	r1, #0
	bne	.L27
	mov	r1, r6
	add	r6, r6, #1
	cmp	r6, r7
	bge	.L28
.L58:
	ldr	r0, [r4, #8]
	ldr	r0, [r0, r6, lsl #2]
	cmp	r0, r5
	bgt	.L28
	mov	r1, r6
	add	r6, r6, #1
	cmp	r6, r7
	blt	.L58
.L28:
	cmp	r9, r7
	bge	.L30
	ldr	ip, [r4, #8]
	sub	r0, r9, #-1073741823
	add	ip, ip, r0, lsl #2
	b	.L31
.L32:
	add	r9, r9, #1
	cmp	r9, r7
	beq	.L30
.L31:
	ldr	r0, [ip, #4]!
	and	r0, r0, r8
	cmp	r0, r5
	ble	.L32
.L30:
	mov	r0, r5
	str	r1, [fp, #-48]
	ldr	r5, [r4, #24]
	bl	bitreverse
	ldr	r3, .L59+8
	ldr	r1, [fp, #-48]
	sub	r6, r7, r9
	cmp	r1, r3
	movcc	lr, r1
	movcs	lr, r3
	cmp	r6, r3
	mov	ip, r6
	movcs	ip, r3
	orr	ip, ip, lr, lsl #15
	orr	ip, ip, #-2147483648
	mov	r6, r1
	str	ip, [r5, r0, lsl #2]
	b	.L27
.L18:
	cmp	r0, #8
	movle	r9, #1
	movgt	r3, #8
	movgt	r2, #256
	lslle	r3, r9, r0
	strle	r0, [r4, #20]
	strle	r3, [fp, #-52]
	strgt	r2, [fp, #-52]
	strgt	r3, [r4, #20]
	b	.L19
.L2:
	mov	r0, #0
	ldr	r3, [r6, #8]
	str	r1, [r4]
	str	r3, [r4, #40]
	str	r0, [r4, #4]
	b	.L1
.L21:
	ldr	r5, [r4, #20]
	b	.L25
.L56:
	mov	r0, r4
	bl	vorbis_book_clear
	mvn	r0, #0
	b	.L1
.L55:
	bl	__stack_chk_fail
.L60:
	.align	2
.L59:
	.word	.LC0
	.word	sort32a
	.word	32767
	.size	vorbis_book_init_decode, .-vorbis_book_init_decode
	.comm	sort32a,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
