	.file	"extr_bufmgr.c_ReleaseAndReadBuffer.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ReleaseAndReadBuffer
	.type	ReleaseAndReadBuffer, @function
ReleaseAndReadBuffer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, QWORD PTR MAIN_FORKNUM[rip]
	call	BufferIsValid@PLT
	test	rax, rax
	je	.L2
	mov	edi, r12d
	call	BufferIsPinned@PLT
	mov	edi, eax
	call	Assert@PLT
	mov	edi, r12d
	call	BufferIsLocal@PLT
	test	rax, rax
	je	.L3
	mov	edi, r12d
	not	edi
	call	GetLocalBufferDescriptor@PLT
	mov	r14, rax
	cmp	QWORD PTR [rax], rbp
	je	.L4
.L5:
	mov	edi, DWORD PTR CurrentResourceOwner[rip]
	mov	esi, r12d
	neg	r12d
	movsx	r12, r12d
	call	ResourceOwnerForgetBuffer@PLT
	mov	rax, QWORD PTR LocalRefCount[rip]
	sub	DWORD PTR -4[rax+r12*4], 1
.L2:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rsi, rbp
	mov	rdi, r13
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	ReadBuffer@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	lea	edi, -1[r12]
	call	GetBufferDescriptor@PLT
	mov	r14, rax
	cmp	QWORD PTR [rax], rbp
	je	.L7
.L8:
	mov	esi, 1
	mov	rdi, r14
	call	UnpinBuffer@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR 16[rax]
	mov	esi, DWORD PTR 0[r13]
	call	RelFileNodeEquals@PLT
	test	rax, rax
	je	.L5
	cmp	QWORD PTR 8[r14], rbx
	jne	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR 16[rax]
	mov	esi, DWORD PTR 0[r13]
	call	RelFileNodeEquals@PLT
	test	rax, rax
	je	.L8
	cmp	QWORD PTR 8[r14], rbx
	jne	.L8
.L6:
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ReleaseAndReadBuffer, .-ReleaseAndReadBuffer
	.comm	MAIN_FORKNUM,8,8
	.comm	LocalRefCount,8,8
	.comm	CurrentResourceOwner,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_bufmgr.c_ReleaseAndReadBuffer.c"
	.text
	.align	2
	.global	ReleaseAndReadBuffer
	.syntax unified
	.arm
	.fpu softvfp
	.type	ReleaseAndReadBuffer, %function
ReleaseAndReadBuffer:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L21
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	mov	r6, r2
	mov	r4, r0
	ldr	r8, [r3]
	bl	BufferIsValid
	cmp	r0, #0
	beq	.L2
	mov	r0, r4
	bl	BufferIsPinned
	bl	Assert
	mov	r0, r4
	bl	BufferIsLocal
	cmp	r0, #0
	beq	.L3
	mvn	r0, r4
	bl	GetLocalBufferDescriptor
	ldr	r3, [r0]
	mov	r7, r0
	cmp	r3, r6
	beq	.L4
.L5:
	mov	r1, r4
	lsl	r4, r4, #2
	eor	r4, r4, #3
	mvn	r4, r4
	ldr	r3, .L21+4
	ldr	r0, [r3]
	bl	ResourceOwnerForgetBuffer
	ldr	r3, .L21+8
	ldr	r2, [r3]
	ldr	r3, [r2, r4]
	sub	r3, r3, #1
	str	r3, [r2, r4]
.L2:
	mov	r1, r6
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	ReadBuffer
.L3:
	sub	r0, r4, #1
	bl	GetBufferDescriptor
	ldr	r3, [r0]
	mov	r7, r0
	cmp	r3, r6
	beq	.L7
.L8:
	mov	r0, r7
	mov	r1, #1
	bl	UnpinBuffer
	mov	r1, r6
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	ReadBuffer
.L4:
	ldr	r1, [r5]
	ldr	r0, [r0, #8]
	bl	RelFileNodeEquals
	cmp	r0, #0
	beq	.L5
	ldr	r3, [r7, #4]
	cmp	r3, r8
	bne	.L5
	b	.L6
.L7:
	ldr	r1, [r5]
	ldr	r0, [r0, #8]
	bl	RelFileNodeEquals
	cmp	r0, #0
	beq	.L8
	ldr	r3, [r7, #4]
	cmp	r3, r8
	bne	.L8
.L6:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	.align	2
.L21:
	.word	MAIN_FORKNUM
	.word	CurrentResourceOwner
	.word	LocalRefCount
	.size	ReleaseAndReadBuffer, .-ReleaseAndReadBuffer
	.comm	MAIN_FORKNUM,4,4
	.comm	LocalRefCount,4,4
	.comm	CurrentResourceOwner,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
