	.file	"129636.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage:  %s <server hostname or address> <port number>\n"
.LC1:
	.string	"Error getting addrinfo: %s\n"
.LC2:
	.string	"Trying %s...\n"
.LC3:
	.string	"Unable to connect to server\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
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -116[rbp], 3
	je	.L2
	mov	rax, QWORD PTR -128[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
.L2:
	lea	rax, -80[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -76[rbp], 2
	mov	DWORD PTR -72[rbp], 2
	mov	DWORD PTR -68[rbp], 17
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 16
	mov	rsi, QWORD PTR [rax]
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rcx, -96[rbp]
	lea	rdx, -80[rbp]
	mov	rdi, rax
	call	getaddrinfo@PLT
	mov	DWORD PTR -100[rbp], eax
	cmp	DWORD PTR -100[rbp], 0
	je	.L3
	mov	eax, DWORD PTR -100[rbp]
	mov	edi, eax
	call	gai_strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	QWORD PTR -88[rbp], rax
	jmp	.L4
.L7:
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -88[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -88[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -104[rbp], eax
	cmp	DWORD PTR -104[rbp], 0
	jns	.L11
	mov	rax, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -88[rbp], rax
.L4:
	cmp	QWORD PTR -88[rbp], 0
	jne	.L7
	jmp	.L6
.L11:
	nop
.L6:
	cmp	QWORD PTR -88[rbp], 0
	jne	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -88[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	edx, eax
	mov	rax, QWORD PTR -88[rbp]
	mov	rcx, QWORD PTR 24[rax]
	lea	rax, -32[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	lea	rdx, -32[rbp]
	mov	eax, DWORD PTR -104[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	DoEchoClient
	mov	eax, DWORD PTR -104[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.string	"Enter message to send [empty message exits]:"
.LC5:
	.string	"Error receiving echo"
.LC6:
	.string	"Received bytes: %s\n"
.LC7:
	.string	"Error reading user input"
	.align 8
.LC8:
	.string	"Error sending message to server"
	.text
	.globl	DoEchoClient
	.type	DoEchoClient, @function
DoEchoClient:
.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, 1088
	mov	DWORD PTR -1076[rbp], edi
	mov	QWORD PTR -1088[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -1076[rbp]
	mov	DWORD PTR -1056[rbp], eax
	mov	WORD PTR -1052[rbp], 1
	mov	DWORD PTR -1048[rbp], 0
	mov	WORD PTR -1044[rbp], 1
	lea	rdi, .LC4[rip]
	call	puts@PLT
.L20:
	lea	rax, -1056[rbp]
	mov	edx, -1
	mov	esi, 2
	mov	rdi, rax
	call	poll@PLT
	movzx	eax, WORD PTR -1050[rbp]
	cwde
	and	eax, 1
	test	eax, eax
	je	.L13
	lea	rsi, -1040[rbp]
	mov	eax, DWORD PTR -1076[rbp]
	mov	ecx, 0
	mov	edx, 1024
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -1060[rbp], eax
	cmp	DWORD PTR -1060[rbp], 0
	jns	.L14
	lea	rdi, .LC5[rip]
	call	perror@PLT
	jmp	.L15
.L14:
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -1040[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
.L13:
	movzx	eax, WORD PTR -1042[rbp]
	cwde
	and	eax, 1
	test	eax, eax
	je	.L20
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L17
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	rax, QWORD PTR stdin[rip]
	mov	rdi, rax
	call	ferror@PLT
	mov	DWORD PTR -1060[rbp], eax
	jmp	.L15
.L17:
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -1040[rbp+rax], 0
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, 1[rax]
	mov	rcx, QWORD PTR -1088[rbp]
	lea	rsi, -1040[rbp]
	mov	eax, DWORD PTR -1076[rbp]
	mov	r9d, 16
	mov	r8, rcx
	mov	ecx, 0
	mov	edi, eax
	call	sendto@PLT
	mov	DWORD PTR -1060[rbp], eax
	cmp	DWORD PTR -1060[rbp], 0
	jns	.L18
	lea	rdi, .LC8[rip]
	call	perror@PLT
	jmp	.L15
.L18:
	movzx	eax, BYTE PTR -1040[rbp]
	test	al, al
	jne	.L19
	mov	DWORD PTR -1060[rbp], 0
	jmp	.L15
.L19:
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -1040[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	jmp	.L20
.L15:
	mov	eax, DWORD PTR -1060[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	DoEchoClient, .-DoEchoClient
	.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	"129636.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage:  %s <server hostname or address> <port numbe"
	.ascii	"r>\012\000"
	.align	2
.LC1:
	.ascii	"Error getting addrinfo: %s\012\000"
	.align	2
.LC2:
	.ascii	"Trying %s...\012\000"
	.align	2
.LC3:
	.ascii	"Unable to connect to server\012.\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 = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #84
	str	r0, [fp, #-88]
	str	r1, [fp, #-92]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-88]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L12+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L12+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #64
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	str	r3, [fp, #-60]
	mov	r3, #2
	str	r3, [fp, #-56]
	mov	r3, #17
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-92]
	add	r3, r3, #4
	ldr	r0, [r3]
	ldr	r3, [fp, #-92]
	add	r3, r3, #8
	ldr	r1, [r3]
	sub	r3, fp, #80
	sub	r2, fp, #64
	bl	getaddrinfo
	str	r0, [fp, #-68]
	ldr	r3, [fp, #-68]
	cmp	r3, #0
	beq	.L3
	ldr	r3, .L12+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-68]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L12+12
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-92]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L12+16
	bl	printf
	ldr	r3, [fp, #-80]
	str	r3, [fp, #-72]
	b	.L4
.L7:
	ldr	r3, [fp, #-72]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-72]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-72]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	bge	.L11
	ldr	r3, [fp, #-72]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-72]
.L4:
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bne	.L7
	b	.L6
.L11:
	nop
.L6:
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bne	.L8
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L12+20
	bl	fwrite
	ldr	r3, [fp, #-80]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r0, #1
	bl	exit
.L8:
	sub	r3, fp, #32
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-72]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-72]
	ldr	r2, [r3, #16]
	sub	r3, fp, #32
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-80]
	mov	r0, r3
	bl	freeaddrinfo
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, [fp, #-76]
	bl	DoEchoClient
	ldr	r0, [fp, #-76]
	bl	close
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC4
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Enter message to send [empty message exits]:\000"
	.align	2
.LC6:
	.ascii	"Error receiving echo\000"
	.align	2
.LC7:
	.ascii	"Received bytes: %s\012\000"
	.align	2
.LC8:
	.ascii	"Error reading user input\000"
	.align	2
.LC9:
	.ascii	"Error sending message to server\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	DoEchoClient
	.syntax unified
	.arm
	.fpu softvfp
	.type	DoEchoClient, %function
DoEchoClient:
	@ args = 0, pretend = 0, frame = 1064
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1072
	str	r0, [fp, #-1064]
	str	r1, [fp, #-1068]
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1064]
	str	r3, [fp, #-1052]
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #8
	mov	r2, #1
	strh	r2, [r3, #4]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-1044]
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #8
	mov	r2, #1
	strh	r2, [r3, #12]	@ movhi
	ldr	r0, .L25+4
	bl	puts
.L22:
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #8
	mvn	r2, #0
	mov	r1, #2
	mov	r0, r3
	bl	poll
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #8
	ldrsh	r3, [r3, #6]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L15
	sub	r1, fp, #1024
	sub	r1, r1, #4
	sub	r1, r1, #8
	mov	r3, #0
	mov	r2, #1024
	ldr	r0, [fp, #-1064]
	bl	recv
	str	r0, [fp, #-1056]
	ldr	r3, [fp, #-1056]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L25+8
	bl	perror
	b	.L17
.L16:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, r3
	ldr	r0, .L25+12
	bl	printf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, #0
	mov	r0, r3
	bl	memset
.L15:
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #8
	ldrsh	r3, [r3, #14]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L22
	ldr	r3, .L25+16
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, #1024
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r0, .L25+20
	bl	perror
	ldr	r3, .L25+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	ferror
	str	r0, [fp, #-1056]
	b	.L17
.L19:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-1032]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r2, r3, #1
	sub	r1, fp, #1024
	sub	r1, r1, #4
	sub	r1, r1, #8
	mov	r3, #16
	str	r3, [sp, #4]
	ldr	r3, [fp, #-1068]
	str	r3, [sp]
	mov	r3, #0
	ldr	r0, [fp, #-1064]
	bl	sendto
	str	r0, [fp, #-1056]
	ldr	r3, [fp, #-1056]
	cmp	r3, #0
	bge	.L20
	ldr	r0, .L25+24
	bl	perror
	b	.L17
.L20:
	ldrb	r3, [fp, #-1036]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L21
	mov	r3, #0
	str	r3, [fp, #-1056]
	b	.L17
.L21:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r0, .L25+4
	bl	puts
	b	.L22
.L17:
	ldr	r3, [fp, #-1056]
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC10
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	stdin
	.word	.LC8
	.word	.LC9
	.size	DoEchoClient, .-DoEchoClient
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
