	.file	"extr_flacenc.c_remove_wasted_bits.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	remove_wasted_bits, @function
remove_wasted_bits:
.LFB0:
	.cfi_startproc
	endbr64
	mov	edx, DWORD PTR [rdi]
	test	edx, edx
	jle	.L17
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdx, QWORD PTR 16[rbp]
	mov	ecx, DWORD PTR 8[rbp]
	lea	rax, [rbx+rbx*2]
	lea	r12, [rdx+rax*8]
	test	ecx, ecx
	jle	.L4
	mov	rdx, QWORD PTR [r12]
	mov	edi, DWORD PTR [rdx]
	test	dil, 1
	jne	.L4
	sub	ecx, 1
	lea	rax, 4[rdx]
	lea	rdx, 4[rdx+rcx*4]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	or	edi, DWORD PTR [rax]
	add	rax, 4
	test	dil, 1
	jne	.L4
.L6:
	cmp	rax, rdx
	jne	.L7
	test	edi, edi
	jne	.L21
.L4:
	add	rbx, 1
	cmp	DWORD PTR 0[rbp], ebx
	jg	.L10
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	test	dil, 1
	jne	.L4
	call	ff_ctz@PLT
	mov	ecx, eax
	mov	eax, DWORD PTR 8[rbp]
	test	eax, eax
	jle	.L8
	mov	rsi, QWORD PTR [r12]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L9:
	sar	DWORD PTR [rsi+rdx*4], cl
	add	rdx, 1
	cmp	DWORD PTR 8[rbp], edx
	jg	.L9
.L8:
	mov	eax, DWORD PTR 12[r12]
	mov	DWORD PTR 8[r12], ecx
	sub	eax, ecx
	mov	DWORD PTR 12[r12], eax
	cmp	eax, 17
	jg	.L4
	mov	eax, DWORD PTR CODING_MODE_RICE[rip]
	mov	DWORD PTR 16[r12], eax
	jmp	.L4
.L17:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE0:
	.size	remove_wasted_bits, .-remove_wasted_bits
	.comm	CODING_MODE_RICE,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_flacenc.c_remove_wasted_bits.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	remove_wasted_bits, %function
remove_wasted_bits:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	lr, [r0]
	cmp	lr, #0
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r6, r0
	mov	r4, #0
	ldr	ip, [r0, #4]
	ldr	r9, .L21
.L10:
	ldr	r5, [r6, #8]
	cmp	ip, #0
	add	r7, r5, r4, lsl #4
	lsl	r8, r4, #4
	ble	.L4
	ldr	r2, [r5, r4, lsl #4]
	ldr	r0, [r2]
	ands	r3, r0, #1
	beq	.L6
	b	.L4
.L7:
	ldr	r1, [r2, #4]!
	orr	r0, r0, r1
	tst	r0, #1
	bne	.L4
.L6:
	add	r3, r3, #1
	cmp	r3, ip
	bne	.L7
	cmp	r0, #0
	bne	.L20
.L4:
	add	r4, r4, #1
	cmp	lr, r4
	bgt	.L10
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	bl	ff_ctz
	ldr	ip, [r6, #4]
	mov	r1, #0
	cmp	ip, #0
	ble	.L8
	ldr	r2, [r5, r8]
	sub	r2, r2, #4
.L9:
	ldr	r3, [r2, #4]!
	add	r1, r1, #1
	asr	r3, r3, r0
	str	r3, [r2]
	ldr	ip, [r6, #4]
	cmp	ip, r1
	bgt	.L9
.L8:
	ldr	r3, [r7, #8]
	str	r0, [r7, #4]
	sub	r0, r3, r0
	cmp	r0, #17
	ldrle	r3, [r9]
	ldrle	lr, [r6]
	ldrgt	lr, [r6]
	str	r0, [r7, #8]
	strle	r3, [r7, #12]
	b	.L4
.L22:
	.align	2
.L21:
	.word	CODING_MODE_RICE
	.size	remove_wasted_bits, .-remove_wasted_bits
	.comm	CODING_MODE_RICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
