	.file	"962345.c"
	.intel_syntax noprefix
	.text
	.globl	debug
	.bss
	.align 4
	.type	debug, @object
	.size	debug, 4
debug:
	.zero	4
	.text
	.globl	setnonblock
	.type	setnonblock, @function
setnonblock:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -4[rbp], eax
	or	DWORD PTR -4[rbp], 2048
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	setnonblock, .-setnonblock
	.section	.rodata
.LC0:
	.string	"BAKED BEANS"
	.text
	.globl	buf_read_callback
	.type	buf_read_callback, @function
buf_read_callback:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	rdi, rax
	call	evbuffer_readline@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L5
	call	evbuffer_new@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	evbuffer_add_printf@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	bufferevent_write_buffer@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	evbuffer_free@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L2
.L5:
	nop
.L2:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	buf_read_callback, .-buf_read_callback
	.globl	buf_write_callback
	.type	buf_write_callback, @function
buf_write_callback:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	buf_write_callback, .-buf_write_callback
	.globl	buf_error_callback
	.type	buf_error_callback, @function
buf_error_callback:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	eax, esi
	mov	QWORD PTR -40[rbp], rdx
	mov	WORD PTR -28[rbp], ax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	bufferevent_free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	buf_error_callback, .-buf_error_callback
	.section	.rodata
.LC1:
	.string	"Client: accept() failed"
.LC2:
	.string	"malloc failed"
	.text
	.globl	accept_callback
	.type	accept_callback, @function
accept_callback:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	eax, esi
	mov	QWORD PTR -64[rbp], rdx
	mov	WORD PTR -56[rbp], ax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 16
	lea	rax, -32[rbp]
	mov	rcx, rax
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jns	.L9
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	warn@PLT
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -44[rbp]
	mov	edi, eax
	call	setnonblock
	mov	esi, 16
	mov	edi, 1
	call	calloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L11
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L11:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR -44[rbp]
	mov	DWORD PTR [rax], edx
	mov	rdx, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	r8, rdx
	lea	rcx, buf_error_callback[rip]
	lea	rdx, buf_write_callback[rip]
	lea	rsi, buf_read_callback[rip]
	mov	edi, eax
	call	bufferevent_new@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR 8[rdx], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	esi, 2
	mov	rdi, rax
	call	bufferevent_enable@PLT
.L8:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	accept_callback, .-accept_callback
	.section	.rodata
	.align 8
.LC3:
	.string	"Failed to create listen socket"
.LC4:
	.string	"Failed to bind"
