	.file	"129109.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: EchoServer <port>\n"
.LC1:
	.string	"Error: Unknown host"
.LC2:
	.string	"Error: Socket/Bind"
.LC3:
	.string	"Error: Listen"
.LC4:
	.string	"Error: Accept"
.LC5:
	.string	"Error: Read"
.LC6:
	.string	"Error: Write"
	.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, 496
	mov	DWORD PTR -484[rbp], edi
	mov	QWORD PTR -496[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -480[rbp], 128
	cmp	DWORD PTR -484[rbp], 1
	jg	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rax, -448[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -444[rbp], 10
	mov	DWORD PTR -440[rbp], 1
	mov	DWORD PTR -448[rbp], 1
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rcx, -464[rbp]
	lea	rdx, -448[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	getaddrinfo@PLT
	test	eax, eax
	je	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -464[rbp]
	mov	QWORD PTR -456[rbp], rax
.L8:
	mov	rax, QWORD PTR -464[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -464[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -464[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -476[rbp], eax
	cmp	DWORD PTR -476[rbp], 0
	js	.L19
	mov	rax, QWORD PTR -464[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -464[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -476[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	je	.L20
	mov	eax, DWORD PTR -476[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L5
.L19:
	nop
.L5:
	mov	rax, QWORD PTR -464[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -464[rbp], rax
	mov	rax, QWORD PTR -464[rbp]
	test	rax, rax
	jne	.L8
	jmp	.L7
.L20:
	nop
.L7:
	mov	rax, QWORD PTR -464[rbp]
	test	rax, rax
	jne	.L9
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -456[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR -476[rbp]
	mov	esi, 4096
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L10
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	lea	rdx, -480[rbp]
	lea	rcx, -400[rbp]
	mov	eax, DWORD PTR -476[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -472[rbp], eax
	cmp	DWORD PTR -472[rbp], 0
	jns	.L11
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -472[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -468[rbp], eax
	cmp	DWORD PTR -468[rbp], 0
	jns	.L12
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	cmp	DWORD PTR -468[rbp], 0
	je	.L21
	mov	eax, DWORD PTR -468[rbp]
	movsx	rdx, eax
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -472[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jns	.L11
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	nop
	mov	eax, DWORD PTR -472[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -476[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"129109.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: EchoServer <port>\012\000"
	.align	2
.LC1:
	.ascii	"Error: Unknown host\000"
	.align	2
.LC2:
	.ascii	"Error: Socket/Bind\000"
	.align	2
.LC3:
	.ascii	"Error: Listen\000"
	.align	2
.LC4:
	.ascii	"Error: Accept\000"
	.align	2
.LC5:
	.ascii	"Error: Read\000"
	.align	2
.LC6:
	.ascii	"Error: Write\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 = 456
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #456
	str	r0, [fp, #-456]
	str	r1, [fp, #-460]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #128
	str	r3, [fp, #-444]
	ldr	r3, [fp, #-456]
	cmp	r3, #1
	bgt	.L2
	ldr	r3, .L22+4
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L22+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #424
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #10
	str	r3, [fp, #-420]
	mov	r3, #1
	str	r3, [fp, #-416]
	mov	r3, #1
	str	r3, [fp, #-424]
	ldr	r3, [fp, #-460]
	add	r3, r3, #4
	ldr	r1, [r3]
	sub	r3, fp, #448
	sub	r2, fp, #424
	mov	r0, #0
	bl	getaddrinfo
	mov	r3, r0
	cmp	r3, #0
	beq	.L3
	ldr	r0, .L22+12
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-448]
	str	r3, [fp, #-440]
.L8:
	ldr	r3, [fp, #-448]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-448]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-448]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-436]
	ldr	r3, [fp, #-436]
	cmp	r3, #0
	blt	.L19
	ldr	r3, [fp, #-448]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-448]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-436]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	beq	.L20
	ldr	r0, [fp, #-436]
	bl	close
	b	.L5
.L19:
	nop
.L5:
	ldr	r3, [fp, #-448]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-448]
	ldr	r3, [fp, #-448]
	cmp	r3, #0
	bne	.L8
	b	.L7
.L20:
	nop
.L7:
	ldr	r3, [fp, #-448]
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L22+16
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r0, [fp, #-440]
	bl	freeaddrinfo
	mov	r1, #4096
	ldr	r0, [fp, #-436]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L22+20
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	sub	r2, fp, #444
	sub	r3, fp, #392
	mov	r1, r3
	ldr	r0, [fp, #-436]
	bl	accept
	str	r0, [fp, #-432]
	ldr	r3, [fp, #-432]
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L22+24
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	sub	r3, fp, #264
	mov	r2, #256
	mov	r1, r3
	ldr	r0, [fp, #-432]
	bl	read
	str	r0, [fp, #-428]
	ldr	r3, [fp, #-428]
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L22+28
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-428]
	cmp	r3, #0
	beq	.L21
	ldr	r2, [fp, #-428]
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, [fp, #-432]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L22+32
	bl	perror
	mov	r0, #1
	bl	exit
.L21:
	nop
	ldr	r0, [fp, #-432]
	bl	close
	ldr	r0, [fp, #-436]
	bl	close
	mov	r3, #0
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC7
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
