	.file	"86779.c"
	.intel_syntax noprefix
	.text
	.data
	.align 32
	.type	sccsid, @object
	.size	sccsid, 38
sccsid:
	.string	"@(#)malloc.c\t1.2 (Lucasfilm) 84/10/17"
	.local	nextf
	.comm	nextf,240,32
	.text
	.globl	malloc
	.type	malloc, @function
malloc:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	eax, edi
	mov	ebx, 0
	add	eax, 8
	add	eax, 3
	and	eax, -4
	sub	eax, 1
	shr	eax, 2
	mov	r12d, eax
	jmp	.L2
.L3:
	add	ebx, 1
.L2:
	shr	r12d
	test	r12d, r12d
	jne	.L3
	movsx	rax, ebx
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	jne	.L4
	mov	edi, ebx
	call	morecore
.L4:
	movsx	rax, ebx
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	r12, QWORD PTR [rdx+rax]
	test	r12, r12
	jne	.L5
	mov	eax, 0
	jmp	.L6
.L5:
	movsx	rax, ebx
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	rax, QWORD PTR [rax]
	movsx	rdx, ebx
	lea	rcx, 0[0+rdx*8]
	lea	rdx, nextf[rip]
	mov	QWORD PTR [rcx+rdx], rax
	mov	BYTE PTR [r12], -1
	mov	eax, ebx
	mov	BYTE PTR 1[r12], al
	lea	rax, 8[r12]
.L6:
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	malloc, .-malloc
	.type	morecore, @function
morecore:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 8
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	r12d, edi
	movsx	rax, r12d
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	jne	.L16
	mov	edi, 0
	call	sbrk@PLT
	mov	rbx, rax
	mov	rax, rbx
	and	eax, 1023
	test	eax, eax
	je	.L10
	mov	rax, rbx
	and	eax, 1023
	mov	edx, eax
	mov	eax, 1024
	sub	eax, edx
	mov	edi, eax
	call	sbrk@PLT
.L10:
	mov	eax, 10
	cmp	r12d, 10
	cmovge	eax, r12d
	lea	ebx, 3[rax]
	lea	edx, 3[r12]
	mov	eax, ebx
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	r13d, edx
	cmp	ebx, r12d
	jge	.L11
	mov	ebx, r12d
.L11:
	mov	eax, 1
	mov	ecx, ebx
	sal	eax, cl
	mov	edi, eax
	call	sbrk@PLT
	mov	rbx, rax
	mov	rax, rbx
	cmp	eax, -1
	je	.L17
	mov	rax, rbx
	and	eax, 7
	test	eax, eax
	je	.L13
	mov	rax, rbx
	add	eax, 8
	and	eax, -8
	cdqe
	mov	rbx, rax
	sub	r13d, 1
.L13:
	movsx	rax, r12d
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	QWORD PTR [rdx+rax], rbx
	lea	eax, 3[r12]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	r12d, edx
	jmp	.L14
.L15:
	movsx	rax, r12d
	add	rax, rbx
	mov	QWORD PTR [rbx], rax
	movsx	rax, r12d
	add	rbx, rax
.L14:
	sub	r13d, 1
	test	r13d, r13d
	jg	.L15
	jmp	.L7
.L16:
	nop
	jmp	.L7
.L17:
	nop
.L7:
	add	rsp, 8
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	morecore, .-morecore
	.globl	free
	.type	free, @function
free:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	QWORD PTR -24[rbp], rdi
	cmp	QWORD PTR -24[rbp], 0
	je	.L22
	mov	rax, QWORD PTR -24[rbp]
	lea	rbx, -8[rax]
	movzx	eax, BYTE PTR [rbx]
	cmp	al, -1
	jne	.L23
	movzx	eax, BYTE PTR 1[rbx]
	movzx	r12d, al
	movsx	rax, r12d
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	QWORD PTR [rbx], rax
	movsx	rax, r12d
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	QWORD PTR [rdx+rax], rbx
	jmp	.L18
.L22:
	nop
	jmp	.L18
.L23:
	nop
.L18:
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	free, .-free
	.globl	realloc_srchlen
	.data
	.align 4
	.type	realloc_srchlen, @object
	.size	realloc_srchlen, 4
realloc_srchlen:
	.long	4
	.text
	.globl	realloc
	.type	realloc, @function
realloc:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	DWORD PTR -36[rbp], 0
	cmp	QWORD PTR -56[rbp], 0
	jne	.L25
	mov	eax, DWORD PTR -60[rbp]
	mov	edi, eax
	call	malloc
	jmp	.L26
.L25:
	mov	rax, QWORD PTR -56[rbp]
	sub	rax, 8
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	jne	.L27
	add	DWORD PTR -36[rbp], 1
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR 1[rax]
	movzx	ebx, al
	jmp	.L28
