	.file	"974142.c"
	.intel_syntax noprefix
	.text
	.globl	g_loc_io_count
	.bss
	.align 4
	.type	g_loc_io_count, @object
	.size	g_loc_io_count, 4
g_loc_io_count:
	.zero	4
	.globl	g_rem_io_count
	.align 4
	.type	g_rem_io_count, @object
	.size	g_rem_io_count, 4
g_rem_io_count:
	.zero	4
	.local	g_terminated
	.comm	g_terminated,4,4
	.local	g_buf
	.comm	g_buf,32768,32
	.text
	.type	g_memset, @function
g_memset:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	DWORD PTR -16[rbp], edx
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	ecx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	memset@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	g_memset, .-g_memset
	.type	g_printf, @function
g_printf:
.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, 224
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -168[rbp], rsi
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], rcx
	mov	QWORD PTR -144[rbp], r8
	mov	QWORD PTR -136[rbp], r9
	test	al, al
	je	.L3
	movaps	XMMWORD PTR -128[rbp], xmm0
	movaps	XMMWORD PTR -112[rbp], xmm1
	movaps	XMMWORD PTR -96[rbp], xmm2
	movaps	XMMWORD PTR -80[rbp], xmm3
	movaps	XMMWORD PTR -64[rbp], xmm4
	movaps	XMMWORD PTR -48[rbp], xmm5
	movaps	XMMWORD PTR -32[rbp], xmm6
	movaps	XMMWORD PTR -16[rbp], xmm7
