	.file	"extr_bufferevent_async.c_read_complete.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	read_complete, @function
read_complete:
.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
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	upcast_read@PLT
	mov	rbp, rax
	lea	r12, 16[rax]
	movzx	eax, WORD PTR BEV_EVENT_READING[rip]
	mov	rdi, r12
	mov	WORD PTR 14[rsp], ax
	call	BEV_LOCK@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	EVUTIL_ASSERT@PLT
	mov	r15d, DWORD PTR 0[rbp]
	mov	edi, DWORD PTR 16[rbp]
	mov	esi, ebx
	call	evbuffer_commit_read_@PLT
	mov	DWORD PTR 0[rbp], 0
	cmp	r15d, ebx
	je	.L2
	mov	esi, ebx
	mov	rdi, r12
	sub	esi, r15d
	call	bufferevent_decrement_read_buckets_@PLT
.L2:
	test	r14d, r14d
	je	.L11
	cmp	QWORD PTR 8[rbp], 0
	je	.L5
	test	ebx, ebx
	jne	.L12
	movzx	r15d, WORD PTR 14[rsp]
	or	r15w, WORD PTR BEV_EVENT_EOF[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, r13
	mov	rdi, r12
	call	bev_async_set_wsa_error@PLT
	cmp	QWORD PTR 8[rbp], 0
	je	.L5
	movzx	r15d, WORD PTR 14[rsp]
	or	r15w, WORD PTR BEV_EVENT_ERROR[rip]
.L9:
	mov	QWORD PTR 8[rbp], 0
	movsx	esi, r15w
	xor	edx, edx
	mov	rdi, r12
	call	be_async_run_eventcb@PLT
.L5:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, 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
	jmp	bufferevent_decref_and_unlock_@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rdi, r12
	call	BEV_RESET_GENERIC_READ_TIMEOUT@PLT
	mov	esi, DWORD PTR EV_READ[rip]
	mov	rdi, r12
	xor	edx, edx
	call	be_async_trigger_nolock@PLT
	mov	rdi, rbp
	call	bev_async_consider_reading@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	read_complete, .-read_complete
	.comm	EV_READ,4,4
	.comm	BEV_EVENT_READING,2,2
	.comm	BEV_EVENT_ERROR,2,2
	.comm	BEV_EVENT_EOF,2,2
	.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_bufferevent_async.c_read_complete.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_complete, %function
read_complete:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r2
	mov	r7, r3
	mov	r8, r0
	bl	upcast_read
	mov	r4, r0
	ldr	r3, .L16
	add	r6, r0, #8
	mov	r0, r6
	ldrsh	r10, [r3]
	bl	BEV_LOCK
	ldr	r0, [r4]
	bl	EVUTIL_ASSERT
	mov	r1, r5
	ldr	r0, [r4, #8]
	ldr	r9, [r4]
	bl	evbuffer_commit_read_
	mov	r3, #0
	cmp	r9, r5
	str	r3, [r4]
	beq	.L2
	mov	r0, r6
	sub	r1, r5, r9
	bl	bufferevent_decrement_read_buckets_
.L2:
	cmp	r7, #0
	beq	.L14
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L5
	cmp	r5, #0
	bne	.L15
	ldr	r3, .L16+4
	mov	r2, r5
	ldrh	r1, [r3]
	str	r5, [r4, #4]
	b	.L12
.L14:
	mov	r1, r8
	mov	r0, r6
	bl	bev_async_set_wsa_error
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L5
	mov	r2, r7
	ldr	r3, .L16+8
	str	r7, [r4, #4]
	ldrh	r1, [r3]
.L12:
	orr	r1, r10, r1
	lsl	r1, r1, #16
	mov	r0, r6
	asr	r1, r1, #16
	bl	be_async_run_eventcb
.L5:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	bufferevent_decref_and_unlock_
.L15:
	mov	r0, r6
	bl	BEV_RESET_GENERIC_READ_TIMEOUT
	ldr	r3, .L16+12
	mov	r2, #0
	mov	r0, r6
	ldr	r1, [r3]
	bl	be_async_trigger_nolock
	mov	r0, r4
	bl	bev_async_consider_reading
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	bufferevent_decref_and_unlock_
.L17:
	.align	2
.L16:
	.word	BEV_EVENT_READING
	.word	BEV_EVENT_EOF
	.word	BEV_EVENT_ERROR
	.word	EV_READ
	.size	read_complete, .-read_complete
	.comm	EV_READ,4,4
	.comm	BEV_EVENT_READING,2,2
	.comm	BEV_EVENT_ERROR,2,2
	.comm	BEV_EVENT_EOF,2,2
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
