	.file	"extr_le-proxy.c_readcb.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	readcb, @function
readcb:
.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, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	bufferevent_get_input@PLT
	mov	rdi, rax
	mov	r12, rax
	call	evbuffer_get_length@PLT
	test	rbp, rbp
	je	.L6
	mov	rdi, rbp
	call	bufferevent_get_output@PLT
	mov	rsi, r12
	mov	r14, rax
	mov	rdi, rax
	call	evbuffer_add_buffer@PLT
	mov	rdi, r14
	call	evbuffer_get_length@PLT
	cmp	eax, DWORD PTR MAX_OUTPUT[rip]
	jge	.L7
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	ecx, DWORD PTR eventcb[rip]
	mov	edx, DWORD PTR drained_writecb[rip]
	mov	r8, r13
	mov	rdi, rbp
	lea	rsi, readcb[rip]
	call	bufferevent_setcb@PLT
	mov	ecx, DWORD PTR MAX_OUTPUT[rip]
	mov	esi, DWORD PTR EV_WRITE[rip]
	mov	rdi, rbp
	mov	edx, ecx
	shr	edx, 31
	add	edx, ecx
	sar	edx
	call	bufferevent_setwatermark@PLT
	mov	esi, DWORD PTR EV_READ[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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	bufferevent_disable@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	movsx	rsi, eax
	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	evbuffer_drain@PLT
	.cfi_endproc
.LFE0:
	.size	readcb, .-readcb
	.comm	eventcb,4,4
	.comm	drained_writecb,4,4
	.comm	MAX_OUTPUT,4,4
	.comm	EV_WRITE,4,4
	.comm	EV_READ,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_le-proxy.c_readcb.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	readcb, %function
readcb:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	sub	sp, sp, #8
	mov	r4, r1
	mov	r6, r0
	bl	bufferevent_get_input
	mov	r5, r0
	bl	evbuffer_get_length
	cmp	r4, #0
	beq	.L6
	mov	r0, r4
	bl	bufferevent_get_output
	mov	r1, r5
	mov	r5, r0
	bl	evbuffer_add_buffer
	mov	r0, r5
	bl	evbuffer_get_length
	ldr	r5, .L8
	ldr	r3, [r5]
	cmp	r0, r3
	bge	.L7
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L7:
	ldr	r3, .L8+4
	ldr	r2, .L8+8
	str	r6, [sp]
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, .L8+12
	bl	bufferevent_setcb
	ldr	r3, [r5]
	ldr	r1, .L8+16
	add	r2, r3, r3, lsr #31
	mov	r0, r4
	ldr	r1, [r1]
	asr	r2, r2, #1
	bl	bufferevent_setwatermark
	mov	r0, r6
	ldr	r3, .L8+20
	ldr	r1, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, lr}
	b	bufferevent_disable
.L6:
	mov	r1, r0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, lr}
	b	evbuffer_drain
.L9:
	.align	2
.L8:
	.word	MAX_OUTPUT
	.word	eventcb
	.word	drained_writecb
	.word	readcb
	.word	EV_WRITE
	.word	EV_READ
	.size	readcb, .-readcb
	.comm	eventcb,4,4
	.comm	drained_writecb,4,4
	.comm	MAX_OUTPUT,4,4
	.comm	EV_WRITE,4,4
	.comm	EV_READ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
