	.file	"157112.c"
	.intel_syntax noprefix
	.text
	.globl	sock_done
	.bss
	.align 4
	.type	sock_done, @object
	.size	sock_done, 4
sock_done:
	.zero	4
	.globl	stdin_done
	.align 4
	.type	stdin_done, @object
	.size	stdin_done, 4
stdin_done:
	.zero	4
	.text
	.globl	send_byte
	.type	send_byte, @function
send_byte:
.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	DWORD PTR -4[rbp], edi
	mov	eax, esi
	mov	BYTE PTR -8[rbp], al
	lea	rsi, -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	ecx, 0
	mov	edx, 1
	mov	edi, eax
	call	send@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	send_byte, .-send_byte
	.globl	recv_byte
	.type	recv_byte, @function
recv_byte:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rsi, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	ecx, 0
	mov	edx, 1
	mov	edi, eax
	call	recv@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	recv_byte, .-recv_byte
	.globl	send_int
	.type	send_int, @function
send_int:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	htonl@PLT
	mov	DWORD PTR -8[rbp], eax
	lea	rsi, -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	ecx, 0
	mov	edx, 4
	mov	edi, eax
	call	send@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	send_int, .-send_int
	.globl	recv_int
	.type	recv_int, @function
recv_int:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rsi, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	ecx, 256
	mov	edx, 4
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	ntohl@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	recv_int, .-recv_int
	.section	.rodata
.LC0:
	.string	"Reading message type: "
.LC1:
	.string	"Reading message length: "
.LC2:
	.string	"Allocating message buffer: "
.LC3:
	.string	"Recieving message data :"
	.text
	.globl	recieve_msg
	.type	recieve_msg, @function
recieve_msg:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rdx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	recv_byte
	cmp	eax, 1
	je	.L10
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 4[rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	recv_int
	cmp	eax, 4
	je	.L11
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	test	eax, eax
	jle	.L12
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L13
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	ecx, 256
	mov	edi, eax
	call	recv@PLT
	mov	rdx, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 4[rdx]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L15
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], 0
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	recieve_msg, .-recieve_msg
	.globl	free_message_data
	.type	free_message_data, @function
free_message_data:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	je	.L18
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], 0
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	free_message_data, .-free_message_data
	.globl	get_in_addr
	.type	get_in_addr, @function
get_in_addr:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, WORD PTR [rax]
	cmp	ax, 2
	jne	.L20
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	jmp	.L21
.L20:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
.L21:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	get_in_addr, .-get_in_addr
	.section	.rodata
	.align 8
.LC4:
	.string	"Expected path message, got message type %d\n"
	.align 8
.LC5:
	.string	"Error allocating memory for path: "
.LC6:
	.string	"r"
.LC7:
	.string	"fopen"
.LC8:
	.string	"send"
.LC9:
	.string	"fread"
	.align 8
.LC10:
	.string	"Server did not accept authentication file\n"
.LC11:
	.string	"Expected OK or ERR, got %d\n"
	.text
	.globl	send_auth_file
	.type	send_auth_file, @function
