// File: 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
subq $0xc70, %rsp            # imm = 0xC70
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0xa98(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa90(%rbp)
callq 0x4e10
leaq -0x50(%rbp), %rdi
callq 0x3360
leaq -0x70(%rbp), %rdi
callq 0x3360
leaq -0x90(%rbp), %rdi
callq 0x3360
leaq -0xb0(%rbp), %rdi
callq 0x3360
movq -0xa90(%rbp), %rsi
movl $0x0, -0x4c4(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x4e8(%rbp), %rdi
movl $0x4, %ecx
callq 0x3270
jmp 0x532c
leaq 0x2e7a(%rip), %rsi      # 0x81ad
leaq -0x4e8(%rbp), %rdi
callq 0x7390
movb %al, -0xa99(%rbp)
jmp 0x5347
leaq -0x4e8(%rbp), %rdi
callq 0x3160
movb -0xa99(%rbp), %al
testb $0x1, %al
jne 0x5362
jmp 0x5591
movq 0x5c67(%rip), %rdi      # 0xafd0
leaq 0x2e42(%rip), %rsi      # 0x81b2
callq 0x3250
jmp 0x5377
leaq 0x2e40(%rip), %rsi      # 0x81be
leaq -0x30(%rbp), %rdi
callq 0x3490
movq %rax, -0xaa8(%rbp)
jmp 0x5390
movq -0xaa8(%rbp), %rsi
leaq -0x518(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x53b1
leaq -0x518(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
leaq 0x3394(%rip), %rsi      # 0x875b
callq 0x30c0
movq %rax, -0xab0(%rbp)
jmp 0x53d5
movq -0xab0(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x518(%rbp), %rdi
callq 0x3160
cmpq $0x0, -0xb8(%rbp)
jne 0x5488
movq 0x5bd4(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x2db6(%rip), %rdi      # 0x81c4
callq 0x32c0
jmp 0x5415
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x518(%rbp), %rdi
callq 0x3160
jmp 0x6e84
jmp 0x548a
movq -0xb8(%rbp), %rdx
leaq -0x4c0(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x33f0
movq %rax, -0xab8(%rbp)
jmp 0x54ab
movq -0xab8(%rbp), %rax
cmpq $0x0, %rax
je 0x552a
leaq -0x90(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0x3490
jmp 0x54cd
movslq -0x4c4(%rbp), %rdx
leaq -0x90(%rbp), %rdi
leaq 0x2ccc(%rip), %rsi      # 0x81ae
callq 0x34d0
movl %eax, -0x4c4(%rbp)
cltq
cmpq $-0x1, %rax
je 0x5525
movslq -0x4c4(%rbp), %rsi
leaq 0x2caa(%rip), %rcx      # 0x81ad
leaq -0x90(%rbp), %rdi
movl $0x3, %edx
callq 0x3150
jmp 0x5516
movl -0x4c4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4c4(%rbp)
jmp 0x548a
movq 0x5a9f(%rip), %rdi      # 0xafd0
leaq -0x90(%rbp), %rsi
callq 0x3200
jmp 0x553f
movq -0xb8(%rbp), %rdi
callq 0x3380
movl %eax, -0xabc(%rbp)
jmp 0x5553
movl -0xabc(%rbp), %eax
cmpl $0x0, %eax
je 0x558c
movq 0x5a73(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x2ca7(%rip), %rdi      # 0x8216
callq 0x32c0
jmp 0x5576
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
jmp 0x6e34
xorl %eax, %eax
movl %eax, %edx
leaq -0x540(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3, %ecx
callq 0x3270
jmp 0x55ac
leaq 0x2c7b(%rip), %rsi      # 0x822e
leaq -0x540(%rbp), %rdi
callq 0x7390
movb %al, -0xabd(%rbp)
jmp 0x55c7
leaq -0x540(%rbp), %rdi
callq 0x3160
movb -0xabd(%rbp), %al
testb $0x1, %al
jne 0x55e2
jmp 0x5812
movq 0x59e7(%rip), %rdi      # 0xafd0
leaq 0x2c42(%rip), %rsi      # 0x8232
callq 0x3250
jmp 0x55f7
leaq 0x2bc0(%rip), %rsi      # 0x81be
leaq -0x30(%rbp), %rdi
callq 0x3490
movq %rax, -0xac8(%rbp)
jmp 0x5610
movq -0xac8(%rbp), %rsi
leaq -0x560(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x5631
leaq -0x560(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
leaq 0x3114(%rip), %rsi      # 0x875b
callq 0x30c0
movq %rax, -0xad0(%rbp)
jmp 0x5655
movq -0xad0(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x3160
cmpq $0x0, -0xb8(%rbp)
jne 0x56ed
movq 0x5958(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x2b3a(%rip), %rdi      # 0x81c4
callq 0x32c0
jmp 0x5691
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x540(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x3160
jmp 0x6e84
jmp 0x56ef
movq -0xb8(%rbp), %rdx
leaq -0x4c0(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x33f0
movq %rax, -0xad8(%rbp)
jmp 0x5710
movq -0xad8(%rbp), %rax
cmpq $0x0, %rax
je 0x578f
leaq -0x90(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0x3490
jmp 0x5732
movslq -0x4c4(%rbp), %rdx
leaq -0x90(%rbp), %rdi
leaq 0x2ae8(%rip), %rsi      # 0x822f
callq 0x34d0
movl %eax, -0x4c4(%rbp)
cltq
cmpq $-0x1, %rax
je 0x578a
movslq -0x4c4(%rbp), %rsi
leaq 0x2ac6(%rip), %rcx      # 0x822e
leaq -0x90(%rbp), %rdi
movl $0x2, %edx
callq 0x3150
jmp 0x577b
movl -0x4c4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4c4(%rbp)
jmp 0x56ef
movq 0x583a(%rip), %rdi      # 0xafd0
leaq -0x90(%rbp), %rsi
callq 0x3200
movq %rax, -0xae0(%rbp)
jmp 0x57ab
movq -0xae0(%rbp), %rdi
movq 0x57ff(%rip), %rsi      # 0xafb8
callq 0x3280
jmp 0x57c0
movq -0xb8(%rbp), %rdi
callq 0x3380
movl %eax, -0xae4(%rbp)
jmp 0x57d4
movl -0xae4(%rbp), %eax
cmpl $0x0, %eax
je 0x580d
movq 0x57f2(%rip), %rax      # 0xafd8
movq (%rax), %rsi
leaq 0x2a4d(%rip), %rdi      # 0x823d
callq 0x32c0
jmp 0x57f7
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
jmp 0x6e32
xorl %eax, %eax
movl %eax, %edx
leaq -0x580(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3, %ecx
callq 0x3270
jmp 0x582d
leaq 0x2a20(%rip), %rsi      # 0x8254
leaq -0x580(%rbp), %rdi
callq 0x7390
movb %al, -0xae5(%rbp)
jmp 0x5848
leaq -0x580(%rbp), %rdi
callq 0x3160
movb -0xae5(%rbp), %al
testb $0x1, %al
jne 0x5863
jmp 0x5bbe
leaq -0x30(%rbp), %rdi
callq 0x3170
cmpq $0x3, %rax
jne 0x594c
leaq 0x29db(%rip), %rdi      # 0x8258
callq 0x3300
movq %rax, -0x588(%rbp)
movq 0x5740(%rip), %rdi      # 0xafd0
leaq 0x29c6(%rip), %rsi      # 0x825d
callq 0x3250
movq %rax, -0xaf0(%rbp)
jmp 0x58a5
movq -0xaf0(%rbp), %rdi
movq -0x588(%rbp), %rsi
callq 0x3250
movq %rax, -0xaf8(%rbp)
jmp 0x58c1
movq -0xaf8(%rbp), %rdi
movq 0x56e9(%rip), %rsi      # 0xafb8
callq 0x3280
jmp 0x58d6
movq -0x588(%rbp), %rdi
callq 0x33a0
movq 0x56e7(%rip), %rdi      # 0xafd0
leaq 0x2985(%rip), %rsi      # 0x8275
callq 0x3250
movq %rax, -0xb00(%rbp)
jmp 0x58fe
movq -0xb00(%rbp), %rdi
movq 0x56ac(%rip), %rsi      # 0xafb8
callq 0x3280
jmp 0x5913
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x580(%rbp), %rdi
callq 0x3160
jmp 0x6e84
leaq -0x5a8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3, %edx
movl $0x2, %ecx
callq 0x3270
jmp 0x5968
leaq 0x2927(%rip), %rsi      # 0x8296
leaq -0x5a8(%rbp), %rdi
callq 0x7390
movb %al, -0xb01(%rbp)
jmp 0x5983
leaq -0x5a8(%rbp), %rdi
callq 0x3160
movb -0xb01(%rbp), %al
testb $0x1, %al
jne 0x599b
jmp 0x59ef
leaq 0x28b6(%rip), %rdi      # 0x8258
callq 0x3300
movq %rax, -0x5b0(%rbp)
movq -0x5b0(%rbp), %rcx
leaq -0x30(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3150
jmp 0x59ca
jmp 0x59ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq 0x55da(%rip), %rdi      # 0xafd0
leaq 0x2860(%rip), %rsi      # 0x825d
callq 0x3250
movq %rax, -0xb10(%rbp)
jmp 0x5a0b
leaq -0x5d0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x5a29
movq -0xb10(%rbp), %rdi
leaq -0x5d0(%rbp), %rsi
callq 0x3200
movq %rax, -0xb18(%rbp)
jmp 0x5a45
movq -0xb18(%rbp), %rdi
movq 0x5565(%rip), %rsi      # 0xafb8
callq 0x3280
jmp 0x5a5a
leaq -0x5d0(%rbp), %rdi
callq 0x3160
leaq -0x5f0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x5a84
leaq -0x5f0(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
callq 0x33a0
movl %eax, -0xb1c(%rbp)
leaq -0x5f0(%rbp), %rdi
callq 0x3160
movl -0xb1c(%rbp), %eax
cmpl $0x0, %eax
je 0x5b86
leaq 0x27d9(%rip), %rsi      # 0x8299
leaq -0x90(%rbp), %rdi
callq 0x3340
jmp 0x5ace
leaq -0x610(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x5aec
leaq -0x90(%rbp), %rdi
leaq -0x610(%rbp), %rsi
callq 0x34b0
movq %rax, -0xb28(%rbp)
jmp 0x5b08
movq -0xb28(%rbp), %rdi
leaq 0x27bb(%rip), %rsi      # 0x82d1
callq 0x3490
jmp 0x5b1d
leaq -0x610(%rbp), %rdi
callq 0x3160
movq 0x54a0(%rip), %rdi      # 0xafd0
leaq -0x90(%rbp), %rsi
callq 0x3200
jmp 0x5b3e
jmp 0x5bb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x5d0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x610(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq 0x5443(%rip), %rdi      # 0xafd0
leaq 0x26e1(%rip), %rsi      # 0x8275
callq 0x3250
movq %rax, -0xb30(%rbp)
jmp 0x5ba2
movq -0xb30(%rbp), %rdi
movq 0x5408(%rip), %rsi      # 0xafb8
callq 0x3280
jmp 0x5bb7
jmp 0x5bb9
jmp 0x6e30
leaq 0x2729(%rip), %rsi      # 0x82ee
leaq -0x30(%rbp), %rdi
callq 0x7390
movb %al, -0xb31(%rbp)
jmp 0x5bd6
movb -0xb31(%rbp), %al
testb $0x1, %al
jne 0x5be5
jmp 0x5c7a
movq 0x53e4(%rip), %rdi      # 0xafd0
leaq 0x2700(%rip), %rsi      # 0x82f3
callq 0x3250
jmp 0x5bfa
leaq -0x630(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
jmp 0x5c0c
movq -0xa98(%rbp), %rdi
leaq -0x630(%rbp), %rsi
callq 0x4210
jmp 0x5c21
leaq -0x630(%rbp), %rdi
callq 0x3160
movq -0xa98(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3be0
jmp 0x5c42
movq -0xa98(%rbp), %rdi
callq 0x3be0
jmp 0x5c50
xorl %edi, %edi
callq 0x32f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x630(%rbp), %rdi
callq 0x3160
jmp 0x6e84
xorl %eax, %eax
movl %eax, %edx
leaq -0x650(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3, %ecx
callq 0x3270
jmp 0x5c95
leaq 0x2512(%rip), %rsi      # 0x81ae
leaq -0x650(%rbp), %rdi
callq 0x7390
movb %al, -0xb32(%rbp)
jmp 0x5cb0
leaq -0x650(%rbp), %rdi
callq 0x3160
movb -0xb32(%rbp), %al
testb $0x1, %al
jne 0x5ccb
jmp 0x5de2
leaq -0x670(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
jmp 0x5cdd
movq -0xa98(%rbp), %rdi
leaq -0x670(%rbp), %rsi
callq 0x4210
jmp 0x5cf2
leaq -0x670(%rbp), %rdi
callq 0x3160
movq -0xa98(%rbp), %rsi
leaq -0x690(%rbp), %rdi
callq 0x42c0
jmp 0x5d13
leaq -0x50(%rbp), %rdi
leaq -0x690(%rbp), %rsi
movq %rsi, -0xb40(%rbp)
callq 0x3310
movq -0xb40(%rbp), %rdi
callq 0x3160
movq -0xa98(%rbp), %rsi
leaq -0x6b0(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x5d50
leaq -0x70(%rbp), %rdi
leaq -0x6b0(%rbp), %rsi
movq %rsi, -0xb48(%rbp)
callq 0x3310
movq -0xb48(%rbp), %rdi
callq 0x3160
movq 0x5256(%rip), %rdi      # 0xafd0
leaq -0x50(%rbp), %rsi
callq 0x3200
jmp 0x5d85
movq 0x5244(%rip), %rdi      # 0xafd0
leaq -0x70(%rbp), %rsi
callq 0x3200
jmp 0x5d97
jmp 0x6e2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x650(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x670(%rbp), %rdi
callq 0x3160
jmp 0x6e84
xorl %eax, %eax
movl %eax, %edx
leaq -0x6d0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x2, %ecx
callq 0x3270
jmp 0x5dfd
leaq 0x242b(%rip), %rsi      # 0x822f
leaq -0x6d0(%rbp), %rdi
callq 0x7390
movb %al, -0xb49(%rbp)
jmp 0x5e18
leaq -0x6d0(%rbp), %rdi
callq 0x3160
movb -0xb49(%rbp), %al
testb $0x1, %al
jne 0x5e33
jmp 0x6000
leaq -0x6f0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
jmp 0x5e45
movq -0xa98(%rbp), %rdi
leaq -0x6f0(%rbp), %rsi
callq 0x4210
jmp 0x5e5a
leaq -0x6f0(%rbp), %rdi
callq 0x3160
jmp 0x5e68
movq -0xa98(%rbp), %rsi
leaq -0x710(%rbp), %rdi
callq 0x42c0
jmp 0x5e7d
leaq -0x50(%rbp), %rdi
movq %rdi, -0xb58(%rbp)
leaq -0x710(%rbp), %rsi
movq %rsi, -0xb60(%rbp)
callq 0x3310
movq -0xb60(%rbp), %rdi
callq 0x3160
movq -0xb58(%rbp), %rdi
callq 0x3170
movq -0xb58(%rbp), %rsi
movq %rax, %rdx
decq %rdx
leaq -0x730(%rbp), %rdi
movq $-0x1, %rcx
callq 0x3270
jmp 0x5ed5
leaq 0x23b8(%rip), %rsi      # 0x8294
leaq -0x730(%rbp), %rdi
callq 0x7390
movb %al, -0xb61(%rbp)
jmp 0x5ef0
leaq -0x730(%rbp), %rdi
callq 0x3160
movb -0xb61(%rbp), %al
testb $0x1, %al
jne 0x5f0b
jmp 0x5f8b
movq 0x50be(%rip), %rdi      # 0xafd0
leaq -0x50(%rbp), %rsi
callq 0x3200
jmp 0x5f1d
jmp 0x5fa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x6f0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x730(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq 0x503e(%rip), %rdi      # 0xafd0
leaq -0x50(%rbp), %rsi
callq 0x3200
jmp 0x5f9d
jmp 0x5e66
movq -0xa98(%rbp), %rsi
leaq -0x750(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x5fbc
leaq -0x70(%rbp), %rdi
movq %rdi, -0xb70(%rbp)
leaq -0x750(%rbp), %rsi
movq %rsi, -0xb78(%rbp)
callq 0x3310
movq -0xb78(%rbp), %rdi
callq 0x3160
movq -0xb70(%rbp), %rsi
movq 0x4fdc(%rip), %rdi      # 0xafd0
callq 0x3200
jmp 0x5ffb
jmp 0x6e2a
xorl %eax, %eax
movl %eax, %edx
leaq -0x770(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x2, %ecx
callq 0x3270
jmp 0x601b
leaq 0x2233(%rip), %rsi      # 0x8255
leaq -0x770(%rbp), %rdi
callq 0x7390
movb %al, -0xb79(%rbp)
jmp 0x6036
leaq -0x770(%rbp), %rdi
callq 0x3160
movb -0xb79(%rbp), %al
testb $0x1, %al
jne 0x6051
jmp 0x6128
leaq -0x790(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
jmp 0x6063
movq -0xa98(%rbp), %rdi
leaq -0x790(%rbp), %rsi
callq 0x4210
jmp 0x6078
leaq -0x790(%rbp), %rdi
callq 0x3160
movq -0xa98(%rbp), %rsi
leaq -0x7b0(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x609e
leaq -0x70(%rbp), %rdi
movq %rdi, -0xb88(%rbp)
leaq -0x7b0(%rbp), %rsi
movq %rsi, -0xb90(%rbp)
callq 0x3310
movq -0xb90(%rbp), %rdi
callq 0x3160
movq -0xb88(%rbp), %rsi
movq 0x4efa(%rip), %rdi      # 0xafd0
callq 0x3200
jmp 0x60dd
jmp 0x6e28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x770(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x790(%rbp), %rdi
callq 0x3160
jmp 0x6e84
xorl %eax, %eax
movl %eax, %edx
leaq -0x7d0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3, %ecx
callq 0x3270
jmp 0x6143
leaq 0x21c5(%rip), %rsi      # 0x830f
leaq -0x7d0(%rbp), %rdi
callq 0x7390
movb %al, -0xb91(%rbp)
jmp 0x615e
leaq -0x7d0(%rbp), %rdi
callq 0x3160
movb -0xb91(%rbp), %al
testb $0x1, %al
jne 0x6179
jmp 0x67a5
leaq -0x7f0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6197
leaq -0x7f0(%rbp), %rdi
callq 0x3100
movq -0xa98(%rbp), %rdi
movq %rax, %rsi
callq 0x6ed0
movl %eax, -0xb98(%rbp)
jmp 0x61ba
movl -0xb98(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0xb99(%rbp)
leaq -0x7f0(%rbp), %rdi
callq 0x3160
movb -0xb99(%rbp), %al
testb $0x1, %al
jne 0x61e9
jmp 0x62c3
leaq -0x810(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6207
movq 0x4dc2(%rip), %rdi      # 0xafd0
leaq -0x810(%rbp), %rsi
callq 0x3200
movq %rax, -0xba8(%rbp)
jmp 0x6223
movq -0xba8(%rbp), %rdi
leaq 0x20e2(%rip), %rsi      # 0x8313
callq 0x3250
jmp 0x6238
leaq -0x810(%rbp), %rdi
callq 0x3160
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x7d0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x7f0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x810(%rbp), %rdi
callq 0x3160
jmp 0x6e84
leaq -0x830(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x62e1
leaq -0x830(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
movl $0x4, %esi
callq 0x3400
movl %eax, -0xbac(%rbp)
leaq -0x830(%rbp), %rdi
callq 0x3160
movl -0xbac(%rbp), %eax
cmpl $-0x1, %eax
jne 0x6342
movq 0x4cb2(%rip), %rdi      # 0xafd0
leaq 0x2005(%rip), %rsi      # 0x832a
callq 0x3250
jmp 0x632c
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
jmp 0x6344
leaq -0x850(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
jmp 0x6356
movq -0xa98(%rbp), %rdi
leaq -0x850(%rbp), %rsi
callq 0x4210
jmp 0x636b
leaq -0x850(%rbp), %rdi
callq 0x3160
movq -0xa98(%rbp), %rsi
leaq -0x870(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x6391
leaq -0x70(%rbp), %rdi
movq %rdi, -0xbb8(%rbp)
leaq -0x870(%rbp), %rsi
movq %rsi, -0xbc0(%rbp)
callq 0x3310
movq -0xbc0(%rbp), %rdi
callq 0x3160
movq -0xbb8(%rbp), %rdi
leaq 0x1f81(%rip), %rsi      # 0x834a
callq 0x7390
movb %al, -0xbad(%rbp)
jmp 0x63d6
movb -0xbad(%rbp), %al
testb $0x1, %al
jne 0x63e5
jmp 0x649c
leaq -0x890(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6403
movq 0x4bc6(%rip), %rdi      # 0xafd0
leaq -0x890(%rbp), %rsi
callq 0x3200
movq %rax, -0xbc8(%rbp)
jmp 0x641f
movq -0xbc8(%rbp), %rdi
leaq 0x1f24(%rip), %rsi      # 0x8351
callq 0x3250
jmp 0x6434
leaq -0x890(%rbp), %rdi
callq 0x3160
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x850(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x890(%rbp), %rdi
callq 0x3160
jmp 0x6e84
leaq -0x8b0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x64ba
movq -0xa98(%rbp), %rdi
leaq -0x8b0(%rbp), %rsi
callq 0x6f20
movl %eax, -0xbcc(%rbp)
jmp 0x64d5
leaq -0x8b0(%rbp), %rdi
callq 0x3160
movl -0xbcc(%rbp), %eax
cmpl $0x0, %eax
je 0x6607
leaq -0x8d1(%rbp), %rdi
movq %rdi, -0xbd8(%rbp)
callq 0x3450
movq -0xbd8(%rbp), %rdx
leaq 0x1e78(%rip), %rsi      # 0x8389
leaq -0x8d0(%rbp), %rdi
callq 0x3350
jmp 0x651f
movq -0xa98(%rbp), %rdi
leaq -0x8d0(%rbp), %rsi
callq 0x4210
jmp 0x6534
leaq -0x8d0(%rbp), %rdi
callq 0x3160
leaq -0x8d1(%rbp), %rdi
callq 0x32a0
movq 0x4a7d(%rip), %rdi      # 0xafd0
leaq 0x1e35(%rip), %rsi      # 0x838f
callq 0x3250
jmp 0x6561
movq 0x4a68(%rip), %rdi      # 0xafd0
leaq 0x1e41(%rip), %rsi      # 0x83b0
callq 0x3250
jmp 0x6576
movq 0x4a53(%rip), %rdi      # 0xafd0
leaq 0x1e52(%rip), %rsi      # 0x83d6
callq 0x3250
jmp 0x658b
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x8b0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
jmp 0x65f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x8d0(%rbp), %rdi
callq 0x3160
leaq -0x8d1(%rbp), %rdi
callq 0x32a0
jmp 0x6e84
leaq -0x8f9(%rbp), %rdi
movq %rdi, -0xbe0(%rbp)
callq 0x3450
movq -0xbe0(%rbp), %rdx
leaq 0x1dd5(%rip), %rsi      # 0x83fd
leaq -0x8f8(%rbp), %rdi
callq 0x3350
jmp 0x6636
movq -0xa98(%rbp), %rdi
leaq -0x8f8(%rbp), %rsi
callq 0x4210
jmp 0x664b
leaq -0x8f8(%rbp), %rdi
callq 0x3160
leaq -0x8f9(%rbp), %rdi
callq 0x32a0
leaq -0x920(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6681
movq -0xa98(%rbp), %rdi
leaq -0x920(%rbp), %rsi
callq 0x4370
movl %eax, -0xbe4(%rbp)
jmp 0x669c
leaq -0x920(%rbp), %rdi
callq 0x3160
movl -0xbe4(%rbp), %eax
cmpl $0x0, %eax
jge 0x6730
movq 0x4916(%rip), %rdi      # 0xafd0
leaq 0x1d40(%rip), %rsi      # 0x8401
callq 0x3250
jmp 0x66c8
jmp 0x6747
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
jmp 0x66fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x8f8(%rbp), %rdi
callq 0x3160
leaq -0x8f9(%rbp), %rdi
callq 0x32a0
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x920(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq 0x4899(%rip), %rdi      # 0xafd0
leaq 0x1cf7(%rip), %rsi      # 0x8435
callq 0x3250
jmp 0x6745
jmp 0x6747
movq -0xa98(%rbp), %rsi
leaq -0x940(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x6761
leaq -0x70(%rbp), %rdi
movq %rdi, -0xbf0(%rbp)
leaq -0x940(%rbp), %rsi
movq %rsi, -0xbf8(%rbp)
callq 0x3310
movq -0xbf8(%rbp), %rdi
callq 0x3160
movq -0xbf0(%rbp), %rsi
movq 0x4837(%rip), %rdi      # 0xafd0
callq 0x3200
jmp 0x67a0
jmp 0x6e26
xorl %eax, %eax
movl %eax, %edx
leaq -0x960(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3, %ecx
callq 0x3270
jmp 0x67c0
leaq 0x1c94(%rip), %rsi      # 0x845b
leaq -0x960(%rbp), %rdi
callq 0x7390
movb %al, -0xbf9(%rbp)
jmp 0x67db
leaq -0x960(%rbp), %rdi
callq 0x3160
movb -0xbf9(%rbp), %al
testb $0x1, %al
jne 0x67f6
jmp 0x6db1
leaq 0x1c62(%rip), %rdi      # 0x845f
movl $0x2, %esi
callq 0x3400
cmpl $-0x1, %eax
jne 0x685a
movq 0x47bd(%rip), %rdi      # 0xafd0
leaq 0x1c48(%rip), %rsi      # 0x8462
callq 0x3250
jmp 0x6821
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x960(%rbp), %rdi
callq 0x3160
jmp 0x6e84
leaq -0x980(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6878
leaq -0x980(%rbp), %rdi
callq 0x3100
movq -0xa98(%rbp), %rdi
movq %rax, %rsi
callq 0x6ed0
movl %eax, -0xc00(%rbp)
jmp 0x689b
leaq -0x980(%rbp), %rdi
callq 0x3160
movl -0xc00(%rbp), %eax
cmpl $0x0, %eax
je 0x6a0d
leaq -0x9a0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x68d4
movq 0x46f5(%rip), %rdi      # 0xafd0
leaq -0x9a0(%rbp), %rsi
callq 0x3200
movq %rax, -0xc08(%rbp)
jmp 0x68f0
movq -0xc08(%rbp), %rdi
leaq 0x1b7c(%rip), %rsi      # 0x847a
callq 0x3250
jmp 0x6905
leaq -0x9a0(%rbp), %rdi
callq 0x3160
jmp 0x6913
movq 0x46ae(%rip), %rax      # 0xafc8
movq (%rax), %rdx
leaq -0xbd(%rbp), %rdi
movl $0x5, %esi
callq 0x33f0
jmp 0x6930
leaq -0xb0(%rbp), %rdi
leaq -0xbd(%rbp), %rsi
callq 0x3340
jmp 0x6945
leaq 0x177b(%rip), %rsi      # 0x80c7
leaq -0xb0(%rbp), %rdi
callq 0x7390
movb %al, -0xc09(%rbp)
jmp 0x6960
movb -0xc09(%rbp), %al
testb $0x1, %al
jne 0x696c
jmp 0x69c8
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x980(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x9a0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
leaq 0x191c(%rip), %rsi      # 0x82eb
leaq -0xb0(%rbp), %rdi
callq 0x7390
movb %al, -0xc0a(%rbp)
jmp 0x69e3
movb -0xc0a(%rbp), %al
testb $0x1, %al
jne 0x69ef
jmp 0x69f1
jmp 0x6a0b
movq 0x45d8(%rip), %rdi      # 0xafd0
leaq 0x1ab3(%rip), %rsi      # 0x84b2
callq 0x3250
jmp 0x6a06
jmp 0x6911
jmp 0x6a0d
leaq -0x9c0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
jmp 0x6a1f
movq -0xa98(%rbp), %rdi
leaq -0x9c0(%rbp), %rsi
callq 0x4210
jmp 0x6a34
leaq -0x9c0(%rbp), %rdi
callq 0x3160
movq -0xa98(%rbp), %rsi
leaq -0x9e0(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x6a5a
leaq -0x70(%rbp), %rdi
movq %rdi, -0xc18(%rbp)
leaq -0x9e0(%rbp), %rsi
movq %rsi, -0xc20(%rbp)
callq 0x3310
movq -0xc20(%rbp), %rdi
callq 0x3160
movq -0xc18(%rbp), %rdi
leaq 0x1a3e(%rip), %rsi      # 0x84d0
callq 0x7390
movb %al, -0xc0b(%rbp)
jmp 0x6a9f
movb -0xc0b(%rbp), %al
testb $0x1, %al
jne 0x6aae
jmp 0x6b65
leaq -0xa00(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6acc
movq 0x44fd(%rip), %rdi      # 0xafd0
leaq -0xa00(%rbp), %rsi
callq 0x3200
movq %rax, -0xc28(%rbp)
jmp 0x6ae8
movq -0xc28(%rbp), %rdi
leaq 0x19de(%rip), %rsi      # 0x84d4
callq 0x3250
jmp 0x6afd
leaq -0xa00(%rbp), %rdi
callq 0x3160
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0x9c0(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0xa00(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq -0xa98(%rbp), %rsi
leaq -0xa20(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x6b7f
leaq -0x70(%rbp), %rdi
movq %rdi, -0xc38(%rbp)
leaq -0xa20(%rbp), %rsi
movq %rsi, -0xc40(%rbp)
callq 0x3310
movq -0xc40(%rbp), %rdi
callq 0x3160
movq -0xc38(%rbp), %rdi
leaq 0x17d2(%rip), %rsi      # 0x8389
callq 0x7390
movb %al, -0xc29(%rbp)
jmp 0x6bc4
movb -0xc29(%rbp), %al
testb $0x1, %al
jne 0x6bd3
jmp 0x6cb5
leaq -0xa48(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6bf1
leaq -0xa48(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
leaq 0x14e8(%rip), %rsi      # 0x80ef
callq 0x32e0
movq %rax, -0xc48(%rbp)
jmp 0x6c15
leaq -0xa48(%rbp), %rdi
callq 0x3160
movq -0xc48(%rbp), %rax
movq %rax, -0xa28(%rbp)
movq -0xa28(%rbp), %rdi
callq 0x3260
jmp 0x6c3d
movq 0x438c(%rip), %rdi      # 0xafd0
leaq 0x18a0(%rip), %rsi      # 0x84eb
callq 0x3250
jmp 0x6c52
movq 0x4377(%rip), %rdi      # 0xafd0
leaq 0x1902(%rip), %rsi      # 0x8562
callq 0x3250
jmp 0x6c67
movq 0x4362(%rip), %rdi      # 0xafd0
leaq 0x1894(%rip), %rsi      # 0x8509
callq 0x3250
jmp 0x6c7c
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0xa48(%rbp), %rdi
callq 0x3160
jmp 0x6e84
leaq -0xa68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4, %edx
movq $-0x1, %rcx
callq 0x3270
jmp 0x6cd3
movq -0xa98(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
callq 0x4820
movl %eax, -0xc4c(%rbp)
jmp 0x6cee
leaq -0xa68(%rbp), %rdi
callq 0x3160
movl -0xc4c(%rbp), %eax
cmpl $0x0, %eax
je 0x6d3f
movq 0x42c4(%rip), %rdi      # 0xafd0
leaq 0x181b(%rip), %rsi      # 0x852e
callq 0x3250
jmp 0x6d1a
jmp 0x6d56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x4f0(%rbp)
movl %eax, -0x4f4(%rbp)
leaq -0xa68(%rbp), %rdi
callq 0x3160
jmp 0x6e84
movq 0x428a(%rip), %rdi      # 0xafd0
leaq 0x1814(%rip), %rsi      # 0x8561
callq 0x3250
jmp 0x6d54
jmp 0x6d56
movq -0xa98(%rbp), %rsi
leaq -0xa88(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x4320
jmp 0x6d70
leaq -0x70(%rbp), %rdi
movq %rdi, -0xc58(%rbp)
leaq -0xa88(%rbp), %rsi
movq %rsi, -0xc60(%rbp)
callq 0x3310
movq -0xc60(%rbp), %rdi
callq 0x3160
movq -0xc58(%rbp), %rsi
movq 0x4228(%rip), %rdi      # 0xafd0
callq 0x3200
jmp 0x6daf
jmp 0x6e24
leaq 0x17d3(%rip), %rsi      # 0x858b
leaq -0x30(%rbp), %rdi
callq 0x7390
movb %al, -0xc61(%rbp)
jmp 0x6dc9
movb -0xc61(%rbp), %al
testb $0x1, %al
jne 0x6dd5
jmp 0x6de7
leaq 0x17b4(%rip), %rdi      # 0x8590
xorl %eax, %eax
callq 0x3050
jmp 0x6de5
jmp 0x6e22
leaq -0x30(%rbp), %rdi
callq 0x3170
cmpq $0x0, %rax
jne 0x6e09
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
jmp 0x6e45
movq 0x41c0(%rip), %rdi      # 0xafd0
leaq 0x17ce(%rip), %rsi      # 0x85e5
callq 0x3250
jmp 0x6e1e
jmp 0x6e20
jmp 0x6e22
jmp 0x6e24
jmp 0x6e26
jmp 0x6e28
jmp 0x6e2a
jmp 0x6e2c
jmp 0x6e2e
jmp 0x6e30
jmp 0x6e32
jmp 0x6e34
movl $0x0, -0x4(%rbp)
movl $0x1, -0x51c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x3160
leaq -0x90(%rbp), %rdi
callq 0x3160
leaq -0x70(%rbp), %rdi
callq 0x3160
leaq -0x50(%rbp), %rdi
callq 0x3160
leaq -0x30(%rbp), %rdi
callq 0x3160
movl -0x4(%rbp), %eax
addq $0xc70, %rsp            # imm = 0xC70
popq %rbp
retq
leaq -0xb0(%rbp), %rdi
callq 0x3160
leaq -0x90(%rbp), %rdi
callq 0x3160
leaq -0x70(%rbp), %rdi
callq 0x3160
leaq -0x50(%rbp), %rdi
callq 0x3160
leaq -0x30(%rbp), %rdi
callq 0x3160
movq -0x4f0(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)