	.file	"extr_bitwise.c_oggpackB_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	oggpackB_write
	.type	oggpackB_write, @function
oggpackB_write:
.LFB0:
	.cfi_startproc
	endbr64
	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
	cmp	edx, 32
	ja	.L2
	mov	r12, rsi
	mov	esi, DWORD PTR 4[rdi]
	mov	r8d, DWORD PTR [rdi]
	mov	ebx, edx
	mov	rdi, QWORD PTR 8[rdi]
	lea	eax, -4[rsi]
	cmp	r8d, eax
	jl	.L3
	test	rdi, rdi
	je	.L1
	mov	edx, DWORD PTR BUFFER_INCREMENT[rip]
	mov	eax, DWORD PTR LONG_MAX[rip]
	sub	eax, edx
	cmp	esi, eax
	jle	.L17
.L2:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	oggpack_writeclear@PLT
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	rdi, QWORD PTR 16[rbp]
	add	esi, edx
	call	_ogg_realloc@PLT
	test	rax, rax
	je	.L2
	mov	edx, DWORD PTR BUFFER_INCREMENT[rip]
	add	DWORD PTR 4[rbp], edx
	movsx	rdx, DWORD PTR 0[rbp]
	mov	QWORD PTR 16[rbp], rax
	lea	rdi, [rax+rdx*8]
	mov	r8, rdx
	mov	QWORD PTR 8[rbp], rdi
.L3:
	mov	rax, QWORD PTR mask[rip]
	movsx	rdx, ebx
	mov	ecx, 32
	sub	ecx, ebx
	mov	rsi, QWORD PTR [rax+rdx*8]
	mov	eax, DWORD PTR 24[rbp]
	and	rsi, r12
	add	ebx, eax
	sal	rsi, cl
	lea	ecx, 24[rax]
	mov	rdx, rsi
	shr	rdx, cl
	or	QWORD PTR [rdi], rdx
	cmp	ebx, 7
	jle	.L6
	lea	ecx, 16[rax]
	mov	rdx, rsi
	shr	rdx, cl
	and	edx, 255
	mov	QWORD PTR 8[rdi], rdx
	cmp	ebx, 15
	jle	.L6
	lea	ecx, 8[rax]
	mov	rdx, rsi
	shr	rdx, cl
	and	edx, 255
	mov	QWORD PTR 16[rdi], rdx
	cmp	ebx, 23
	jle	.L6
	mov	rdx, rsi
	mov	ecx, eax
	shr	rdx, cl
	and	edx, 255
	mov	QWORD PTR 24[rdi], rdx
	cmp	ebx, 31
	jle	.L6
	test	eax, eax
	je	.L8
	mov	ecx, 8
	sub	ecx, eax
	sal	rsi, cl
	movzx	eax, sil
	mov	QWORD PTR 32[rdi], rax
	.p2align 4,,10
	.p2align 3
.L6:
	test	ebx, ebx
	lea	eax, 7[rbx]
	cmovns	eax, ebx
	and	ebx, 7
	mov	DWORD PTR 24[rbp], ebx
	sar	eax, 3
	lea	ecx, [rax+r8]
	cdqe
	lea	rax, [rdi+rax*8]
	mov	DWORD PTR 0[rbp], ecx
	mov	QWORD PTR 8[rbp], rax
.L1:
	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
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	QWORD PTR 32[rdi], 0
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	oggpackB_write, .-oggpackB_write
	.comm	mask,8,8
	.comm	LONG_MAX,4,4
	.comm	BUFFER_INCREMENT,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_bitwise.c_oggpackB_write.c"
	.text
	.align	2
	.global	oggpackB_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	oggpackB_write, %function
oggpackB_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r2, #32
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	bhi	.L2
	mov	r4, r2
	ldr	r2, [r0, #4]
	ldr	ip, [r0]
	sub	r3, r2, #4
	cmp	ip, r3
	mov	r6, r1
	ldr	r3, [r0, #8]
	blt	.L3
	cmp	r3, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r7, .L18
	ldr	r3, .L18+4
	ldr	r1, [r7]
	ldr	r3, [r3]
	sub	r3, r3, r1
	cmp	r2, r3
	ble	.L17
.L2:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	oggpack_writeclear
.L17:
	ldr	r0, [r0, #12]
	add	r1, r2, r1
	bl	_ogg_realloc
	cmp	r0, #0
	beq	.L2
	ldr	r3, [r7]
	ldr	r2, [r5, #4]
	ldr	ip, [r5]
	add	r2, r2, r3
	add	r3, r0, ip, lsl #2
	stmib	r5, {r2, r3}
	str	r0, [r5, #12]
.L3:
	ldr	r1, .L18+8
	ldr	r2, [r5, #16]
	ldr	r1, [r1]
	rsb	lr, r4, #32
	ldr	r1, [r1, r4, lsl #2]
	ldr	r0, [r3]
	and	r1, r1, r6
	lsl	r1, r1, lr
	add	r4, r2, r4
	add	lr, r2, #24
	orr	r0, r0, r1, lsr lr
	cmp	r4, #7
	str	r0, [r3]
	ble	.L6
	add	r0, r2, #16
	lsr	r0, r1, r0
	and	r0, r0, #255
	cmp	r4, #15
	str	r0, [r3, #4]
	ble	.L6
	add	r0, r2, #8
	lsr	r0, r1, r0
	and	r0, r0, #255
	cmp	r4, #23
	str	r0, [r3, #8]
	ble	.L6
	lsr	r0, r1, r2
	and	r0, r0, #255
	cmp	r4, #31
	str	r0, [r3, #12]
	ble	.L6
	cmp	r2, #0
	rsbne	r0, r2, #8
	lslne	r0, r1, r0
	andne	r0, r0, #255
	strne	r0, [r3, #16]
	streq	r2, [r3, #16]
.L6:
	cmp	r4, #0
	add	r1, r4, #7
	movge	r1, r4
	asr	r2, r1, #3
	add	r3, r3, r2, lsl #2
	add	r1, ip, r1, asr #3
	and	r4, r4, #7
	str	r3, [r5, #8]
	str	r1, [r5]
	str	r4, [r5, #16]
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	.align	2
.L18:
	.word	BUFFER_INCREMENT
	.word	LONG_MAX
	.word	mask
	.size	oggpackB_write, .-oggpackB_write
	.comm	mask,4,4
	.comm	LONG_MAX,4,4
	.comm	BUFFER_INCREMENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