send_auth_file:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	r11, -65536[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 80
	mov	DWORD PTR -65604[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -65568[rbp]
	mov	eax, DWORD PTR -65604[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	recieve_msg
	movzx	eax, BYTE PTR -65568[rbp]
	cmp	al, 3
	je	.L23
	movzx	eax, BYTE PTR -65568[rbp]
	movzx	edx, al
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	eax, DWORD PTR -65564[rbp]
	add	eax, 1
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -65592[rbp], rax
	cmp	QWORD PTR -65592[rbp], 0
	jne	.L24
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	mov	eax, DWORD PTR -65564[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -65560[rbp]
	mov	rax, QWORD PTR -65592[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	mov	eax, DWORD PTR -65564[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -65592[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -65592[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -65584[rbp], rax
	cmp	QWORD PTR -65584[rbp], 0
	jne	.L25
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	rax, QWORD PTR -65592[rbp]
	mov	rdi, rax
	call	free@PLT
.L31:
	mov	rdx, QWORD PTR -65584[rbp]
	lea	rax, -65552[rbp]
	mov	rcx, rdx
	mov	edx, 65535
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	QWORD PTR -65576[rbp], rax
	cmp	QWORD PTR -65576[rbp], 65535
	je	.L26
	mov	rax, QWORD PTR -65584[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L27
	mov	rdx, QWORD PTR -65576[rbp]
	lea	rsi, -65552[rbp]
	mov	eax, DWORD PTR -65604[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -65596[rbp], eax
	mov	eax, DWORD PTR -65596[rbp]
	cdqe
	cmp	QWORD PTR -65576[rbp], rax
	je	.L38
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L27:
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	rdx, QWORD PTR -65576[rbp]
	lea	rsi, -65552[rbp]
	mov	eax, DWORD PTR -65604[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -65596[rbp], eax
	mov	eax, DWORD PTR -65596[rbp]
	cdqe
	cmp	QWORD PTR -65576[rbp], rax
	je	.L31
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L38:
	nop
	lea	rax, -65568[rbp]
	mov	rdi, rax
	call	free_message_data
	lea	rdx, -65568[rbp]
	mov	eax, DWORD PTR -65604[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	recieve_msg
	movzx	eax, BYTE PTR -65568[rbp]
	movzx	eax, al
	cmp	eax, 4
	je	.L39
	cmp	eax, 5
	jne	.L37
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 42
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L37:
	movzx	eax, BYTE PTR -65568[rbp]
	movzx	edx, al
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L39:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	send_auth_file, .-send_auth_file
	.section	.rodata
.LC12:
	.string	"read"
	.text
	.globl	stdin_reader
	.type	stdin_reader, @function
stdin_reader:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	r11, -65536[rsp]
.LPSRL1:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL1
	sub	rsp, 48
	mov	DWORD PTR -65572[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -65552[rbp]
	mov	edx, 65535
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -65556[rbp], eax
	cmp	DWORD PTR -65556[rbp], -1
	je	.L41
	cmp	DWORD PTR -65556[rbp], 0
	je	.L42
	jmp	.L46
.L41:
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L42:
	mov	DWORD PTR stdin_done[rip], 1
	mov	eax, DWORD PTR -65572[rbp]
	mov	esi, 1
	mov	edi, eax
	call	shutdown@PLT
	jmp	.L44
.L46:
	mov	eax, DWORD PTR -65556[rbp]
	movsx	rdx, eax
	lea	rsi, -65552[rbp]
	mov	eax, DWORD PTR -65572[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
.L44:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	stdin_reader, .-stdin_reader
	.section	.rodata
	.align 8
.LC13:
	.string	"An error occured while writing to stdout"
	.align 8
.LC14:
	.string	"An error occured while writing to stderr"
	.align 8
.LC15:
	.string	"Got unexpected message type %d"
	.text
	.globl	stdout_writer
	.type	stdout_writer, @function
stdout_writer:
.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, 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 -36[rbp], 0
	lea	rdx, -32[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	recieve_msg
	movzx	eax, BYTE PTR -32[rbp]
	movzx	eax, al
	cmp	eax, 2
	je	.L48
	cmp	eax, 2
	jg	.L49
	test	eax, eax
	je	.L50
	cmp	eax, 1
	je	.L51
	jmp	.L49
.L50:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	mov	edx, DWORD PTR -28[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L56
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L51:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	mov	edi, 2
	call	write@PLT
	mov	edx, DWORD PTR -28[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L57
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L48:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	edi, eax
	call	ntohl@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	exit@PLT
.L49:
	movzx	eax, BYTE PTR -32[rbp]
	movzx	edx, al
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L56:
	nop
	jmp	.L53
.L57:
	nop
.L53:
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	free_message_data
	mov	edi, 0
	call	fflush@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L55
	call	__stack_chk_fail@PLT
.L55:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	stdout_writer, .-stdout_writer
	.section	.rodata
.LC16:
	.string	""
.LC17:
	.string	"CLJ_CLIENT_PORT"
.LC18:
	.string	"9000"
.LC19:
	.string	"127.0.0.1"
.LC20:
	.string	"getaddrinfo: %s\n"
.LC21:
	.string	"client: socket"
.LC22:
	.string	"client: connect"
.LC23:
	.string	"client: failed to connect\n"
.LC24:
	.string	"select"
	.text
	.globl	main
	.type	main, @function
main:
.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, 320
	mov	DWORD PTR -308[rbp], edi
	mov	QWORD PTR -320[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -240[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -236[rbp], 0
	mov	DWORD PTR -232[rbp], 1
	lea	rsi, .LC16[rip]
	mov	edi, 6
	call	setlocale@PLT
	lea	rdi, .LC17[rip]
	call	getenv@PLT
	mov	QWORD PTR -256[rbp], rax
	cmp	QWORD PTR -256[rbp], 0
	jne	.L59
	lea	rax, .LC18[rip]
	mov	QWORD PTR -256[rbp], rax
.L59:
	lea	rcx, -272[rbp]
	lea	rdx, -240[rbp]
	mov	rax, QWORD PTR -256[rbp]
	mov	rsi, rax
	lea	rdi, .LC19[rip]
	call	getaddrinfo@PLT
	mov	DWORD PTR -288[rbp], eax
	cmp	DWORD PTR -288[rbp], 0
	je	.L60
	mov	eax, DWORD PTR -288[rbp]
	mov	edi, eax
	call	gai_strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L76
.L60:
	mov	rax, QWORD PTR -272[rbp]
	mov	QWORD PTR -264[rbp], rax
	jmp	.L62
.L67:
	mov	rax, QWORD PTR -264[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -264[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -264[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -296[rbp], eax
	cmp	DWORD PTR -296[rbp], -1
	jne	.L63
	lea	rdi, .LC21[rip]
	call	perror@PLT
	jmp	.L64
.L63:
	mov	rax, QWORD PTR -264[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -264[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -296[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	cmp	eax, -1
	jne	.L78
	mov	eax, DWORD PTR -296[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC22[rip]
	call	perror@PLT
	nop
.L64:
	mov	rax, QWORD PTR -264[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -264[rbp], rax
.L62:
	cmp	QWORD PTR -264[rbp], 0
	jne	.L67
	jmp	.L66
.L78:
	nop
.L66:
	cmp	QWORD PTR -264[rbp], 0
	jne	.L68
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC23[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L76
.L68:
	mov	rax, QWORD PTR -264[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdi, rax
	call	get_in_addr
	mov	rsi, rax
	mov	rax, QWORD PTR -264[rbp]
	mov	eax, DWORD PTR 4[rax]
	lea	rdx, -64[rbp]
	mov	ecx, 46
	mov	edi, eax
	call	inet_ntop@PLT
	mov	rax, QWORD PTR -272[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR -296[rbp]
	mov	edi, eax
	call	send_auth_file
	mov	eax, 0
	call	get_current_dir_name@PLT
	cdqe
	mov	QWORD PTR -248[rbp], rax
	mov	rax, QWORD PTR -248[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -296[rbp]
	mov	esi, edx
	mov	edi, eax
	call	send_int
	mov	rax, QWORD PTR -248[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rsi, QWORD PTR -248[rbp]
	mov	eax, DWORD PTR -296[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	rax, QWORD PTR -248[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, DWORD PTR -308[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -296[rbp]
	mov	esi, edx
	mov	edi, eax
	call	send_int
	mov	DWORD PTR -292[rbp], 1
	jmp	.L69
.L70:
	mov	eax, DWORD PTR -292[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -320[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -296[rbp]
	mov	esi, edx
	mov	edi, eax
	call	send_int
	mov	eax, DWORD PTR -292[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -320[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -292[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -320[rbp]
	add	rax, rcx
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR -296[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	add	DWORD PTR -292[rbp], 1
.L69:
	mov	eax, DWORD PTR -292[rbp]
	cmp	eax, DWORD PTR -308[rbp]
	jl	.L70
	jmp	.L71
.L75:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -192[rbp]
	mov	rdi, rdx
#APP
# 327 "the_stack_data/157112.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -284[rbp], edx
	mov	DWORD PTR -280[rbp], eax
	mov	eax, DWORD PTR stdin_done[rip]
	test	eax, eax
	jne	.L72
	mov	rax, QWORD PTR -192[rbp]
	or	rax, 1
	mov	QWORD PTR -192[rbp], rax
.L72:
	mov	eax, DWORD PTR -296[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -192[rbp+rax*8]
	mov	eax, DWORD PTR -296[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -192[rbp+rax*8], rdx
	mov	eax, DWORD PTR -296[rbp]
	lea	edi, 1[rax]
	lea	rax, -192[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	mov	DWORD PTR -276[rbp], eax
	cmp	DWORD PTR -276[rbp], 0
	jns	.L73
	lea	rdi, .LC24[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L73:
	mov	rax, QWORD PTR -192[rbp]
	and	eax, 1
	test	rax, rax
	je	.L74
	mov	eax, DWORD PTR -296[rbp]
	mov	edi, eax
	call	stdin_reader
	mov	rax, QWORD PTR -192[rbp]
	and	rax, -2
	mov	QWORD PTR -192[rbp], rax
.L74:
	mov	eax, DWORD PTR -296[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -192[rbp+rax*8]
	mov	eax, DWORD PTR -296[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	.L71
	mov	eax, DWORD PTR -296[rbp]
	mov	edi, eax
	call	stdout_writer
	mov	eax, DWORD PTR -296[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -192[rbp+rax*8]
	mov	eax, DWORD PTR -296[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
	not	rax
	and	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -192[rbp+rax*8], rdx
.L71:
	mov	eax, DWORD PTR sock_done[rip]
	test	eax, eax
	je	.L75
	mov	eax, 0
.L76:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L77
	call	__stack_chk_fail@PLT
.L77:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	"157112.c"
	.text
	.global	sock_done
	.bss
	.align	2
	.type	sock_done, %object
	.size	sock_done, 4
sock_done:
	.space	4
	.global	stdin_done
	.align	2
	.type	stdin_done, %object
	.size	stdin_done, 4
stdin_done:
	.space	4
	.text
	.align	2
	.global	send_byte
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_byte, %function
send_byte:
	@ 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	r3, r1
	strb	r3, [fp, #-9]
	sub	r1, fp, #9
	mov	r3, #0
	mov	r2, #1
	ldr	r0, [fp, #-8]
	bl	send
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	send_byte, .-send_byte
	.align	2
	.global	recv_byte
	.syntax unified
	.arm
	.fpu softvfp
	.type	recv_byte, %function
recv_byte:
	@ 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]
	mov	r3, #0
	mov	r2, #1
	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	recv_byte, .-recv_byte
	.align	2
	.global	send_int
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_int, %function
send_int:
	@ 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	r3, [fp, #-12]
	mov	r0, r3
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-12]
	sub	r1, fp, #12
	mov	r3, #0
	mov	r2, #4
	ldr	r0, [fp, #-8]
	bl	send
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	send_int, .-send_int
	.align	2
	.global	recv_int
	.syntax unified
	.arm
	.fpu softvfp
	.type	recv_int, %function
recv_int:
	@ 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	r3, #256
	mov	r2, #4
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	recv
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	mov	r0, r3
	bl	ntohl
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	recv_int, .-recv_int
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Reading message type: \000"
	.align	2
.LC1:
	.ascii	"Reading message length: \000"
	.align	2
.LC2:
	.ascii	"Allocating message buffer: \000"
	.align	2
.LC3:
	.ascii	"Recieving message data :\000"
	.text
	.align	2
	.global	recieve_msg
	.syntax unified
	.arm
	.fpu softvfp
	.type	recieve_msg, %function
recieve_msg:
	@ 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	r3, [fp, #-12]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	recv_byte
	mov	r3, r0
	cmp	r3, #1
	beq	.L10
	ldr	r0, .L16
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	recv_int
	mov	r3, r0
	cmp	r3, #4
	beq	.L11
	ldr	r0, .L16+4
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	ble	.L12
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-12]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	bne	.L13
	ldr	r0, .L16+8
	bl	perror
	mov	r0, #1
	bl	exit
.L13:
	ldr	r3, [fp, #-12]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	mov	r2, r3
	mov	r3, #256
	ldr	r0, [fp, #-8]
	bl	recv
	mov	r2, r0
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	cmp	r2, r3
	beq	.L15
	ldr	r0, .L16+12
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #8]
.L15:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	recieve_msg, .-recieve_msg
	.align	2
	.global	free_message_data
	.syntax unified
	.arm
	.fpu softvfp
	.type	free_message_data, %function
free_message_data:
	@ 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]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L20
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #8]
.L20:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	free_message_data, .-free_message_data
	.align	2
	.global	get_in_addr
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_in_addr, %function
get_in_addr:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrh	r3, [r3]
	cmp	r3, #2
	bne	.L22
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	b	.L23
.L22:
	ldr	r3, [fp, #-8]
	add	r3, r3, #8
.L23:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get_in_addr, .-get_in_addr
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Expected path message, got message type %d\012\000"
	.align	2
.LC5:
	.ascii	"Error allocating memory for path: \000"
	.align	2
.LC6:
	.ascii	"r\000"
	.align	2
.LC7:
	.ascii	"fopen\000"
	.align	2
.LC8:
	.ascii	"send\000"
	.align	2
.LC9:
	.ascii	"fread\000"
	.align	2
.LC10:
	.ascii	"Server did not accept authentication file\012\000"
	.align	2
.LC11:
	.ascii	"Expected OK or ERR, got %d\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	send_auth_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_auth_file, %function
send_auth_file:
	@ args = 0, pretend = 0, frame = 65576
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #65536
	sub	sp, sp, #44
	sub	r3, fp, #65536
	sub	r3, r3, #12
	str	r0, [r3, #-36]
	ldr	r3, .L42
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #65536
	sub	r3, r3, #12
	sub	r3, r3, #16
	sub	r2, fp, #65536
	sub	r2, r2, #12
	mov	r1, r3
	ldr	r0, [r2, #-36]
	bl	recieve_msg
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldrb	r3, [r3, #-16]	@ zero_extendqisi2
	cmp	r3, #3
	beq	.L25
	ldr	r3, .L42+4
	ldr	r3, [r3]
	sub	r2, fp, #65536
	sub	r2, r2, #12
	ldrb	r2, [r2, #-16]	@ zero_extendqisi2
	ldr	r1, .L42+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L25:
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-12]
	add	r3, r3, #1
	mov	r2, r3
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r4, r3
	mov	r0, r2
	bl	malloc
	mov	r3, r0
	str	r3, [r4, #-32]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-32]
	cmp	r3, #0
	bne	.L26
	ldr	r0, .L42+12
	bl	perror
	mov	r0, #1
	bl	exit
.L26:
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	sub	r2, fp, #65536
	sub	r2, r2, #12
	ldr	r2, [r2, #-12]
	mov	r1, r2
	sub	r2, fp, #65536
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, r1
	mov	r1, r3
	ldr	r0, [r0, #-32]
	bl	memcpy
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-12]
	mov	r2, r3
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-32]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r1, .L42+16
	ldr	r0, [r3, #-32]
	bl	fopen
	str	r0, [r4, #-28]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-28]
	cmp	r3, #0
	bne	.L27
	ldr	r0, .L42+20
	bl	perror
	mov	r0, #1
	bl	exit
.L27:
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r0, [r3, #-32]
	bl	free
.L33:
	sub	r3, fp, #65536
	sub	r3, r3, #12
	sub	r0, fp, #65536
	sub	r0, r0, #12
	sub	r0, r0, #4
	ldr	r3, [r3, #-28]
	ldr	r2, .L42+24
	mov	r1, #1
	bl	fread
	mov	r3, r0
	sub	r2, fp, #65536
	sub	r2, r2, #12
	str	r3, [r2, #-24]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-24]
	ldr	r2, .L42+24
	cmp	r3, r2
	beq	.L28
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r0, [r3, #-28]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L29
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r2, [r3, #-24]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r4, r3
	sub	r1, fp, #65536
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	ldr	r0, [r0, #-36]
	bl	send
	str	r0, [r4, #-20]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r2, [r2, #-20]
	ldr	r3, [r3, #-24]
	cmp	r2, r3
	beq	.L40
	ldr	r0, .L42+28
	bl	perror
	mov	r0, #1
	bl	exit
.L29:
	ldr	r0, .L42+32
	bl	perror
	mov	r0, #1
	bl	exit
.L28:
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r2, [r3, #-24]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r4, r3
	sub	r1, fp, #65536
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	ldr	r0, [r0, #-36]
	bl	send
	str	r0, [r4, #-20]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r2, [r2, #-20]
	ldr	r3, [r3, #-24]
	cmp	r2, r3
	beq	.L33
	ldr	r0, .L42+28
	bl	perror
	mov	r0, #1
	bl	exit
.L40:
	nop
	sub	r3, fp, #65536
	sub	r3, r3, #12
	sub	r3, r3, #16
	mov	r0, r3
	bl	free_message_data
	sub	r3, fp, #65536
	sub	r3, r3, #12
	sub	r3, r3, #16
	sub	r2, fp, #65536
	sub	r2, r2, #12
	mov	r1, r3
	ldr	r0, [r2, #-36]
	bl	recieve_msg
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldrb	r3, [r3, #-16]	@ zero_extendqisi2
	cmp	r3, #4
	beq	.L41
	cmp	r3, #5
	bne	.L39
	ldr	r3, .L42+4
	ldr	r3, [r3]
	mov	r2, #42
	mov	r1, #1
	ldr	r0, .L42+36
	bl	fwrite
	mov	r0, #1
	bl	exit
.L39:
	ldr	r3, .L42+4
	ldr	r3, [r3]
	sub	r2, fp, #65536
	sub	r2, r2, #12
	ldrb	r2, [r2, #-16]	@ zero_extendqisi2
	ldr	r1, .L42+40
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L41:
	nop
	ldr	r3, .L42
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L38
	bl	__stack_chk_fail
.L38:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L43:
	.align	2
.L42:
	.word	.LC12
	.word	stderr
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	65535
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	send_auth_file, .-send_auth_file
	.section	.rodata
	.align	2
.LC13:
	.ascii	"read\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	stdin_reader
	.syntax unified
	.arm
	.fpu softvfp
	.type	stdin_reader, %function
stdin_reader:
	@ args = 0, pretend = 0, frame = 65552
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #65536
	sub	sp, sp, #20
	sub	r3, fp, #65536
	sub	r3, r3, #12
	str	r0, [r3, #-12]
	ldr	r3, .L51
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #65536
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, .L51+4
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [r4, #-8]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmn	r3, #1
	beq	.L45
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmp	r3, #0
	beq	.L46
	b	.L50
.L45:
	ldr	r0, .L51+8
	bl	perror
	mov	r0, #1
	bl	exit
.L46:
	ldr	r3, .L51+12
	mov	r2, #1
	str	r2, [r3]
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r1, #1
	ldr	r0, [r3, #-12]
	bl	shutdown
	b	.L48
.L50:
	sub	r3, fp, #65536
	sub	r3, r3, #12
	ldr	r2, [r3, #-8]
	sub	r1, fp, #65536
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #65536
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, #0
	ldr	r0, [r0, #-12]
	bl	send
.L48:
	nop
	ldr	r3, .L51
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L49
	bl	__stack_chk_fail
.L49:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L52:
	.align	2
.L51:
	.word	.LC14
	.word	65535
	.word	.LC13
	.word	stdin_done
	.size	stdin_reader, .-stdin_reader
	.section	.rodata
	.align	2
.LC15:
	.ascii	"An error occured while writing to stdout\000"
	.align	2
.LC16:
	.ascii	"An error occured while writing to stderr\000"
	.align	2
.LC17:
	.ascii	"Got unexpected message type %d\000"
	.align	2
.LC18:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	stdout_writer
	.syntax unified
	.arm
	.fpu softvfp
	.type	stdout_writer, %function
stdout_writer:
	@ 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	r3, .L64
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-24]
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	recieve_msg
	ldrb	r3, [fp, #-20]	@ zero_extendqisi2
	cmp	r3, #2
	beq	.L54
	cmp	r3, #2
	bgt	.L55
	cmp	r3, #0
	beq	.L56
	cmp	r3, #1
	beq	.L57
	b	.L55
.L56:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	mov	r1, r3
	mov	r0, #1
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L62
	ldr	r0, .L64+4
	bl	perror
	mov	r0, #1
	bl	exit
.L57:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	mov	r1, r3
	mov	r0, #2
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L63
	ldr	r0, .L64+8
	bl	perror
	mov	r0, #1
	bl	exit
.L54:
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	ntohl
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r0, [fp, #-24]
	bl	exit
.L55:
	ldr	r3, .L64+12
	ldr	r3, [r3]
	ldrb	r2, [fp, #-20]	@ zero_extendqisi2
	ldr	r1, .L64+16
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L62:
	nop
	b	.L59
.L63:
	nop
.L59:
	sub	r3, fp, #20
	mov	r0, r3
	bl	free_message_data
	mov	r0, #0
	bl	fflush
	nop
	ldr	r3, .L64
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L61
	bl	__stack_chk_fail
.L61:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L65:
	.align	2
.L64:
	.word	.LC18
	.word	.LC15
	.word	.LC16
	.word	stderr
	.word	.LC17
	.size	stdout_writer, .-stdout_writer
	.section	.rodata
	.align	2
.LC19:
	.ascii	"\000"
	.align	2
.LC20:
	.ascii	"CLJ_CLIENT_PORT\000"
	.align	2
.LC21:
	.ascii	"9000\000"
	.align	2
.LC22:
	.ascii	"127.0.0.1\000"
	.align	2
.LC23:
	.ascii	"getaddrinfo: %s\012\000"
	.align	2
.LC24:
	.ascii	"client: socket\000"
	.align	2
.LC25:
	.ascii	"client: connect\000"
	.align	2
.LC26:
	.ascii	"client: failed to connect\012\000"
	.align	2
.LC27:
	.ascii	"select\000"
	.align	2
.LC28:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 264
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #276
	str	r0, [fp, #-272]
	str	r1, [fp, #-276]
	ldr	r3, .L89
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #224
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-220]
	mov	r3, #1
	str	r3, [fp, #-216]
	ldr	r1, .L89+4
	mov	r0, #6
	bl	setlocale
	ldr	r0, .L89+8
	bl	getenv
	str	r0, [fp, #-248]
	ldr	r3, [fp, #-248]
	cmp	r3, #0
	bne	.L67
	ldr	r3, .L89+12
	str	r3, [fp, #-248]
.L67:
	sub	r3, fp, #264
	sub	r2, fp, #224
	ldr	r1, [fp, #-248]
	ldr	r0, .L89+16
	bl	getaddrinfo
	str	r0, [fp, #-240]
	ldr	r3, [fp, #-240]
	cmp	r3, #0
	beq	.L68
	ldr	r3, .L89+20
	ldr	r4, [r3]
	ldr	r0, [fp, #-240]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L89+24
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L86
.L68:
	ldr	r3, [fp, #-264]
	str	r3, [fp, #-256]
	b	.L70
.L75:
	ldr	r3, [fp, #-256]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-256]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-256]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-260]
	ldr	r3, [fp, #-260]
	cmn	r3, #1
	bne	.L71
	ldr	r0, .L89+28
	bl	perror
	b	.L72
.L71:
	ldr	r3, [fp, #-256]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-256]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-260]
	bl	connect
	mov	r3, r0
	cmn	r3, #1
	bne	.L88
	ldr	r0, [fp, #-260]
	bl	close
	ldr	r0, .L89+32
	bl	perror
	nop
.L72:
	ldr	r3, [fp, #-256]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-256]
.L70:
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	bne	.L75
	b	.L74
.L88:
	nop
.L74:
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	bne	.L76
	ldr	r3, .L89+20
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L89+36
	bl	fwrite
	mov	r3, #2
	b	.L86
.L76:
	ldr	r3, [fp, #-256]
	ldr	r4, [r3, #4]
	ldr	r3, [fp, #-256]
	ldr	r3, [r3, #20]
	mov	r0, r3
	bl	get_in_addr
	mov	r1, r0
	sub	r2, fp, #64
	mov	r3, #46
	mov	r0, r4
	bl	inet_ntop
	ldr	r3, [fp, #-264]
	mov	r0, r3
	bl	freeaddrinfo
	ldr	r0, [fp, #-260]
	bl	send_auth_file
	bl	get_current_dir_name
	mov	r3, r0
	str	r3, [fp, #-236]
	ldr	r0, [fp, #-236]
	bl	strlen
	mov	r3, r0
	mov	r1, r3
	ldr	r0, [fp, #-260]
	bl	send_int
	ldr	r0, [fp, #-236]
	bl	strlen
	mov	r2, r0
	mov	r3, #0
	ldr	r1, [fp, #-236]
	ldr	r0, [fp, #-260]
	bl	send
	ldr	r0, [fp, #-236]
	bl	free
	ldr	r3, [fp, #-272]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-260]
	bl	send_int
	mov	r3, #1
	str	r3, [fp, #-252]
	b	.L77
.L78:
	ldr	r3, [fp, #-252]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-276]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r1, r3
	ldr	r0, [fp, #-260]
	bl	send_int
	ldr	r3, [fp, #-252]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-276]
	add	r3, r2, r3
	ldr	r4, [r3]
	ldr	r3, [fp, #-252]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-276]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	mov	r3, #0
	mov	r1, r4
	ldr	r0, [fp, #-260]
	bl	send
	ldr	r3, [fp, #-252]
	add	r3, r3, #1
	str	r3, [fp, #-252]
.L77:
	ldr	r2, [fp, #-252]
	ldr	r3, [fp, #-272]
	cmp	r2, r3
	blt	.L78
	b	.L79
.L85:
	sub	r3, fp, #192
	str	r3, [fp, #-232]
	mov	r3, #0
	str	r3, [fp, #-244]
	b	.L80
.L81:
	ldr	r3, [fp, #-232]
	ldr	r2, [fp, #-244]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-244]
	add	r3, r3, #1
	str	r3, [fp, #-244]
.L80:
	ldr	r3, [fp, #-244]
	cmp	r3, #31
	bls	.L81
	ldr	r3, .L89+40
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L82
	ldr	r3, [fp, #-192]
	orr	r3, r3, #1
	str	r3, [fp, #-192]
.L82:
	ldr	r3, [fp, #-260]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r1, [r3, #-180]
	ldr	r3, [fp, #-260]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	str	r1, [r3, #-180]
	ldr	r3, [fp, #-260]
	add	r0, r3, #1
	sub	r1, fp, #192
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	str	r0, [fp, #-228]
	ldr	r3, [fp, #-228]
	cmp	r3, #0
	bge	.L83
	ldr	r0, .L89+44
	bl	perror
	mov	r0, #1
	bl	exit
.L83:
	ldr	r3, [fp, #-192]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L84
	ldr	r0, [fp, #-260]
	bl	stdin_reader
	ldr	r3, [fp, #-192]
	bic	r3, r3, #1
	str	r3, [fp, #-192]
.L84:
	ldr	r3, [fp, #-260]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-180]
	ldr	r3, [fp, #-260]
	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	.L79
	ldr	r0, [fp, #-260]
	bl	stdout_writer
	ldr	r3, [fp, #-260]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r1, [r3, #-180]
	ldr	r3, [fp, #-260]
	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	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	str	r1, [r3, #-180]
.L79:
	ldr	r3, .L89+48
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L85
	mov	r3, #0
.L86:
	ldr	r2, .L89
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L87
	bl	__stack_chk_fail
.L87:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L90:
	.align	2
.L89:
	.word	.LC28
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	stderr
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	stdin_done
	.word	.LC27
	.word	sock_done
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
