	.file	"913300.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: connect hostname port\n"
.LC1:
	.string	"%d"
.LC2:
	.string	"connect: bad argument '%s'\n"
	.align 8
.LC3:
	.string	"connect2: Can't get IP-address"
	.align 8
.LC4:
	.string	"connect2: Can't create new socket"
.LC5:
	.string	"connect2: connect() failed"
.LC6:
	.string	"connect2: select() failed"
.LC7:
	.string	"connect2: Closing socket."
	.align 8
.LC8:
	.string	"Connection closed by remote host."
	.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, 224
	mov	DWORD PTR -212[rbp], edi
	mov	QWORD PTR -224[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -212[rbp], 3
	je	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L14
.L2:
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, -200[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 1
	je	.L4
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L14
.L4:
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -176[rbp], rax
	cmp	QWORD PTR -176[rbp], 0
	jne	.L5
	lea	rdi, .LC3[rip]
	call	herror@PLT
	mov	eax, 1
	jmp	.L14
.L5:
	mov	rax, QWORD PTR -176[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -168[rbp], rax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -196[rbp], eax
	cmp	DWORD PTR -196[rbp], -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L14
.L6:
	mov	WORD PTR -160[rbp], 2
	mov	eax, DWORD PTR -200[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -158[rbp], ax
	mov	rax, QWORD PTR -168[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -156[rbp], eax
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -196[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	mov	DWORD PTR -192[rbp], eax
	cmp	DWORD PTR -192[rbp], -1
	jne	.L7
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L14
.L7:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -144[rbp]
	mov	rdi, rdx
#APP
# 65 "the_stack_data/913300.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -188[rbp], edx
	mov	DWORD PTR -184[rbp], eax
	mov	rax, QWORD PTR -144[rbp]
	or	rax, 1
	mov	QWORD PTR -144[rbp], rax
	mov	eax, DWORD PTR -196[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -196[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 -144[rbp+rax*8], rdx
	mov	eax, DWORD PTR -196[rbp]
	lea	edi, 1[rax]
	lea	rax, -144[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC6[rip]
	call	perror@PLT
.L8:
	mov	rax, QWORD PTR -144[rbp]
	and	eax, 1
	test	rax, rax
	je	.L9
	mov	rax, QWORD PTR stdin[rip]
	mov	rdx, rax
	mov	esi, 256
	lea	rdi, buffer.0[rip]
	call	fgets@PLT
	test	rax, rax
	jne	.L10
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L11
.L10:
	lea	rdi, buffer.0[rip]
	call	strlen@PLT
	mov	DWORD PTR -180[rbp], eax
	mov	eax, DWORD PTR -180[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -196[rbp]
	mov	ecx, 0
	lea	rsi, buffer.0[rip]
	mov	edi, eax
	call	send@PLT
	jmp	.L7
.L9:
	mov	eax, DWORD PTR -196[rbp]
	mov	ecx, 0
	mov	edx, 256
	lea	rsi, buffer.0[rip]
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -180[rbp], eax
	cmp	DWORD PTR -180[rbp], 0
	jne	.L13
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L11
.L13:
	mov	eax, DWORD PTR -180[rbp]
	cdqe
	mov	rdx, rax
	lea	rsi, buffer.0[rip]
	mov	edi, 1
	call	write@PLT
	jmp	.L7
.L11:
	mov	eax, DWORD PTR -196[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L14:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	buffer.0
	.comm	buffer.0,256,32
	.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	"913300.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: connect hostname port\012\000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"connect: bad argument '%s'\012\000"
	.align	2
.LC3:
	.ascii	"connect2: Can't get IP-address\000"
	.align	2
.LC4:
	.ascii	"connect2: Can't create new socket\000"
	.align	2
.LC5:
	.ascii	"connect2: connect() failed\000"
	.align	2
.LC6:
	.ascii	"connect2: select() failed\000"
	.align	2
.LC7:
	.ascii	"connect2: Closing socket.\000"
	.align	2
.LC8:
	.ascii	"Connection closed by remote host.\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 192
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #200
	str	r0, [fp, #-192]
	str	r1, [fp, #-196]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-192]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L18+4
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L18+8
	bl	fwrite
	mov	r3, #1
	b	.L16
.L2:
	ldr	r3, [fp, #-196]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #184
	ldr	r1, .L18+12
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #1
	beq	.L4
	ldr	r3, .L18+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-196]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L18+16
	bl	fprintf
	mov	r3, #1
	b	.L16
.L4:
	ldr	r3, [fp, #-196]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-176]
	ldr	r3, [fp, #-176]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L18+20
	bl	herror
	mov	r3, #1
	b	.L16
.L5:
	ldr	r3, [fp, #-176]
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	str	r3, [fp, #-172]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-168]
	ldr	r3, [fp, #-168]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L18+24
	bl	perror
	mov	r3, #1
	b	.L16
.L6:
	mov	r3, #2
	strh	r3, [fp, #-152]	@ movhi
	ldr	r3, [fp, #-184]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-150]	@ movhi
	ldr	r3, [fp, #-172]
	ldr	r3, [r3]
	str	r3, [fp, #-148]
	sub	r3, fp, #152
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-168]
	bl	connect
	str	r0, [fp, #-164]
	ldr	r3, [fp, #-164]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L18+28
	bl	perror
	mov	r3, #1
	b	.L16
.L7:
	sub	r3, fp, #136
	str	r3, [fp, #-160]
	mov	r3, #0
	str	r3, [fp, #-180]
	b	.L8
.L9:
	ldr	r3, [fp, #-160]
	ldr	r2, [fp, #-180]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-180]
	add	r3, r3, #1
	str	r3, [fp, #-180]
.L8:
	ldr	r3, [fp, #-180]
	cmp	r3, #31
	bls	.L9
	ldr	r3, [fp, #-136]
	orr	r3, r3, #1
	str	r3, [fp, #-136]
	ldr	r3, [fp, #-168]
	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, #-132]
	ldr	r3, [fp, #-168]
	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, #-132]
	ldr	r3, [fp, #-168]
	add	r0, r3, #1
	sub	r1, fp, #136
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L18+32
	bl	perror
.L10:
	ldr	r3, [fp, #-136]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L11
	ldr	r3, .L18+36
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, #256
	ldr	r0, .L18+40
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	ldr	r0, .L18+44
	bl	puts
	b	.L13
.L12:
	ldr	r0, .L18+40
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-156]
	ldr	r2, [fp, #-156]
	mov	r3, #0
	ldr	r1, .L18+40
	ldr	r0, [fp, #-168]
	bl	send
	b	.L7
.L11:
	mov	r3, #0
	mov	r2, #256
	ldr	r1, .L18+40
	ldr	r0, [fp, #-168]
	bl	recv
	str	r0, [fp, #-156]
	ldr	r3, [fp, #-156]
	cmp	r3, #0
	bne	.L15
	ldr	r0, .L18+48
	bl	puts
	b	.L13
.L15:
	ldr	r3, [fp, #-156]
	mov	r2, r3
	ldr	r1, .L18+40
	mov	r0, #1
	bl	write
	b	.L7
.L13:
	ldr	r0, [fp, #-168]
	bl	close
	mov	r3, #0
.L16:
	ldr	r2, .L18
	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}
.L19:
	.align	2
.L18:
	.word	.LC9
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	stdin
	.word	buffer.6244
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.local	buffer.6244
	.comm	buffer.6244,256,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
