// File: /workspace/github_cpp_makefile_star2_O1/amit-mittal[P]FTP/ftpServer.cpp
// Function: ftpServer::sendResponse()
int ftpServer::sendResponse(){	
	string cmd = recvControl(MAXBUFFSIZE);
	FILE *pf;
	string str, responseControl;
	char output[MAXBUFFSIZE];
	if(DEBUG)
		cout << "Got command from client: " << cmd << endl;

	if(cmd.substr(0, 3) == "pwd"){
		
		pf = popen(cmd.append(" 2>&1").c_str(), "r");
		if(!pf){
			sendData(" ");
      			sendControl("Error occurred while opening pipe for output, calling fork or allocating memory.\n");
			cout << "Command could NOT be successfully executed for client\n";
			return(0); 
		}

		fgets(output, MAXBUFFSIZE-1, pf);
		str = output;
		sendData(str);
		if (pclose(pf) != 0){
			sendControl("Incorrect use of pwd \n");
			cout << "Command could NOT be successfully executed for client\n";
			return(0);
		}

		sendControl("pwd successfully executed in server \n");
		cout << "Command successfully executed for client\n";
	} 

	else if(cmd.substr(0, 2) == "ls"){
		pf = popen(cmd.append(" 2>&1").c_str(), "r");	//popen does not return stderr file handle. Only stdout. So we are redirecting stderr to stdout
		if(!pf){
			sendData(" ");
      			sendControl("Error occurred while opening pipe for output, calling fork or allocating memory.\n");
			cout << "Command could NOT be successfully executed for client\n";
			return(0); 
		}
	
		while(fgets(output, MAXBUFFSIZE-1, pf)){
			if(str.size() + strlen(output) >= MAXBUFFSIZE){
				sendData(str);
				str = "";
			}
			str.append(output);
		}
		
		str.append(" ");
		sendData(str);
		if (pclose(pf) != 0){
			sendControl("Incorrect use of ls \n");
			cout << "Command could NOT be successfully executed for client\n";
			return(0);
		}
		
		sendControl("ls successfully executed in server \n");
		cout << "Command successfully executed for client\n";
	} 

	else if(cmd.substr(0, 2) == "cd"){

		if(cmd.size() == 2){
			char *env = getenv("HOME");
			chdir(env);
			sendControl("Directory successfully changed \n");
			cout << "Command successfully executed for client\n";
			return(0);
		}

		if(cmd.substr(2, 2) == " ~"){
			char *env = getenv("HOME");
			cmd.replace(3, 1, env);
		}

		if(chdir(cmd.substr(3).c_str())){
			str = "Error occurred while changing directory using cd in server\ncd: ";
			str.append(cmd.substr(3)).append(": No such file or directory\n");
			sendControl(str);
			cout << "Command could NOT be successfully executed for client\n";
		}
		else {
			sendControl("Directory successfully changed \n");
			cout << "Command successfully executed for client\n";
		}
	}

	else if(cmd.substr(0, 3) == "put"){
		if(fileExists(cmd.substr(4).c_str())){
			sendControl("EXISTS");
			cout << "Command could NOT be successfully executed for client\n";
			return(0);
		}
		sendControl("DNE");	//Does Not Exist
		responseControl = recvControl(MAXBUFFSIZE);
		if(responseControl == "EMPTY"){
			FILE *fp = fopen(cmd.substr(4).c_str(), "w");
			fclose(fp);
			cout << "Command successfully executed for client\n";
			return 0;
		}
		if(receiveFile(cmd.substr(4))){
			sendControl("Error occurred while receiving file in server \n");
			cout << "Command could NOT be successfully executed for client\n";
		}
		else {
			sendControl("File successfully received in server \n");
			cout << "Command successfully executed for client\n";
		}
	}

	else if(cmd.substr(0, 3) == "get"){
		if(!fileExists(cmd.substr(4).c_str())){
			sendControl("DNE");
			cout << "Command could NOT be successfully executed for client\n";
			return(0);
		}
		sendControl("EXISTS");	//File Exists
		if(isEmpty(cmd.substr(4))){
			sendControl("EMPTY");	//Empty File
			cout << "Command could NOT be successfully executed for client\n";
			return(0);
		}
		sendControl("NEF");	//Not Empty File (NEF)
		if(transferFile(cmd.substr(4)) < 0){
			sendControl("Error occurred while sending file from server \n");
			cout << "Command could NOT be successfully executed for client\n";
		}
		else {
			sendControl("File successfully sent from server \n");
			cout << "Command successfully executed for client\n";
		}
	}

	else if(cmd == "quit"){
		d_socket.close();
		c_socket.close();
		cout << "Child Process exiting ... \n";
		cout << "Command successfully executed for client\n";
		exit(0);
	}

	else {
		sendControl("Invalid command sent to server \n");
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x878, %rsp            # imm = 0x878
movq %rdi, -0x30(%rbp)
leaq 0xf8(%rdi), %r14
leaq -0x50(%rbp), %rbx
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x2c24
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r15, -0x8(%r13)
movb %r15b, (%r13)
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r15, -0x8(%rax)
movb %r15b, (%rax)
leaq -0x140(%rbp), %rdi
movl $0x3, %ecx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2230
leaq 0x1d66(%rip), %rsi      # 0x50e3
leaq -0x140(%rbp), %r15
movq %r15, %rdi
callq 0x20b0
movl %eax, %ebx
movq (%r15), %rdi
leaq -0x130(%rbp), %r12
cmpq %r12, %rdi
je 0x33a2
callq 0x21f0
testl %ebx, %ebx
je 0x3505
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x2, %ecx
xorl %edx, %edx
callq 0x2230
leaq 0x1e17(%rip), %rsi      # 0x51df
movq %r15, %rdi
callq 0x20b0
movl %eax, %ebx
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x33df
callq 0x21f0
testl %ebx, %ebx
je 0x35fe
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x2, %ecx
xorl %edx, %edx
callq 0x2230
leaq 0x1e18(%rip), %rsi      # 0x521d
movq %r15, %rdi
callq 0x20b0
movl %eax, %ebx
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x341c
callq 0x21f0
testl %ebx, %ebx
je 0x36d1
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x2230
leaq 0x1e64(%rip), %rsi      # 0x52a6
movq %r15, %rdi
callq 0x20b0
movl %eax, %ebx
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x3459
callq 0x21f0
testl %ebx, %ebx
je 0x3882
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x2230
leaq 0x1e95(%rip), %rsi      # 0x5314
movq %r15, %rdi
callq 0x20b0
movl %eax, %ebx
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x3496
callq 0x21f0
testl %ebx, %ebx
je 0x3b3a
leaq 0x1e9c(%rip), %rsi      # 0x5341
leaq -0x50(%rbp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x4023
leaq -0x150(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1e9a(%rip), %rsi      # 0x5362
leaq 0x1eb3(%rip), %rdx      # 0x5382
leaq -0x160(%rbp), %rdi
callq 0x4964
leaq -0x160(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x160(%rbp), %rdi
cmpq %r14, %rdi
je 0x3fd7
callq 0x21f0
jmp 0x3fd7
leaq 0x1bdb(%rip), %rsi      # 0x50e7
leaq -0x50(%rbp), %rdi
callq 0x2400
movq (%rax), %rdi
leaq 0x1bce(%rip), %rsi      # 0x50ed
callq 0x20c0
testq %rax, %rax
je 0x37fb
movq %rax, %rbx
leaq -0x8a0(%rbp), %r14
movq %r14, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %rax, %rdx
callq 0x2380
leaq -0x70(%rbp), %r15
movq 0x8(%r15), %r12
movq %r14, %rdi
callq 0x2110
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x2360
leaq -0x3d0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x3e0(%rbp), %rdi
callq 0x48ca
leaq -0x3e0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2f0e
movq -0x3e0(%rbp), %rdi
cmpq %r14, %rdi
je 0x35ad
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
testl %eax, %eax
je 0x3996
leaq -0x3b0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ba9(%rip), %rsi      # 0x5178
leaq 0x1bb8(%rip), %rdx      # 0x518e
leaq -0x3c0(%rbp), %rdi
callq 0x4964
leaq -0x3c0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x3c0(%rbp), %rdi
jmp 0x3e35
leaq 0x1ae2(%rip), %rsi      # 0x50e7
leaq -0x50(%rbp), %rdi
callq 0x2400
movq (%rax), %rdi
leaq 0x1ad5(%rip), %rsi      # 0x50ed
callq 0x20c0
testq %rax, %rax
je 0x390f
movq %rax, %r14
leaq -0x8a0(%rbp), %r15
leaq -0x90(%rbp), %r12
leaq -0x70(%rbp), %rbx
movq %r15, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %r14, %rdx
callq 0x2380
testq %rax, %rax
je 0x3753
movq -0x68(%rbp), %r13
movq %r15, %rdi
callq 0x2110
addq %r13, %rax
cmpq $0x400, %rax            # imm = 0x400
jb 0x36c1
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x70(%rbp), %rsi
addq %rsi, %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x48ca
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x2f0e
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x36a9
callq 0x21f0
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
leaq 0x1d71(%rip), %rcx      # 0x542a
xorl %r8d, %r8d
callq 0x2360
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2400
jmp 0x363b
cmpq $0x2, -0x48(%rbp)
jne 0x39d7
leaq 0x1b3d(%rip), %rdi      # 0x5220
callq 0x22c0
movq %rax, %rdi
callq 0x2320
leaq -0x2d0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b23(%rip), %rsi      # 0x5225
leaq 0x1b3c(%rip), %rdx      # 0x5245
leaq -0x2e0(%rbp), %rdi
callq 0x4964
leaq -0x2e0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x2e0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3736
callq 0x21f0
movq 0x4893(%rip), %rdi      # 0x7fd0
leaq 0x1a71(%rip), %rsi      # 0x51b5
movl $0x29, %edx
callq 0x2290
jmp 0x3fd7
leaq 0x1d6d(%rip), %rsi      # 0x54c7
leaq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %r13
callq 0x2400
leaq -0x330(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x340(%rbp), %rdi
callq 0x48ca
leaq -0x340(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2f0e
movq -0x340(%rbp), %rdi
cmpq %r15, %rdi
je 0x37aa
callq 0x21f0
movq %r14, %rdi
callq 0x2300
testl %eax, %eax
je 0x3c54
leaq -0x310(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a16(%rip), %rsi      # 0x51e2
leaq 0x1a24(%rip), %rdx      # 0x51f7
leaq -0x320(%rbp), %rdi
callq 0x4964
leaq -0x320(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x320(%rbp), %rdi
jmp 0x3e35
leaq -0x410(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cba(%rip), %rsi      # 0x54c7
leaq 0x1cb4(%rip), %rdx      # 0x54c8
leaq -0x420(%rbp), %rdi
callq 0x4964
leaq -0x420(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2f0e
movq -0x420(%rbp), %rdi
cmpq %r14, %rdi
je 0x3841
callq 0x21f0
leaq -0x3f0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x189c(%rip), %rsi      # 0x50ef
leaq 0x18e6(%rip), %rdx      # 0x5140
leaq -0x400(%rbp), %rdi
callq 0x4964
leaq -0x400(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x400(%rbp), %rdi
jmp 0x3e35
leaq -0x4a0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x2230
leaq -0x490(%rbp), %r15
movq -0x10(%r15), %rdi
leaq -0x140(%rbp), %rsi
callq 0x21e0
movl %eax, %ebx
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x38c5
callq 0x21f0
cmpl $-0x1, %ebx
je 0x3c95
leaq -0x270(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x19ca(%rip), %rsi      # 0x52aa
leaq 0x19c9(%rip), %rdx      # 0x52b0
leaq -0x280(%rbp), %rdi
callq 0x4964
leaq -0x280(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x280(%rbp), %rdi
jmp 0x3e35
leaq -0x370(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ba6(%rip), %rsi      # 0x54c7
leaq 0x1ba0(%rip), %rdx      # 0x54c8
leaq -0x380(%rbp), %rdi
callq 0x4964
leaq -0x380(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2f0e
movq -0x380(%rbp), %rdi
cmpq %r14, %rdi
je 0x3955
callq 0x21f0
leaq -0x350(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1788(%rip), %rsi      # 0x50ef
leaq 0x17d2(%rip), %rdx      # 0x5140
leaq -0x360(%rbp), %rdi
callq 0x4964
leaq -0x360(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x360(%rbp), %rdi
jmp 0x3e35
leaq -0x390(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x17e7(%rip), %rsi      # 0x518f
leaq 0x1805(%rip), %rdx      # 0x51b4
leaq -0x3a0(%rbp), %rdi
callq 0x4964
leaq -0x3a0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x3a0(%rbp), %rdi
jmp 0x3faf
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x2, %edx
movl $0x2, %ecx
callq 0x2230
leaq 0x184e(%rip), %rsi      # 0x5246
leaq -0x140(%rbp), %r14
movq %r14, %rdi
callq 0x20b0
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x3a16
callq 0x21f0
testl %ebx, %ebx
jne 0x3a4a
leaq 0x17ff(%rip), %rdi      # 0x5220
callq 0x22c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x2110
leaq -0x50(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
movq %rax, %r8
callq 0x2280
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %edx
movq $-0x1, %rcx
callq 0x2230
movq -0x140(%rbp), %rdi
callq 0x2320
movl %eax, %ebx
movq -0x140(%rbp), %rdi
cmpq %r12, %rdi
je 0x3a85
callq 0x21f0
testl %ebx, %ebx
je 0x3db8
leaq -0x70(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x17ad(%rip), %rcx      # 0x5249
movl $0x3f, %r8d
xorl %esi, %esi
callq 0x2360
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3, %edx
movq $-0x1, %rcx
callq 0x2230
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x20d0
leaq 0x17a6(%rip), %rsi      # 0x5289
movq %rax, %rdi
callq 0x2400
movq -0x140(%rbp), %rdi
cmpq %r12, %rdi
je 0x3afc
callq 0x21f0
leaq -0x2b0(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x2c0(%rbp), %rdi
callq 0x48ca
leaq -0x2c0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x2c0(%rbp), %rdi
jmp 0x3e35
leaq -0x4a0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x2230
leaq -0x490(%rbp), %r14
movq -0x10(%r14), %rdi
leaq -0x140(%rbp), %rsi
callq 0x21e0
movl %eax, %ebx
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x3b7d
callq 0x21f0
cmpl $-0x1, %ebx
je 0x3df9
leaq -0x1d0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1712(%rip), %rsi      # 0x52aa
leaq 0x1711(%rip), %rdx      # 0x52b0
leaq -0x1e0(%rbp), %rdi
callq 0x4964
leaq -0x1e0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x1e0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3bcc
callq 0x21f0
leaq -0x460(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x2230
leaq -0x460(%rbp), %rsi
callq 0x4454
movl %eax, %ebx
leaq -0x450(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c0b
callq 0x21f0
testl %ebx, %ebx
je 0x3e46
leaq -0x1b0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1690(%rip), %rsi      # 0x52b5
leaq 0x168e(%rip), %rdx      # 0x52ba
leaq -0x1c0(%rbp), %rdi
callq 0x4964
leaq -0x1c0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x1c0(%rbp), %rdi
jmp 0x3e35
leaq -0x2f0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1592(%rip), %rsi      # 0x51f8
leaq 0x15af(%rip), %rdx      # 0x521c
leaq -0x300(%rbp), %rdi
callq 0x4964
leaq -0x300(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x300(%rbp), %rdi
jmp 0x3faf
leaq -0x250(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x160a(%rip), %rsi      # 0x52b1
leaq 0x1606(%rip), %rdx      # 0x52b4
leaq -0x260(%rbp), %rdi
callq 0x4964
leaq -0x260(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x260(%rbp), %rdi
cmpq %r15, %rdi
je 0x3cdb
callq 0x21f0
leaq -0x140(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0x400, %ecx            # imm = 0x400
callq 0x2c24
leaq -0xb0(%rbp), %rdi
leaq -0x140(%rbp), %rbx
movq %rbx, %rsi
callq 0x22d0
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x3d14
callq 0x21f0
leaq 0x159a(%rip), %rsi      # 0x52b5
leaq -0xb0(%rbp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x3f0e
leaq -0x480(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x2230
leaq -0x480(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x4326
movl %eax, %ebx
leaq -0x470(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d72
callq 0x21f0
testl %ebx, %ebx
je 0x3f73
leaq -0x230(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1531(%rip), %rsi      # 0x52bd
leaq 0x1559(%rip), %rdx      # 0x52ec
leaq -0x240(%rbp), %rdi
callq 0x4964
leaq -0x240(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x240(%rbp), %rdi
jmp 0x3e35
leaq -0x290(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x145b(%rip), %rsi      # 0x5225
leaq 0x1474(%rip), %rdx      # 0x5245
leaq -0x2a0(%rbp), %rdi
callq 0x4964
leaq -0x2a0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x2a0(%rbp), %rdi
jmp 0x3faf
leaq -0x1f0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x14a6(%rip), %rsi      # 0x52b1
leaq 0x14a2(%rip), %rdx      # 0x52b4
leaq -0x200(%rbp), %rdi
callq 0x4964
leaq -0x200(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x200(%rbp), %rdi
movl $0x36, %ebx
leaq 0x1300(%rip), %r14      # 0x5141
jmp 0x3fbb
leaq -0x190(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x14c0(%rip), %rsi      # 0x5318
leaq 0x14bc(%rip), %rdx      # 0x531b
leaq -0x1a0(%rbp), %rdi
callq 0x4964
leaq -0x1a0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x1a0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3e8c
callq 0x21f0
leaq -0x440(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x2230
leaq -0x440(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x44b6
leaq -0x430(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ecd
callq 0x21f0
leaq -0x170(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x143d(%rip), %rsi      # 0x531c
leaq 0x145a(%rip), %rdx      # 0x5340
leaq -0x180(%rbp), %rdi
callq 0x4964
leaq -0x180(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x180(%rbp), %rdi
jmp 0x3faf
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x2230
movq -0x140(%rbp), %rdi
leaq 0x1383(%rip), %rsi      # 0x52bb
callq 0x22a0
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r12, %rdi
je 0x3f51
callq 0x21f0
movq %rbx, %rdi
callq 0x2220
movq 0x4070(%rip), %rdi      # 0x7fd0
leaq 0x124e(%rip), %rsi      # 0x51b5
movl $0x29, %edx
callq 0x2290
jmp 0x3fd7
leaq -0x210(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1368(%rip), %rsi      # 0x52ed
leaq 0x1387(%rip), %rdx      # 0x5313
leaq -0x220(%rbp), %rdi
callq 0x4964
leaq -0x220(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x2fa0
movq -0x220(%rbp), %rdi
movl $0x29, %ebx
leaq 0x11fa(%rip), %r14      # 0x51b5
cmpq %r15, %rdi
je 0x3fc5
callq 0x21f0
movq 0x4004(%rip), %rdi      # 0x7fd0
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x3fef
callq 0x21f0
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x3ffd
callq 0x21f0
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x400f
callq 0x21f0
xorl %eax, %eax
addq $0x878, %rsp            # imm = 0x878
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rax
movl 0x1e8(%rax), %edi
callq 0x2420
movl (%r14), %edi
callq 0x2420
movq 0x3f8f(%rip), %rdi      # 0x7fd0
leaq 0x12fe(%rip), %rsi      # 0x5346
movl $0x1b, %edx
callq 0x2290
movq 0x3f77(%rip), %rdi      # 0x7fd0
leaq 0x1155(%rip), %rsi      # 0x51b5
callq 0x2210
xorl %edi, %edi
callq 0x22b0
movq %rax, %rbx
movq -0x220(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x180(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
leaq -0x430(%rbp), %rax
jmp 0x4145
movq %rax, %rbx
movq -0x1a0(%rbp), %rdi
jmp 0x4285
movq %rax, %rbx
movq -0x240(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
leaq -0x470(%rbp), %rax
jmp 0x4145
movq %rax, %rbx
movq -0x200(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
movq -0x2a0(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x260(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
leaq -0x450(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x42a2
movq %rax, %rbx
movq -0x1e0(%rbp), %rdi
jmp 0x4285
jmp 0x42b0
movq %rax, %rbx
movq -0x2c0(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
movq -0x300(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
movq -0x280(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
jmp 0x42b0
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x2e0(%rbp), %rdi
jmp 0x4285
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x3a0(%rbp), %rdi
jmp 0x4270
movq %rax, %rbx
movq -0x360(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x380(%rbp), %rdi
jmp 0x4285
jmp 0x42b0
movq %rax, %rbx
movq -0x320(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r12, %rdi
jne 0x42a7
jmp 0x42b3
jmp 0x42b0
movq %rax, %rbx
movq -0x160(%rbp), %rdi
jmp 0x4285
jmp 0x42b0
movq %rax, %rbx
movq -0x400(%rbp), %rdi
jmp 0x4270
jmp 0x42b0
movq %rax, %rbx
movq -0x420(%rbp), %rdi
jmp 0x4285
jmp 0x42b0
movq %rax, %rbx
movq -0x340(%rbp), %rdi
jmp 0x4270
movq %rax, %rbx
movq -0x3c0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x42a7
jmp 0x42b3
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x3e0(%rbp), %rdi
cmpq %r14, %rdi
jne 0x42a7
jmp 0x42b3
jmp 0x42b0
jmp 0x42b0
jmp 0x42b0
jmp 0x42b0
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x42b3
callq 0x21f0
jmp 0x42b3
jmp 0x42b0
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x42cb
callq 0x21f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x42dd
callq 0x21f0
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42ef
callq 0x21f0
movq %rbx, %rdi
callq 0x23c0
nop