.L27:
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	findbucket
	mov	ebx, eax
	test	ebx, ebx
	jns	.L28
	mov	edx, DWORD PTR realloc_srchlen[rip]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	findbucket
	mov	ebx, eax
	test	ebx, ebx
	jns	.L28
	mov	ebx, 0
.L28:
	lea	eax, 3[rbx]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	lea	ebx, -8[rax]
	cmp	DWORD PTR -36[rbp], 0
	je	.L29
	cmp	DWORD PTR -60[rbp], ebx
	ja	.L29
	mov	eax, DWORD PTR -60[rbp]
	mov	edx, ebx
	shr	edx
	mov	edx, edx
	sub	rdx, 8
	cmp	rax, rdx
	jbe	.L29
	mov	rax, QWORD PTR -56[rbp]
	jmp	.L26
.L29:
	mov	eax, DWORD PTR -60[rbp]
	mov	edi, eax
	call	malloc
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L30
	mov	eax, 0
	jmp	.L26
.L30:
	mov	rax, QWORD PTR -56[rbp]
	cmp	rax, QWORD PTR -24[rbp]
	je	.L31
	mov	eax, DWORD PTR -60[rbp]
	cmp	ebx, eax
	cmovbe	eax, ebx
	mov	edx, eax
	mov	rcx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memmove@PLT
.L31:
	cmp	DWORD PTR -36[rbp], 0
	je	.L32
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	free
.L32:
	mov	rax, QWORD PTR -24[rbp]
.L26:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	realloc, .-realloc
	.type	findbucket, @function
findbucket:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	QWORD PTR -32[rbp], rdi
	mov	DWORD PTR -36[rbp], esi
	mov	r12d, 0
	jmp	.L34
.L40:
	mov	r13d, 0
	movsx	rax, r12d
	lea	rdx, 0[0+rax*8]
	lea	rax, nextf[rip]
	mov	rbx, QWORD PTR [rdx+rax]
	jmp	.L35
.L39:
	cmp	rbx, QWORD PTR -32[rbp]
	jne	.L36
	mov	eax, r12d
	jmp	.L37
.L36:
	add	r13d, 1
	mov	rbx, QWORD PTR [rbx]
.L35:
	test	rbx, rbx
	je	.L38
	cmp	r13d, DWORD PTR -36[rbp]
	jne	.L39
.L38:
	add	r12d, 1
.L34:
	cmp	r12d, 29
	jle	.L40
	mov	eax, -1
.L37:
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	findbucket, .-findbucket
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"86779.c"
	.text
	.data
	.align	2
	.type	sccsid, %object
	.size	sccsid, 38
sccsid:
	.ascii	"@(#)malloc.c\0111.2 (Lucasfilm) 84/10/17\000"
	.local	nextf
	.comm	nextf,120,4
	.text
	.align	2
	.global	malloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	malloc, %function
malloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	mov	r3, r0
	mov	r4, #0
	add	r3, r3, #4
	add	r3, r3, #3
	bic	r3, r3, #3
	sub	r3, r3, #1
	lsr	r5, r3, #2
	b	.L2
.L3:
	add	r4, r4, #1
