	.file	"536589.c"
	.intel_syntax noprefix
	.text
	.globl	serv_addr
	.bss
	.align 16
	.type	serv_addr, @object
	.size	serv_addr, 16
serv_addr:
	.zero	16
	.globl	cli_addr
	.align 16
	.type	cli_addr, @object
	.size	cli_addr, 16
cli_addr:
	.zero	16
	.globl	listenfd
	.align 4
	.type	listenfd, @object
	.size	listenfd, 4
listenfd:
	.zero	4
	.globl	connfd
	.align 4
	.type	connfd, @object
	.size	connfd, 4
connfd:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	val
	.align 4
	.type	val, @object
	.size	val, 4
val:
	.zero	4
	.globl	cli_addr_len
	.align 4
	.type	cli_addr_len, @object
	.size	cli_addr_len, 4
cli_addr_len:
	.zero	4
	.globl	serv_port
	.data
	.align 2
	.type	serv_port, @object
	.size	serv_port, 2
serv_port:
	.value	25020
	.globl	serv_ip
	.align 8
	.type	serv_ip, @object
	.size	serv_ip, 10
serv_ip:
	.string	"127.0.0.1"
	.globl	buff
	.bss
	.align 32
	.type	buff, @object
	.size	buff, 256
buff:
	.zero	256
	.globl	ticks
	.align 8
	.type	ticks, @object
	.size	ticks, 8
ticks:
	.zero	8
	.section	.rodata
.LC0:
	.string	"\nTCP TIME SERVER."
	.align 8
.LC1:
	.string	"\nSERVER ERROR: Cannot create socket."
.LC2:
	.string	"\nSERVER ERROR: Cannot bind."
.LC3:
	.string	"\nSERVER ERROR: Cannot listen."
	.align 8
.LC4:
	.string	"\nSERVER: Listenning for clients...Press Cntrl + c to stop echo server."
	.align 8
.LC5:
	.string	"\nSERVER ERROR: Cannot accept client connections."
	.align 8
.LC6:
	.string	"\nSERVER: Connection fron client %s accepted.\n"
.LC7:
	.string	"%s"
	.align 8
.LC8:
	.string	"\nSERVER ERROR: Cannot send message to the client."
	.align 8
