	.file	"114833.c"
	.intel_syntax noprefix
	.text
	.globl	connections
	.bss
	.align 32
	.type	connections, @object
	.size	connections, 8192
connections:
	.zero	8192
	.globl	buff
	.align 32
	.type	buff, @object
	.size	buff, 8192
buff:
	.zero	8192
	.globl	read_events
	.align 32
	.type	read_events, @object
	.size	read_events, 128
read_events:
	.zero	128
	.globl	write_events
	.align 32
	.type	write_events, @object
	.size	write_events, 128
write_events:
	.zero	128
	.section	.rodata
.LC0:
	.string	"socket() error"
.LC1:
	.string	"SO_REUSEADDR error"
.LC2:
	.string	"bind() error"
.LC3:
	.string	"listen() error"
.LC4:
	.string	"select() error"
.LC5:
	.string	"cannot accept()"
.LC6:
	.string	"%s connected\n"
.LC7:
	.string	"cannot malloc"
.LC8:
	.string	"%d %d disconnected\n"
.LC9:
	.string	"unknown connection status"
.LC10:
	.string	"send() error"
.LC11:
	.string	"connected to server fd: %d\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, 416
	mov	DWORD PTR -404[rbp], edi
	mov	QWORD PTR -416[rbp], rsi
	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 -380[rbp], eax
	cmp	DWORD PTR -380[rbp], 0
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR -380[rbp]
	mov	esi, 2048
	mov	edi, eax
	call	set_fd
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -316[rbp], eax
	mov	WORD PTR -320[rbp], 2
	mov	edi, 9998
	call	htons@PLT
	mov	WORD PTR -318[rbp], ax
	mov	DWORD PTR -392[rbp], 1
	lea	rdx, -392[rbp]
	mov	eax, DWORD PTR -380[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rcx, -320[rbp]
	mov	eax, DWORD PTR -380[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -380[rbp]
	mov	esi, 50
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, read_events[rip]
	mov	rdi, rdx
#APP
# 79 "the_stack_data/114833.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -376[rbp], edx
	mov	DWORD PTR -372[rbp], eax
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, write_events[rip]
	mov	rdi, rdx
#APP
# 80 "the_stack_data/114833.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -368[rbp], edx
	mov	DWORD PTR -364[rbp], eax
	mov	eax, DWORD PTR -380[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -380[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
.L31:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -288[rbp]
	mov	rdi, rdx
#APP
# 86 "the_stack_data/114833.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -360[rbp], edx
	mov	DWORD PTR -356[rbp], eax
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -160[rbp]
	mov	rdi, rdx
#APP
# 87 "the_stack_data/114833.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -352[rbp], edx
	mov	DWORD PTR -348[rbp], eax
	mov	rax, QWORD PTR read_events[rip]
	mov	rdx, QWORD PTR read_events[rip+8]
	mov	QWORD PTR -288[rbp], rax
	mov	QWORD PTR -280[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+16]
	mov	rdx, QWORD PTR read_events[rip+24]
	mov	QWORD PTR -272[rbp], rax
	mov	QWORD PTR -264[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+32]
	mov	rdx, QWORD PTR read_events[rip+40]
	mov	QWORD PTR -256[rbp], rax
	mov	QWORD PTR -248[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+48]
	mov	rdx, QWORD PTR read_events[rip+56]
	mov	QWORD PTR -240[rbp], rax
	mov	QWORD PTR -232[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+64]
	mov	rdx, QWORD PTR read_events[rip+72]
	mov	QWORD PTR -224[rbp], rax
	mov	QWORD PTR -216[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+80]
	mov	rdx, QWORD PTR read_events[rip+88]
	mov	QWORD PTR -208[rbp], rax
	mov	QWORD PTR -200[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+96]
	mov	rdx, QWORD PTR read_events[rip+104]
	mov	QWORD PTR -192[rbp], rax
	mov	QWORD PTR -184[rbp], rdx
	mov	rax, QWORD PTR read_events[rip+112]
	mov	rdx, QWORD PTR read_events[rip+120]
	mov	QWORD PTR -176[rbp], rax
	mov	QWORD PTR -168[rbp], rdx
	mov	rax, QWORD PTR write_events[rip]
	mov	rdx, QWORD PTR write_events[rip+8]
	mov	QWORD PTR -160[rbp], rax
	mov	QWORD PTR -152[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+16]
	mov	rdx, QWORD PTR write_events[rip+24]
	mov	QWORD PTR -144[rbp], rax
	mov	QWORD PTR -136[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+32]
	mov	rdx, QWORD PTR write_events[rip+40]
	mov	QWORD PTR -128[rbp], rax
	mov	QWORD PTR -120[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+48]
	mov	rdx, QWORD PTR write_events[rip+56]
	mov	QWORD PTR -112[rbp], rax
	mov	QWORD PTR -104[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+64]
	mov	rdx, QWORD PTR write_events[rip+72]
	mov	QWORD PTR -96[rbp], rax
	mov	QWORD PTR -88[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+80]
	mov	rdx, QWORD PTR write_events[rip+88]
	mov	QWORD PTR -80[rbp], rax
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+96]
	mov	rdx, QWORD PTR write_events[rip+104]
	mov	QWORD PTR -64[rbp], rax
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR write_events[rip+112]
	mov	rdx, QWORD PTR write_events[rip+120]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	lea	rdx, -160[rbp]
	lea	rax, -288[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	rsi, rax
	mov	edi, 1024
	call	select@PLT
	mov	DWORD PTR -344[rbp], eax
	cmp	DWORD PTR -344[rbp], -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	cmp	DWORD PTR -344[rbp], 0
	je	.L33
	mov	DWORD PTR -384[rbp], 0
	jmp	.L9
.L30:
	mov	eax, DWORD PTR -384[rbp]
	cmp	eax, DWORD PTR -380[rbp]
	je	.L10
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	je	.L34
.L10:
	mov	eax, DWORD PTR -384[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -288[rbp+rax*8]
	mov	eax, DWORD PTR -384[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
	and	rax, rsi
	test	rax, rax
	je	.L12
	mov	eax, DWORD PTR -384[rbp]
	cmp	eax, DWORD PTR -380[rbp]
	jne	.L13
	mov	DWORD PTR -388[rbp], 16
	lea	rdx, -388[rbp]
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -380[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -336[rbp], eax
	cmp	DWORD PTR -336[rbp], 0
	jns	.L14
	lea	rdi, .LC5[rip]
	call	perror@PLT
	jmp	.L31
.L14:
	lea	rax, -32[rbp]
	lea	rdx, -304[rbp]
	lea	rsi, 4[rdx]
	mov	ecx, 16
	mov	rdx, rax
	mov	edi, 2
	call	inet_ntop@PLT
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -336[rbp]
	mov	esi, 2048
	mov	edi, eax
	call	set_fd
	mov	eax, DWORD PTR -336[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -336[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	edi, 12
	call	malloc@PLT
	mov	QWORD PTR -328[rbp], rax
	cmp	QWORD PTR -328[rbp], 0
	jne	.L15
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	rax, QWORD PTR -328[rbp]
	mov	edx, DWORD PTR -336[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -328[rbp]
	mov	DWORD PTR 4[rax], -1
	mov	rax, QWORD PTR -328[rbp]
	movzx	edx, BYTE PTR 8[rax]
	and	edx, -4
	or	edx, 1
	mov	BYTE PTR 8[rax], dl
	mov	eax, DWORD PTR -336[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rdx, connections[rip]
	mov	rax, QWORD PTR -328[rbp]
	mov	QWORD PTR [rcx+rdx], rax
	jmp	.L12
.L13:
	lea	rdx, -388[rbp]
	mov	eax, DWORD PTR -384[rbp]
	mov	esi, 21531
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	eax, DWORD PTR -388[rbp]
	test	eax, eax
	jg	.L16
	mov	eax, DWORD PTR -388[rbp]
	mov	edx, DWORD PTR -384[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	Close
	jmp	.L11
.L16:
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	movzx	eax, BYTE PTR 8[rax]
	and	eax, 3
	movzx	eax, al
	cmp	eax, 3
	je	.L18
	cmp	eax, 3
	jg	.L19
	cmp	eax, 1
	je	.L20
	cmp	eax, 2
	je	.L21
	jmp	.L19
.L20:
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	handle_auth
	test	eax, eax
	je	.L22
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	Close
	jmp	.L24
.L22:
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	movzx	edx, BYTE PTR 8[rax]
	and	edx, -4
	or	edx, 2
	mov	BYTE PTR 8[rax], dl
	jmp	.L24
.L21:
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	handle_rqst
	mov	DWORD PTR -340[rbp], eax
	cmp	DWORD PTR -340[rbp], 0
	jns	.L25
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	Close
	jmp	.L24
.L25:
	mov	eax, DWORD PTR -340[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -340[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -340[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -340[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	or	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -340[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -340[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*8]
	lea	rdx, connections[rip]
	mov	QWORD PTR [rcx+rdx], rax
	jmp	.L24
.L18:
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	handle_tras
	test	eax, eax
	je	.L35
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	Close
	jmp	.L35
.L19:
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	Close
	jmp	.L24
.L35:
	nop
.L24:
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -384[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -160[rbp+rax*8]
	mov	eax, DWORD PTR -384[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
	and	rax, rsi
	test	rax, rax
	je	.L11
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	movzx	eax, BYTE PTR 8[rax]
	and	eax, 3
	cmp	al, 2
	jne	.L11
	mov	QWORD PTR -32[rbp], 16777221
	mov	WORD PTR -24[rbp], 0
	mov	BYTE PTR -22[rbp], 0
	mov	DWORD PTR -332[rbp], 10
	mov	edi, 9998
	call	htons@PLT
	mov	WORD PTR -388[rbp], ax
	mov	eax, DWORD PTR -332[rbp]
	sub	eax, 1
	lea	rdx, -32[rbp]
	cdqe
	add	rdx, rax
	movzx	eax, WORD PTR -388[rbp]
	mov	WORD PTR [rdx], ax
	mov	eax, DWORD PTR -332[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR [rax]
	lea	rsi, -32[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	edx, DWORD PTR -332[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L28
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	je	.L11
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -384[rbp]
	mov	edi, eax
	call	Close
	jmp	.L11
.L28:
	mov	eax, DWORD PTR -384[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -384[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	not	rax
	and	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	movzx	edx, BYTE PTR 8[rax]
	or	edx, 3
	mov	BYTE PTR 8[rax], dl
	mov	eax, DWORD PTR -384[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L34:
	nop
.L11:
	add	DWORD PTR -384[rbp], 1
.L9:
	cmp	DWORD PTR -384[rbp], 1023
	jle	.L30
	jmp	.L31
.L33:
	nop
	jmp	.L31
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC12:
	.string	"recv error"
.LC13:
	.string	"unexpected SOCKS VERSION"
	.text
	.globl	handle_auth
	.type	handle_auth, @function
handle_auth:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -11[rbp], 5
	mov	BYTE PTR -9[rbp], 0
	mov	QWORD PTR -32[rbp], 2
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 2
	mov	edx, 8192
	lea	rsi, buff[rip]
	mov	edi, eax
	call	recv@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jns	.L37
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L43
.L37:
	lea	rdx, buff[rip]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	movzx	eax, BYTE PTR buff[rip]
	cmp	al, 5
	jne	.L39
	mov	rdx, QWORD PTR -32[rbp]
	lea	rsi, -11[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	rdx, QWORD PTR -32[rbp]
	cmp	rax, rdx
	je	.L40
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	jne	.L41
	mov	eax, 0
	jmp	.L43
.L41:
	mov	eax, -1
	jmp	.L43
.L40:
	mov	rdx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 0
	lea	rsi, buff[rip]
	mov	edi, eax
	call	recv@PLT
	test	rax, rax
	jns	.L42
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L43
.L42:
	mov	eax, 0
	jmp	.L43
.L39:
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, -1
.L43:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	handle_auth, .-handle_auth
	.section	.rodata
.LC14:
	.string	"Unsupported CMD"
.LC15:
	.string	"SOCKS FORMAT ERROR"
.LC16:
	.string	"%s %d\n"
.LC17:
	.string	"Unsupported Address Type"
	.text
	.globl	handle_rqst
	.type	handle_rqst, @function
handle_rqst:
.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, 304
	mov	DWORD PTR -292[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -292[rbp]
	mov	ecx, 0
	mov	edx, 8192
	lea	rsi, buff[rip]
	mov	edi, eax
	call	recv@PLT
	mov	QWORD PTR -280[rbp], rax
	cmp	QWORD PTR -280[rbp], 0
	jns	.L46
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L52
.L46:
	movzx	eax, BYTE PTR buff[rip]
	cmp	al, 5
	je	.L48
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L52
.L48:
	movzx	eax, BYTE PTR buff[rip+1]
	cmp	al, 1
	je	.L49
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L52
.L49:
	movzx	eax, BYTE PTR buff[rip+2]
	test	al, al
	je	.L50
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L52
.L50:
	mov	QWORD PTR -272[rbp], 0
	mov	QWORD PTR -264[rbp], 0
	lea	rdx, -256[rbp]
	mov	eax, 0
	mov	ecx, 29
	mov	rdi, rdx
	rep stosq
	mov	rdx, rdi
	mov	DWORD PTR [rdx], eax
	add	rdx, 4
	mov	WORD PTR [rdx], ax
	add	rdx, 2
	mov	BYTE PTR [rdx], al
	add	rdx, 1
	movzx	eax, BYTE PTR buff[rip+3]
	cmp	al, 3
	jne	.L51
	movzx	eax, BYTE PTR buff[rip+4]
	mov	BYTE PTR -283[rbp], al
	movsx	rdx, BYTE PTR -283[rbp]
	lea	rax, -272[rbp]
	lea	rsi, buff[rip+5]
	mov	rdi, rax
	call	memcpy@PLT
	movsx	eax, BYTE PTR -283[rbp]
	cdqe
	mov	BYTE PTR -272[rbp+rax], 0
	movsx	eax, BYTE PTR -283[rbp]
	add	eax, 5
	cdqe
	lea	rdx, buff[rip]
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	mov	WORD PTR -282[rbp], ax
	movzx	eax, WORD PTR -282[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	ntohs@PLT
	mov	WORD PTR -282[rbp], ax
	movzx	eax, WORD PTR -282[rbp]
	movzx	edx, ax
	lea	rax, -272[rbp]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	movzx	eax, WORD PTR -282[rbp]
	movzx	edx, ax
	lea	rax, -272[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	noblock_connect
	jmp	.L52
.L51:
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	eax, -1
.L52:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L53
	call	__stack_chk_fail@PLT
.L53:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	handle_rqst, .-handle_rqst
	.section	.rodata
.LC18:
	.string	"unexpected fd"
.LC19:
	.string	"recv() error"
.LC20:
	.string	"in"
.LC21:
	.string	"out"
	.text
	.globl	handle_tras
	.type	handle_tras, @function
handle_tras:
.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 -36[rbp], edi
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	je	.L55
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	jne	.L56
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -28[rbp], eax
	jmp	.L57
.L56:
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jne	.L58
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -28[rbp], eax
	jmp	.L57
.L58:
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L59
.L57:
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 2
	mov	edx, 8192
	lea	rsi, buff[rip]
	mov	edi, eax
	call	recv@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jns	.L60
	lea	rdi, .LC19[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L59
.L60:
	mov	rdx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -28[rbp]
	mov	ecx, 0
	lea	rsi, buff[rip]
	mov	edi, eax
	call	send@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jns	.L61
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	jne	.L62
	mov	eax, 0
	jmp	.L59
.L62:
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L59
.L61:
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 0
	lea	rsi, buff[rip]
	mov	edi, eax
	call	recv@PLT
	cmp	QWORD PTR -8[rbp], rax
	je	.L63
	lea	rdi, .LC19[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L59
.L63:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -36[rbp], eax
	jne	.L64
	lea	rax, .LC20[rip]
	jmp	.L65
.L64:
	lea	rax, .LC21[rip]
.L65:
	mov	rdi, rax
	call	puts@PLT
	mov	eax, 0
	jmp	.L59
.L55:
	mov	eax, -1
.L59:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	handle_tras, .-handle_tras
	.section	.rodata
.LC22:
	.string	"cannot resolve addr %s\n"
.LC23:
	.string	"connect() error"
	.text
	.globl	noblock_connect
	.type	noblock_connect, @function
noblock_connect:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	eax, esi
	mov	WORD PTR -60[rbp], ax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -32[rbp], 2
	movzx	eax, WORD PTR -60[rbp]
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	lea	rax, -32[rbp]
	lea	rdx, 4[rax]
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	mov	edi, 2
	call	inet_pton@PLT
	test	eax, eax
	jne	.L67
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L68
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L71
.L68:
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -32[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
.L67:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, 2048
	mov	edi, eax
	call	set_fd
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	jns	.L70
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 115
	je	.L70
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L71
.L70:
	mov	eax, DWORD PTR -44[rbp]
.L71:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L72
	call	__stack_chk_fail@PLT
.L72:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	noblock_connect, .-noblock_connect
	.section	.rodata
.LC24:
	.string	"F_GETFL error"
.LC25:
	.string	"F_SETFL error"
	.text
	.globl	set_fd
	.type	set_fd, @function
set_fd:
.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	DWORD PTR -24[rbp], esi
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L74
	lea	rdi, .LC24[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L75
.L74:
	mov	eax, DWORD PTR -24[rbp]
	or	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	test	eax, eax
	jns	.L76
	lea	rdi, .LC25[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L75
.L76:
	mov	eax, 0
.L75:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	set_fd, .-set_fd
	.globl	Close
	.type	Close, @function
Close:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	je	.L83
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	js	.L79
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	not	rax
	and	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	not	rax
	and	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
.L79:
	cmp	DWORD PTR -4[rbp], 0
	js	.L80
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	not	rax
	and	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, read_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	edx, eax
	movsx	rax, edx
	lea	rcx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	rsi, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	ecx, eax
	sar	ecx, 31
	shr	ecx, 26
	add	eax, ecx
	and	eax, 63
	sub	eax, ecx
	mov	edi, 1
	mov	ecx, eax
	sal	rdi, cl
	mov	rax, rdi
	not	rax
	and	rsi, rax
	mov	rcx, rsi
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	lea	rax, write_events[rip]
	mov	QWORD PTR [rdx+rax], rcx
.L80:
	cmp	DWORD PTR -4[rbp], 0
	jle	.L81
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
.L81:
	cmp	DWORD PTR -8[rbp], 0
	jle	.L82
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	close@PLT
.L82:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	rdi, rax
	call	free@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	QWORD PTR [rdx+rax], 0
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, connections[rip]
	mov	QWORD PTR [rdx+rax], 0
.L83:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	Close, .-Close
	.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	"114833.c"
	.text
	.comm	connections,4096,4
	.comm	buff,8192,4
	.comm	read_events,128,4
	.comm	write_events,128,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"socket() error\000"
	.align	2
.LC1:
	.ascii	"SO_REUSEADDR error\000"
	.align	2
.LC2:
	.ascii	"bind() error\000"
	.align	2
.LC3:
	.ascii	"listen() error\000"
	.align	2
.LC4:
	.ascii	"select() error\000"
	.align	2
.LC5:
	.ascii	"cannot accept()\000"
	.align	2
.LC6:
	.ascii	"%s connected\012\000"
	.align	2
.LC7:
	.ascii	"cannot malloc\000"
	.align	2
.LC8:
	.ascii	"%d %d disconnected\012\000"
	.align	2
.LC9:
	.ascii	"unknown connection status\000"
	.align	2
.LC11:
	.ascii	"send() error\000"
	.align	2
.LC12:
	.ascii	"connected to server fd: %d\012\000"
	.align	2
.LC10:
	.ascii	"\005\000\000\001\000\000\000\000\000\000\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 384
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #392
	str	r0, [fp, #-384]
	str	r1, [fp, #-388]
	ldr	r3, .L44
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-352]
	ldr	r3, [fp, #-352]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L44+4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	mov	r1, #2048
	ldr	r0, [fp, #-352]
	bl	set_fd
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-308]
	sub	r3, fp, #4
	sub	r3, r3, #308
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r0, .L44+8
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #308
	strh	r2, [r3, #2]	@ movhi
	mov	r3, #1
	str	r3, [fp, #-380]
	sub	r3, fp, #380
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-352]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L44+12
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	sub	r3, fp, #312
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-352]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L44+16
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	mov	r1, #50
	ldr	r0, [fp, #-352]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L44+20
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, .L44+24
	str	r3, [fp, #-348]
	mov	r3, #0
	str	r3, [fp, #-372]
	b	.L6
.L7:
	ldr	r3, [fp, #-348]
	ldr	r2, [fp, #-372]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-372]
	add	r3, r3, #1
	str	r3, [fp, #-372]
.L6:
	ldr	r3, [fp, #-372]
	cmp	r3, #31
	bls	.L7
	ldr	r3, .L44+28
	str	r3, [fp, #-344]
	mov	r3, #0
	str	r3, [fp, #-368]
	b	.L8
.L9:
	ldr	r3, [fp, #-344]
	ldr	r2, [fp, #-368]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-368]
	add	r3, r3, #1
	str	r3, [fp, #-368]
.L8:
	ldr	r3, [fp, #-368]
	cmp	r3, #31
	bls	.L9
	ldr	r3, [fp, #-352]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L44+24
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-352]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r3, r1, r3
	ldr	r1, .L44+24
	str	r3, [r1, r2, lsl #2]
.L39:
	sub	r3, fp, #280
	str	r3, [fp, #-340]
	mov	r3, #0
	str	r3, [fp, #-364]
	b	.L10
.L11:
	ldr	r3, [fp, #-340]
	ldr	r2, [fp, #-364]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-364]
	add	r3, r3, #1
	str	r3, [fp, #-364]
.L10:
	ldr	r3, [fp, #-364]
	cmp	r3, #31
	bls	.L11
	sub	r3, fp, #152
	str	r3, [fp, #-336]
	mov	r3, #0
	str	r3, [fp, #-360]
	b	.L12
.L13:
	ldr	r3, [fp, #-336]
	ldr	r2, [fp, #-360]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-360]
	add	r3, r3, #1
	str	r3, [fp, #-360]
.L12:
	ldr	r3, [fp, #-360]
	cmp	r3, #31
	bls	.L13
	ldr	r2, .L44+24
	sub	r3, fp, #280
	mov	r1, r2
	mov	r2, #128
	mov	r0, r3
	bl	memcpy
	ldr	r2, .L44+28
	sub	r3, fp, #152
	mov	r1, r2
	mov	r2, #128
	mov	r0, r3
	bl	memcpy
	sub	r2, fp, #152
	sub	r1, fp, #280
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r0, #1024
	bl	select
	str	r0, [fp, #-332]
	ldr	r3, [fp, #-332]
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L44+32
	bl	perror
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, [fp, #-332]
	cmp	r3, #0
	beq	.L41
	mov	r3, #0
	str	r3, [fp, #-356]
	b	.L17
.L38:
	ldr	r2, [fp, #-356]
	ldr	r3, [fp, #-352]
	cmp	r2, r3
	beq	.L18
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	beq	.L42
.L18:
	ldr	r3, [fp, #-356]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-276]
	ldr	r3, [fp, #-356]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L20
	ldr	r2, [fp, #-356]
	ldr	r3, [fp, #-352]
	cmp	r2, r3
	bne	.L21
	mov	r3, #16
	str	r3, [fp, #-376]
	sub	r2, fp, #376
	sub	r3, fp, #296
	mov	r1, r3
	ldr	r0, [fp, #-352]
	bl	accept
	str	r0, [fp, #-324]
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	bge	.L22
	ldr	r0, .L44+40
	bl	perror
	b	.L39
.L22:
	sub	r2, fp, #24
	sub	r3, fp, #296
	add	r1, r3, #4
	mov	r3, #16
	mov	r0, #2
	bl	inet_ntop
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L44+44
	bl	printf
	mov	r1, #2048
	ldr	r0, [fp, #-324]
	bl	set_fd
	ldr	r3, [fp, #-324]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L44+24
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-324]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r3, r1, r3
	ldr	r1, .L44+24
	str	r3, [r1, r2, lsl #2]
	mov	r0, #12
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-320]
	ldr	r3, [fp, #-320]
	cmp	r3, #0
	bne	.L23
	ldr	r0, .L44+48
	bl	perror
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, [fp, #-320]
	ldr	r2, [fp, #-324]
	str	r2, [r3]
	ldr	r3, [fp, #-320]
	mvn	r2, #0
	str	r2, [r3, #4]
	ldr	r2, [fp, #-320]
	ldrb	r3, [r2, #8]
	bic	r3, r3, #2
	orr	r3, r3, #1
	strb	r3, [r2, #8]
	ldr	r1, .L44+36
	ldr	r3, [fp, #-324]
	ldr	r2, [fp, #-320]
	str	r2, [r1, r3, lsl #2]
	b	.L20
.L21:
	sub	r3, fp, #376
	mov	r2, r3
	ldr	r1, .L44+52
	ldr	r0, [fp, #-356]
	bl	ioctl
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bgt	.L24
	ldr	r3, [fp, #-376]
	ldr	r2, [fp, #-356]
	mov	r1, r3
	ldr	r0, .L44+56
	bl	printf
	ldr	r0, [fp, #-356]
	bl	Close
	b	.L19
.L24:
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r3, [r2, r3, lsl #2]
	ldrb	r3, [r3, #8]
	and	r3, r3, #3
	and	r3, r3, #255
	cmp	r3, #3
	beq	.L26
	cmp	r3, #3
	bgt	.L27
	cmp	r3, #1
	beq	.L28
	cmp	r3, #2
	beq	.L29
	b	.L27
.L28:
	ldr	r0, [fp, #-356]
	bl	handle_auth
	mov	r3, r0
	cmp	r3, #0
	beq	.L30
	ldr	r0, [fp, #-356]
	bl	Close
	b	.L32
.L30:
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r2, [r2, r3, lsl #2]
	ldrb	r3, [r2, #8]
	bic	r3, r3, #1
	orr	r3, r3, #2
	strb	r3, [r2, #8]
	b	.L32
.L29:
	ldr	r0, [fp, #-356]
	bl	handle_rqst
	str	r0, [fp, #-328]
	ldr	r3, [fp, #-328]
	cmp	r3, #0
	bge	.L33
	ldr	r0, [fp, #-356]
	bl	Close
	b	.L32
.L33:
	ldr	r3, [fp, #-328]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L44+28
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-328]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r3, r1, r3
	ldr	r1, .L44+28
	str	r3, [r1, r2, lsl #2]
	ldr	r3, [fp, #-328]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L44+24
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-328]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r3, r1, r3
	ldr	r1, .L44+24
	str	r3, [r1, r2, lsl #2]
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-328]
	str	r2, [r3, #4]
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L44+36
	ldr	r3, [fp, #-328]
	str	r2, [r1, r3, lsl #2]
	b	.L32
.L26:
	ldr	r0, [fp, #-356]
	bl	handle_tras
	mov	r3, r0
	cmp	r3, #0
	beq	.L43
	ldr	r0, [fp, #-356]
	bl	Close
	b	.L43
.L27:
	ldr	r0, .L44+60
	bl	printf
	ldr	r0, [fp, #-356]
	bl	Close
	b	.L32
.L43:
	nop
.L32:
	b	.L19
.L20:
	ldr	r3, [fp, #-356]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-148]
	ldr	r3, [fp, #-356]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L19
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r3, [r2, r3, lsl #2]
	ldrb	r3, [r3, #8]	@ zero_extendqisi2
	and	r3, r3, #3
	and	r3, r3, #255
	cmp	r3, #2
	bne	.L19
	ldr	r2, .L44+64
	sub	r3, fp, #24
	ldm	r2, {r0, r1, r2}
	stmia	r3!, {r0, r1}
	strh	r2, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r2, #16
	strb	r2, [r3]
	mov	r3, #10
	str	r3, [fp, #-316]
	ldr	r0, .L44+8
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #372
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-316]
	sub	r3, r3, #1
	sub	r2, fp, #24
	add	r3, r2, r3
	sub	r1, fp, #376
	mov	r2, #2
	mov	r0, r3
	bl	memcpy
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r0, [r3]
	ldr	r2, [fp, #-316]
	sub	r1, fp, #24
	mov	r3, #0
	bl	send
	mov	r2, r0
	ldr	r3, [fp, #-316]
	cmp	r3, r2
	beq	.L36
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	beq	.L19
	ldr	r0, .L44+68
	bl	printf
	ldr	r0, [fp, #-356]
	bl	Close
	b	.L19
.L36:
	ldr	r3, [fp, #-356]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L44+28
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-356]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	mvn	r3, r3
	and	r3, r3, r1
	ldr	r1, .L44+28
	str	r3, [r1, r2, lsl #2]
	ldr	r2, .L44+36
	ldr	r3, [fp, #-356]
	ldr	r2, [r2, r3, lsl #2]
	ldrb	r3, [r2, #8]
	orr	r3, r3, #3
	strb	r3, [r2, #8]
	ldr	r1, [fp, #-356]
	ldr	r0, .L44+72
	bl	printf
	b	.L19
.L42:
	nop
.L19:
	ldr	r3, [fp, #-356]
	add	r3, r3, #1
	str	r3, [fp, #-356]
.L17:
	ldr	r3, [fp, #-356]
	cmp	r3, #1024
	blt	.L38
	b	.L39
.L41:
	nop
	b	.L39
.L45:
	.align	2
.L44:
	.word	.LC13
	.word	.LC0
	.word	9998
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	read_events
	.word	write_events
	.word	.LC4
	.word	connections
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	21531
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.section	.rodata
	.align	2
.LC15:
	.ascii	"recv error\000"
	.align	2
.LC16:
	.ascii	"unexpected SOCKS VERSION\000"
	.align	2
.LC14:
	.ascii	"\005\000\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	handle_auth
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_auth, %function
handle_auth:
	@ 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]
	ldr	r3, .L55
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L55+4
	sub	r3, fp, #12
	ldr	r2, [r2]
	strh	r2, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r2, #16
	strb	r2, [r3]
	mov	r3, #2
	str	r3, [fp, #-20]
	mov	r3, #2
	mov	r2, #8192
	ldr	r1, .L55+8
	ldr	r0, [fp, #-24]
	bl	recv
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L47
	ldr	r0, .L55+12
	bl	perror
	mvn	r3, #0
	b	.L53
.L47:
	ldr	r2, .L55+8
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L55+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #5
	bne	.L49
	sub	r1, fp, #12
	mov	r3, #0
	ldr	r2, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	send
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	cmp	r3, r2
	beq	.L50
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	bne	.L51
	mov	r3, #0
	b	.L53
.L51:
	mvn	r3, #0
	b	.L53
.L50:
	ldr	r2, [fp, #-16]
	mov	r3, #0
	ldr	r1, .L55+8
	ldr	r0, [fp, #-24]
	bl	recv
	mov	r3, r0
	cmp	r3, #0
	bge	.L52
	ldr	r0, .L55+12
	bl	perror
	mvn	r3, #0
	b	.L53
.L52:
	mov	r3, #0
	b	.L53
.L49:
	ldr	r0, .L55+16
	bl	puts
	mvn	r3, #0
.L53:
	ldr	r2, .L55
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L54
	bl	__stack_chk_fail
.L54:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L56:
	.align	2
.L55:
	.word	.LC17
	.word	.LC14
	.word	buff
	.word	.LC15
	.word	.LC16
	.size	handle_auth, .-handle_auth
	.section	.rodata
	.align	2
.LC18:
	.ascii	"Unsupported CMD\000"
	.align	2
.LC19:
	.ascii	"SOCKS FORMAT ERROR\000"
	.align	2
.LC20:
	.ascii	"%s %d\012\000"
	.align	2
.LC21:
	.ascii	"Unsupported Address Type\000"
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	handle_rqst
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_rqst, %function
handle_rqst:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #280
	str	r0, [fp, #-280]
	ldr	r3, .L66
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	mov	r2, #8192
	ldr	r1, .L66+4
	ldr	r0, [fp, #-280]
	bl	recv
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmp	r3, #0
	bge	.L58
	ldr	r0, .L66+8
	bl	perror
	mvn	r3, #0
	b	.L64
.L58:
	ldr	r3, .L66+4
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #5
	beq	.L60
	ldr	r0, .L66+12
	bl	puts
	mvn	r3, #0
	b	.L64
.L60:
	ldr	r3, .L66+4
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L61
	ldr	r0, .L66+16
	bl	puts
	mvn	r3, #0
	b	.L64
.L61:
	ldr	r3, .L66+4
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L62
	ldr	r0, .L66+20
	bl	puts
	mvn	r3, #0
	b	.L64
.L62:
	mov	r3, #0
	str	r3, [fp, #-264]
	sub	r3, fp, #260
	mov	r2, #251
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L66+4
	ldrb	r3, [r3, #3]	@ zero_extendqisi2
	cmp	r3, #3
	bne	.L63
	ldr	r3, .L66+4
	ldrb	r3, [r3, #4]
	strb	r3, [fp, #-271]
	ldrb	r2, [fp, #-271]	@ zero_extendqisi2
	sub	r3, fp, #264
	ldr	r1, .L66+24
	mov	r0, r3
	bl	memcpy
	ldrb	r3, [fp, #-271]	@ zero_extendqisi2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-260]
	ldrb	r3, [fp, #-271]	@ zero_extendqisi2
	add	r3, r3, #5
	ldr	r2, .L66+4
	add	r1, r3, r2
	sub	r3, fp, #268
	sub	r3, r3, #2
	mov	r2, #2
	mov	r0, r3
	bl	memcpy
	sub	r3, fp, #4
	sub	r3, r3, #264
	sub	r3, r3, #2
	ldrh	r3, [r3]
	mov	r0, r3
	bl	ntohs
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #264
	sub	r3, r3, #2
	strh	r2, [r3]	@ movhi
	sub	r3, fp, #4
	sub	r3, r3, #264
	sub	r3, r3, #2
	ldrh	r3, [r3]
	mov	r2, r3
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, .L66+28
	bl	printf
	sub	r3, fp, #4
	sub	r3, r3, #264
	sub	r3, r3, #2
	ldrh	r2, [r3]
	sub	r3, fp, #264
	mov	r1, r2
	mov	r0, r3
	bl	noblock_connect
	mov	r3, r0
	b	.L64
.L63:
	ldr	r0, .L66+32
	bl	puts
	mvn	r3, #0
.L64:
	ldr	r2, .L66
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L65
	bl	__stack_chk_fail
.L65:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L67:
	.align	2
.L66:
	.word	.LC22
	.word	buff
	.word	.LC15
	.word	.LC16
	.word	.LC18
	.word	.LC19
	.word	buff+5
	.word	.LC20
	.word	.LC21
	.size	handle_rqst, .-handle_rqst
	.section	.rodata
	.align	2
.LC23:
	.ascii	"unexpected fd\000"
	.align	2
.LC24:
	.ascii	"recv() error\000"
	.align	2
.LC25:
	.ascii	"in\000"
	.align	2
.LC26:
	.ascii	"out\000"
	.text
	.align	2
	.global	handle_tras
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_tras, %function
handle_tras:
	@ 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]
	ldr	r2, .L80
	ldr	r3, [fp, #-32]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	beq	.L69
	ldr	r2, .L80
	ldr	r3, [fp, #-32]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r2, .L80
	ldr	r3, [fp, #-32]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bne	.L70
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-24]
	b	.L71
.L70:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bne	.L72
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-24]
	b	.L71
.L72:
	ldr	r0, .L80+4
	bl	printf
	mvn	r3, #0
	b	.L73
.L71:
	mov	r3, #2
	mov	r2, #8192
	ldr	r1, .L80+8
	ldr	r0, [fp, #-32]
	bl	recv
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L74
	ldr	r0, .L80+12
	bl	perror
	mvn	r3, #0
	b	.L73
.L74:
	ldr	r2, [fp, #-12]
	mov	r3, #0
	ldr	r1, .L80+8
	ldr	r0, [fp, #-24]
	bl	send
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L75
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	bne	.L76
	mov	r3, #0
	b	.L73
.L76:
	ldr	r0, .L80+16
	bl	perror
	mvn	r3, #0
	b	.L73
.L75:
	ldr	r2, [fp, #-8]
	mov	r3, #0
	ldr	r1, .L80+8
	ldr	r0, [fp, #-32]
	bl	recv
	mov	r2, r0
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	beq	.L77
	ldr	r0, .L80+12
	bl	perror
	mvn	r3, #0
	b	.L73
.L77:
	ldr	r2, .L80
	ldr	r3, [fp, #-32]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bne	.L78
	ldr	r3, .L80+20
	b	.L79
.L78:
	ldr	r3, .L80+24
.L79:
	mov	r0, r3
	bl	puts
	mov	r3, #0
	b	.L73
.L69:
	mvn	r3, #0
.L73:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L81:
	.align	2
.L80:
	.word	connections
	.word	.LC23
	.word	buff
	.word	.LC24
	.word	.LC11
	.word	.LC25
	.word	.LC26
	.size	handle_tras, .-handle_tras
	.section	.rodata
	.align	2
.LC27:
	.ascii	"cannot resolve addr %s\012\000"
	.align	2
.LC28:
	.ascii	"connect() error\000"
	.align	2
.LC29:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	noblock_connect
	.syntax unified
	.arm
	.fpu softvfp
	.type	noblock_connect, %function
noblock_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, #-40]
	mov	r3, r1
	strh	r3, [fp, #-42]	@ movhi
	ldr	r3, .L89
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	ldrh	r3, [fp, #-42]
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	sub	r3, fp, #24
	add	r3, r3, #4
	mov	r2, r3
	ldr	r1, [fp, #-40]
	mov	r0, #2
	bl	inet_pton
	mov	r3, r0
	cmp	r3, #0
	bne	.L83
	ldr	r0, [fp, #-40]
	bl	gethostbyname
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L84
	ldr	r1, [fp, #-40]
	ldr	r0, .L89+4
	bl	printf
	mvn	r3, #0
	b	.L87
.L84:
	ldr	r3, [fp, #-32]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	ldr	r3, [fp, #-32]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #24
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
.L83:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-28]
	mov	r1, #2048
	ldr	r0, [fp, #-28]
	bl	set_fd
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-28]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	bge	.L86
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #115
	beq	.L86
	ldr	r0, .L89+8
	bl	perror
	mvn	r3, #0
	b	.L87
.L86:
	ldr	r3, [fp, #-28]
.L87:
	ldr	r2, .L89
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L88
	bl	__stack_chk_fail
.L88:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L90:
	.align	2
.L89:
	.word	.LC29
	.word	.LC27
	.word	.LC28
	.size	noblock_connect, .-noblock_connect
	.section	.rodata
	.align	2
.LC30:
	.ascii	"F_GETFL error\000"
	.align	2
.LC31:
	.ascii	"F_SETFL error\000"
	.text
	.align	2
	.global	set_fd
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_fd, %function
set_fd:
	@ 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]
	mov	r2, #0
	mov	r1, #3
	ldr	r0, [fp, #-16]
	bl	fcntl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L92
	ldr	r0, .L95
	bl	perror
	mvn	r3, #0
	b	.L93
.L92:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	orr	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	mov	r1, #4
	ldr	r0, [fp, #-16]
	bl	fcntl
	mov	r3, r0
	cmp	r3, #0
	bge	.L94
	ldr	r0, .L95+4
	bl	perror
	mvn	r3, #0
	b	.L93
.L94:
	mov	r3, #0
.L93:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L96:
	.align	2
.L95:
	.word	.LC30
	.word	.LC31
	.size	set_fd, .-set_fd
	.align	2
	.global	Close
	.syntax unified
	.arm
	.fpu softvfp
	.type	Close, %function
Close:
	@ 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]
	ldr	r2, .L104
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	beq	.L103
	ldr	r2, .L104
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r2, .L104
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L99
	ldr	r3, [fp, #-12]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L104+4
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-12]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	mvn	r3, r3
	and	r3, r3, r1
	ldr	r1, .L104+4
	str	r3, [r1, r2, lsl #2]
	ldr	r3, [fp, #-12]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L104+8
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-12]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	mvn	r3, r3
	and	r3, r3, r1
	ldr	r1, .L104+8
	str	r3, [r1, r2, lsl #2]
.L99:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	blt	.L100
	ldr	r3, [fp, #-8]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L104+4
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-8]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	mvn	r3, r3
	and	r3, r3, r1
	ldr	r1, .L104+4
	str	r3, [r1, r2, lsl #2]
	ldr	r3, [fp, #-8]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	ldr	r3, .L104+8
	ldr	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-8]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	mvn	r3, r3
	and	r3, r3, r1
	ldr	r1, .L104+8
	str	r3, [r1, r2, lsl #2]
.L100:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	ble	.L101
	ldr	r0, [fp, #-8]
	bl	close
.L101:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	ble	.L102
	ldr	r0, [fp, #-12]
	bl	close
.L102:
	ldr	r2, .L104
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	mov	r0, r3
	bl	free
	ldr	r2, .L104
	ldr	r3, [fp, #-8]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r2, .L104
	ldr	r3, [fp, #-12]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
.L103:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L105:
	.align	2
.L104:
	.word	connections
	.word	read_events
	.word	write_events
	.size	Close, .-Close
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
