	.file	"extr_hash_buf.c_newbuf.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	newbuf, @function
newbuf:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r12, QWORD PTR LRU[rip]
	mov	DWORD PTR 12[rsp], esi
	cmp	QWORD PTR 40[rdi], r12
	je	.L62
.L2:
	mov	rax, QWORD PTR 0[rbp]
	test	rax, rax
	jne	.L6
	test	r13, r13
	je	.L3
	mov	rax, QWORD PTR 24[r12]
	test	rax, rax
	je	.L4
	cmp	r13, rax
	je	.L63
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR 24[rax]
	test	rax, rax
	je	.L4
	cmp	r13, rax
	jne	.L5
.L63:
	mov	QWORD PTR 0[rbp], 1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, 32
	mov	edi, 1
	call	calloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L59
	mov	esi, DWORD PTR 8[rbp]
	mov	edi, 1
	call	calloc@PLT
	mov	QWORD PTR 8[r12], rax
	test	rax, rax
	je	.L64
	mov	rax, QWORD PTR 0[rbp]
	test	rax, rax
	je	.L12
	sub	rax, 1
	mov	QWORD PTR 0[rbp], rax
.L12:
	mov	QWORD PTR 24[r12], 0
	mov	eax, DWORD PTR 12[rsp]
	mov	DWORD PTR 16[r12], eax
	test	r13, r13
	je	.L26
	mov	QWORD PTR 24[r13], r12
	mov	DWORD PTR [r12], 0
.L27:
	mov	rdi, r12
	call	MRU_INSERT@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
.L3:
	.cfi_restore_state
	test	rax, rax
	jne	.L6
.L4:
	mov	eax, DWORD PTR [r12]
	test	DWORD PTR BUF_PIN[rip], eax
	jne	.L6
	cmp	QWORD PTR 40[rbp], r12
	je	.L6
	mov	rdi, r12
	call	BUF_REMOVE@PLT
	mov	eax, DWORD PTR 16[r12]
	mov	edi, DWORD PTR [r12]
	test	eax, eax
	jne	.L14
	test	DWORD PTR BUF_BUCKET[rip], edi
	je	.L12
.L14:
	mov	rax, QWORD PTR 8[r12]
	mov	r14d, DWORD PTR [rax]
	test	r14d, r14d
	je	.L15
	movsx	r9, r14d
	mov	r14d, DWORD PTR -4[rax+r9*4]
.L15:
	test	DWORD PTR BUF_MOD[rip], edi
	je	.L16
	call	IS_BUCKET@PLT
	mov	edx, DWORD PTR 16[r12]
	xor	r8d, r8d
	mov	rdi, rbp
	mov	rsi, QWORD PTR 8[r12]
	mov	rcx, rax
	call	__put_page@PLT
	test	rax, rax
	jne	.L59
	mov	edi, DWORD PTR [r12]
.L16:
	call	IS_BUCKET@PLT
	test	rax, rax
	je	.L18
	mov	esi, DWORD PTR 16[r12]
	mov	rcx, QWORD PTR 16[rbp]
	mov	eax, DWORD PTR 12[rbp]
	mov	edx, esi
	sar	edx, cl
	mov	rcx, QWORD PTR 32[rbp]
	sub	eax, 1
	movsx	rdx, edx
	and	eax, esi
	cmp	QWORD PTR 24[rbp], 0
	mov	rdx, QWORD PTR [rcx+rdx*8]
	cdqe
	lea	rbx, [rdx+rax*8]
	je	.L19
	mov	eax, DWORD PTR [r12]
	test	DWORD PTR BUF_MOD[rip], eax
	je	.L20
.L21:
	mov	rax, QWORD PTR BUF_DISK[rip]
	mov	QWORD PTR [rbx], rax
.L18:
	mov	rbx, QWORD PTR 24[r12]
	mov	rdx, r12
	test	rbx, rbx
	jne	.L22
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L65:
	cmp	DWORD PTR 16[rbx], r14d
	jne	.L12
	mov	rsi, QWORD PTR 8[rbx]
	mov	r15d, r14d
	movsx	rax, DWORD PTR [rsi]
	test	eax, eax
	je	.L23
	mov	r15d, DWORD PTR -4[rsi+rax*4]
