	.file	"1142721.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s <address> <port>\n"
.LC1:
	.string	"Invalid address\n"
.LC2:
	.string	"Invalid port\n"
.LC3:
	.string	"Impossible to create socket"
.LC4:
	.string	"Impossible to connect"
.LC5:
	.string	"r"
.LC6:
	.string	"w"
.LC7:
	.string	"Impossible to fdopen\n"
.LC8:
	.string	"Ready. Write 'end' to quit"
.LC9:
	.string	"end\n"
.LC10:
	.string	"Error in select: "
.LC11:
	.string	"Sent"
.LC12:
	.string	"Timed out. Retrying"
	.align 8
.LC13:
	.string	"Maximum number of retransmission reached. Suicide."
.LC14:
	.string	"Impossible to receive answer"
.LC15:
	.string	"Received answer: %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
	sub	rsp, 448
	mov	DWORD PTR -436[rbp], edi
	mov	QWORD PTR -448[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -436[rbp], 3
	je	.L2
	mov	rax, QWORD PTR -448[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	eax, 1
	jmp	.L24
.L2:
	mov	rax, QWORD PTR -448[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -368[rbp]
	add	rdx, 4
	mov	rsi, rdx
	mov	rdi, rax
	call	inet_aton@PLT
	test	eax, eax
	jne	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 16
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L24
.L4:
	mov	rax, QWORD PTR -448[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -428[rbp], eax
	cmp	DWORD PTR -428[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L24
.L5:
	mov	eax, DWORD PTR -428[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -366[rbp], ax
	mov	WORD PTR -368[rbp], 2
	mov	edx, 17
	mov	esi, 2
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -424[rbp], eax
	cmp	DWORD PTR -424[rbp], 0
	jns	.L6
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L24
.L6:
	lea	rcx, -368[rbp]
	mov	eax, DWORD PTR -424[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	jns	.L7
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L24
.L7:
	mov	eax, DWORD PTR -424[rbp]
	lea	rsi, .LC5[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -400[rbp], rax
	mov	eax, DWORD PTR -424[rbp]
	lea	rsi, .LC6[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -392[rbp], rax
	cmp	QWORD PTR -400[rbp], 0
	je	.L8
	cmp	QWORD PTR -392[rbp], 0
	jne	.L9
.L8:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 21
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L24
.L9:
	mov	rax, QWORD PTR -392[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L23:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -224[rbp]
	mov	esi, 100
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -224[rbp]
	mov	rdx, rax
	lea	rax, .LC9[rip]
	mov	ecx, 5
	mov	rsi, rdx
	mov	rdi, rax
	repz cmpsb
	seta	al
	setb	dl
	sub	eax, edx
	movsx	eax, al
	test	eax, eax
	je	.L28
	mov	DWORD PTR -432[rbp], 0
	jmp	.L12
.L16:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -352[rbp]
	mov	rdi, rdx
#APP
# 89 "the_stack_data/1142721.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -420[rbp], edx
	mov	DWORD PTR -416[rbp], eax
	mov	eax, DWORD PTR -424[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -352[rbp+rax*8]
	mov	eax, DWORD PTR -424[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -352[rbp+rax*8], rdx
	mov	QWORD PTR -384[rbp], 0
	mov	QWORD PTR -376[rbp], 0
	lea	rdx, -384[rbp]
	lea	rax, -352[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 1024
	call	select@PLT
	mov	DWORD PTR -412[rbp], eax
	cmp	DWORD PTR -412[rbp], 0
	jns	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	edi, 0
	call	perror@PLT
	mov	eax, 1
	jmp	.L24
.L13:
	cmp	DWORD PTR -412[rbp], 0
	je	.L29
	lea	rcx, -112[rbp]
	mov	eax, DWORD PTR -424[rbp]
	mov	edx, 100
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	jmp	.L16
.L29:
	nop
	mov	rdx, QWORD PTR -392[rbp]
	lea	rax, -224[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fputs@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -352[rbp]
	mov	rdi, rdx
#APP
# 110 "the_stack_data/1142721.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -408[rbp], edx
	mov	DWORD PTR -404[rbp], eax
	mov	eax, DWORD PTR -424[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -352[rbp+rax*8]
	mov	eax, DWORD PTR -424[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -352[rbp+rax*8], rdx
	mov	QWORD PTR -384[rbp], 3
	mov	QWORD PTR -376[rbp], 0
	lea	rdx, -384[rbp]
	lea	rax, -352[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 1024
	call	select@PLT
	mov	DWORD PTR -412[rbp], eax
	cmp	DWORD PTR -412[rbp], 0
	jns	.L17
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	edi, 0
	call	perror@PLT
	mov	eax, 1
	jmp	.L24
.L17:
	cmp	DWORD PTR -412[rbp], 0
	jne	.L30
	lea	rdi, .LC12[rip]
	call	puts@PLT
	add	DWORD PTR -432[rbp], 1
.L12:
	cmp	DWORD PTR -432[rbp], 4
	jle	.L16
	jmp	.L20
.L30:
	nop
.L20:
	cmp	DWORD PTR -432[rbp], 5
	jne	.L21
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L24
.L21:
	mov	rdx, QWORD PTR -400[rbp]
	lea	rax, -224[rbp]
	mov	esi, 100
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L22
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L24
.L22:
	lea	rax, -224[rbp]
	mov	rsi, rax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L23
.L28:
	nop
	mov	rax, QWORD PTR -400[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -392[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, DWORD PTR -424[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L24:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	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	"1142721.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <address> <port>\012\000"
	.align	2
.LC1:
	.ascii	"Invalid address\012\000"
	.align	2
.LC2:
	.ascii	"Invalid port\012\000"
	.align	2
.LC3:
	.ascii	"Impossible to create socket\000"
	.align	2
.LC4:
	.ascii	"Impossible to connect\000"
	.align	2
.LC5:
	.ascii	"r\000"
	.align	2
.LC6:
	.ascii	"w\000"
	.align	2
.LC7:
	.ascii	"Impossible to fdopen\012\000"
	.align	2
.LC8:
	.ascii	"Ready. Write 'end' to quit\000"
	.align	2
.LC9:
	.ascii	"end\012\000"
	.align	2
.LC10:
	.ascii	"Error in select: \000"
	.align	2
.LC11:
	.ascii	"Sent\000"
	.align	2
.LC12:
	.ascii	"Timed out. Retrying\000"
	.align	2
.LC13:
	.ascii	"Maximum number of retransmission reached. Suicide.\000"
	.align	2
.LC14:
	.ascii	"Impossible to receive answer\000"
	.align	2
.LC15:
	.ascii	"Received answer: %s\012\000"
	.align	2
.LC16:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 416
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #424
	str	r0, [fp, #-416]
	str	r1, [fp, #-420]
	ldr	r3, .L35
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-416]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L35+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-420]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L35+8
	bl	fprintf
	mov	r3, #1
	b	.L28
.L2:
	ldr	r3, [fp, #-420]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #360
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	inet_aton
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L35+4
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #1
	ldr	r0, .L35+12
	bl	fwrite
	mov	r3, #1
	b	.L28
.L4:
	ldr	r3, [fp, #-420]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-396]
	ldr	r3, [fp, #-396]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L35+4
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L35+16
	bl	fwrite
	mov	r3, #1
	b	.L28
.L5:
	ldr	r3, [fp, #-396]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #356
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #4
	sub	r3, r3, #356
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	mov	r2, #17
	mov	r1, #2
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-392]
	ldr	r3, [fp, #-392]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L35+20
	bl	perror
	mov	r3, #1
	b	.L28
.L6:
	sub	r3, fp, #360
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-392]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L35+24
	bl	perror
	mov	r3, #1
	b	.L28
.L7:
	ldr	r1, .L35+28
	ldr	r0, [fp, #-392]
	bl	fdopen
	str	r0, [fp, #-388]
	ldr	r1, .L35+32
	ldr	r0, [fp, #-392]
	bl	fdopen
	str	r0, [fp, #-384]
	ldr	r3, [fp, #-388]
	cmp	r3, #0
	beq	.L8
	ldr	r3, [fp, #-384]
	cmp	r3, #0
	bne	.L9
.L8:
	ldr	r3, .L35+4
	ldr	r3, [r3]
	mov	r2, #21
	mov	r1, #1
	ldr	r0, .L35+36
	bl	fwrite
	mov	r3, #1
	b	.L28
.L9:
	mov	r1, #0
	ldr	r0, [fp, #-384]
	bl	setbuf
	ldr	r0, .L35+40
	bl	puts
.L27:
	ldr	r3, .L35+44
	ldr	r2, [r3]
	sub	r3, fp, #216
	mov	r1, #100
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #216
	ldr	r1, .L35+48
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L32
	mov	r3, #0
	str	r3, [fp, #-408]
	b	.L12
.L18:
	sub	r3, fp, #344
	str	r3, [fp, #-380]
	mov	r3, #0
	str	r3, [fp, #-404]
	b	.L13
.L14:
	ldr	r3, [fp, #-380]
	ldr	r2, [fp, #-404]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-404]
	add	r3, r3, #1
	str	r3, [fp, #-404]
.L13:
	ldr	r3, [fp, #-404]
	cmp	r3, #31
	bls	.L14
	ldr	r3, [fp, #-392]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-340]
	ldr	r3, [fp, #-392]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-340]
	mov	r3, #0
	str	r3, [fp, #-368]
	mov	r3, #0
	str	r3, [fp, #-364]
	sub	r1, fp, #344
	sub	r3, fp, #368
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	mov	r0, #1024
	bl	select
	str	r0, [fp, #-376]
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bge	.L15
	ldr	r3, .L35+4
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L35+52
	bl	fwrite
	mov	r0, #0
	bl	perror
	mov	r3, #1
	b	.L28
.L15:
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	beq	.L33
	sub	r3, fp, #112
	mov	r2, #100
	mov	r1, r3
	ldr	r0, [fp, #-392]
	bl	read
	b	.L18
.L33:
	nop
	sub	r3, fp, #216
	ldr	r1, [fp, #-384]
	mov	r0, r3
	bl	fputs
	ldr	r0, .L35+56
	bl	puts
	sub	r3, fp, #344
	str	r3, [fp, #-372]
	mov	r3, #0
	str	r3, [fp, #-400]
	b	.L19
.L20:
	ldr	r3, [fp, #-372]
	ldr	r2, [fp, #-400]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-400]
	add	r3, r3, #1
	str	r3, [fp, #-400]
.L19:
	ldr	r3, [fp, #-400]
	cmp	r3, #31
	bls	.L20
	ldr	r3, [fp, #-392]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-340]
	ldr	r3, [fp, #-392]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-340]
	mov	r3, #3
	str	r3, [fp, #-368]
	mov	r3, #0
	str	r3, [fp, #-364]
	sub	r1, fp, #344
	sub	r3, fp, #368
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	mov	r0, #1024
	bl	select
	str	r0, [fp, #-376]
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bge	.L21
	ldr	r3, .L35+4
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L35+52
	bl	fwrite
	mov	r0, #0
	bl	perror
	mov	r3, #1
	b	.L28
.L21:
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bne	.L34
	ldr	r0, .L35+60
	bl	puts
	ldr	r3, [fp, #-408]
	add	r3, r3, #1
	str	r3, [fp, #-408]
.L12:
	ldr	r3, [fp, #-408]
	cmp	r3, #4
	ble	.L18
	b	.L24
.L34:
	nop
.L24:
	ldr	r3, [fp, #-408]
	cmp	r3, #5
	bne	.L25
	ldr	r0, .L35+64
	bl	puts
	mov	r3, #1
	b	.L28
.L25:
	sub	r3, fp, #216
	ldr	r2, [fp, #-388]
	mov	r1, #100
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L26
	ldr	r0, .L35+68
	bl	puts
	mov	r3, #1
	b	.L28
.L26:
	sub	r3, fp, #216
	mov	r1, r3
	ldr	r0, .L35+72
	bl	printf
	b	.L27
.L32:
	nop
	ldr	r0, [fp, #-388]
	bl	fclose
	ldr	r0, [fp, #-384]
	bl	fclose
	ldr	r0, [fp, #-392]
	bl	close
	mov	r3, #0
.L28:
	ldr	r2, .L35
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L29
	bl	__stack_chk_fail
.L29:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	.LC16
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	stdin
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
