	.file	"823.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Please give a port number: ./epoll_echo_server [port]"
.LC1:
	.string	"Error creating socket..\n"
.LC2:
	.string	"Error binding socket..\n"
.LC3:
	.string	"Error listening..\n"
	.align 8
.LC4:
	.string	"epoll echo server listening for connections on port: %d\n"
.LC5:
	.string	"Error creating epoll..\n"
	.align 8
.LC6:
	.string	"Error adding new listeding socket to epoll..\n"
.LC7:
	.string	"Error in epoll_wait..\n"
	.align 8
.LC8:
	.string	"Error accepting new connection..\n"
	.align 8
.LC9:
	.string	"Error adding new event to epoll..\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	r11, -102400[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 1280
	mov	DWORD PTR -103668[rbp], edi
	mov	QWORD PTR -103680[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -103668[rbp], 1
	jg	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -103680[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -103656[rbp], eax
	mov	DWORD PTR -103664[rbp], 16
	lea	rax, -91296[rbp]
	mov	edx, 91280
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -103652[rbp], eax
	cmp	DWORD PTR -103652[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	error
.L3:
	lea	rax, -103616[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -103616[rbp], 2
	mov	eax, DWORD PTR -103656[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -103614[rbp], ax
	mov	DWORD PTR -103612[rbp], 0
	lea	rcx, -103616[rbp]
	mov	eax, DWORD PTR -103652[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC2[rip]
	call	error
.L4:
	mov	eax, DWORD PTR -103652[rbp]
	mov	esi, 512
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC3[rip]
	call	error
.L5:
	mov	eax, DWORD PTR -103656[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1024
	call	epoll_create@PLT
	mov	DWORD PTR -103648[rbp], eax
	cmp	DWORD PTR -103648[rbp], 0
	jns	.L6
	lea	rdi, .LC5[rip]
	call	error
.L6:
	mov	DWORD PTR -103628[rbp], 1
	mov	eax, DWORD PTR -103652[rbp]
	mov	DWORD PTR -103624[rbp], eax
	lea	rcx, -103628[rbp]
	mov	edx, DWORD PTR -103652[rbp]
	mov	eax, DWORD PTR -103648[rbp]
	mov	esi, 1
	mov	edi, eax
	call	epoll_ctl@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC6[rip]
	call	error
.L7:
	mov	edi, 0
	mov	eax, 0
	call	init_worker@PLT
.L15:
	lea	rsi, -103584[rbp]
	mov	eax, DWORD PTR -103648[rbp]
	mov	ecx, -1
	mov	edx, 1024
	mov	edi, eax
	call	epoll_wait@PLT
	mov	DWORD PTR -103644[rbp], eax
	cmp	DWORD PTR -103644[rbp], -1
	jne	.L8
	lea	rdi, .LC7[rip]
	call	error
.L8:
	mov	eax, 0
	call	batch_start@PLT
	mov	DWORD PTR -103660[rbp], 0
	jmp	.L9
.L14:
	mov	eax, DWORD PTR -103660[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rbp
	sub	rax, 103580
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -103652[rbp], eax
	jne	.L10
	lea	rdx, -103664[rbp]
	lea	rsi, -103600[rbp]
	mov	eax, DWORD PTR -103652[rbp]
	mov	ecx, 2048
	mov	edi, eax
	mov	eax, 0
	call	accept4@PLT
	mov	DWORD PTR -103632[rbp], eax
	cmp	DWORD PTR -103632[rbp], -1
	jne	.L11
	lea	rdi, .LC8[rip]
	call	error
.L11:
	mov	DWORD PTR -103628[rbp], -2147483647
	mov	eax, DWORD PTR -103632[rbp]
	mov	DWORD PTR -103624[rbp], eax
	lea	rcx, -103628[rbp]
	mov	edx, DWORD PTR -103632[rbp]
	mov	eax, DWORD PTR -103648[rbp]
	mov	esi, 1
	mov	edi, eax
	call	epoll_ctl@PLT
	cmp	eax, -1
	jne	.L12
	lea	rdi, .LC9[rip]
	call	error
	jmp	.L12
.L10:
	mov	eax, DWORD PTR -103660[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rbp
	sub	rax, 103580
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -103640[rbp], eax
	lea	rsi, -91296[rbp]
	mov	eax, DWORD PTR -103640[rbp]
	mov	ecx, 0
	mov	edx, 91280
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -103636[rbp], eax
	cmp	DWORD PTR -103636[rbp], 0
	jg	.L13
	mov	edx, DWORD PTR -103640[rbp]
	mov	eax, DWORD PTR -103648[rbp]
	mov	ecx, 0
	mov	esi, 2
	mov	edi, eax
	call	epoll_ctl@PLT
	mov	eax, DWORD PTR -103640[rbp]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -103636[rbp]
	movsx	rdx, eax
	lea	rsi, -91296[rbp]
	mov	eax, DWORD PTR -103640[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
.L12:
	add	DWORD PTR -103660[rbp], 1
.L9:
	mov	eax, DWORD PTR -103660[rbp]
	cmp	eax, DWORD PTR -103644[rbp]
	jl	.L14
	mov	eax, 0
	call	batch_flush@PLT
	jmp	.L15
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC10:
	.string	"erreur..."
	.text
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	error, .-error
	.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	"823.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Please give a port number: ./epoll_echo_server [por"
	.ascii	"t]\000"
	.align	2
.LC1:
	.ascii	"Error creating socket..\012\000"
	.align	2
.LC2:
	.ascii	"Error binding socket..\012\000"
	.align	2
.LC3:
	.ascii	"Error listening..\012\000"
	.align	2
.LC4:
	.ascii	"epoll echo server listening for connections on port"
	.ascii	": %d\012\000"
	.align	2
.LC5:
	.ascii	"Error creating epoll..\012\000"
	.align	2
.LC6:
	.ascii	"Error adding new listeding socket to epoll..\012\000"
	.align	2
.LC7:
	.ascii	"Error in epoll_wait..\012\000"
	.align	2
.LC8:
	.ascii	"Error accepting new connection..\012\000"
	.align	2
.LC9:
	.ascii	"Error adding new event to epoll..\012\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 107768
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #107520
	sub	sp, sp, #252
	sub	r3, fp, #106496
	sub	r3, r3, #12
	str	r0, [r3, #-1268]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	str	r1, [r3, #-1272]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1268]
	cmp	r3, #1
	bgt	.L2
	ldr	r0, .L17+4
	bl	puts
	mov	r0, #0
	bl	exit
.L2:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1272]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #106496
	sub	r2, r2, #12
	mov	r4, r2
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtol
	str	r0, [r4, #-1252]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #16
	str	r3, [r2, #-1260]
	sub	r3, fp, #91136
	sub	r3, r3, #12
	sub	r3, r3, #148
	ldr	r2, .L17+8
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r4, r3
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [r4, #-1248]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1248]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L17+12
	bl	error
.L3:
	sub	r3, fp, #107520
	sub	r3, r3, #12
	sub	r3, r3, #184
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #106496
	sub	r3, r3, #12
	sub	r3, r3, #1200
	sub	r3, r3, #8
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1252]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	sub	r3, r3, #1200
	sub	r3, r3, #8
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1204]
	sub	r3, fp, #107520
	sub	r3, r3, #12
	sub	r3, r3, #184
	sub	r2, fp, #106496
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [r0, #-1248]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L17+16
	bl	error
.L4:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r1, #512
	ldr	r0, [r3, #-1248]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L17+20
	bl	error
.L5:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r1, [r3, #-1252]
	ldr	r0, .L17+24
	bl	printf
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r4, r3
	mov	r0, #1024
	bl	epoll_create
	str	r0, [r4, #-1244]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1244]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L17+28
	bl	error
.L6:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #1
	str	r3, [r2, #-1224]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1248]
	str	r3, [r2, #-1216]
	sub	r3, fp, #107520
	sub	r3, r3, #12
	sub	r3, r3, #200
	sub	r2, fp, #106496
	sub	r2, r2, #12
	sub	r1, fp, #106496
	sub	r1, r1, #12
	mov	r0, r1
	ldr	r2, [r2, #-1248]
	mov	r1, #1
	ldr	r0, [r0, #-1244]
	bl	epoll_ctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L17+32
	bl	error
.L7:
	mov	r0, #0
	bl	init_worker
.L15:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r4, r3
	sub	r1, fp, #107520
	sub	r1, r1, #12
	sub	r1, r1, #152
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r0, r3
	mvn	r3, #0
	mov	r2, #1024
	ldr	r0, [r0, #-1244]
	bl	epoll_wait
	str	r0, [r4, #-1240]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1240]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L17+36
	bl	error
.L8:
	bl	batch_start
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1256]
	b	.L9
.L14:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1256]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-1168]
	sub	r2, fp, #106496
	sub	r2, r2, #12
	ldr	r2, [r2, #-1248]
	cmp	r2, r3
	bne	.L10
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r4, r3
	sub	r2, fp, #107520
	sub	r2, r2, #12
	sub	r2, r2, #236
	sub	r1, fp, #107520
	sub	r1, r1, #12
	sub	r1, r1, #168
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #2048
	ldr	r0, [r0, #-1248]
	bl	accept4
	str	r0, [r4, #-1228]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1228]
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L17+40
	bl	error
.L11:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #-2147483647
	str	r3, [r2, #-1224]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1228]
	str	r3, [r2, #-1216]
	sub	r3, fp, #107520
	sub	r3, r3, #12
	sub	r3, r3, #200
	sub	r2, fp, #106496
	sub	r2, r2, #12
	sub	r1, fp, #106496
	sub	r1, r1, #12
	mov	r0, r1
	ldr	r2, [r2, #-1228]
	mov	r1, #1
	ldr	r0, [r0, #-1244]
	bl	epoll_ctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L17+44
	bl	error
	b	.L12
.L10:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1256]
	lsl	r3, r3, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-1168]
	str	r3, [r2, #-1236]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r4, r3
	sub	r1, fp, #91136
	sub	r1, r1, #12
	sub	r1, r1, #148
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	ldr	r2, .L17+8
	ldr	r0, [r0, #-1236]
	bl	recv
	str	r0, [r4, #-1232]
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1232]
	cmp	r3, #0
	bgt	.L13
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	ldr	r2, [r2, #-1236]
	mov	r1, #2
	ldr	r0, [r0, #-1244]
	bl	epoll_ctl
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r1, #2
	ldr	r0, [r3, #-1236]
	bl	shutdown
	b	.L12
.L13:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r2, [r3, #-1232]
	sub	r1, fp, #91136
	sub	r1, r1, #12
	sub	r1, r1, #148
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	ldr	r0, [r0, #-1236]
	bl	send
.L12:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r3, [r3, #-1256]
	add	r3, r3, #1
	str	r3, [r2, #-1256]
.L9:
	sub	r3, fp, #106496
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #106496
	sub	r3, r3, #12
	ldr	r2, [r2, #-1256]
	ldr	r3, [r3, #-1240]
	cmp	r2, r3
	blt	.L14
	bl	batch_flush
	b	.L15
.L18:
	.align	2
.L17:
	.word	.LC10
	.word	.LC0
	.word	91280
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.ascii	"erreur...\000"
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	perror
	ldr	r0, .L20
	bl	puts
	mov	r0, #1
	bl	exit
.L21:
	.align	2
.L20:
	.word	.LC11
	.size	error, .-error
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