.L23:
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR BUF_MOD[rip], eax
	je	.L25
	xor	r8d, r8d
	xor	ecx, ecx
	mov	edx, r14d
	mov	rdi, rbp
	call	__put_page@PLT
	test	rax, rax
	jne	.L59
.L25:
	mov	DWORD PTR 16[rbx], 0
	mov	rdi, rbx
	mov	DWORD PTR [rbx], 0
	call	BUF_REMOVE@PLT
	mov	rdi, rbx
	call	LRU_INSERT@PLT
	mov	rax, QWORD PTR 24[rbx]
	mov	rdx, rbx
	test	rax, rax
	je	.L12
	mov	r14d, r15d
	mov	rbx, rax
.L22:
	mov	QWORD PTR 24[rdx], 0
	mov	edi, DWORD PTR [rbx]
	call	IS_BUCKET@PLT
	test	rax, rax
	je	.L65
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L26:
	mov	eax, DWORD PTR BUF_BUCKET[rip]
	mov	DWORD PTR [r12], eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L64:
	mov	rdi, r12
	call	free@PLT
	.p2align 4,,10
	.p2align 3
.L59:
	xor	r12d, r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L62:
	mov	rdi, r12
	call	BUF_REMOVE@PLT
	mov	rdi, r12
	call	MRU_INSERT@PLT
	mov	r12, QWORD PTR LRU[rip]
	jmp	.L2
.L20:
	mov	rdi, QWORD PTR [rbx]
	call	ISDISK@PLT
	test	rax, rax
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	mov	QWORD PTR [rbx], 0
	jmp	.L18
	.cfi_endproc
.LFE0:
	.size	newbuf, .-newbuf
	.comm	stderr,4,4
	.comm	LRU,8,8
	.comm	BUF_PIN,4,4
	.comm	BUF_MOD,4,4
	.comm	BUF_DISK,8,8
	.comm	BUF_BUCKET,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_hash_buf.c_newbuf.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	newbuf, %function