.LC9:
	.string	"\nSERVER: Time sent to client %s.\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
	mov	QWORD PTR serv_addr[rip], 0
	mov	QWORD PTR serv_addr[rip+8], 0
	mov	WORD PTR serv_addr[rip], 2
	movzx	eax, WORD PTR serv_port[rip]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR serv_addr[rip+2], ax
	lea	rsi, serv_addr[rip+4]
	lea	rdi, serv_ip[rip]
	call	inet_aton@PLT
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR listenfd[rip], eax
	mov	eax, DWORD PTR listenfd[rip]
	test	eax, eax
	jns	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR listenfd[rip]
	mov	edx, 16
	lea	rsi, serv_addr[rip]
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, DWORD PTR listenfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR listenfd[rip]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, DWORD PTR listenfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	DWORD PTR cli_addr_len[rip], 16
.L8:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, DWORD PTR listenfd[rip]
	lea	rdx, cli_addr_len[rip]
	lea	rsi, cli_addr[rip]
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR connfd[rip], eax
	mov	eax, DWORD PTR connfd[rip]
	test	eax, eax
	jns	.L5
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, DWORD PTR listenfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR cli_addr[rip+4]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR ticks[rip], rax
	lea	rdi, ticks[rip]
	call	ctime@PLT
	mov	rcx, rax
	lea	rdx, .LC7[rip]
	mov	esi, 256
	lea	rdi, buff[rip]
	mov	eax, 0
	call	snprintf@PLT
	mov	eax, DWORD PTR connfd[rip]
	mov	edx, 256
	lea	rsi, buff[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR w[rip], eax
	mov	eax, DWORD PTR w[rip]
	test	eax, eax
	jns	.L6
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L8
.L6:
	mov	eax, DWORD PTR cli_addr[rip+4]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L8
	.cfi_endproc
.LFE6:
	.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	"536589.c"
	.text
	.comm	serv_addr,16,4
	.comm	cli_addr,16,4
	.comm	listenfd,4,4
	.comm	connfd,4,4
	.comm	r,4,4
	.comm	w,4,4
	.comm	val,4,4
	.comm	cli_addr_len,4,4
	.global	serv_port
	.data
	.align	1
	.type	serv_port, %object
	.size	serv_port, 2
serv_port:
	.short	25020
	.global	serv_ip
	.align	2
	.type	serv_ip, %object
	.size	serv_ip, 10
serv_ip:
	.ascii	"127.0.0.1\000"
	.comm	buff,256,4
	.comm	ticks,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012TCP TIME SERVER.\000"
	.align	2
.LC1:
	.ascii	"\012SERVER ERROR: Cannot create socket.\000"
	.align	2
.LC2:
	.ascii	"\012SERVER ERROR: Cannot bind.\000"
	.align	2
.LC3:
	.ascii	"\012SERVER ERROR: Cannot listen.\000"
	.align	2
.LC4:
	.ascii	"\012SERVER: Listenning for clients...Press Cntrl + "
	.ascii	"c to stop echo server.\000"
	.align	2
.LC5:
	.ascii	"\012SERVER ERROR: Cannot accept client connections."
	.ascii	"\000"
	.align	2
.LC6:
	.ascii	"\012SERVER: Connection fron client %s accepted.\012"
	.ascii	"\000"
	.align	2
.LC7:
	.ascii	"%s\000"
	.align	2
.LC8:
	.ascii	"\012SERVER ERROR: Cannot send message to the client"
	.ascii	".\000"
	.align	2
.LC9:
	.ascii	"\012SERVER: Time sent to client %s.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L9
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	ldr	r3, .L9
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r3, .L9+4
	ldrh	r3, [r3]
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L9
	strh	r2, [r3, #2]	@ movhi
	ldr	r1, .L9+8
	ldr	r0, .L9+12
	bl	inet_aton
	ldr	r0, .L9+16
	bl	puts
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	mov	r3, r0
	ldr	r2, .L9+20
	str	r3, [r2]
	ldr	r3, .L9+20
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L9+24
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, .L9+20
	ldr	r3, [r3]
	mov	r2, #16
	ldr	r1, .L9
	mov	r0, r3
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L9+28
	bl	puts
	ldr	r3, .L9+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, .L9+20
	ldr	r3, [r3]
	mov	r1, #5
	mov	r0, r3
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L9+32
	bl	puts
	ldr	r3, .L9+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, .L9+36
	mov	r2, #16
	str	r2, [r3]
.L8:
	ldr	r0, .L9+40
	bl	puts
	ldr	r3, .L9+20
	ldr	r3, [r3]
	ldr	r2, .L9+36
	ldr	r1, .L9+44
	mov	r0, r3
	bl	accept
	mov	r3, r0
	ldr	r2, .L9+48
	str	r3, [r2]
	ldr	r3, .L9+48
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L9+52
	bl	puts
	ldr	r3, .L9+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, .L9+44
	ldr	r0, [r3, #4]
	bl	inet_ntoa
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L9+56
	bl	printf
	mov	r0, #0
	bl	time
	mov	r3, r0
	ldr	r2, .L9+60
	str	r3, [r2]
	ldr	r0, .L9+60
	bl	ctime
	mov	r3, r0
	ldr	r2, .L9+64
	mov	r1, #256
	ldr	r0, .L9+68
	bl	snprintf
	ldr	r3, .L9+48
	ldr	r3, [r3]
	mov	r2, #256
	ldr	r1, .L9+68
	mov	r0, r3
	bl	write
	mov	r3, r0
	ldr	r2, .L9+72
	str	r3, [r2]
	ldr	r3, .L9+72
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L9+76
	bl	puts
	b	.L8
.L6:
	ldr	r3, .L9+44
	ldr	r0, [r3, #4]
	bl	inet_ntoa
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L9+80
	bl	printf
	b	.L8
.L10:
	.align	2
.L9:
	.word	serv_addr
	.word	serv_port
	.word	serv_addr+4
	.word	serv_ip
	.word	.LC0
	.word	listenfd
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	cli_addr_len
	.word	.LC4
	.word	cli_addr
	.word	connfd
	.word	.LC5
	.word	.LC6
	.word	ticks
	.word	.LC7
	.word	buff
	.word	w
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