.L2:
	lsr	r5, r5, #1
	cmp	r5, #0
	bne	.L3
	ldr	r3, .L7
	ldr	r3, [r3, r4, lsl #2]
	cmp	r3, #0
	bne	.L4
	mov	r0, r4
	bl	morecore
.L4:
	ldr	r3, .L7
	ldr	r5, [r3, r4, lsl #2]
	cmp	r5, #0
	bne	.L5
	mov	r3, #0
	b	.L6
.L5:
	ldr	r3, .L7
	ldr	r3, [r3, r4, lsl #2]
	ldr	r3, [r3]
	ldr	r2, .L7
	str	r3, [r2, r4, lsl #2]
	mvn	r3, #0
	strb	r3, [r5]
	and	r3, r4, #255
	strb	r3, [r5, #1]
	add	r3, r5, #4
.L6:
	mov	r0, r3
	pop	{r4, r5, fp, pc}
.L8:
	.align	2
.L7:
	.word	nextf
	.size	malloc, .-malloc
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	morecore, %function
morecore:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	mov	r5, r0
	ldr	r3, .L21
	ldr	r3, [r3, r5, lsl #2]
	cmp	r3, #0
	bne	.L18
	mov	r0, #0
	bl	sbrk
	mov	r4, r0
	mov	r3, r4
	lsl	r3, r3, #22
	lsr	r3, r3, #22
	cmp	r3, #0
	beq	.L12
	mov	r3, r4
	lsl	r3, r3, #22
	lsr	r3, r3, #22
	rsb	r3, r3, #1024
	mov	r0, r3
	bl	sbrk
.L12:
	cmp	r5, #10
	movge	r3, r5
	movlt	r3, #10
	add	r4, r3, #3
	add	r3, r5, #3
	sub	r3, r4, r3
	mov	r2, #1
	lsl	r6, r2, r3
	cmp	r4, r5
	bge	.L13
	mov	r4, r5
.L13:
	mov	r3, #1
	lsl	r3, r3, r4
	mov	r0, r3
	bl	sbrk
	mov	r4, r0
	cmn	r4, #1
	beq	.L19
	mov	r3, r4
	and	r3, r3, #7
	cmp	r3, #0
	beq	.L15
	mov	r3, r4
	add	r3, r3, #8
	bic	r3, r3, #7
	mov	r4, r3
	sub	r6, r6, #1
.L15:
	ldr	r3, .L21
	str	r4, [r3, r5, lsl #2]
	add	r3, r5, #3
	mov	r2, #1
	lsl	r5, r2, r3
	b	.L16
.L17:
	mov	r3, r5
	add	r3, r4, r3
	str	r3, [r4]
	mov	r3, r5
	add	r4, r4, r3
.L16:
	sub	r6, r6, #1
	cmp	r6, #0
	pople	{r4, r5, r6, r7, fp, pc}
	b	.L17
.L18:
	nop
	pop	{r4, r5, r6, r7, fp, pc}
.L19:
	nop
	pop	{r4, r5, r6, r7, fp, pc}
.L22:
	.align	2
.L21:
	.word	nextf
	.size	morecore, .-morecore
	.align	2
	.global	free
	.syntax unified
	.arm
	.fpu softvfp
	.type	free, %function
free:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	push	{r4, r5, fp}
	add	fp, sp, #8
	sub	sp, sp, #12
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L27
	ldr	r3, [fp, #-16]
	sub	r4, r3, #4
	ldrb	r3, [r4]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L28
	ldrb	r3, [r4, #1]	@ zero_extendqisi2
	mov	r5, r3
	ldr	r3, .L29
	ldr	r3, [r3, r5, lsl #2]
	str	r3, [r4]
	ldr	r3, .L29
	str	r4, [r3, r5, lsl #2]
	b	.L23
.L27:
	nop
	b	.L23
.L28:
	nop
.L23:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, r5, fp}
	bx	lr
.L30:
	.align	2
.L29:
	.word	nextf
	.size	free, .-free
	.global	realloc_srchlen
	.data
	.align	2
	.type	realloc_srchlen, %object
	.size	realloc_srchlen, 4
realloc_srchlen:
	.word	4
	.text
	.align	2
	.global	realloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	realloc, %function
realloc:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L32
	ldr	r0, [fp, #-36]
	bl	malloc
	mov	r3, r0
	b	.L33
.L32:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #4
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L34
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	mov	r4, r3
	b	.L35
.L34:
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	findbucket
	mov	r4, r0
	cmp	r4, #0
	bge	.L35
	ldr	r3, .L40
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	findbucket
	mov	r4, r0
	cmp	r4, #0
	bge	.L35
	mov	r4, #0
.L35:
	add	r3, r4, #3
	mov	r2, #1
	lsl	r3, r2, r3
	sub	r4, r3, #4
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L36
	ldr	r3, [fp, #-36]
	cmp	r3, r4
	bhi	.L36
	lsr	r3, r4, #1
	sub	r3, r3, #4
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	bls	.L36
	ldr	r3, [fp, #-32]
	b	.L33
.L36:
	ldr	r0, [fp, #-36]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L37
	mov	r3, #0
	b	.L33
.L37:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L38
	ldr	r3, [fp, #-36]
	cmp	r4, r3
	movcc	r3, r4
	movcs	r3, r3
	mov	r2, r3
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-16]
	bl	memmove
.L38:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L39
	ldr	r0, [fp, #-32]
	bl	free
.L39:
	ldr	r3, [fp, #-16]
.L33:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L41:
	.align	2
.L40:
	.word	realloc_srchlen
	.size	realloc, .-realloc
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	findbucket, %function
findbucket:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	push	{r4, r5, r6, fp}
	add	fp, sp, #12
	sub	sp, sp, #8
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r5, #0
	b	.L43
.L49:
	mov	r6, #0
	ldr	r3, .L50
	ldr	r4, [r3, r5, lsl #2]
	b	.L44
.L48:
	ldr	r3, [fp, #-16]
	cmp	r4, r3
	bne	.L45
	mov	r3, r5
	b	.L46
.L45:
	add	r6, r6, #1
	ldr	r4, [r4]
.L44:
	cmp	r4, #0
	beq	.L47
	ldr	r3, [fp, #-20]
	cmp	r6, r3
	bne	.L48
.L47:
	add	r5, r5, #1
.L43:
	cmp	r5, #29
	ble	.L49
	mvn	r3, #0
.L46:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, r6, fp}
	bx	lr
.L51:
	.align	2
.L50:
	.word	nextf
	.size	findbucket, .-findbucket
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