newbuf:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r5, .L61
	ldr	r3, [r0, #24]
	ldr	r4, [r5]
	sub	sp, sp, #20
	cmp	r3, r4
	mov	r7, r0
	mov	r6, r2
	str	r1, [sp, #12]
	beq	.L56
.L2:
	ldr	r5, [r7]
	subs	r3, r6, #0
	movne	r3, #1
	cmp	r5, #0
	movne	r3, #0
	cmp	r3, #0
	bne	.L57
	cmp	r5, #0
	bne	.L6
.L4:
	ldr	r3, .L61+4
	ldr	r2, [r4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L58
.L6:
	mov	r1, #16
	mov	r0, #1
	bl	calloc
	subs	r4, r0, #0
	beq	.L17
	mov	r0, #1
	ldr	r1, [r7, #4]
	bl	calloc
	cmp	r0, #0
	mov	r8, r0
	str	r0, [r4, #4]
	beq	.L59
	cmp	r5, #0
	subne	r5, r5, #1
	strne	r5, [r7]
.L12:
	mov	r3, #0
	cmp	r6, r3
	str	r3, [r4, #12]
	ldreq	r3, .L61+8
	ldr	r2, [sp, #12]
	ldreq	r3, [r3]
	str	r2, [r4, #8]
	mov	r0, r4
	strne	r4, [r6, #12]
	str	r3, [r4]
	bl	MRU_INSERT
.L1:
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L58:
	ldr	r3, [r7, #24]
	cmp	r3, r4
	beq	.L6
	mov	r0, r4
	bl	BUF_REMOVE
	ldr	r5, [r4, #8]
	cmp	r5, #0
	beq	.L13
	ldr	r0, [r4]
.L14:
	ldr	r8, [r4, #4]
	ldr	fp, .L61+12
	ldr	r9, [r8]
	ldr	r3, [fp]
	cmp	r9, #0
	subne	r9, r9, #-1073741823
	ldrne	r9, [r8, r9, lsl #2]
	tst	r0, r3
	beq	.L16
	bl	IS_BUCKET
	mov	ip, #0
	mov	r3, r0
	mov	r2, r5
	mov	r1, r8
	mov	r0, r7
	str	ip, [sp]
	bl	__put_page
	cmp	r0, #0
	bne	.L17
	ldr	r0, [r4]
.L16:
	bl	IS_BUCKET
	cmp	r0, #0
	beq	.L18
	ldr	r2, [r4, #8]
	ldr	r3, [r7, #12]
	ldr	r5, [r7, #8]
	ldr	r0, [r7, #16]
	ldr	r1, [r7, #20]
	asr	r3, r2, r3
	sub	r5, r5, #1
	cmp	r0, #0
	ldr	r8, [r1, r3, lsl #2]
	and	r5, r5, r2
	beq	.L19
	ldr	r2, [r4]
	ldr	r3, [fp]
	tst	r2, r3
	beq	.L20
.L21:
	ldr	r3, .L61+16
	ldr	r3, [r3]
	str	r3, [r8, r5, lsl #2]
.L18:
	ldr	r5, [r4, #12]
	cmp	r5, #0
	movne	r2, r4
	movne	r8, #0
	bne	.L22
	b	.L12
.L25:
	mov	r0, r5
	str	r8, [r5, #8]
	str	r8, [r5]
	bl	BUF_REMOVE
	mov	r0, r5
	bl	LRU_INSERT
	ldr	r3, [r5, #12]
	mov	r2, r5
	cmp	r3, #0
	beq	.L12
	mov	r5, r3
	mov	r9, r10
.L22:
	ldr	r0, [r5]
	str	r8, [r2, #12]
	bl	IS_BUCKET
	cmp	r0, #0
	bne	.L12
	ldr	r3, [r5, #8]
	cmp	r3, r9
	bne	.L12
	ldr	r1, [r5, #4]
	ldr	r2, [r5]
	ldr	r3, [r1]
	cmp	r3, #0
	sub	r3, r3, #-1073741823
	ldrne	r10, [r1, r3, lsl #2]
	ldr	r3, [fp]
	moveq	r10, r9
	tst	r2, r3
	beq	.L25
	mov	r3, #0
	mov	r2, r9
	mov	r0, r7
	str	r8, [sp]
	bl	__put_page
	cmp	r0, #0
	beq	.L25
.L17:
	mov	r4, #0
	b	.L1
.L57:
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L4
	cmp	r6, r3
	beq	.L60
.L5:
	ldr	r3, [r3, #12]
	cmp	r3, #0
	beq	.L4
	cmp	r6, r3
	bne	.L5
.L60:
	mov	r5, #1
	str	r5, [r7]
	b	.L6
.L56:
	mov	r0, r4
	bl	BUF_REMOVE
	mov	r0, r4
	bl	MRU_INSERT
	ldr	r4, [r5]
	b	.L2
.L13:
	ldr	r3, .L61+8
	ldr	r0, [r4]
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L12
	b	.L14
.L20:
	ldr	r0, [r8, r5, lsl #2]
	bl	ISDISK
	cmp	r0, #0
	bne	.L21
.L19:
	mov	r3, #0
	str	r3, [r8, r5, lsl #2]
	b	.L18
.L59:
	mov	r0, r4
	bl	free
	mov	r4, r8
	b	.L1
.L62:
	.align	2
.L61:
	.word	LRU
	.word	BUF_PIN
	.word	BUF_BUCKET
	.word	BUF_MOD
	.word	BUF_DISK
	.size	newbuf, .-newbuf
	.comm	stderr,4,4
	.comm	LRU,4,4
	.comm	BUF_PIN,4,4
	.comm	BUF_MOD,4,4
	.comm	BUF_DISK,4,4
	.comm	BUF_BUCKET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
