	.file	"191135.c"
	.intel_syntax noprefix
	.text
	.globl	ready
	.bss
	.align 8
	.type	ready, @object
	.size	ready, 8
ready:
	.zero	8
	.section	.rodata
.LC0:
	.string	"Please provide a port"
.LC1:
	.string	"Erroring creating socket"
.LC2:
	.string	"Error binding address"
.LC3:
	.string	"Error accepting connection"
	.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
	sub	rsp, 160
	mov	DWORD PTR -148[rbp], edi
	mov	QWORD PTR -160[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -148[rbp], 1
	jg	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	lea	rax, -64[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	pthread_attr_setdetachstate@PLT
	mov	edi, 64
	call	epoll_create@PLT
	mov	DWORD PTR -140[rbp], eax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -132[rbp], eax
	cmp	DWORD PTR -132[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rax, -96[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -128[rbp], eax
	mov	esi, 12
	mov	edi, 64
	call	calloc@PLT
	mov	QWORD PTR ready[rip], rax
	mov	WORD PTR -96[rbp], 2
	mov	DWORD PTR -92[rbp], 0
	mov	eax, DWORD PTR -128[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -94[rbp], ax
	mov	DWORD PTR -136[rbp], 1
	lea	rdx, -136[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	lea	rdx, -140[rbp]
	lea	rsi, -64[rbp]
	lea	rax, -120[rbp]
	mov	rcx, rdx
	lea	rdx, client_handler[rip]
	mov	rdi, rax
	call	pthread_create@PLT
.L6:
	mov	eax, DWORD PTR -132[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR -144[rbp], 16
	lea	rdx, -144[rbp]
	lea	rcx, -80[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -124[rbp], eax
	cmp	DWORD PTR -124[rbp], 0
	jns	.L5
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L5:
	mov	eax, DWORD PTR -124[rbp]
	mov	DWORD PTR -104[rbp], eax
	mov	DWORD PTR -108[rbp], 1
	mov	eax, DWORD PTR -140[rbp]
	lea	rcx, -108[rbp]
	mov	edx, DWORD PTR -124[rbp]
	mov	esi, 1
	mov	edi, eax
	call	epoll_ctl@PLT
	jmp	.L6
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"Client %d terminated\n"
.LC5:
	.string	"Client %d says: %s"
	.text
	.globl	client_handler
	.type	client_handler, @function
client_handler:
.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, 304
	mov	QWORD PTR -296[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -296[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -284[rbp], eax
.L13:
	mov	rsi, QWORD PTR ready[rip]
	mov	eax, DWORD PTR -284[rbp]
	mov	ecx, -1
	mov	edx, 64
	mov	edi, eax
	call	epoll_wait@PLT
	mov	DWORD PTR -280[rbp], eax
	mov	DWORD PTR -288[rbp], 0
	jmp	.L9
.L12:
	lea	rax, -272[rbp]
	mov	edx, 256
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rcx, QWORD PTR ready[rip]
	mov	eax, DWORD PTR -288[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	lea	rcx, -272[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -276[rbp], eax
	cmp	DWORD PTR -276[rbp], 0
	jg	.L10
	mov	rcx, QWORD PTR ready[rip]
	mov	eax, DWORD PTR -288[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	edx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -284[rbp]
	mov	ecx, 0
	mov	esi, 2
	mov	edi, eax
	call	epoll_ctl@PLT
	mov	rcx, QWORD PTR ready[rip]
	mov	eax, DWORD PTR -288[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rcx, QWORD PTR ready[rip]
	mov	eax, DWORD PTR -288[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	jmp	.L11
.L10:
	mov	rcx, QWORD PTR ready[rip]
	mov	eax, DWORD PTR -288[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	lea	rdx, -272[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L11:
	add	DWORD PTR -288[rbp], 1
.L9:
	mov	eax, DWORD PTR -288[rbp]
	cmp	eax, DWORD PTR -280[rbp]
	jl	.L12
	jmp	.L13
	.cfi_endproc
.LFE7:
	.size	client_handler, .-client_handler
	.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	"191135.c"
	.text
	.comm	ready,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Please provide a port\000"
	.align	2
.LC1:
	.ascii	"Erroring creating socket\000"
	.align	2
.LC2:
	.ascii	"Error binding address\000"
	.align	2
.LC3:
	.ascii	"Error accepting connection\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-128]
	cmp	r3, #1
	bgt	.L2
	ldr	r0, .L8+4
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #44
	mov	r0, r3
	bl	pthread_attr_init
	sub	r3, fp, #44
	mov	r1, #1
	mov	r0, r3
	bl	pthread_attr_setdetachstate
	mov	r0, #64
	bl	epoll_create
	mov	r3, r0
	str	r3, [fp, #-116]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L8+8
	bl	puts
	mov	r0, #1
	bl	exit
.L3:
	sub	r3, fp, #76
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-100]
	mov	r1, #16
	mov	r0, #64
	bl	calloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L8+12
	str	r2, [r3]
	mov	r3, #2
	strh	r3, [fp, #-76]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-72]
	ldr	r3, [fp, #-100]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-74]	@ movhi
	mov	r3, #1
	str	r3, [fp, #-108]
	sub	r3, fp, #108
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-104]
	bl	setsockopt
	sub	r3, fp, #76
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L8+16
	bl	puts
	mov	r0, #1
	bl	exit
.L4:
	sub	r3, fp, #116
	sub	r1, fp, #44
	sub	r0, fp, #112
	ldr	r2, .L8+20
	bl	pthread_create
.L6:
	mov	r1, #5
	ldr	r0, [fp, #-104]
	bl	listen
	mov	r3, #16
	str	r3, [fp, #-120]
	sub	r2, fp, #120
	sub	r3, fp, #60
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	accept
	str	r0, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L8+24
	bl	puts
.L5:
	ldr	r3, [fp, #-96]
	str	r3, [fp, #-84]
	mov	r3, #1
	str	r3, [fp, #-92]
	ldr	r0, [fp, #-116]
	sub	r3, fp, #92
	ldr	r2, [fp, #-96]
	mov	r1, #1
	bl	epoll_ctl
	b	.L6
.L9:
	.align	2
.L8:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	ready
	.word	.LC2
	.word	client_handler
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Client %d terminated\012\000"
	.align	2
.LC6:
	.ascii	"Client %d says: %s\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	client_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	client_handler, %function
client_handler:
	@ args = 0, pretend = 0, frame = 288
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #288
	str	r0, [fp, #-288]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-288]
	ldr	r3, [r3]
	str	r3, [fp, #-276]
.L15:
	ldr	r3, .L17+4
	ldr	r1, [r3]
	mvn	r3, #0
	mov	r2, #64
	ldr	r0, [fp, #-276]
	bl	epoll_wait
	str	r0, [fp, #-272]
	mov	r3, #0
	str	r3, [fp, #-280]
	b	.L11
.L14:
	sub	r3, fp, #264
	mov	r2, #256
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L17+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	sub	r1, fp, #264
	mov	r2, #256
	mov	r0, r3
	bl	read
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmp	r3, #0
	bgt	.L12
	ldr	r3, .L17+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [r3, #8]
	mov	r3, #0
	mov	r1, #2
	ldr	r0, [fp, #-276]
	bl	epoll_ctl
	ldr	r3, .L17+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L17+8
	bl	printf
	ldr	r3, .L17+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	close
	b	.L13
.L12:
	ldr	r3, .L17+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	sub	r2, fp, #264
	mov	r1, r3
	ldr	r0, .L17+12
	bl	printf
.L13:
	ldr	r3, [fp, #-280]
	add	r3, r3, #1
	str	r3, [fp, #-280]
.L11:
	ldr	r2, [fp, #-280]
	ldr	r3, [fp, #-272]
	cmp	r2, r3
	blt	.L14
	b	.L15
.L18:
	.align	2
.L17:
	.word	.LC7
	.word	ready
	.word	.LC5
	.word	.LC6
	.size	client_handler, .-client_handler
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