.L3:
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -184[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -208[rbp], 8
	mov	DWORD PTR -204[rbp], 48
	lea	rax, 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -176[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	rax, QWORD PTR stdout[rip]
	lea	rdx, -208[rbp]
	mov	rcx, QWORD PTR -216[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	vfprintf@PLT
	nop
	mov	rax, QWORD PTR -184[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	g_printf, .-g_printf
	.section	.rodata
.LC0:
	.string	"\n"
	.text
	.type	g_writeln, @function
g_writeln:
.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, 224
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -168[rbp], rsi
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], rcx
	mov	QWORD PTR -144[rbp], r8
	mov	QWORD PTR -136[rbp], r9
	test	al, al
	je	.L6
	movaps	XMMWORD PTR -128[rbp], xmm0
	movaps	XMMWORD PTR -112[rbp], xmm1
	movaps	XMMWORD PTR -96[rbp], xmm2
	movaps	XMMWORD PTR -80[rbp], xmm3
	movaps	XMMWORD PTR -64[rbp], xmm4
	movaps	XMMWORD PTR -48[rbp], xmm5
	movaps	XMMWORD PTR -32[rbp], xmm6
	movaps	XMMWORD PTR -16[rbp], xmm7
.L6:
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -184[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -208[rbp], 8
	mov	DWORD PTR -204[rbp], 48
	lea	rax, 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -176[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	rax, QWORD PTR stdout[rip]
	lea	rdx, -208[rbp]
	mov	rcx, QWORD PTR -216[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	vfprintf@PLT
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	g_printf
	nop
	mov	rax, QWORD PTR -184[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	g_writeln, .-g_writeln
	.section	.rodata
.LC1:
	.string	"%04x "
.LC2:
	.string	"%02x "
.LC3:
	.string	"   "
.LC4:
	.string	"%c"
.LC5:
	.string	""
	.text
	.type	g_hexdump, @function
g_hexdump:
.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	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L9
.L19:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	g_printf
	mov	eax, DWORD PTR -44[rbp]
	sub	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], 16
	jle	.L10
	mov	DWORD PTR -16[rbp], 16
.L10:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	g_printf
	add	DWORD PTR -20[rbp], 1
.L11:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -16[rbp]
	jl	.L12
	jmp	.L13
.L14:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	g_printf
	add	DWORD PTR -20[rbp], 1
.L13:
	cmp	DWORD PTR -20[rbp], 15
	jle	.L14
	mov	DWORD PTR -20[rbp], 0
	jmp	.L15
.L18:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 31
	jbe	.L16
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 126
	ja	.L16
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	jmp	.L17
.L16:
	mov	eax, 46
.L17:
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	g_printf
	add	DWORD PTR -20[rbp], 1
.L15:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -16[rbp]
	jl	.L18
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	g_writeln
	mov	eax, DWORD PTR -16[rbp]
	add	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	add	QWORD PTR -8[rbp], rax
.L9:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -44[rbp]
	jl	.L19
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	g_hexdump, .-g_hexdump
	.type	g_tcp_socket, @function
g_tcp_socket:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jns	.L21
	mov	eax, -1
	jmp	.L25
.L21:
	mov	DWORD PTR -16[rbp], 4
	lea	rcx, -16[rbp]
	lea	rdx, -20[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	getsockopt@PLT
	test	eax, eax
	jne	.L23
	mov	eax, DWORD PTR -20[rbp]
	test	eax, eax
	jne	.L23
	mov	DWORD PTR -20[rbp], 1
	mov	DWORD PTR -16[rbp], 4
	mov	ecx, DWORD PTR -16[rbp]
	lea	rdx, -20[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	r8d, ecx
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
.L23:
	mov	DWORD PTR -16[rbp], 4
	lea	rcx, -16[rbp]
	lea	rdx, -20[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	mov	edx, 7
	mov	esi, 1
	mov	edi, eax
	call	getsockopt@PLT
	test	eax, eax
	jne	.L24
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 32767
	jg	.L24
	mov	DWORD PTR -20[rbp], 32768
	mov	DWORD PTR -16[rbp], 4
	mov	ecx, DWORD PTR -16[rbp]
	lea	rdx, -20[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	r8d, ecx
	mov	rcx, rdx
	mov	edx, 7
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
.L24:
	mov	eax, DWORD PTR -12[rbp]
.L25:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	g_tcp_socket, .-g_tcp_socket
	.type	g_tcp_set_non_blocking, @function
g_tcp_set_non_blocking:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	cdqe
	mov	QWORD PTR -8[rbp], rax
	or	QWORD PTR -8[rbp], 2048
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	g_tcp_set_non_blocking, .-g_tcp_set_non_blocking
	.type	g_tcp_bind, @function
g_tcp_bind:
.LFB12:
	.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 -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -32[rbp], 2
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	atoi@PLT
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	mov	DWORD PTR -28[rbp], 0
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	g_tcp_bind, .-g_tcp_bind
	.type	g_tcp_listen, @function
g_tcp_listen:
.LFB13:
	.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	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, 2
	mov	edi, eax
	call	listen@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	g_tcp_listen, .-g_tcp_listen
	.type	g_tcp_select, @function
g_tcp_select:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	DWORD PTR -180[rbp], edi
	mov	DWORD PTR -184[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -176[rbp], 0
	mov	DWORD PTR -172[rbp], 0
	lea	rax, -144[rbp]
	mov	edx, 128
	mov	esi, 0
	mov	rdi, rax
	call	g_memset
	lea	rax, -160[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	g_memset
	mov	QWORD PTR -160[rbp], 0
	mov	QWORD PTR -152[rbp], 0
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -144[rbp]
	mov	rdi, rdx
#APP
# 207 "the_stack_data/974142.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
	cmp	DWORD PTR -180[rbp], 0
	jle	.L35
	mov	eax, DWORD PTR -180[rbp]
	shr	eax, 6
	mov	edx, eax
	mov	eax, edx
	mov	rsi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -180[rbp]
	and	eax, 63
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rax, rsi
	mov	edx, edx
	mov	QWORD PTR -144[rbp+rdx*8], rax
.L35:
	cmp	DWORD PTR -184[rbp], 0
	jle	.L36
	mov	eax, DWORD PTR -184[rbp]
	shr	eax, 6
	mov	edx, eax
	mov	eax, edx
	mov	rsi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -184[rbp]
	and	eax, 63
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rax, rsi
	mov	edx, edx
	mov	QWORD PTR -144[rbp+rdx*8], rax
.L36:
	mov	eax, DWORD PTR -180[rbp]
	mov	DWORD PTR -176[rbp], eax
	mov	eax, DWORD PTR -184[rbp]
	cmp	eax, DWORD PTR -176[rbp]
	jle	.L37
	mov	eax, DWORD PTR -184[rbp]
	mov	DWORD PTR -176[rbp], eax
.L37:
	mov	eax, DWORD PTR -176[rbp]
	lea	edi, 1[rax]
	lea	rdx, -160[rbp]
	lea	rax, -144[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 0
	jle	.L38
	mov	DWORD PTR -172[rbp], 0
	mov	eax, DWORD PTR -180[rbp]
	shr	eax, 6
	mov	eax, eax
	mov	rdx, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -180[rbp]
	and	eax, 63
	mov	esi, 1
	mov	ecx, eax
	sal	rsi, cl
	mov	rax, rsi
	and	rax, rdx
	test	rax, rax
	je	.L39
	or	DWORD PTR -172[rbp], 1
.L39:
	mov	eax, DWORD PTR -184[rbp]
	shr	eax, 6
	mov	eax, eax
	mov	rdx, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -184[rbp]
	and	eax, 63
	mov	esi, 1
	mov	ecx, eax
	sal	rsi, cl
	mov	rax, rsi
	and	rax, rdx
	test	rax, rax
	je	.L40
	or	DWORD PTR -172[rbp], 2
	jmp	.L40
.L38:
	mov	DWORD PTR -172[rbp], 0
.L40:
	mov	eax, DWORD PTR -172[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	g_tcp_select, .-g_tcp_select
	.type	g_tcp_recv, @function
g_tcp_recv:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -8[rbp], edx
	mov	DWORD PTR -20[rbp], ecx
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	ecx, DWORD PTR -20[rbp]
	mov	rsi, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	recv@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	g_tcp_recv, .-g_tcp_recv
	.type	g_tcp_close, @function
g_tcp_close:
.LFB16:
	.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	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 0
	je	.L48
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L45
.L48:
	nop
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	g_tcp_close, .-g_tcp_close
	.type	g_tcp_send, @function
g_tcp_send:
.LFB17:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -8[rbp], edx
	mov	DWORD PTR -20[rbp], ecx
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	ecx, DWORD PTR -20[rbp]
	mov	rsi, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	send@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	g_tcp_send, .-g_tcp_send
	.globl	g_sleep
	.type	g_sleep, @function
g_sleep:
.LFB18:
	.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	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	imul	eax, eax, 1000
	mov	edi, eax
	call	usleep@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.size	g_sleep, .-g_sleep
	.type	g_tcp_last_error_would_block, @function
g_tcp_last_error_would_block:
.LFB19:
	.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	DWORD PTR -4[rbp], edi
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	je	.L53
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	je	.L53
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 115
	jne	.L54
.L53:
	mov	eax, 1
	jmp	.L56
.L54:
	mov	eax, 0
.L56:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE19:
	.size	g_tcp_last_error_would_block, .-g_tcp_last_error_would_block
	.type	g_tcp_accept, @function
g_tcp_accept:
.LFB20:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -40[rbp], 16
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rdx, -40[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L59
	call	__stack_chk_fail@PLT
.L59:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE20:
	.size	g_tcp_accept, .-g_tcp_accept
	.type	g_tcp_connect, @function
g_tcp_connect:
.LFB21:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	g_memset
	mov	WORD PTR -32[rbp], 2
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	atoi@PLT
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	inet_addr@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, -1
	jne	.L61
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	je	.L61
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L61
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 24[rax]
	test	rax, rax
	je	.L61
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L61
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -28[rbp], eax
.L61:
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L63
	call	__stack_chk_fail@PLT
.L63:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE21:
	.size	g_tcp_connect, .-g_tcp_connect
	.type	g_tcp_socket_ok, @function
g_tcp_socket_ok:
.LFB22:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 4
	lea	rcx, -12[rbp]
	lea	rdx, -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	edi, eax
	call	getsockopt@PLT
	test	eax, eax
	jne	.L65
	mov	eax, DWORD PTR -16[rbp]
	test	eax, eax
	jne	.L65
	mov	eax, 1
	jmp	.L67
.L65:
	mov	eax, 0
.L67:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE22:
	.size	g_tcp_socket_ok, .-g_tcp_socket_ok
	.type	g_init, @function
g_init:
.LFB23:
	.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
	lea	rsi, .LC5[rip]
	mov	edi, 0
	call	setlocale@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE23:
	.size	g_init, .-g_init
	.type	g_deinit, @function
g_deinit:
.LFB24:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE24:
	.size	g_deinit, .-g_deinit
	.type	g_tcp_can_send, @function
g_tcp_can_send:
.LFB25:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	DWORD PTR -180[rbp], edi
	mov	DWORD PTR -184[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -184[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 274877907
	shr	rdx, 32
	sar	edx, 6
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	mov	QWORD PTR -160[rbp], rax
	mov	eax, DWORD PTR -184[rbp]
	imul	eax, eax, 1000
	movsx	rdx, eax
	imul	rdx, rdx, 1125899907
	shr	rdx, 32
	sar	edx, 18
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 1000000
	sub	eax, ecx
	mov	edx, eax
	movsx	rax, edx
	mov	QWORD PTR -152[rbp], rax
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -144[rbp]
	mov	rdi, rdx
#APP
# 377 "the_stack_data/974142.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -172[rbp], edx
	mov	DWORD PTR -168[rbp], eax
	cmp	DWORD PTR -180[rbp], 0
	jle	.L72
	mov	eax, DWORD PTR -180[rbp]
	shr	eax, 6
	mov	edx, eax
	mov	eax, edx
	mov	rsi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -180[rbp]
	and	eax, 63
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rax, rsi
	mov	edx, edx
	mov	QWORD PTR -144[rbp+rdx*8], rax
	mov	eax, DWORD PTR -180[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
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	jle	.L72
	mov	eax, DWORD PTR -180[rbp]
	mov	edi, eax
	call	g_tcp_socket_ok
	jmp	.L74
.L72:
	mov	eax, 0
.L74:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L75
	call	__stack_chk_fail@PLT
.L75:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE25:
	.size	g_tcp_can_send, .-g_tcp_can_send
	.type	g_signal_user_interrupt, @function
g_signal_user_interrupt:
.LFB26:
	.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 -8[rbp]
	mov	rsi, rax
	mov	edi, 2
	call	signal@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE26:
	.size	g_signal_user_interrupt, .-g_signal_user_interrupt
	.type	g_signal_kill, @function
g_signal_kill:
.LFB27:
	.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 -8[rbp]
	mov	rsi, rax
	mov	edi, 9
	call	signal@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE27:
	.size	g_signal_kill, .-g_signal_kill
	.type	g_signal_terminate, @function
g_signal_terminate:
.LFB28:
	.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 -8[rbp]
	mov	rsi, rax
	mov	edi, 15
	call	signal@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE28:
	.size	g_signal_terminate, .-g_signal_terminate
	.type	g_signal_usr1, @function
g_signal_usr1:
.LFB29:
	.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 -8[rbp]
	mov	rsi, rax
	mov	edi, 10
	call	signal@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE29:
	.size	g_signal_usr1, .-g_signal_usr1
	.type	g_strcasecmp, @function
g_strcasecmp:
.LFB30:
	.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	QWORD PTR -16[rbp], rsi
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcasecmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE30:
	.size	g_strcasecmp, .-g_strcasecmp
	.section	.rodata
.LC6:
	.string	"bind failed"
.LC7:
	.string	"listening for connection"
.LC8:
	.string	"got connection"
.LC9:
	.string	"timeout connecting"
.LC10:
	.string	"error connecting to remote\r\n"
	.align 8
.LC11:
	.string	"from remove, the socket from connect"
	.align 8
.LC12:
	.string	"from accepted, the socket from accept"
.LC13:
	.string	"acc_to_con %d"
.LC14:
	.string	"con_to_acc %d"
	.text
	.type	main_loop, @function
main_loop:
.LFB31:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	DWORD PTR -76[rbp], ecx
	mov	DWORD PTR -16[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -36[rbp], 0
	call	g_tcp_socket
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	g_tcp_set_non_blocking
	mov	rdx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	g_tcp_bind
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	je	.L83
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	g_writeln
.L83:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L84
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	g_tcp_listen
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jne	.L84
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	g_writeln
.L84:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L85
	jmp	.L86
.L90:
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	g_tcp_accept
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], -1
	jne	.L87
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	g_tcp_last_error_would_block
	test	eax, eax
	je	.L87
	mov	edi, 100
	call	g_sleep
	jmp	.L86
.L87:
	cmp	DWORD PTR -36[rbp], -1
	jne	.L114
	mov	DWORD PTR -24[rbp], 1
.L86:
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	jne	.L89
	cmp	DWORD PTR -24[rbp], 0
	je	.L90
	jmp	.L89
.L114:
	nop
.L89:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L91
	mov	eax, DWORD PTR g_terminated[rip]
	mov	DWORD PTR -24[rbp], eax
.L91:
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	g_tcp_close
	mov	DWORD PTR -40[rbp], 0
	cmp	DWORD PTR -24[rbp], 0
	jne	.L85
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	g_writeln
.L85:
	mov	DWORD PTR -32[rbp], 0
	cmp	DWORD PTR -24[rbp], 0
	jne	.L98
	call	g_tcp_socket
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	g_tcp_set_non_blocking
	mov	rdx, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	g_tcp_connect
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], -1
	jne	.L93
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	g_tcp_last_error_would_block
	test	eax, eax
	je	.L93
	mov	DWORD PTR -24[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	jmp	.L94
.L96:
	mov	edi, 100
	call	g_sleep
	add	DWORD PTR -20[rbp], 1
.L94:
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, 100
	mov	edi, eax
	call	g_tcp_can_send
	test	eax, eax
	jne	.L95
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	jne	.L95
	cmp	DWORD PTR -20[rbp], 99
	jle	.L96
.L95:
	cmp	DWORD PTR -20[rbp], 99
	jle	.L97
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	g_writeln
	mov	DWORD PTR -24[rbp], 1
.L97:
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	je	.L93
	mov	DWORD PTR -24[rbp], 1
.L93:
	cmp	DWORD PTR -24[rbp], 0
	je	.L98
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	jne	.L98
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	g_writeln
	jmp	.L98
.L112:
	mov	edx, DWORD PTR -36[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, edx
	mov	edi, eax
	call	g_tcp_select
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	jne	.L99
	mov	edi, 10
	call	g_sleep
	jmp	.L98
.L99:
	mov	eax, DWORD PTR -8[rbp]
	and	eax, 1
	test	eax, eax
	je	.L100
	mov	eax, DWORD PTR -32[rbp]
	mov	ecx, 0
	mov	edx, 16384
	lea	rsi, g_buf[rip]
	mov	edi, eax
	call	g_tcp_recv
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	setle	al
	movzx	eax, al
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jne	.L100
	mov	edx, DWORD PTR g_loc_io_count[rip]
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	mov	DWORD PTR g_loc_io_count[rip], eax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -76[rbp], 0
	je	.L101
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	g_writeln
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, g_buf[rip]
	call	g_hexdump
.L101:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L102
.L105:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rcx, g_buf[rip]
	lea	rsi, [rax+rcx]
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	g_tcp_send
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L103
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	g_tcp_last_error_would_block
	test	eax, eax
	je	.L103
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 1000
	mov	edi, eax
	call	g_tcp_can_send
	jmp	.L102
.L103:
	cmp	DWORD PTR -20[rbp], 0
	jg	.L104
	mov	DWORD PTR -24[rbp], 1
	jmp	.L102
.L104:
	mov	eax, DWORD PTR -20[rbp]
	add	DWORD PTR -28[rbp], eax
.L102:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jge	.L100
	cmp	DWORD PTR -24[rbp], 0
	jne	.L100
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	je	.L105
.L100:
	mov	eax, DWORD PTR -8[rbp]
	and	eax, 2
	test	eax, eax
	je	.L98
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 0
	mov	edx, 16384
	lea	rsi, g_buf[rip]
	mov	edi, eax
	call	g_tcp_recv
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	setle	al
	movzx	eax, al
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jne	.L98
	mov	edx, DWORD PTR g_rem_io_count[rip]
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	mov	DWORD PTR g_rem_io_count[rip], eax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -76[rbp], 0
	je	.L106
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	g_writeln
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, g_buf[rip]
	call	g_hexdump
.L106:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L107
.L110:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rcx, g_buf[rip]
	lea	rsi, [rax+rcx]
	mov	eax, DWORD PTR -32[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	g_tcp_send
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L108
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	g_tcp_last_error_would_block
	test	eax, eax
	je	.L108
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, 1000
	mov	edi, eax
	call	g_tcp_can_send
	jmp	.L107
.L108:
	cmp	DWORD PTR -20[rbp], 0
	jg	.L109
	mov	DWORD PTR -24[rbp], 1
	jmp	.L107
.L109:
	mov	eax, DWORD PTR -20[rbp]
	add	DWORD PTR -28[rbp], eax
.L107:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jge	.L98
	cmp	DWORD PTR -24[rbp], 0
	jne	.L98
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	je	.L110
.L98:
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	jne	.L111
	cmp	DWORD PTR -24[rbp], 0
	je	.L112
.L111:
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	g_tcp_close
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	g_tcp_close
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	g_tcp_close
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	g_writeln
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	g_writeln
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE31:
	.size	main_loop, .-main_loop
	.section	.rodata
	.align 8
.LC15:
	.string	"tcp_proxy <local-port> <remote-ip> <remote-port> [dump]"
	.text
	.type	usage, @function
usage:
.LFB32:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	g_writeln
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE32:
	.size	usage, .-usage
	.section	.rodata
.LC16:
	.string	"shutting down"
	.text
	.globl	proxy_shutdown
	.type	proxy_shutdown, @function
proxy_shutdown:
.LFB33:
	.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	DWORD PTR -4[rbp], edi
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	g_writeln
	mov	DWORD PTR g_terminated[rip], 1
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE33:
	.size	proxy_shutdown, .-proxy_shutdown
	.section	.rodata
	.align 8
.LC17:
	.string	"cleared counters at: local_io_count: %d remote_io_count: %d"
	.text
	.globl	clear_counters
	.type	clear_counters, @function
clear_counters:
.LFB34:
	.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	DWORD PTR -4[rbp], edi
	mov	edx, DWORD PTR g_rem_io_count[rip]
	mov	eax, DWORD PTR g_loc_io_count[rip]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	g_writeln
	mov	DWORD PTR g_loc_io_count[rip], 0
	mov	DWORD PTR g_rem_io_count[rip], 0
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE34:
	.size	clear_counters, .-clear_counters
	.section	.rodata
.LC18:
	.string	"tcp_proxy"
.LC19:
	.string	"dump"
	.text
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 3
	jg	.L120
	call	usage
	mov	eax, 0
	jmp	.L121
.L120:
	lea	rdi, .LC18[rip]
	call	g_init
	lea	rdi, proxy_shutdown[rip]
	call	g_signal_user_interrupt
	lea	rdi, proxy_shutdown[rip]
	call	g_signal_kill
	lea	rdi, clear_counters[rip]
	call	g_signal_usr1
	lea	rdi, proxy_shutdown[rip]
	call	g_signal_terminate
	cmp	DWORD PTR -20[rbp], 4
	jg	.L122
	jmp	.L123
.L124:
	mov	DWORD PTR g_loc_io_count[rip], 0
	mov	DWORD PTR g_rem_io_count[rip], 0
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 24
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rsi, QWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	ecx, 0
	mov	rdi, rax
	call	main_loop
.L123:
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	je	.L124
	jmp	.L125
.L122:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	call	g_strcasecmp
	test	eax, eax
	sete	al
	movzx	eax, al
	mov	DWORD PTR -4[rbp], eax
	jmp	.L126
.L127:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 24
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rsi, QWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	ecx, DWORD PTR -4[rbp]
	mov	rdi, rax
	call	main_loop
.L126:
	mov	eax, DWORD PTR g_terminated[rip]
	test	eax, eax
	je	.L127
.L125:
	call	g_deinit
	mov	eax, 0
.L121:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE35:
	.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	"974142.c"
	.text
	.global	g_loc_io_count
	.bss
	.align	2
	.type	g_loc_io_count, %object
	.size	g_loc_io_count, 4
g_loc_io_count:
	.space	4
	.global	g_rem_io_count
	.align	2
	.type	g_rem_io_count, %object
	.size	g_rem_io_count, 4
g_rem_io_count:
	.space	4
	.local	g_terminated
	.comm	g_terminated,4,4
	.local	g_buf
	.comm	g_buf,32768,4
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_memset, %function
g_memset:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	memset
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_memset, .-g_memset
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_printf, %function
g_printf:
	@ args = 4, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 1
	push	{r0, r1, r2, r3}
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	add	r3, fp, #8
	str	r3, [fp, #-12]
	ldr	r3, .L4+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	vfprintf
	nop
	ldr	r3, .L4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L5:
	.align	2
.L4:
	.word	.LC0
	.word	stdout
	.size	g_printf, .-g_printf
	.section	.rodata
	.align	2
.LC1:
	.ascii	"\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_writeln, %function
g_writeln:
	@ args = 4, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 1
	push	{r0, r1, r2, r3}
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	add	r3, fp, #8
	str	r3, [fp, #-12]
	ldr	r3, .L8+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	vfprintf
	ldr	r0, .L8+8
	bl	g_printf
	nop
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L9:
	.align	2
.L8:
	.word	.LC2
	.word	stdout
	.word	.LC1
	.size	g_writeln, .-g_writeln
	.section	.rodata
	.align	2
.LC3:
	.ascii	"%04x \000"
	.align	2
.LC4:
	.ascii	"%02x \000"
	.align	2
.LC5:
	.ascii	"   \000"
	.align	2
.LC6:
	.ascii	"%c\000"
	.align	2
.LC7:
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_hexdump, %function
g_hexdump:
	@ 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, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L11
.L21:
	ldr	r1, [fp, #-8]
	ldr	r0, .L22
	bl	g_printf
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #16
	ble	.L12
	mov	r3, #16
	str	r3, [fp, #-12]
.L12:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L13
.L14:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L22+4
	bl	g_printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L13:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	blt	.L14
	b	.L15
.L16:
	ldr	r0, .L22+8
	bl	g_printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L15:
	ldr	r3, [fp, #-16]
	cmp	r3, #15
	ble	.L16
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L17
.L20:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #31
	bls	.L18
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #126
	bhi	.L18
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	b	.L19
.L18:
	mov	r3, #46
.L19:
	mov	r1, r3
	ldr	r0, .L22+12
	bl	g_printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L17:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	blt	.L20
	ldr	r0, .L22+16
	bl	g_writeln
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	str	r3, [fp, #-20]
.L11:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L21
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	g_hexdump, .-g_hexdump
	.section	.rodata
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_socket, %function
g_tcp_socket:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L25
	mvn	r3, #0
	b	.L29
.L25:
	mov	r3, #4
	str	r3, [fp, #-16]
	sub	r2, fp, #20
	sub	r3, fp, #16
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	getsockopt
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L27
	mov	r3, #1
	str	r3, [fp, #-20]
	mov	r3, #4
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	sub	r2, fp, #20
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	setsockopt
.L27:
	mov	r3, #4
	str	r3, [fp, #-16]
	sub	r2, fp, #20
	sub	r3, fp, #16
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #7
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	getsockopt
	mov	r3, r0
	cmp	r3, #0
	bne	.L28
	ldr	r3, [fp, #-20]
	cmp	r3, #32768
	bge	.L28
	mov	r3, #32768
	str	r3, [fp, #-20]
	mov	r3, #4
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	sub	r2, fp, #20
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #7
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	setsockopt
.L28:
	ldr	r3, [fp, #-12]
.L29:
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L30
	bl	__stack_chk_fail
.L30:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC8
	.size	g_tcp_socket, .-g_tcp_socket
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_set_non_blocking, %function
g_tcp_set_non_blocking:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r1, #3
	ldr	r0, [fp, #-16]
	bl	fcntl
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	orr	r3, r3, #2048
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	mov	r1, #4
	ldr	r0, [fp, #-16]
	bl	fcntl
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_tcp_set_non_blocking, .-g_tcp_set_non_blocking
	.section	.rodata
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_bind, %function
g_tcp_bind:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L38
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	ldr	r0, [fp, #-36]
	bl	atoi
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-20]
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	bind
	mov	r3, r0
	ldr	r2, .L38
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L37
	bl	__stack_chk_fail
.L37:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L39:
	.align	2
.L38:
	.word	.LC9
	.size	g_tcp_bind, .-g_tcp_bind
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_listen, %function
g_tcp_listen:
	@ 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]
	mov	r1, #2
	ldr	r0, [fp, #-8]
	bl	listen
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_tcp_listen, .-g_tcp_listen
	.section	.rodata
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_select, %function
g_tcp_select:
	@ args = 0, pretend = 0, frame = 168
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #176
	str	r0, [fp, #-168]
	str	r1, [fp, #-172]
	ldr	r3, .L53
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-160]
	mov	r3, #0
	str	r3, [fp, #-156]
	sub	r3, fp, #136
	mov	r2, #128
	mov	r1, #0
	mov	r0, r3
	bl	g_memset
	sub	r3, fp, #144
	mov	r2, #8
	mov	r1, #0
	mov	r0, r3
	bl	g_memset
	mov	r3, #0
	str	r3, [fp, #-144]
	mov	r3, #0
	str	r3, [fp, #-140]
	sub	r3, fp, #136
	str	r3, [fp, #-148]
	mov	r3, #0
	str	r3, [fp, #-152]
	b	.L43
.L44:
	ldr	r3, [fp, #-148]
	ldr	r2, [fp, #-152]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-152]
	add	r3, r3, #1
	str	r3, [fp, #-152]
.L43:
	ldr	r3, [fp, #-152]
	cmp	r3, #31
	bls	.L44
	ldr	r3, [fp, #-168]
	cmp	r3, #0
	ble	.L45
	ldr	r3, [fp, #-168]
	lsr	r2, r3, #5
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-132]
	ldr	r1, [fp, #-168]
	and	r1, r1, #31
	mov	r0, #1
	lsl	r1, r0, r1
	orr	r1, r3, r1
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-132]
.L45:
	ldr	r3, [fp, #-172]
	cmp	r3, #0
	ble	.L46
	ldr	r3, [fp, #-172]
	lsr	r2, r3, #5
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-132]
	ldr	r1, [fp, #-172]
	and	r1, r1, #31
	mov	r0, #1
	lsl	r1, r0, r1
	orr	r1, r3, r1
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-132]
.L46:
	ldr	r3, [fp, #-168]
	str	r3, [fp, #-160]
	ldr	r2, [fp, #-172]
	ldr	r3, [fp, #-160]
	cmp	r2, r3
	ble	.L47
	ldr	r3, [fp, #-172]
	str	r3, [fp, #-160]
.L47:
	ldr	r3, [fp, #-160]
	add	r0, r3, #1
	sub	r1, fp, #136
	sub	r3, fp, #144
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	str	r0, [fp, #-156]
	ldr	r3, [fp, #-156]
	cmp	r3, #0
	ble	.L48
	mov	r3, #0
	str	r3, [fp, #-156]
	ldr	r3, [fp, #-168]
	lsr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-132]
	ldr	r2, [fp, #-168]
	and	r2, r2, #31
	mov	r1, #1
	lsl	r2, r1, r2
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L49
	ldr	r3, [fp, #-156]
	orr	r3, r3, #1
	str	r3, [fp, #-156]
.L49:
	ldr	r3, [fp, #-172]
	lsr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-132]
	ldr	r2, [fp, #-172]
	and	r2, r2, #31
	mov	r1, #1
	lsl	r2, r1, r2
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L50
	ldr	r3, [fp, #-156]
	orr	r3, r3, #2
	str	r3, [fp, #-156]
	b	.L50
.L48:
	mov	r3, #0
	str	r3, [fp, #-156]
.L50:
	ldr	r3, [fp, #-156]
	ldr	r2, .L53
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L52
	bl	__stack_chk_fail
.L52:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L54:
	.align	2
.L53:
	.word	.LC10
	.size	g_tcp_select, .-g_tcp_select
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_recv, %function
g_tcp_recv:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	recv
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_tcp_recv, .-g_tcp_recv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_close, %function
g_tcp_close:
	@ 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, [fp, #-8]
	cmp	r3, #0
	beq	.L60
	ldr	r0, [fp, #-8]
	bl	close
	b	.L57
.L60:
	nop
.L57:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_tcp_close, .-g_tcp_close
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_send, %function
g_tcp_send:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	send
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_tcp_send, .-g_tcp_send
	.align	2
	.global	g_sleep
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_sleep, %function
g_sleep:
	@ 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	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	usleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_sleep, .-g_sleep
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_last_error_would_block, %function
g_tcp_last_error_would_block:
	@ 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]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	beq	.L65
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	beq	.L65
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #115
	bne	.L66
.L65:
	mov	r3, #1
	b	.L68
.L66:
	mov	r3, #0
.L68:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_tcp_last_error_would_block, .-g_tcp_last_error_would_block
	.section	.rodata
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_accept, %function
g_tcp_accept:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	ldr	r3, .L72
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #16
	str	r3, [fp, #-32]
	ldr	r2, [fp, #-32]
	sub	r3, fp, #24
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r2, fp, #32
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-40]
	bl	accept
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	ldr	r2, .L72
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L71
	bl	__stack_chk_fail
.L71:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L73:
	.align	2
.L72:
	.word	.LC11
	.size	g_tcp_accept, .-g_tcp_accept
	.section	.rodata
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_connect, %function
g_tcp_connect:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	ldr	r3, .L78
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	g_memset
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	ldr	r0, [fp, #-40]
	bl	atoi
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	ldr	r0, [fp, #-36]
	bl	inet_addr
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L75
	ldr	r0, [fp, #-36]
	bl	gethostbyname
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L75
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L75
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #16]
	cmp	r3, #0
	beq	.L75
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L75
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	ldr	r3, [r3]
	str	r3, [fp, #-20]
.L75:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	connect
	mov	r3, r0
	ldr	r2, .L78
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L77
	bl	__stack_chk_fail
.L77:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L79:
	.align	2
.L78:
	.word	.LC12
	.size	g_tcp_connect, .-g_tcp_connect
	.section	.rodata
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_socket_ok, %function
g_tcp_socket_ok:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	ldr	r3, .L85
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #4
	str	r3, [fp, #-12]
	sub	r2, fp, #16
	sub	r3, fp, #12
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #4
	mov	r1, #1
	ldr	r0, [fp, #-24]
	bl	getsockopt
	mov	r3, r0
	cmp	r3, #0
	bne	.L81
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L81
	mov	r3, #1
	b	.L83
.L81:
	mov	r3, #0
.L83:
	ldr	r2, .L85
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L84
	bl	__stack_chk_fail
.L84:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L86:
	.align	2
.L85:
	.word	.LC13
	.size	g_tcp_socket_ok, .-g_tcp_socket_ok
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_init, %function
g_init:
	@ 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	r1, .L88
	mov	r0, #0
	bl	setlocale
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L89:
	.align	2
.L88:
	.word	.LC7
	.size	g_init, .-g_init
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_deinit, %function
g_deinit:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	g_deinit, .-g_deinit
	.section	.rodata
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_tcp_can_send, %function
g_tcp_can_send:
	@ args = 0, pretend = 0, frame = 160
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #168
	str	r0, [fp, #-160]
	str	r1, [fp, #-164]
	ldr	r3, .L98
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-164]
	ldr	r2, .L98+4
	smull	r1, r2, r3, r2
	asr	r2, r2, #6
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-144]
	ldr	r2, [fp, #-164]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	ldr	r3, .L98+8
	smull	r2, r3, r0, r3
	asr	r2, r3, #18
	asr	r3, r0, #31
	sub	r1, r2, r3
	mov	r2, r1
	lsl	r2, r2, #5
	sub	r2, r2, r1
	lsl	r3, r2, #6
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #6
	sub	r1, r0, r3
	str	r1, [fp, #-140]
	sub	r3, fp, #136
	str	r3, [fp, #-152]
	mov	r3, #0
	str	r3, [fp, #-156]
	b	.L92
.L93:
	ldr	r3, [fp, #-152]
	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]
.L92:
	ldr	r3, [fp, #-156]
	cmp	r3, #31
	bls	.L93
	ldr	r3, [fp, #-160]
	cmp	r3, #0
	ble	.L94
	ldr	r3, [fp, #-160]
	lsr	r2, r3, #5
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-132]
	ldr	r1, [fp, #-160]
	and	r1, r1, #31
	mov	r0, #1
	lsl	r1, r0, r1
	orr	r1, r3, r1
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-132]
	ldr	r3, [fp, #-160]
	add	r0, r3, #1
	sub	r2, fp, #136
	sub	r3, fp, #144
	str	r3, [sp]
	mov	r3, #0
	mov	r1, #0
	bl	select
	str	r0, [fp, #-148]
	ldr	r3, [fp, #-148]
	cmp	r3, #0
	ble	.L94
	ldr	r0, [fp, #-160]
	bl	g_tcp_socket_ok
	mov	r3, r0
	b	.L96
.L94:
	mov	r3, #0
.L96:
	ldr	r2, .L98
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L97
	bl	__stack_chk_fail
.L97:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L99:
	.align	2
.L98:
	.word	.LC14
	.word	274877907
	.word	1125899907
	.size	g_tcp_can_send, .-g_tcp_can_send
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_signal_user_interrupt, %function
g_signal_user_interrupt:
	@ 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	r1, [fp, #-8]
	mov	r0, #2
	bl	signal
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_signal_user_interrupt, .-g_signal_user_interrupt
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_signal_kill, %function
g_signal_kill:
	@ 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	r1, [fp, #-8]
	mov	r0, #9
	bl	signal
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_signal_kill, .-g_signal_kill
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_signal_terminate, %function
g_signal_terminate:
	@ 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	r1, [fp, #-8]
	mov	r0, #15
	bl	signal
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_signal_terminate, .-g_signal_terminate
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_signal_usr1, %function
g_signal_usr1:
	@ 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	r1, [fp, #-8]
	mov	r0, #10
	bl	signal
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_signal_usr1, .-g_signal_usr1
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_strcasecmp, %function
g_strcasecmp:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	strcasecmp
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	g_strcasecmp, .-g_strcasecmp
	.section	.rodata
	.align	2
.LC15:
	.ascii	"bind failed\000"
	.align	2
.LC16:
	.ascii	"listening for connection\000"
	.align	2
.LC17:
	.ascii	"got connection\000"
	.align	2
.LC18:
	.ascii	"timeout connecting\000"
	.align	2
.LC19:
	.ascii	"error connecting to remote\015\012\000"
	.align	2
.LC20:
	.ascii	"from remove, the socket from connect\000"
	.align	2
.LC21:
	.ascii	"from accepted, the socket from accept\000"
	.align	2
.LC22:
	.ascii	"acc_to_con %d\000"
	.align	2
.LC23:
	.ascii	"con_to_acc %d\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	main_loop, %function
main_loop:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-40]
	bl	g_tcp_socket
	str	r0, [fp, #-44]
	ldr	r0, [fp, #-44]
	bl	g_tcp_set_non_blocking
	ldr	r1, [fp, #-48]
	ldr	r0, [fp, #-44]
	bl	g_tcp_bind
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L107
	ldr	r0, .L139
	bl	g_writeln
.L107:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L108
	ldr	r0, [fp, #-44]
	bl	g_tcp_listen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L108
	ldr	r0, .L139+4
	bl	g_writeln
.L108:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L109
	b	.L110
.L114:
	ldr	r0, [fp, #-44]
	bl	g_tcp_accept
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmn	r3, #1
	bne	.L111
	ldr	r0, [fp, #-44]
	bl	g_tcp_last_error_would_block
	mov	r3, r0
	cmp	r3, #0
	beq	.L111
	mov	r0, #100
	bl	g_sleep
	b	.L110
.L111:
	ldr	r3, [fp, #-40]
	cmn	r3, #1
	bne	.L138
	mov	r3, #1
	str	r3, [fp, #-28]
.L110:
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L113
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L114
	b	.L113
.L138:
	nop
.L113:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L115
	ldr	r3, .L139+8
	ldr	r3, [r3]
	str	r3, [fp, #-28]
.L115:
	ldr	r0, [fp, #-44]
	bl	g_tcp_close
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L109
	ldr	r0, .L139+12
	bl	g_writeln
.L109:
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L122
	bl	g_tcp_socket
	str	r0, [fp, #-36]
	ldr	r0, [fp, #-36]
	bl	g_tcp_set_non_blocking
	ldr	r2, [fp, #-56]
	ldr	r1, [fp, #-52]
	ldr	r0, [fp, #-36]
	bl	g_tcp_connect
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L117
	ldr	r0, [fp, #-36]
	bl	g_tcp_last_error_would_block
	mov	r3, r0
	cmp	r3, #0
	beq	.L117
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L118
.L120:
	mov	r0, #100
	bl	g_sleep
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L118:
	mov	r1, #100
	ldr	r0, [fp, #-36]
	bl	g_tcp_can_send
	mov	r3, r0
	cmp	r3, #0
	bne	.L119
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L119
	ldr	r3, [fp, #-24]
	cmp	r3, #99
	ble	.L120
.L119:
	ldr	r3, [fp, #-24]
	cmp	r3, #99
	ble	.L121
	ldr	r0, .L139+16
	bl	g_writeln
	mov	r3, #1
	str	r3, [fp, #-28]
.L121:
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L117
	mov	r3, #1
	str	r3, [fp, #-28]
.L117:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L122
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L122
	ldr	r0, .L139+20
	bl	g_writeln
	b	.L122
.L136:
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-36]
	bl	g_tcp_select
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L123
	mov	r0, #10
	bl	g_sleep
	b	.L122
.L123:
	ldr	r3, [fp, #-12]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L124
	mov	r3, #0
	mov	r2, #16384
	ldr	r1, .L139+24
	ldr	r0, [fp, #-36]
	bl	g_tcp_recv
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	movle	r3, #1
	movgt	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L124
	ldr	r3, .L139+28
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, .L139+28
	str	r3, [r2]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	beq	.L125
	ldr	r0, .L139+32
	bl	g_writeln
	ldr	r1, [fp, #-8]
	ldr	r0, .L139+24
	bl	g_hexdump
.L125:
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L126
.L129:
	ldr	r3, [fp, #-32]
	ldr	r2, .L139+24
	add	r1, r3, r2
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-32]
	sub	r2, r2, r3
	mov	r3, #0
	ldr	r0, [fp, #-40]
	bl	g_tcp_send
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L127
	ldr	r0, [fp, #-40]
	bl	g_tcp_last_error_would_block
	mov	r3, r0
	cmp	r3, #0
	beq	.L127
	mov	r1, #1000
	ldr	r0, [fp, #-40]
	bl	g_tcp_can_send
	b	.L126
.L127:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bgt	.L128
	mov	r3, #1
	str	r3, [fp, #-28]
	b	.L126
.L128:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L126:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bge	.L124
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L124
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L129
.L124:
	ldr	r3, [fp, #-12]
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L122
	mov	r3, #0
	mov	r2, #16384
	ldr	r1, .L139+24
	ldr	r0, [fp, #-40]
	bl	g_tcp_recv
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	movle	r3, #1
	movgt	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L122
	ldr	r3, .L139+36
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, .L139+36
	str	r3, [r2]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	beq	.L130
	ldr	r0, .L139+40
	bl	g_writeln
	ldr	r1, [fp, #-8]
	ldr	r0, .L139+24
	bl	g_hexdump
.L130:
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L131
.L134:
	ldr	r3, [fp, #-32]
	ldr	r2, .L139+24
	add	r1, r3, r2
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-32]
	sub	r2, r2, r3
	mov	r3, #0
	ldr	r0, [fp, #-36]
	bl	g_tcp_send
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L132
	ldr	r0, [fp, #-36]
	bl	g_tcp_last_error_would_block
	mov	r3, r0
	cmp	r3, #0
	beq	.L132
	mov	r1, #1000
	ldr	r0, [fp, #-36]
	bl	g_tcp_can_send
	b	.L131
.L132:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bgt	.L133
	mov	r3, #1
	str	r3, [fp, #-28]
	b	.L131
.L133:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L131:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bge	.L122
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L122
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L134
.L122:
	ldr	r3, .L139+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L135
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L136
.L135:
	ldr	r0, [fp, #-44]
	bl	g_tcp_close
	ldr	r0, [fp, #-36]
	bl	g_tcp_close
	ldr	r0, [fp, #-40]
	bl	g_tcp_close
	ldr	r1, [fp, #-20]
	ldr	r0, .L139+44
	bl	g_writeln
	ldr	r1, [fp, #-16]
	ldr	r0, .L139+48
	bl	g_writeln
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L140:
	.align	2
.L139:
	.word	.LC15
	.word	.LC16
	.word	g_terminated
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	g_buf
	.word	g_loc_io_count
	.word	.LC20
	.word	g_rem_io_count
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.size	main_loop, .-main_loop
	.section	.rodata
	.align	2
.LC24:
	.ascii	"tcp_proxy <local-port> <remote-ip> <remote-port> [d"
	.ascii	"ump]\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L143
	bl	g_writeln
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L144:
	.align	2
.L143:
	.word	.LC24
	.size	usage, .-usage
	.section	.rodata
	.align	2
.LC25:
	.ascii	"shutting down\000"
	.text
	.align	2
	.global	proxy_shutdown
	.syntax unified
	.arm
	.fpu softvfp
	.type	proxy_shutdown, %function
proxy_shutdown:
	@ 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	r0, .L146
	bl	g_writeln
	ldr	r3, .L146+4
	mov	r2, #1
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L147:
	.align	2
.L146:
	.word	.LC25
	.word	g_terminated
	.size	proxy_shutdown, .-proxy_shutdown
	.section	.rodata
	.align	2
.LC26:
	.ascii	"cleared counters at: local_io_count: %d remote_io_c"
	.ascii	"ount: %d\000"
	.text
	.align	2
	.global	clear_counters
	.syntax unified
	.arm
	.fpu softvfp
	.type	clear_counters, %function
clear_counters:
	@ 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, .L149
	ldr	r3, [r3]
	ldr	r2, .L149+4
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L149+8
	bl	g_writeln
	ldr	r3, .L149
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L149+4
	mov	r2, #0
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L150:
	.align	2
.L149:
	.word	g_loc_io_count
	.word	g_rem_io_count
	.word	.LC26
	.size	clear_counters, .-clear_counters
	.section	.rodata
	.align	2
.LC27:
	.ascii	"tcp_proxy\000"
	.align	2
.LC28:
	.ascii	"dump\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	bgt	.L152
	bl	usage
	mov	r3, #0
	b	.L153
.L152:
	ldr	r0, .L160
	bl	g_init
	ldr	r0, .L160+4
	bl	g_signal_user_interrupt
	ldr	r0, .L160+4
	bl	g_signal_kill
	ldr	r0, .L160+8
	bl	g_signal_usr1
	ldr	r0, .L160+4
	bl	g_signal_terminate
	ldr	r3, [fp, #-16]
	cmp	r3, #4
	bgt	.L154
	b	.L155
.L156:
	ldr	r3, .L160+12
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L160+16
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	ldr	r1, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #12
	ldr	r2, [r3]
	mov	r3, #0
	bl	main_loop
.L155:
	ldr	r3, .L160+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L156
	b	.L157
.L154:
	ldr	r3, [fp, #-20]
	add	r3, r3, #16
	ldr	r3, [r3]
	ldr	r1, .L160+24
	mov	r0, r3
	bl	g_strcasecmp
	mov	r3, r0
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-8]
	b	.L158
.L159:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	ldr	r1, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #12
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	bl	main_loop
.L158:
	ldr	r3, .L160+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L159
.L157:
	bl	g_deinit
	mov	r3, #0
.L153:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L161:
	.align	2
.L160:
	.word	.LC27
	.word	proxy_shutdown
	.word	clear_counters
	.word	g_loc_io_count
	.word	g_rem_io_count
	.word	g_terminated
	.word	.LC28
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
