// File: /workspace/github_cpp_makefile_star2_O1/amit-mittal[P]FTP/ftpClient.cpp
// Function: ftpClient::sendRequest()
int ftpClient::sendRequest(){
	string cmd = getInput();
	string responseData, responseControl;
	string str, response;
	FILE *pf;
	char input[5];	//For overwrite response
	char output[MAXBUFFSIZE];
	int pos = 0;

	if(cmd.substr(0, 4) == "!pwd"){
		cout << "Result is:\n";
		pf = popen(cmd.append(" 2>&1").substr(1).c_str(), "r");	//popen is used instead of system because we want to change pwd to !pwd
		if(!pf){
      			fputs("Error occurred while opening pipe for output, calling fork or allocating memory.\n", stderr);
			return(0);
		}
	
		while(fgets(output, MAXBUFFSIZE-1, pf)){
			str.append(output);
			if((pos = str.find("pwd", pos)) != string::npos){	//Search for pwd in the output and if present, replace with !pwd
				str.replace(pos, 3, "!pwd");
				pos += 2;			
			}
		}
		
		cout << str;
		if (pclose(pf) != 0){
			fputs("Incorrect use of !pwd \n", stderr);
			return(0);
		}
		
		if(DEBUG)
			cout << "!pwd successfully executed \n";
	} else if(cmd.substr(0, 3) == "!ls"){
		cout << "Result is\n";
		pf = popen(cmd.append(" 2>&1").substr(1).c_str(), "r");	
		if(!pf){
      			fputs("Error occurred while opening pipe for output, calling fork or allocating memory.\n", stderr);
			return(0);
		}
	
		while(fgets(output, MAXBUFFSIZE-1, pf)){
			str.append(output);
			if((pos = str.find("ls", pos)) != string::npos){	//Find occurrences of ls and replace them with !ls
				str.replace(pos, 2, "!ls");
				pos += 2;			
			}
		}
		
		cout << str << endl;
		if (pclose(pf) != 0){
			fputs("Incorrect use of !ls \n", stderr);
			return(0);
		}
		if(DEBUG)
			cout << "!ls successfully executed \n";
	} else if(cmd.substr(0, 3) == "!cd"){

		if(cmd.size() == 3){
			char *env = getenv("HOME");
			cout << "Changing directory to: "  << env << endl;
			chdir(env);
			cout << "Directory successfully changed. " << endl;
			return(0);
		}

		if(cmd.substr(3, 2) == " ~"){
			char *env = getenv("HOME");
			cmd.replace(4, 1, env);
		}
		cout << "Changing directory to: "  << cmd.substr(4) << endl;
		if(chdir(cmd.substr(4).c_str())){
			str = "Error occurred while changing directory using !cd\n!cd: ";
			str.append(cmd.substr(4)).append(": No such file or directory\n");
			cout << str;
		}
		else	cout << "Directory successfully changed. " << endl;
		if(DEBUG)
			cout << "!cd successfully executed \n";
	} else if(cmd == "quit"){
		cout << "Client process exiting ...\n";
		sendControl(cmd);
		d_socket.close();
		c_socket.close();
		exit(0);
	} else if(cmd.substr(0, 3) == "pwd"){
		sendControl(cmd);
		responseData = recvData();
		responseControl = recvControl(MAXBUFFSIZE);
		cout << responseData;
		cout << responseControl;
	} else if(cmd.substr(0, 2) == "ls"){
		sendControl(cmd);
		while(1){
			responseData = recvData();
			if(responseData.substr(responseData.size()-1) == " "){
				cout << responseData;
				break;
			}
			cout << responseData;
		}
		responseControl = recvControl(MAXBUFFSIZE);
		cout << responseControl;
	} else if(cmd.substr(0, 2) == "cd"){
		sendControl(cmd);
		responseControl = recvControl(MAXBUFFSIZE);
		cout << responseControl;
	} else if(cmd.substr(0, 3) == "put"){
		if(!fileExists(cmd.substr(4).c_str())){
			cout << cmd.substr(4) << ": No such file to put\n";
			return(0);
		}
		else if(access(cmd.substr(4).c_str(), R_OK) == -1){
			cout << "No permission to read the file\n";
			return(0);
		}
		sendControl(cmd);
		responseControl = recvControl(MAXBUFFSIZE);
		if(responseControl == "EXISTS"){	//Don't allow overwriting on the server
			cout << cmd.substr(4) << ": File already exists on the server. Cannot overwrite.\n";
			return(0);
		}
		if(isEmpty(cmd.substr(4))){
			sendControl("EMPTY");	//Empty File
			cout << "\nSize of file transferred : 0 B\n";
			cout << "File transfer to server successful  \n";
			cout << "File successfully received in server \n";
			return(0);
		}
		sendControl("NEF");	//Not Empty File (NEF)
		if(transferFile(cmd.substr(4)) < 0)
			cout << "\nError occurred while transferring file to server \n";
		else cout << "\nFile transfer to server successful \n";
		responseControl = recvControl(MAXBUFFSIZE);
		cout << responseControl;		
	} else if(cmd.substr(0, 3) == "get"){
		if(access("./", W_OK) == -1){
			cout << "No permission to write\n";
			return(0);
		}
		if(fileExists(cmd.substr(4).c_str())){
			cout << cmd.substr(4) << ": File already exists\nDo you want to overwrite? (y/n): ";
			while(1){
				fgets(input, 5, stdin);
				response = input;
				if(response == "n\n")
					return(0);
				else if(response == "y\n")
					break;
				else{
					cout << "Please enter either y or n : ";
					continue;
				}
			}
		}
		sendControl(cmd);
		responseControl = recvControl(MAXBUFFSIZE);
		if(responseControl == "DNE"){
			cout << cmd.substr(4) << ": No such file to get\n";
			return(0);
		}
		responseControl = recvControl(MAXBUFFSIZE);
		if(responseControl == "EMPTY"){
			FILE *fp = fopen(cmd.substr(4).c_str(), "w");
			fclose(fp);
			cout << "\nSize of file received : 0 B\n";
			cout << "File successfully received from server \n";
			cout << "File successfully sent from server \n";
			return 0;
		}
		if(receiveFile(cmd.substr(4)))
			cout << "\nError occurred while receiving file from server \n";
		else cout << "\nFile successfully received from server \n";
		responseControl = recvControl(MAXBUFFSIZE);
		cout << responseControl;
	} else if(cmd == "help"){
		printf("\nOptions available:\n1. !ls\n2. !cd\n3. !pwd\n4. ls\n5. cd\n6. pwd\n7. get\n8. put\n9. quit\n\n");
	} else if(cmd.size() == 0){
		return(0);
	} else {
		cout << "An invalid FTP Command. Type 'help'\n";
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6c8, %rsp            # imm = 0x6C8
movq %rdi, %rsi
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %rsi, -0x30(%rbp)
callq 0x46f8
leaq -0x130(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xf0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x110(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x150(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xe0(%rbp), %rdi
movl $0x4, %ecx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3250
leaq 0x2691(%rip), %rsi      # 0x7131
leaq -0xe0(%rbp), %r14
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4ac5
callq 0x3210
testl %ebx, %ebx
je 0x4cf5
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x26c7(%rip), %rsi      # 0x71b2
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4b09
callq 0x3210
testl %ebx, %ebx
je 0x4e46
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x26a9(%rip), %rsi      # 0x71d8
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4b4d
callq 0x3210
testl %ebx, %ebx
je 0x4fc1
leaq 0x2716(%rip), %rsi      # 0x7272
leaq -0x50(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x5d80
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x25a7(%rip), %rsi      # 0x7132
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4ba9
callq 0x3210
testl %ebx, %ebx
je 0x501e
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x2, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x25e4(%rip), %rsi      # 0x71b3
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4bed
callq 0x3210
testl %ebx, %ebx
je 0x52cc
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x2, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x25c6(%rip), %rsi      # 0x71d9
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4c31
callq 0x3210
testl %ebx, %ebx
je 0x53ed
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x263c(%rip), %rsi      # 0x7293
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4c75
callq 0x3210
testl %ebx, %ebx
je 0x556d
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x3250
leaq 0x2710(%rip), %rsi      # 0x73ab
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4cb9
callq 0x3210
testl %ebx, %ebx
je 0x5780
leaq 0x2816(%rip), %rsi      # 0x74de
leaq -0x50(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x58e7
cmpq $0x0, -0x48(%rbp)
je 0x5ba0
movl $0x24, %edx
leaq 0x27f3(%rip), %rsi      # 0x74e3
jmp 0x5ae1
movq 0x52d4(%rip), %rdi      # 0x9fd0
leaq 0x2433(%rip), %rsi      # 0x7136
movl $0xb, %edx
callq 0x32b0
leaq 0x242e(%rip), %rsi      # 0x7142
leaq -0x50(%rbp), %rdi
callq 0x3490
leaq -0xe0(%rbp), %rdi
movl $0x1, %edx
movq %rax, %rsi
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rdi
leaq 0x2911(%rip), %rsi      # 0x7657
callq 0x30c0
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4d66
callq 0x3210
testq %rbx, %rbx
je 0x5776
leaq -0x6f0(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %rbx, %rdx
callq 0x33c0
testq %rax, %rax
je 0x4e12
xorl %r13d, %r13d
leaq -0x120(%rbp), %r14
leaq -0x6f0(%rbp), %r15
leaq 0x238e(%rip), %r12      # 0x7132
movq %r14, %rdi
movq %r15, %rsi
callq 0x3490
movslq %r13d, %rdx
movl $0x3, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3440
movq %rax, %r13
movq %rax, %rsi
shlq $0x20, %rsi
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
cmpq %rax, %rsi
je 0x4dfd
sarq $0x20, %rsi
movl $0x3, %edx
movl $0x4, %r8d
movq %r14, %rdi
leaq 0x233d(%rip), %rcx      # 0x7131
callq 0x32a0
addq $0x2, %r13
movq %r15, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %rbx, %rdx
callq 0x33c0
testq %rax, %rax
jne 0x4da4
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
movq 0x51a9(%rip), %rdi      # 0x9fd0
callq 0x32b0
movq %rbx, %rdi
callq 0x3330
testl %eax, %eax
je 0x5ba0
callq 0x3618
jmp 0x5ba0
movq 0x5183(%rip), %rdi      # 0x9fd0
leaq 0x2362(%rip), %rsi      # 0x71b6
movl $0xa, %edx
callq 0x32b0
leaq 0x22dd(%rip), %rsi      # 0x7142
leaq -0x50(%rbp), %rdi
callq 0x3490
leaq -0xe0(%rbp), %rdi
movl $0x1, %edx
movq %rax, %rsi
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rdi
leaq 0x27c0(%rip), %rsi      # 0x7657
callq 0x30c0
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4eb7
callq 0x3210
testq %rbx, %rbx
je 0x58dd
leaq -0x6f0(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %rbx, %rdx
callq 0x33c0
testq %rax, %rax
je 0x4f63
xorl %r13d, %r13d
leaq -0x120(%rbp), %r14
leaq -0x6f0(%rbp), %r15
leaq 0x22be(%rip), %r12      # 0x71b3
movq %r14, %rdi
movq %r15, %rsi
callq 0x3490
movslq %r13d, %rdx
movl $0x2, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3440
movq %rax, %r13
movq %rax, %rsi
shlq $0x20, %rsi
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
cmpq %rax, %rsi
je 0x4f4e
sarq $0x20, %rsi
movl $0x2, %edx
movl $0x3, %r8d
movq %r14, %rdi
leaq 0x226d(%rip), %rcx      # 0x71b2
callq 0x32a0
addq $0x2, %r13
movq %r15, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %rbx, %rdx
callq 0x33c0
testq %rax, %rax
jne 0x4ef5
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
movq 0x5058(%rip), %rdi      # 0x9fd0
callq 0x32b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x3330
testl %eax, %eax
je 0x5ba0
callq 0x35e0
jmp 0x5ba0
cmpq $0x3, -0x48(%rbp)
jne 0x510c
leaq 0x2209(%rip), %rdi      # 0x71dc
callq 0x32e0
movq %rax, %rbx
movq 0x4fee(%rip), %r14      # 0x9fd0
leaq 0x21f8(%rip), %rsi      # 0x71e1
movl $0x17, %edx
movq %r14, %rdi
callq 0x32b0
testq %rbx, %rbx
je 0x548c
movq %rbx, %rdi
callq 0x3120
movq 0x4fc2(%rip), %rdi      # 0x9fd0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x32b0
jmp 0x54a4
leaq -0x238(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x248(%rbp), %rdi
callq 0x621c
leaq -0x248(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x248(%rbp), %rdi
cmpq %r14, %rdi
je 0x5061
callq 0x3210
movq -0x30(%rbp), %rax
leaq 0xf0(%rax), %rsi
leaq -0xe0(%rbp), %rdi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
leaq -0x140(%rbp), %rdi
leaq -0xe0(%rbp), %rbx
movq %rbx, %rsi
callq 0x32f0
movq (%rbx), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x50a9
callq 0x3210
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
leaq -0x100(%rbp), %rbx
leaq -0xe0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32f0
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x50ed
callq 0x3210
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
movq 0x4ece(%rip), %rdi      # 0x9fd0
callq 0x32b0
jmp 0x5474
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %edx
movl $0x2, %ecx
callq 0x3250
leaq 0x20ed(%rip), %rsi      # 0x721a
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x514b
callq 0x3210
testl %ebx, %ebx
jne 0x517f
leaq 0x2086(%rip), %rdi      # 0x71dc
callq 0x32e0
movq %rax, %rbx
movq %rax, %rdi
callq 0x3120
leaq -0x50(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
movq %rax, %r8
callq 0x32a0
movq 0x4e4a(%rip), %rdi      # 0x9fd0
leaq 0x2054(%rip), %rsi      # 0x71e1
movl $0x17, %edx
callq 0x32b0
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0x4e08(%rip), %rdi      # 0x9fd0
callq 0x32b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3170
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x520f
callq 0x3210
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rdi
callq 0x3350
movl %eax, %ebx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5251
callq 0x3210
testl %ebx, %ebx
je 0x5522
leaq -0x120(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1fb2(%rip), %rcx      # 0x721d
movl $0x37, %r8d
xorl %esi, %esi
callq 0x33a0
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x120(%rbp), %rbx
movq %rbx, %rdi
callq 0x30d0
leaq 0x1f9d(%rip), %rsi      # 0x7255
movq %rax, %rdi
callq 0x3490
movq -0xe0(%rbp), %rdi
jmp 0x5463
leaq -0x218(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x228(%rbp), %rdi
callq 0x621c
leaq -0x228(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x228(%rbp), %rdi
cmpq %r14, %rdi
je 0x530f
callq 0x3210
movq -0x30(%rbp), %rax
leaq 0xf0(%rax), %r14
leaq -0xe0(%rbp), %r15
leaq -0x140(%rbp), %r12
leaq 0x1ee9(%rip), %r13      # 0x7218
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
movq %r12, %rdi
movq %r15, %rsi
callq 0x32f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5364
callq 0x3210
movq -0x138(%rbp), %rdx
decq %rdx
movq %r15, %rdi
movq %r12, %rsi
movq $-0x1, %rcx
callq 0x3250
movq %r15, %rdi
movq %r13, %rsi
callq 0x30b0
movl %eax, %ebx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x53a5
callq 0x3210
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
testl %ebx, %ebx
je 0x53c8
movq 0x4c12(%rip), %rdi      # 0x9fd0
callq 0x32b0
jmp 0x532f
movq 0x4c01(%rip), %rdi      # 0x9fd0
callq 0x32b0
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
jmp 0x5447
leaq -0x1f8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x208(%rbp), %rdi
callq 0x621c
leaq -0x208(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x208(%rbp), %rdi
cmpq %r14, %rdi
je 0x5430
callq 0x3210
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
leaq -0x100(%rbp), %rbx
leaq -0xe0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32f0
movq (%r14), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5474
callq 0x3210
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x4b4e(%rip), %rdi      # 0x9fd0
callq 0x32b0
jmp 0x5ba0
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x3410
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq 0x4b0e(%rip), %rdi      # 0x9fd0
callq 0x3040
movq %rax, %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x3350
movq 0x4af2(%rip), %rbx      # 0x9fd0
leaq 0x1d14(%rip), %rsi      # 0x71f9
movl $0x20, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq 0x4ac0(%rip), %rdi      # 0x9fd0
callq 0x3040
movq %rax, %rdi
callq 0x3170
jmp 0x5ba0
movq 0x4aa7(%rip), %rbx      # 0x9fd0
leaq 0x1cc9(%rip), %rsi      # 0x71f9
movl $0x20, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq 0x4a75(%rip), %rdi      # 0x9fd0
callq 0x3040
movq %rax, %rdi
callq 0x3170
jmp 0x5ba0
leaq -0x2e8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
leaq -0x2d8(%rbp), %r14
movq -0x10(%r14), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3200
movl %eax, %ebx
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x55b0
callq 0x3210
cmpl $-0x1, %ebx
je 0x58f8
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rdi
movl $0x4, %esi
callq 0x33f0
movl %eax, %ebx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5600
callq 0x3210
cmpl $-0x1, %ebx
je 0x5ad5
leaq -0x1d8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e8(%rbp), %rdi
callq 0x621c
leaq -0x1e8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x1e8(%rbp), %rdi
cmpq %r14, %rdi
je 0x564c
callq 0x3210
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
leaq -0x100(%rbp), %rdi
leaq -0xe0(%rbp), %rbx
movq %rbx, %rsi
callq 0x32f0
movq (%rbx), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x568d
callq 0x3210
leaq 0x1c3a(%rip), %rsi      # 0x72ce
leaq -0x100(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x5af2
leaq -0x2c8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
leaq -0x2c8(%rbp), %rsi
callq 0x5ff0
movl %eax, %ebx
leaq -0x2b8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56e7
callq 0x3210
testl %ebx, %ebx
je 0x5c26
leaq -0x1b8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c0c(%rip), %rsi      # 0x730d
leaq 0x1c0a(%rip), %rdx      # 0x7312
leaq -0x1c8(%rbp), %rdi
callq 0x62b6
leaq -0x1c8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x1c8(%rbp), %rdi
cmpq %r14, %rdi
je 0x5735
callq 0x3210
movq 0x4894(%rip), %rdi      # 0x9fd0
leaq 0x1bd0(%rip), %rsi      # 0x7313
movl $0x20, %edx
callq 0x32b0
movq 0x487c(%rip), %rdi      # 0x9fd0
leaq 0x1bd9(%rip), %rsi      # 0x7334
movl $0x25, %edx
callq 0x32b0
movl $0x26, %edx
leaq 0x1be9(%rip), %rsi      # 0x735a
jmp 0x5ae1
callq 0x3634
jmp 0x5ba0
leaq 0x1c28(%rip), %rdi      # 0x73af
movl $0x2, %esi
callq 0x33f0
cmpl $-0x1, %eax
je 0x5ac7
leaq -0x2e8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
leaq -0x2d8(%rbp), %r14
movq -0x10(%r14), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3200
movl %eax, %ebx
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x57dd
callq 0x3210
cmpl $-0x1, %ebx
je 0x5947
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0x47b9(%rip), %rdi      # 0x9fd0
callq 0x32b0
leaq 0x1ba7(%rip), %rsi      # 0x73ca
movl $0x37, %edx
movq %rax, %rdi
callq 0x32b0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5848
callq 0x3210
leaq -0x165(%rbp), %rbx
leaq -0x160(%rbp), %r14
leaq 0x1ba5(%rip), %r15      # 0x7402
leaq 0x1a0b(%rip), %r12      # 0x726f
movq 0x475d(%rip), %rax      # 0x9fc8
movq (%rax), %rdx
movq %rbx, %rdi
movl $0x5, %esi
callq 0x33c0
movq -0x158(%rbp), %r13
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x33a0
movq %r14, %rdi
movq %r15, %rsi
callq 0x30b0
testl %eax, %eax
je 0x5ba0
movq %r14, %rdi
movq %r12, %rsi
callq 0x30b0
testl %eax, %eax
je 0x5947
movl $0x1d, %edx
movq 0x4701(%rip), %rdi      # 0x9fd0
leaq 0x1b2f(%rip), %rsi      # 0x7405
callq 0x32b0
jmp 0x5864
callq 0x35fc
jmp 0x5ba0
leaq 0x1dee(%rip), %rdi      # 0x76dc
callq 0x3390
jmp 0x5ba0
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0x46a7(%rip), %rdi      # 0x9fd0
callq 0x32b0
leaq 0x1962(%rip), %rsi      # 0x7297
movl $0x16, %edx
movq %rax, %rdi
callq 0x32b0
jmp 0x5b88
leaq -0x178(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x621c
leaq -0x188(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x598a
callq 0x3210
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
leaq -0x100(%rbp), %rdi
leaq -0xe0(%rbp), %rbx
movq %rbx, %rsi
callq 0x32f0
movq (%rbx), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x59cb
callq 0x3210
leaq 0x1a51(%rip), %rsi      # 0x7423
leaq -0x100(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x5b3e
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
leaq -0x100(%rbp), %rdi
movq %rbx, %rsi
callq 0x32f0
movq (%rbx), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5a20
callq 0x3210
leaq 0x18e6(%rip), %rsi      # 0x730d
leaq -0x100(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x5ce1
leaq -0x288(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
leaq -0x288(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x4228
movl %eax, %ebx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5a7e
callq 0x3210
xorl %eax, %eax
testl %ebx, %ebx
setne %al
leaq 0x1a28(%rip), %rcx      # 0x74b4
leaq 0x19ee(%rip), %rsi      # 0x7481
cmoveq %rcx, %rsi
leaq (%rax,%rax,8), %rdx
addq $0x29, %rdx
movq 0x452a(%rip), %rdi      # 0x9fd0
callq 0x32b0
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
jmp 0x5447
movl $0x17, %edx
leaq 0x18df(%rip), %rsi      # 0x73b2
jmp 0x5ae1
movl $0x1f, %edx
leaq 0x17cd(%rip), %rsi      # 0x72ae
movq 0x44e8(%rip), %rdi      # 0x9fd0
callq 0x32b0
jmp 0x5ba0
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0x44ad(%rip), %rdi      # 0x9fd0
callq 0x32b0
leaq 0x17a6(%rip), %rsi      # 0x72d5
movl $0x37, %edx
movq %rax, %rdi
callq 0x32b0
jmp 0x5b88
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0x4461(%rip), %rdi      # 0x9fd0
callq 0x32b0
leaq 0x18ac(%rip), %rsi      # 0x7427
movl $0x16, %edx
movq %rax, %rdi
callq 0x32b0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5ba0
callq 0x3210
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x5bb8
callq 0x3210
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x5bd0
callq 0x3210
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x5be8
callq 0x3210
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x5c00
callq 0x3210
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c12
callq 0x3210
xorl %eax, %eax
addq $0x6c8, %rsp            # imm = 0x6C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x198(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1749(%rip), %rsi      # 0x7381
leaq 0x1745(%rip), %rdx      # 0x7384
leaq -0x1a8(%rbp), %rdi
callq 0x62b6
leaq -0x1a8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x1a8(%rbp), %rdi
cmpq %r14, %rdi
je 0x5c6c
callq 0x3210
leaq -0x2a8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
leaq -0x2a8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3fa0
leaq -0x298(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5cad
callq 0x3210
movq 0x431c(%rip), %rdi      # 0x9fd0
leaq 0x16ca(%rip), %rsi      # 0x7385
movl $0x25, %edx
callq 0x32b0
leaq -0xe0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x3d24
jmp 0x5447
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3250
movq -0xe0(%rbp), %rdi
leaq 0x13b1(%rip), %rsi      # 0x70bc
callq 0x32c0
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5d2b
callq 0x3210
movq %rbx, %rdi
callq 0x3240
movq 0x4296(%rip), %rdi      # 0x9fd0
leaq 0x16fd(%rip), %rsi      # 0x743e
movl $0x1d, %edx
callq 0x32b0
movq 0x427e(%rip), %rdi      # 0x9fd0
leaq 0x175c(%rip), %rsi      # 0x74b5
movl $0x28, %edx
callq 0x32b0
movq 0x4266(%rip), %rdi      # 0x9fd0
leaq 0x16eb(%rip), %rsi      # 0x745c
movl $0x24, %edx
callq 0x32b0
jmp 0x5ba0
movq 0x4249(%rip), %rdi      # 0x9fd0
leaq 0x14e9(%rip), %rsi      # 0x7277
movl $0x1b, %edx
callq 0x32b0
leaq -0x258(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x268(%rbp), %rdi
callq 0x621c
leaq -0x268(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3ed2
movq -0x268(%rbp), %rdi
cmpq %r14, %rdi
je 0x5ddb
callq 0x3210
movq -0x30(%rbp), %rax
movl 0xf0(%rax), %edi
callq 0x34b0
movq -0x30(%rbp), %rdi
callq 0x3a8c
xorl %edi, %edi
callq 0x32d0
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
leaq -0x298(%rbp), %rax
jmp 0x5e6c
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
jmp 0x5f02
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
leaq -0x278(%rbp), %rax
jmp 0x5e6c
jmp 0x5f44
movq %rax, %rbx
movq -0x1c8(%rbp), %rdi
jmp 0x5f02
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f11
movq %rax, %rbx
leaq -0x2b8(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x5f22
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0x188(%rbp), %rdi
jmp 0x5f02
jmp 0x5f11
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0x1e8(%rbp), %rdi
jmp 0x5f02
jmp 0x5f44
jmp 0x5f11
jmp 0x5f44
jmp 0x5f11
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0x268(%rbp), %rdi
jmp 0x5f02
jmp 0x5f44
movq %rax, %rbx
movq -0x208(%rbp), %rdi
jmp 0x5f02
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0x228(%rbp), %rdi
jmp 0x5f02
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f11
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0x248(%rbp), %rdi
cmpq %r14, %rdi
jne 0x5f27
jmp 0x5f47
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5f47
callq 0x3210
jmp 0x5f47
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
jmp 0x5f44
movq %rax, %rbx
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x5f5f
callq 0x3210
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x5f77
callq 0x3210
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x5f8f
callq 0x3210
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x5fa7
callq 0x3210
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5fb9
callq 0x3210
movq %rbx, %rdi
callq 0x3450
nop