// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/server_files/server.cpp
// Function: cmd_get()
bool cmd_get(){

	int len;

	char *encryptedData = recvDataHMAC(client_socket,len);
	if(encryptedData == NULL)
		return false;

	EncryptedChunk ec;
	ec.setCipherText(encryptedData);				//now in charge of memory management
	ec.size = len;

	Chunk c;

	DecryptManager dm;
	if(!dm.DecryptUpdate(c,ec))			return false;
	if(!dm.DecryptFinal(c))				return false;

	string filename(c.getPlainText());

	if(filename.size() >= MAX_FILENAME_LENGTH){
		return false;
	}

	string path(SERVER_PATH);
	cout<<path<<endl;
	if(!SendFile(path,client_socket,filename,SERVER_PRIVKEY_PATH,false)){
		cout << "[ERROR] sendFile failed" << endl;
		return false;
	}
	else{
		cout << "[LOG] sendFile correct" << endl;
		return true;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
leaq 0xb343(%rip), %rdi      # 0x10580
leaq 0xc(%rsp), %rsi
callq 0x6f20
testq %rax, %rax
je 0x52f7
movq %rax, %rbx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0xa0ea
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa138
movl 0xc(%rsp), %eax
movl %eax, 0x78(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x9ff8
movq %rsp, %rdi
callq 0x7dc4
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x7e62
testb %al, %al
je 0x52d7
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x7f80
testb %al, %al
je 0x52d7
leaq 0x30(%rsp), %rdi
callq 0xa0ae
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rax, %rsi
callq 0x668e
cmpq $0x63, 0x50(%rsp)
jbe 0x5308
xorl %ebx, %ebx
jmp 0x53f7
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x7e4e
leaq 0x30(%rsp), %rdi
callq 0xa00c
leaq 0x68(%rsp), %rdi
callq 0xa0fe
jmp 0x52f9
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5d29(%rip), %rsi      # 0xb041
leaq 0x5d38(%rip), %rdx      # 0xb057
leaq 0x10(%rsp), %rdi
callq 0x6762
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0xac96(%rip), %rdi      # 0xffd0
callq 0x4530
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4330
leaq 0xb210(%rip), %rsi      # 0x10580
leaq 0x5cfa(%rip), %rcx      # 0xb071
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
xorl %r8d, %r8d
callq 0x8766
movl %eax, %ebx
leaq 0x5d0f(%rip), %rax      # 0xb0a1
leaq 0x5cf0(%rip), %rsi      # 0xb089
testb %bl, %bl
cmovneq %rax, %rsi
movzbl %bl, %edx
xorq $0x17, %rdx
movq 0xac23(%rip), %r14      # 0xffd0
movq %r14, %rdi
callq 0x4530
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x4440
movsbl %al, %esi
movq 0xabfd(%rip), %rdi      # 0xffd0
callq 0x4040
movq %rax, %rdi
callq 0x4330
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x53f7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4480
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x52d9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4480
jmp 0x52d9
movq %rax, %rbx
jmp 0x544a
jmp 0x5467
jmp 0x5467
movq %rax, %rbx
jmp 0x5472
jmp 0x542b
movq %rax, %rbx
jmp 0x547c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x544a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4480
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x546a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4480
jmp 0x546a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7e4e
leaq 0x30(%rsp), %rdi
callq 0xa00c
leaq 0x68(%rsp), %rdi
callq 0xa0fe
movq %rbx, %rdi
callq 0x4830