	.file	"18888864.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s <Server IP> <Echo Word> [<Echo Port>]\n"
.LC1:
	.string	"socket() failed"
.LC2:
	.string	"connect() failed"
	.align 8
.LC3:
	.string	"send() sent a different number of bytes than expected"
	.align 8
.LC4:
	.string	"recv() failed or connection closed prematurely"
.LC5:
	.string	"%s"
	.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, 352
	mov	DWORD PTR -340[rbp], edi
	mov	QWORD PTR -352[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -340[rbp], 2
	jle	.L2
	cmp	DWORD PTR -340[rbp], 4
	jle	.L3
.L2:
	mov	rax, QWORD PTR -352[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -352[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -304[rbp], rax
	mov	rax, QWORD PTR -352[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -296[rbp], rax
	cmp	DWORD PTR -340[rbp], 4
	jne	.L4
	mov	rax, QWORD PTR -352[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	WORD PTR -322[rbp], ax
	jmp	.L5
.L4:
	mov	WORD PTR -322[rbp], 7
.L5:
	mov	edx, 6
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -316[rbp], eax
	cmp	DWORD PTR -316[rbp], 0
	jns	.L6
	lea	rdi, .LC1[rip]
	call	DieWithError
.L6:
	lea	rax, -288[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -288[rbp], 2
	mov	rax, QWORD PTR -304[rbp]
	mov	rdi, rax
	call	inet_addr@PLT
	mov	DWORD PTR -284[rbp], eax
	movzx	eax, WORD PTR -322[rbp]
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -286[rbp], ax
	lea	rcx, -288[rbp]
	mov	eax, DWORD PTR -316[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	jns	.L7
	lea	rdi, .LC2[rip]
	call	DieWithError
.L7:
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -312[rbp], eax
	mov	edx, DWORD PTR -312[rbp]
	mov	rsi, QWORD PTR -296[rbp]
	mov	eax, DWORD PTR -316[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	edx, DWORD PTR -312[rbp]
	cmp	rax, rdx
	je	.L8
	lea	rdi, .LC3[rip]
	call	DieWithError
.L8:
	mov	DWORD PTR -320[rbp], 0
	mov	rax, QWORD PTR -296[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 98
	je	.L9
	mov	rax, QWORD PTR -296[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 113
	jne	.L11
.L9:
	mov	eax, DWORD PTR -316[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
.L13:
	lea	rsi, -272[rbp]
	mov	eax, DWORD PTR -316[rbp]
	mov	ecx, 0
	mov	edx, 255
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -308[rbp], eax
	cmp	DWORD PTR -308[rbp], 0
	jg	.L12
	lea	rdi, .LC4[rip]
	call	DieWithError
.L12:
	mov	eax, DWORD PTR -308[rbp]
	add	DWORD PTR -320[rbp], eax
	mov	eax, DWORD PTR -308[rbp]
	cdqe
	mov	BYTE PTR -272[rbp+rax], 0
	lea	rax, -272[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L11:
	mov	eax, DWORD PTR -320[rbp]
	cmp	DWORD PTR -312[rbp], eax
	ja	.L13
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR -316[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"%s\n"
	.text
	.globl	DieWithError
	.type	DieWithError, @function
DieWithError:
.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 stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	DieWithError, .-DieWithError
	.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	"18888864.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <Server IP> <Echo Word> [<Echo Port>]\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"socket() failed\000"
	.align	2
.LC2:
	.ascii	"connect() failed\000"
	.align	2
.LC3:
	.ascii	"send() sent a different number of bytes than expect"
	.ascii	"ed\000"
	.align	2
.LC4:
	.ascii	"recv() failed or connection closed prematurely\000"
	.align	2
.LC5:
	.ascii	"%s\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 312
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #312
	str	r0, [fp, #-312]
	str	r1, [fp, #-316]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-312]
	cmp	r3, #2
	ble	.L2
	ldr	r3, [fp, #-312]
	cmp	r3, #4
	ble	.L3
.L2:
	ldr	r3, .L15+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-316]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L15+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-316]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-300]
	ldr	r3, [fp, #-316]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-296]
	ldr	r3, [fp, #-312]
	cmp	r3, #4
	bne	.L4
	ldr	r3, [fp, #-316]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r2, r0
	sub	r3, fp, #4
	sub	r3, r3, #300
	sub	r3, r3, #2
	strh	r2, [r3]	@ movhi
	b	.L5
.L4:
	sub	r3, fp, #4
	sub	r3, r3, #300
	sub	r3, r3, #2
	mov	r2, #7
	strh	r2, [r3]	@ movhi
.L5:
	mov	r2, #6
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-292]
	ldr	r3, [fp, #-292]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L15+12
	bl	DieWithError
.L6:
	sub	r3, fp, #280
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4
	sub	r3, r3, #276
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r0, [fp, #-300]
	bl	inet_addr
	mov	r3, r0
	str	r3, [fp, #-276]
	sub	r3, fp, #4
	sub	r3, r3, #300
	sub	r3, r3, #2
	ldrh	r3, [r3]
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #276
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #280
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-292]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L15+16
	bl	DieWithError
.L7:
	ldr	r0, [fp, #-296]
	bl	strlen
	str	r0, [fp, #-288]
	mov	r3, #0
	ldr	r2, [fp, #-288]
	ldr	r1, [fp, #-296]
	ldr	r0, [fp, #-292]
	bl	send
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-288]
	cmp	r3, r2
	beq	.L8
	ldr	r0, .L15+20
	bl	DieWithError
.L8:
	mov	r3, #0
	str	r3, [fp, #-304]
	ldr	r3, [fp, #-296]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #98
	beq	.L9
	ldr	r3, [fp, #-296]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #113
	bne	.L11
.L9:
	ldr	r0, [fp, #-292]
	bl	close
	mov	r0, #0
	bl	exit
.L13:
	sub	r1, fp, #264
	mov	r3, #0
	mov	r2, #255
	ldr	r0, [fp, #-292]
	bl	recv
	str	r0, [fp, #-284]
	ldr	r3, [fp, #-284]
	cmp	r3, #0
	bgt	.L12
	ldr	r0, .L15+24
	bl	DieWithError
.L12:
	ldr	r2, [fp, #-304]
	ldr	r3, [fp, #-284]
	add	r3, r2, r3
	str	r3, [fp, #-304]
	sub	r2, fp, #264
	ldr	r3, [fp, #-284]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, .L15+28
	bl	printf
.L11:
	ldr	r3, [fp, #-304]
	ldr	r2, [fp, #-288]
	cmp	r2, r3
	bhi	.L13
	mov	r0, #10
	bl	putchar
	ldr	r0, [fp, #-292]
	bl	close
	mov	r0, #0
	bl	exit
.L16:
	.align	2
.L15:
	.word	.LC6
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC7:
	.ascii	"%s\012\000"
	.text
	.align	2
	.global	DieWithError
	.syntax unified
	.arm
	.fpu softvfp
	.type	DieWithError, %function
DieWithError:
	@ 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	r3, .L19
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L19+4
	mov	r0, r3
	bl	fprintf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	stderr
	.word	.LC7
	.size	DieWithError, .-DieWithError
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
