	.file	"95166.c"
	.intel_syntax noprefix
	.text
	.globl	connect_with_timeout
	.type	connect_with_timeout, @function
connect_with_timeout:
.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 -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	DWORD PTR -200[rbp], edx
	mov	DWORD PTR -212[rbp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -196[rbp]
	mov	edx, 2048
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	rcx, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR -196[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 0
	je	.L2
	cmp	DWORD PTR -172[rbp], -1
	jne	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 115
	je	.L3
.L2:
	mov	eax, DWORD PTR -172[rbp]
	jmp	.L7
.L3:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -144[rbp]
	mov	rdi, rdx
#APP
# 30 "the_stack_data/95166.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -168[rbp], edx
	mov	DWORD PTR -164[rbp], eax
	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 -212[rbp]
	cdqe
	mov	QWORD PTR -160[rbp], rax
	mov	QWORD PTR -152[rbp], 0
	mov	eax, DWORD PTR -196[rbp]
	lea	edi, 1[rax]
	lea	rdx, -160[rbp]
	lea	rax, -144[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	rdx, rax
	mov	esi, 0
	call	select@PLT
	cmp	eax, 1
	jne	.L5
	mov	DWORD PTR -176[rbp], 4
	lea	rcx, -176[rbp]
	lea	rdx, -180[rbp]
	mov	eax, DWORD PTR -196[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	edi, eax
	call	getsockopt@PLT
	mov	eax, DWORD PTR -180[rbp]
	test	eax, eax
	jne	.L5
	mov	eax, DWORD PTR -196[rbp]
	mov	edx, 0
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	eax, 0
	jmp	.L7
.L5:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 110
	mov	eax, -1
.L7:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	connect_with_timeout, .-connect_with_timeout
	.section	.rodata
.LC0:
	.string	"%u"
.LC1:
	.string	"Failed to lookup route"
.LC2:
	.string	"failed to create socket"
.LC3:
	.string	"failed to connect"
	.text
	.globl	connect_to_host
	.type	connect_to_host, @function
connect_to_host:
.LFB7:
	.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	QWORD PTR -120[rbp], rdi
	mov	eax, esi
	mov	DWORD PTR -128[rbp], edx
	mov	WORD PTR -124[rbp], ax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -80[rbp], 0
	mov	QWORD PTR -72[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	mov	DWORD PTR -100[rbp], 1
	movzx	edx, WORD PTR -124[rbp]
	lea	rax, -32[rbp]
	mov	ecx, edx
	lea	rdx, .LC0[rip]
	mov	esi, 15
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	mov	DWORD PTR -76[rbp], 2
	mov	DWORD PTR -72[rbp], 1
	mov	DWORD PTR -80[rbp], 1
	lea	rcx, -88[rbp]
	lea	rdx, -80[rbp]
	lea	rsi, -32[rbp]
	mov	rax, QWORD PTR -120[rbp]
	mov	rdi, rax
	call	getaddrinfo@PLT
	test	eax, eax
	je	.L10
	lea	rdi, .LC1[rip]
	call	perror@PLT
	jmp	.L11
.L10:
	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 -96[rbp], eax
	cmp	DWORD PTR -96[rbp], 0
	jns	.L12
	lea	rdi, .LC2[rip]
	call	perror@PLT
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -88[rbp]
	mov	rsi, QWORD PTR 24[rax]
	mov	ecx, DWORD PTR -128[rbp]
	mov	eax, DWORD PTR -96[rbp]
	mov	edi, eax
	call	connect_with_timeout
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], 0
	je	.L13
	lea	rdi, .LC3[rip]
	call	perror@PLT
	nop
.L14:
	mov	eax, DWORD PTR -96[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L11
.L13:
	lea	rdx, -100[rbp]
	mov	eax, DWORD PTR -96[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 6
	mov	edi, eax
	call	setsockopt@PLT
	mov	eax, DWORD PTR -96[rbp]
	jmp	.L16
.L11:
	mov	eax, -1
.L16:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	connect_to_host, .-connect_to_host
	.globl	xread
	.type	xread, @function
xread:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
.L20:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jns	.L19
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	jne	.L19
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	xread, .-xread
	.globl	xwrite
	.type	xwrite, @function
xwrite:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
.L24:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jns	.L23
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	jne	.L23
	jmp	.L24
.L23:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	xwrite, .-xwrite
	.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	"95166.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	connect_with_timeout
	.syntax unified
	.arm
	.fpu softvfp
	.type	connect_with_timeout, %function
connect_with_timeout:
	@ args = 0, pretend = 0, frame = 176
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #184
	str	r0, [fp, #-168]
	str	r1, [fp, #-172]
	str	r2, [fp, #-176]
	str	r3, [fp, #-180]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #2048
	mov	r1, #4
	ldr	r0, [fp, #-168]
	bl	fcntl
	mov	r2, #16
	ldr	r1, [fp, #-172]
	ldr	r0, [fp, #-168]
	bl	connect
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-152]
	cmn	r3, #1
	bne	.L3
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #115
	beq	.L3
.L2:
	ldr	r3, [fp, #-152]
	b	.L9
.L3:
	sub	r3, fp, #136
	str	r3, [fp, #-148]
	mov	r3, #0
	str	r3, [fp, #-156]
	b	.L5
.L6:
	ldr	r3, [fp, #-148]
	ldr	r2, [fp, #-156]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-156]
	add	r3, r3, #1
	str	r3, [fp, #-156]
.L5:
	ldr	r3, [fp, #-156]
	cmp	r3, #31
	bls	.L6
	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, #-180]
	str	r3, [fp, #-144]
	mov	r3, #0
	str	r3, [fp, #-140]
	ldr	r3, [fp, #-168]
	add	r0, r3, #1
	sub	r2, fp, #136
	sub	r3, fp, #144
	str	r3, [sp]
	mov	r3, #0
	mov	r1, #0
	bl	select
	mov	r3, r0
	cmp	r3, #1
	bne	.L7
	mov	r3, #4
	str	r3, [fp, #-160]
	sub	r2, fp, #164
	sub	r3, fp, #160
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #4
	mov	r1, #1
	ldr	r0, [fp, #-168]
	bl	getsockopt
	ldr	r3, [fp, #-164]
	cmp	r3, #0
	bne	.L7
	mov	r2, #0
	mov	r1, #4
	ldr	r0, [fp, #-168]
	bl	fcntl
	mov	r3, #0
	b	.L9
.L7:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #110
	str	r2, [r3]
	mvn	r3, #0
.L9:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC0
	.size	connect_with_timeout, .-connect_with_timeout
	.section	.rodata
	.align	2
.LC1:
	.ascii	"%u\000"
	.align	2
.LC2:
	.ascii	"Failed to lookup route\000"
	.align	2
.LC3:
	.ascii	"failed to create socket\000"
	.align	2
.LC4:
	.ascii	"failed to connect\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	connect_to_host
	.syntax unified
	.arm
	.fpu softvfp
	.type	connect_to_host, %function
connect_to_host:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #96
	str	r0, [fp, #-80]
	mov	r3, r1
	str	r2, [fp, #-88]
	strh	r3, [fp, #-82]	@ movhi
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #56
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-24]
	sub	r3, fp, #20
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	mov	r3, #1
	str	r3, [fp, #-68]
	ldrh	r3, [fp, #-82]
	sub	r0, fp, #24
	ldr	r2, .L22+4
	mov	r1, #15
	bl	snprintf
	mov	r3, #2
	str	r3, [fp, #-52]
	mov	r3, #1
	str	r3, [fp, #-48]
	mov	r3, #1
	str	r3, [fp, #-56]
	sub	r3, fp, #72
	sub	r2, fp, #56
	sub	r1, fp, #24
	ldr	r0, [fp, #-80]
	bl	getaddrinfo
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	ldr	r0, .L22+8
	bl	perror
	b	.L15
.L14:
	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, #-64]
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L22+12
	bl	perror
	b	.L15
.L16:
	ldr	r3, [fp, #-72]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-72]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-88]
	ldr	r0, [fp, #-64]
	bl	connect_with_timeout
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	beq	.L17
	ldr	r0, .L22+16
	bl	perror
	nop
.L18:
	ldr	r0, [fp, #-64]
	bl	close
	b	.L15
.L17:
	sub	r3, fp, #68
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #1
	mov	r1, #6
	ldr	r0, [fp, #-64]
	bl	setsockopt
	ldr	r3, [fp, #-64]
	b	.L20
.L15:
	mvn	r3, #0
.L20:
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC5
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	connect_to_host, .-connect_to_host
	.align	2
	.global	xread
	.syntax unified
	.arm
	.fpu softvfp
	.type	xread, %function
xread:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
.L26:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	read
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L25
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	bne	.L25
	b	.L26
.L25:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	xread, .-xread
	.align	2
	.global	xwrite
	.syntax unified
	.arm
	.fpu softvfp
	.type	xwrite, %function
xwrite:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
.L30:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L29
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	bne	.L29
	b	.L30
.L29:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	xwrite, .-xwrite
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