.LC5:
	.string	"Failed to listen to socket"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -168[rbp], 1
	call	event_init@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	jns	.L14
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L18
.L14:
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -32[rbp], 2
	mov	DWORD PTR -28[rbp], 0
	mov	edi, 8080
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	lea	rax, -32[rbp]
	mov	rcx, rax
	mov	eax, DWORD PTR -164[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 14
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L18
.L16:
	mov	eax, DWORD PTR -164[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L17
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L18
.L17:
	lea	rdx, -168[rbp]
	mov	eax, DWORD PTR -164[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	setnonblock
	mov	esi, DWORD PTR -164[rbp]
	lea	rax, -160[rbp]
	mov	r8d, 0
	lea	rcx, accept_callback[rip]
	mov	edx, 18
	mov	rdi, rax
	call	event_set@PLT
	lea	rax, -160[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	event_add@PLT
	call	event_dispatch@PLT
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L18:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.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	"962345.c"
	.text
	.global	debug
	.bss
	.align	2
	.type	debug, %object
	.size	debug, 4
debug:
	.space	4
	.text
	.align	2
	.global	setnonblock
	.syntax unified
	.arm
	.fpu softvfp
	.type	setnonblock, %function
setnonblock:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r1, #3
	ldr	r0, [fp, #-16]
	bl	fcntl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	orr	r3, r3, #2048
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	mov	r1, #4
	ldr	r0, [fp, #-16]
	bl	fcntl
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	setnonblock, .-setnonblock
	.section	.rodata
	.align	2
.LC0:
	.ascii	"BAKED BEANS\000"
	.text
	.align	2
	.global	buf_read_callback
	.syntax unified
	.arm
	.fpu softvfp
	.type	buf_read_callback, %function
buf_read_callback:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #136]
	mov	r0, r3
	bl	evbuffer_readline
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L5
	bl	evbuffer_new
	str	r0, [fp, #-8]
	ldr	r1, .L6
	ldr	r0, [fp, #-8]
	bl	evbuffer_add_printf
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	bufferevent_write_buffer
	ldr	r0, [fp, #-8]
	bl	evbuffer_free
	ldr	r0, [fp, #-12]
	bl	free
	b	.L2
.L5:
	nop
.L2:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.size	buf_read_callback, .-buf_read_callback
	.align	2
	.global	buf_write_callback
	.syntax unified
	.arm
	.fpu softvfp
	.type	buf_write_callback, %function
buf_write_callback:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	buf_write_callback, .-buf_write_callback
	.align	2
	.global	buf_error_callback
	.syntax unified
	.arm
	.fpu softvfp
	.type	buf_error_callback, %function
buf_error_callback:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	mov	r3, r1
	str	r2, [fp, #-24]
	strh	r3, [fp, #-18]	@ movhi
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	bufferevent_free
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r0, [fp, #-8]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	buf_error_callback, .-buf_error_callback
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Client: accept() failed\000"
	.align	2
.LC2:
	.ascii	"malloc failed\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	accept_callback
	.syntax unified
	.arm
	.fpu softvfp
	.type	accept_callback, %function
accept_callback:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-40]
	mov	r3, r1
	str	r2, [fp, #-48]
	strh	r3, [fp, #-42]	@ movhi
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #16
	str	r3, [fp, #-36]
	sub	r3, fp, #24
	mov	r1, r3
	sub	r3, fp, #36
	mov	r2, r3
	ldr	r0, [fp, #-40]
	bl	accept
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L15+4
	bl	warn
	b	.L10
.L11:
	ldr	r0, [fp, #-32]
	bl	setnonblock
	mov	r1, #8
	mov	r0, #1
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L13
	ldr	r1, .L15+8
	mov	r0, #1
	bl	err
.L13:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-32]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	str	r3, [sp]
	ldr	r3, .L15+12
	ldr	r2, .L15+16
	ldr	r1, .L15+20
	ldr	r0, [fp, #-32]
	bl	bufferevent_new
	mov	r2, r0
	ldr	r3, [fp, #-28]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #4]
	mov	r1, #2
	mov	r0, r3
	bl	bufferevent_enable
.L10:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	.LC1
	.word	.LC2
	.word	buf_error_callback
	.word	buf_write_callback
	.word	buf_read_callback
	.size	accept_callback, .-accept_callback
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Failed to create listen socket\000"
	.align	2
.LC5:
	.ascii	"Failed to bind\000"
	.align	2
.LC6:
	.ascii	"Failed to listen to socket\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	str	r0, [fp, #-104]
	str	r1, [fp, #-108]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-96]
	bl	event_init
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L18
	ldr	r3, .L24+4
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L24+8
	bl	fwrite
	mov	r3, #1
	b	.L22
.L18:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r0, .L24+12
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-92]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L20
	ldr	r3, .L24+4
	ldr	r3, [r3]
	mov	r2, #14
	mov	r1, #1
	ldr	r0, .L24+16
	bl	fwrite
	mov	r3, #1
	b	.L22
.L20:
	mov	r1, #5
	ldr	r0, [fp, #-92]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L21
	ldr	r3, .L24+4
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L24+20
	bl	fwrite
	mov	r3, #1
	b	.L22
.L21:
	sub	r3, fp, #96
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-92]
	bl	setsockopt
	ldr	r0, [fp, #-92]
	bl	setnonblock
	sub	r0, fp, #88
	mov	r3, #0
	str	r3, [sp]
	ldr	r3, .L24+24
	mov	r2, #18
	ldr	r1, [fp, #-92]
	bl	event_set
	sub	r3, fp, #88
	mov	r1, #0
	mov	r0, r3
	bl	event_add
	bl	event_dispatch
	ldr	r0, [fp, #-92]
	bl	close
	mov	r3, #0
.L22:
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC7
	.word	stderr
	.word	.LC4
	.word	8080
	.word	.LC5
	.word	.LC6
	.word	accept_callback
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
