	.file	"44485.c"
	.intel_syntax noprefix
	.text
	.globl	father_pid
	.bss
	.align 4
	.type	father_pid, @object
	.size	father_pid, 4
father_pid:
	.zero	4
	.globl	localfd
	.align 4
	.type	localfd, @object
	.size	localfd, 4
localfd:
	.zero	4
	.globl	connectfd
	.align 32
	.type	connectfd, @object
	.size	connectfd, 120
connectfd:
	.zero	120
	.globl	cc
	.align 4
	.type	cc, @object
	.size	cc, 4
cc:
	.zero	4
	.globl	now
	.align 32
	.type	now, @object
	.size	now, 64
now:
	.zero	64
	.section	.rodata
.LC0:
	.string	"Closing connection..."
	.align 8
.LC1:
	.string	"Server stopped. All clients will be disconnected."
	.text
	.globl	closeConnect
	.type	closeConnect, @function
closeConnect:
.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
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip+4]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 1
	jne	.L3
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	cmp	eax, -1
	jne	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	call	__errno_location@PLT
	jmp	.L1
.L3:
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR cc[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L5
	mov	eax, DWORD PTR localfd[rip]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	cmp	eax, -1
	jne	.L6
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	call	__errno_location@PLT
	jmp	.L1
.L6:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	closeConnect, .-closeConnect
	.section	.rodata
.LC2:
	.string	"%Y-%m-%d %H:%M:%S"
	.text
	.globl	getCurrentTime
	.type	getCurrentTime, @function
getCurrentTime:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -24[rbp]
	mov	rdi, rax
	call	time@PLT
	lea	rax, -24[rbp]
	mov	rdi, rax
	call	localtime@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	lea	rdx, .LC2[rip]
	mov	esi, 79
	lea	rdi, now[rip]
	call	strftime@PLT
	lea	rax, now[rip]
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	getCurrentTime, .-getCurrentTime
	.section	.rodata
.LC3:
	.string	"<%s CLIENT %s:%d> %s"
.LC4:
	.string	"Client %s:%d disconnected\n"
.LC5:
	.string	"exit\n"
	.align 8
.LC6:
	.string	"Fail to send message: %s(erro: %d)"
.LC7:
	.string	"CONNECTIO_CLOSED"
	.text
	.globl	connectionHandler
	.type	connectionHandler, @function
connectionHandler:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 64
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	DWORD PTR -8244[rbp], edi
	mov	rcx, rdx
	mov	rax, rsi
	mov	rdx, rdi
	mov	rdx, rcx
	mov	QWORD PTR -8272[rbp], rax
	mov	QWORD PTR -8264[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, -8224[rbp]
	mov	edx, 4096
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -4128[rbp]
	mov	edx, 4096
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	call	fork@PLT
	mov	DWORD PTR -8236[rbp], eax
	cmp	DWORD PTR -8236[rbp], 0
	jne	.L11
.L14:
	lea	rsi, -4128[rbp]
	mov	eax, DWORD PTR -8244[rbp]
	mov	ecx, 0
	mov	edx, 4096
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -8228[rbp], eax
	cmp	DWORD PTR -8228[rbp], 0
	jle	.L24
	mov	eax, DWORD PTR -8228[rbp]
	cdqe
	mov	BYTE PTR -4128[rbp+rax], 0
	movzx	eax, WORD PTR -8270[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	ntohs@PLT
	movzx	ebx, ax
	mov	eax, DWORD PTR -8268[rbp]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	r12, rax
	mov	eax, 0
	call	getCurrentTime
	lea	rdx, -4128[rbp]
	mov	r8, rdx
	mov	ecx, ebx
	mov	rdx, r12
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -4128[rbp]
	mov	edx, 4096
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	jmp	.L14
.L24:
	nop
	movzx	eax, WORD PTR -8270[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	ntohs@PLT
	movzx	ebx, ax
	mov	eax, DWORD PTR -8268[rbp]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -8244[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
.L11:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -8224[rbp]
	mov	esi, 4096
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -8224[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L15
	mov	eax, DWORD PTR father_pid[rip]
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
	nop
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L21
	jmp	.L23
.L15:
	mov	DWORD PTR -8240[rbp], 0
	mov	DWORD PTR -8240[rbp], 0
	jmp	.L17
.L20:
	mov	DWORD PTR -8232[rbp], 0
	mov	eax, DWORD PTR -8240[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip+4]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 1
	jne	.L18
	lea	rax, -8224[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -8240[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, connectfd[rip]
	mov	eax, DWORD PTR [rcx+rax]
	lea	rsi, -8224[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -8232[rbp], eax
	cmp	DWORD PTR -8232[rbp], 0
	jns	.L19
	lea	rax, -8224[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -8224[rbp+rax], 0
	call	__errno_location@PLT
	mov	ebx, DWORD PTR [rax]
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L19:
	cmp	DWORD PTR -8232[rbp], 0
	jne	.L18
	mov	eax, DWORD PTR -8240[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip+4]
	mov	DWORD PTR [rdx+rax], -1
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L18:
	add	DWORD PTR -8240[rbp], 1
.L17:
	mov	eax, DWORD PTR cc[rip]
	cmp	DWORD PTR -8240[rbp], eax
	jl	.L20
	lea	rax, -8224[rbp]
	mov	edx, 4096
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	jmp	.L11
.L23:
	call	__stack_chk_fail@PLT
.L21:
	add	rsp, 8256
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	connectionHandler, .-connectionHandler
	.section	.rodata
	.align 8
.LC8:
	.string	"A simple TCP duplex communication program. Press [Ctrl] + [C] to exit.\n"
	.align 8
.LC9:
	.string	"Invalid arguments. Usage: server.o port"
.LC10:
	.string	"Error occured in socket()."
	.align 8
.LC11:
	.string	"Error occured in bind(): %s(errno: %d)\n"
	.align 8
.LC12:
	.string	"Error occured in listen(): %s(errno: %d)\n"
	.align 8
.LC13:
	.string	"Socket established. Waiting for client..."
	.align 8
.LC14:
	.string	"Error occured in accept(): %s(errno: %d)"
.LC15:
	.string	"Max client count reached."
	.align 8
.LC16:
	.string	"Client %s:%d connected. clientfd = %d.\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 104
	.cfi_offset 3, -24
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rdi, .LC8[rip]
	call	puts@PLT
	cmp	DWORD PTR -100[rbp], 2
	jne	.L26
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -72[rbp], rax
	jmp	.L27
.L26:
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L27:
	mov	DWORD PTR -80[rbp], -1
	lea	rsi, closeConnect[rip]
	mov	edi, 2
	call	signal@PLT
	lea	rsi, closeConnect[rip]
	mov	edi, 10
	call	signal@PLT
	mov	eax, 0
	call	getpid@PLT
	mov	DWORD PTR father_pid[rip], eax
	mov	edx, 60
	mov	esi, 0
	lea	rdi, connectfd[rip]
	call	memset@PLT
	lea	rax, -64[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	edi, 0
	call	htons@PLT
	movzx	eax, ax
	mov	DWORD PTR -60[rbp], eax
	mov	WORD PTR -64[rbp], 2
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	atoi@PLT
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -62[rbp], ax
	mov	edx, 6
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR localfd[rip], eax
	mov	eax, DWORD PTR localfd[rip]
	cmp	eax, -1
	jne	.L28
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L28:
	mov	eax, DWORD PTR localfd[rip]
	lea	rcx, -64[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L29
	call	__errno_location@PLT
	mov	ebx, DWORD PTR [rax]
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L29:
	mov	eax, DWORD PTR localfd[rip]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L30
	call	__errno_location@PLT
	mov	ebx, DWORD PTR [rax]
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L30:
	lea	rdi, .LC13[rip]
	call	puts@PLT
.L38:
	mov	DWORD PTR -84[rbp], 16
	lea	rax, -48[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR cc[rip]
	cmp	eax, 14
	jg	.L31
	mov	eax, DWORD PTR localfd[rip]
	mov	ebx, DWORD PTR cc[rip]
	lea	rdx, -84[rbp]
	lea	rcx, -48[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	movsx	rdx, ebx
	lea	rcx, 0[0+rdx*8]
	lea	rdx, connectfd[rip]
	mov	DWORD PTR [rcx+rdx], eax
	movsx	rax, ebx
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, -1
	jne	.L32
	call	__errno_location@PLT
	mov	ebx, DWORD PTR [rax]
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L32:
	mov	eax, DWORD PTR cc[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR cc[rip], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip+4]
	mov	DWORD PTR [rdx+rax], 1
	cmp	DWORD PTR -80[rbp], -1
	je	.L35
	jmp	.L40
.L31:
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -84[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	wait@PLT
	mov	edi, 0
	call	closeConnect
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L39
	jmp	.L41
.L40:
	mov	eax, DWORD PTR -80[rbp]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
.L35:
	call	fork@PLT
	mov	DWORD PTR -80[rbp], eax
	cmp	DWORD PTR -80[rbp], 0
	jne	.L38
	mov	esi, 0
	mov	edi, 2
	call	signal@PLT
	mov	eax, DWORD PTR localfd[rip]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, DWORD PTR cc[rip]
	sub	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connectfd[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -76[rbp], eax
	movzx	eax, WORD PTR -46[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	ntohs@PLT
	movzx	ebx, ax
	mov	eax, DWORD PTR -44[rbp]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	rsi, rax
	mov	eax, DWORD PTR -76[rbp]
	mov	ecx, eax
	mov	edx, ebx
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rcx, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	connectionHandler
	jmp	.L38
.L41:
	call	__stack_chk_fail@PLT
.L39:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"44485.c"
	.text
	.comm	father_pid,4,4
	.comm	localfd,4,4
	.comm	connectfd,120,4
	.global	cc
	.bss
	.align	2
	.type	cc, %object
	.size	cc, 4
cc:
	.space	4
	.comm	now,64,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Closing connection...\000"
	.align	2
.LC1:
	.ascii	"Server stopped. All clients will be disconnected.\000"
	.text
	.align	2
	.global	closeConnect
	.syntax unified
	.arm
	.fpu softvfp
	.type	closeConnect, %function
closeConnect:
	@ 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]
	ldr	r0, .L7
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L5:
	ldr	r2, .L7+4
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	cmp	r3, #1
	bne	.L3
	ldr	r2, .L7+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #3]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	bl	__errno_location
	b	.L1
.L3:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, .L7+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L5
	ldr	r3, .L7+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	bl	__errno_location
	b	.L1
.L6:
	ldr	r0, .L7+16
	bl	puts
	mov	r0, #0
	bl	exit
.L1:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC0
	.word	connectfd
	.word	cc
	.word	localfd
	.word	.LC1
	.size	closeConnect, .-closeConnect
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%Y-%m-%d %H:%M:%S\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getCurrentTime
	.syntax unified
	.arm
	.fpu softvfp
	.type	getCurrentTime, %function
getCurrentTime:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #16
	mov	r0, r3
	bl	time
	sub	r3, fp, #16
	mov	r0, r3
	bl	localtime
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r2, .L12+4
	mov	r1, #79
	ldr	r0, .L12+8
	bl	strftime
	ldr	r3, .L12+8
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC3
	.word	.LC2
	.word	now
	.size	getCurrentTime, .-getCurrentTime
	.section	.rodata
	.align	2
.LC4:
	.ascii	"<%s CLIENT %s:%d> %s\000"
	.align	2
.LC5:
	.ascii	"Client %s:%d disconnected\012\000"
	.align	2
.LC6:
	.ascii	"exit\012\000"
	.align	2
.LC7:
	.ascii	"Fail to send message: %s(erro: %d)\000"
	.align	2
.LC8:
	.ascii	"CONNECTIO_CLOSED\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	connectionHandler
	.syntax unified
	.arm
	.fpu softvfp
	.type	connectionHandler, %function
connectionHandler:
	@ args = 20, pretend = 16, frame = 8224
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #8192
	sub	sp, sp, #40
	sub	ip, fp, #8192
	sub	ip, ip, #12
	str	r0, [ip, #-28]
	add	r0, fp, #8
	stm	r0, {r1, r2, r3}
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	bl	fork
	mov	r3, r0
	str	r3, [r4, #-16]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-16]
	cmp	r3, #0
	bne	.L15
.L18:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r1, fp, #4096
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	mov	r2, #4096
	ldr	r0, [r0, #-28]
	bl	recv
	str	r0, [r4, #-8]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmp	r3, #0
	ble	.L28
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	add	r3, r2, r3
	sub	r3, r3, #4
	mov	r2, #0
	strb	r2, [r3]
	bl	getCurrentTime
	mov	r4, r0
	ldr	r0, [fp, #12]
	bl	inet_ntoa
	mov	r5, r0
	ldrh	r3, [fp, #10]
	mov	r0, r3
	bl	ntohs
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	str	r3, [sp]
	mov	r3, r2
	mov	r2, r5
	mov	r1, r4
	ldr	r0, .L29+4
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r1, #0
	mov	r0, r3
	bl	memset
	b	.L18
.L28:
	nop
	ldr	r0, [fp, #12]
	bl	inet_ntoa
	mov	r4, r0
	ldrh	r3, [fp, #10]
	mov	r0, r3
	bl	ntohs
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L29+8
	bl	printf
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-28]
	bl	close
	mov	r0, #0
	bl	exit
.L15:
	ldr	r3, .L29+12
	ldr	r2, [r3]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, #4096
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, .L29+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L29+20
	ldr	r3, [r3]
	mov	r1, #10
	mov	r0, r3
	bl	kill
	nop
	nop
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L25
	b	.L27
.L19:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-20]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-20]
	b	.L21
.L24:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-12]
	ldr	r2, .L29+24
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	cmp	r3, #1
	bne	.L22
	ldr	r2, .L29+24
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	ldr	r4, [r2, r3, lsl #3]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r5, r3
	sub	r1, fp, #8192
	sub	r1, r1, #12
	sub	r1, r1, #4
	mov	r3, #0
	mov	r0, r4
	bl	send
	str	r0, [r5, #-12]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-12]
	cmp	r3, #0
	bge	.L23
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #8192
	sub	r2, r2, #12
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-4]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r4, r0
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L29+28
	bl	printf
.L23:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-12]
	cmp	r3, #0
	bne	.L22
	ldr	r2, .L29+24
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	lsl	r3, r3, #3
	add	r3, r2, r3
	mvn	r2, #0
	str	r2, [r3, #4]
	ldr	r0, .L29+32
	bl	puts
.L22:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	add	r3, r3, #1
	str	r3, [r2, #-20]
.L21:
	ldr	r3, .L29+36
	ldr	r3, [r3]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	ldr	r2, [r2, #-20]
	cmp	r2, r3
	blt	.L24
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r1, #0
	mov	r0, r3
	bl	memset
	b	.L15
.L27:
	bl	__stack_chk_fail
.L25:
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, lr}
	add	sp, sp, #16
	bx	lr
.L30:
	.align	2
.L29:
	.word	.LC9
	.word	.LC4
	.word	.LC5
	.word	stdin
	.word	.LC6
	.word	father_pid
	.word	connectfd
	.word	.LC7
	.word	.LC8
	.word	cc
	.size	connectionHandler, .-connectionHandler
	.section	.rodata
	.align	2
.LC10:
	.ascii	"A simple TCP duplex communication program. Press [C"
	.ascii	"trl] + [C] to exit.\012\000"
	.align	2
.LC11:
	.ascii	"Invalid arguments. Usage: server.o port\000"
	.align	2
.LC12:
	.ascii	"Error occured in socket().\000"
	.align	2
.LC13:
	.ascii	"Error occured in bind(): %s(errno: %d)\012\000"
	.align	2
.LC14:
	.ascii	"Error occured in listen(): %s(errno: %d)\012\000"
	.align	2
.LC15:
	.ascii	"Socket established. Waiting for client...\000"
	.align	2
.LC16:
	.ascii	"Error occured in accept(): %s(errno: %d)\000"
	.align	2
.LC17:
	.ascii	"Max client count reached.\000"
	.align	2
.LC18:
	.ascii	"Client %s:%d connected. clientfd = %d.\012\000"
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #76
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L48
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r0, .L48+4
	bl	puts
	ldr	r3, [fp, #-72]
	cmp	r3, #2
	bne	.L32
	ldr	r3, [fp, #-76]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-60]
	b	.L33
.L32:
	ldr	r0, .L48+8
	bl	puts
.L33:
	mvn	r3, #0
	str	r3, [fp, #-56]
	ldr	r1, .L48+12
	mov	r0, #2
	bl	signal
	ldr	r1, .L48+12
	mov	r0, #10
	bl	signal
	bl	getpid
	mov	r3, r0
	ldr	r2, .L48+16
	str	r3, [r2]
	mov	r2, #60
	mov	r1, #0
	ldr	r0, .L48+20
	bl	memset
	sub	r3, fp, #48
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r0, #0
	bl	htons
	mov	r3, r0
	str	r3, [fp, #-44]
	mov	r3, #2
	strh	r3, [fp, #-48]	@ movhi
	ldr	r0, [fp, #-60]
	bl	atoi
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-46]	@ movhi
	mov	r2, #6
	mov	r1, #1
	mov	r0, #2
	bl	socket
	mov	r3, r0
	ldr	r2, .L48+24
	str	r3, [r2]
	ldr	r3, .L48+24
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L34
	ldr	r0, .L48+28
	bl	puts
	mvn	r0, #0
	bl	exit
.L34:
	ldr	r3, .L48+24
	ldr	r3, [r3]
	sub	r1, fp, #48
	mov	r2, #16
	mov	r0, r3
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L35
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r4, r0
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L48+32
	bl	printf
	mvn	r0, #0
	bl	exit
.L35:
	ldr	r3, .L48+24
	ldr	r3, [r3]
	mov	r1, #5
	mov	r0, r3
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L36
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r4, r0
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L48+36
	bl	printf
	mvn	r0, #0
	bl	exit
.L36:
	ldr	r0, .L48+40
	bl	puts
.L44:
	mov	r3, #16
	str	r3, [fp, #-64]
	sub	r3, fp, #32
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L48+44
	ldr	r3, [r3]
	cmp	r3, #14
	bgt	.L37
	ldr	r3, .L48+24
	ldr	r3, [r3]
	ldr	r2, .L48+44
	ldr	r4, [r2]
	sub	r2, fp, #64
	sub	r1, fp, #32
	mov	r0, r3
	bl	accept
	mov	r3, r0
	ldr	r2, .L48+20
	str	r3, [r2, r4, lsl #3]
	ldr	r3, .L48+20
	ldr	r3, [r3, r4, lsl #3]
	cmn	r3, #1
	bne	.L38
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r4, r0
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L48+48
	bl	printf
	mvn	r0, #0
	bl	exit
.L38:
	ldr	r3, .L48+44
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L48+44
	str	r2, [r1]
	ldr	r2, .L48+20
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r2, #1
	str	r2, [r3, #4]
	ldr	r3, [fp, #-56]
	cmn	r3, #1
	beq	.L41
	b	.L46
.L37:
	ldr	r0, .L48+52
	bl	printf
	sub	r3, fp, #64
	mov	r0, r3
	bl	wait
	mov	r0, #0
	bl	closeConnect
	mov	r3, #0
	ldr	r2, .L48
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L45
	b	.L47
.L46:
	mov	r1, #9
	ldr	r0, [fp, #-56]
	bl	kill
.L41:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L44
	mov	r1, #0
	mov	r0, #2
	bl	signal
	ldr	r3, .L48+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L48+44
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L48+20
	ldr	r3, [r2, r3, lsl #3]
	str	r3, [fp, #-52]
	ldr	r0, [fp, #-28]
	bl	inet_ntoa
	mov	r4, r0
	ldrh	r3, [fp, #-30]
	mov	r0, r3
	bl	ntohs
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-52]
	mov	r1, r4
	ldr	r0, .L48+56
	bl	printf
	ldr	r3, [fp, #-20]
	str	r3, [sp]
	sub	r3, fp, #32
	ldm	r3, {r1, r2, r3}
	ldr	r0, [fp, #-52]
	bl	connectionHandler
	b	.L44
.L47:
	bl	__stack_chk_fail
.L45:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L49:
	.align	2
.L48:
	.word	.LC19
	.word	.LC10
	.word	.LC11
	.word	closeConnect
	.word	father_pid
	.word	connectfd
	.word	localfd
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	cc
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
