// File: dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::getResponse(int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::vector<char, std::allocator<char>>, std::allocator<std::vector<char, std::allocator<char>>>>&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void getResponse(int client_id,
					int client_fd, 
					int server_fd, 
					const std::string & url, 
					const std::string & header, 
					std::vector<std::vector<char>> & segment,
					int len,
					const std::string & httpAction)
	{
	    // content-based http response
	    // (1) extract content length from header
	    // (2) keep receiving until total received size exceeds content length(marks end)
	    std::vector<char> buffer(BUFFER_SIZE, '\0');
	    if(header.find("Content-Length") != -1)
	    {
	    	int received_length = len;
	    	int content_length = parser.extractContentLength(header);
	    	while(received_length < content_length)
	    	{
	    		// receive response from server
	    		len = recv(server_fd, &buffer.data()[0], BUFFER_SIZE - 1, 0);
		    	if(len == -1)
		    	{
		    		throw ProxyException("Proxy received from server error");
		    	}
		    	buffer[len] = '\0';
		    	segment.push_back(std::vector<char>(buffer.begin(), buffer.begin() + len));
		    	received_length += len;

		    	// send response to client
		    	bool respond_suc = respondClient(client_fd, buffer, len);
		    	if(!respond_suc)
		    	{
		    		throw ProxyException("Proxy respond to client error");
		    	}
	    	}
	    }

	    // chunk-based http response
	    // keep receiving till the last chunk of the response, which is marked as 0 at the first line of the chunk
	    else if(header.find("chunked") != -1)
	    {
	    	bool isLastBlock = false;
	    	while(!isLastBlock)
	    	{
	    		// receive message from server
	    		len = recv(server_fd, &buffer.data()[0], BUFFER_SIZE - 1, 0);
		    	if(len == -1)
		    	{
		    		throw ProxyException("Proxy received from server error");
		    	}
		    	buffer[len] = '\0';
		    	segment.push_back(std::vector<char>(buffer.begin(), buffer.begin() + len));

		    	// send response to the client
		    	bool respond_suc = respondClient(client_fd, buffer, len);
		    	if(!respond_suc)
		    	{
		    		throw ProxyException("Proxy respond to client error");
		    	}

		    	// the first character of the last block starts with 0
		    	if(buffer[0] == '0')
		    	{
		    		isLastBlock = true;
		    	}
	    	}	
	    }

	    // POST action
	    else
	    {
	    	// keep receiving until the received length is 0, which marks the end of transmission
	    	int received_length = len;
	    	while(true)
	    	{
	    		// receive from server
	    		len = recv(server_fd, &buffer.data()[0], BUFFER_SIZE - 1, 0);
		    	if(len == -1)
		    	{
		    		throw ProxyException("Proxy received from server error");
		    	}
		    	else if(len == 0)
		    	{
		    		break;
		    	}
		    	segment.push_back(std::vector<char>(buffer.begin(), buffer.begin() + len));

		    	// send response to the client
		    	bool respond_suc = respondClient(client_fd, buffer, len);
		    	if(!respond_suc)
		    	{
		    		throw ProxyException("Proxy respond to client error");
		    	}
	    	}
	    }
	    Response response(url, segment, header);
	    parser.parseResponse(response);

	    // write first line of response to log
	    std::string log_content = std::to_string(client_id) + ": Received " + response.first_line + " from " + response.url;
	    logger.log(log_content);
	    log_content = std::to_string(client_id) + ": Responding " + response.first_line;
	    logger.log(log_content);

	    // cache only works for GET http action, and apply on those with no "no-store" attribute
	    if(!response.no_store && httpAction == "GET")
	    {
	    	cache.put(url, response);
	    }

	    // if http action is GET and status code is 200, write it into log
	    if(httpAction == "GET" && response.status_code == 200)
	    {
	    	std::string log_content;
	    	if(response.no_store)
	    	{
	    		log_content = std::to_string(client_id) + ": not cachable bacause no-store in Cache-Control"; 
	    	}
	    	else if(!response.etag.empty() || response.last_modified != 0)
	    	{
	    		log_content = std::to_string(client_id) + ": cached, but requires re-validation"; 
	    	}
	    	else
	    	{
	    		// convert time_t to string
	    		tm * tm = localtime(&response.expiration_time);
	    		char * dt = asctime(tm);
	    		std::string expiration_time(dt);
	 			log_content = std::to_string(client_id) + ": cached, expired at " + expiration_time;
	    	}
	    	logger.log(log_content);
	    }
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6b0, %rsp            # imm = 0x6B0
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x590(%rbp)
movb $0x0, -0x41(%rbp)
leaq -0x42(%rbp), %rdi
movq %rdi, -0x588(%rbp)
callq 0x4650
movq -0x588(%rbp), %rcx
leaq -0x40(%rbp), %rdi
movl $0x10000, %esi          # imm = 0x10000
leaq -0x41(%rbp), %rdx
callq 0x9390
jmp 0x10f55
leaq -0x42(%rbp), %rdi
callq 0x4420
movq -0x28(%rbp), %rdi
leaq 0x84ed(%rip), %rsi      # 0x19456
xorl %eax, %eax
movl %eax, %edx
callq 0x46f0
cmpq $-0x1, %rax
je 0x112fc
movq -0x590(%rbp), %rdi
movl 0x18(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x28(%rbp), %rsi
callq 0x12a50
movl %eax, -0x594(%rbp)
jmp 0x10f9a
movl -0x594(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x112f7
movl -0x14(%rbp), %eax
movl %eax, -0x5a4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9410
movl -0x5a4(%rbp), %edi
movq %rax, %rsi
movl $0xffff, %edx           # imm = 0xFFFF
xorl %ecx, %ecx
callq 0x40f0
movq %rax, -0x5a0(%rbp)
jmp 0x10fdf
movq -0x5a0(%rbp), %rax
movl %eax, 0x18(%rbp)
cmpl $-0x1, 0x18(%rbp)
jne 0x110e5
movb $0x1, -0x82(%rbp)
movl $0x28, %edi
callq 0x41b0
movq %rax, -0x5b8(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x5b0(%rbp)
callq 0x4650
movq -0x5b0(%rbp), %rdx
leaq 0x8439(%rip), %rsi      # 0x19465
leaq -0x80(%rbp), %rdi
callq 0x4bf0
jmp 0x11037
movq -0x5b8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x9240
jmp 0x11049
movq -0x5b8(%rbp), %rdi
movb $0x0, -0x82(%rbp)
leaq 0x12c9a(%rip), %rsi     # 0x23cf8
leaq -0x7db5(%rip), %rdx     # 0x92b0
callq 0x4610
jmp 0x1204f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x42(%rbp), %rdi
callq 0x4420
jmp 0x12046
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x110bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4250
leaq -0x81(%rbp), %rdi
callq 0x4420
testb $0x1, -0x82(%rbp)
jne 0x110d4
jmp 0x110e0
movq -0x5b8(%rbp), %rdi
callq 0x42d0
jmp 0x1203d
movslq 0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x5c8(%rbp)
callq 0x9430
movq -0x5c8(%rbp), %rdi
movb $0x0, (%rax)
movq 0x10(%rbp), %rax
movq %rax, -0x5d0(%rbp)
callq 0xa150
movq -0x5c8(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0xa150
movq %rax, -0xb8(%rbp)
movslq 0x18(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xa180
movq %rax, -0xb0(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x5c0(%rbp)
callq 0x4650
movq -0x5c0(%rbp), %rcx
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0xa1c0
jmp 0x1117a
movq -0x5d0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10e40
jmp 0x1118f
leaq -0xa0(%rbp), %rdi
callq 0x6130
leaq -0xb9(%rbp), %rdi
callq 0x4420
movq -0x590(%rbp), %rdi
movl 0x18(%rbp), %ecx
movl -0x58(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x10(%rbp), %esi
movl 0x18(%rbp), %ecx
leaq -0x40(%rbp), %rdx
callq 0x10e70
movb %al, -0x5d1(%rbp)
jmp 0x111d0
movb -0x5d1(%rbp), %al
andb $0x1, %al
movb %al, -0xba(%rbp)
testb $0x1, -0xba(%rbp)
jne 0x112f2
movb $0x1, -0xe2(%rbp)
movl $0x28, %edi
callq 0x41b0
movq %rax, -0x5e8(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x5e0(%rbp)
callq 0x4650
movq -0x5e0(%rbp), %rdx
leaq 0x8262(%rip), %rsi      # 0x19486
leaq -0xe0(%rbp), %rdi
callq 0x4bf0
jmp 0x11232
movq -0x5e8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x9240
jmp 0x11247
movq -0x5e8(%rbp), %rdi
movb $0x0, -0xe2(%rbp)
leaq 0x12a9c(%rip), %rsi     # 0x23cf8
leaq -0x7fb3(%rip), %rdx     # 0x92b0
callq 0x4610
jmp 0x1204f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11293
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x6130
leaq -0xb9(%rbp), %rdi
callq 0x4420
jmp 0x1203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x112ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x4250
leaq -0xe1(%rbp), %rdi
callq 0x4420
testb $0x1, -0xe2(%rbp)
jne 0x112e1
jmp 0x112ed
movq -0x5e8(%rbp), %rdi
callq 0x42d0
jmp 0x1203d
jmp 0x10fa3
jmp 0x11992
movq -0x28(%rbp), %rdi
leaq 0x819d(%rip), %rsi      # 0x194a4
xorl %eax, %eax
movl %eax, %edx
callq 0x46f0
cmpq $-0x1, %rax
je 0x1166e
movb $0x0, -0xe3(%rbp)
movb -0xe3(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x11332
jmp 0x11669
movl -0x14(%rbp), %eax
movl %eax, -0x5f4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9410
movl -0x5f4(%rbp), %edi
movq %rax, %rsi
movl $0xffff, %edx           # imm = 0xFFFF
xorl %ecx, %ecx
callq 0x40f0
movq %rax, -0x5f0(%rbp)
jmp 0x11362
movq -0x5f0(%rbp), %rax
movl %eax, 0x18(%rbp)
cmpl $-0x1, 0x18(%rbp)
jne 0x11446
movb $0x1, -0x10a(%rbp)
movl $0x28, %edi
callq 0x41b0
movq %rax, -0x608(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0x4650
movq -0x600(%rbp), %rdx
leaq 0x80b6(%rip), %rsi      # 0x19465
leaq -0x108(%rbp), %rdi
callq 0x4bf0
jmp 0x113bd
movq -0x608(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x9240
jmp 0x113d2
movq -0x608(%rbp), %rdi
movb $0x0, -0x10a(%rbp)
leaq 0x12911(%rip), %rsi     # 0x23cf8
leaq -0x813e(%rip), %rdx     # 0x92b0
callq 0x4610
jmp 0x1204f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1141e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4250
leaq -0x109(%rbp), %rdi
callq 0x4420
testb $0x1, -0x10a(%rbp)
jne 0x11435
jmp 0x11441
movq -0x608(%rbp), %rdi
callq 0x42d0
jmp 0x1203d
movslq 0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x618(%rbp)
callq 0x9430
movq -0x618(%rbp), %rdi
movb $0x0, (%rax)
movq 0x10(%rbp), %rax
movq %rax, -0x620(%rbp)
callq 0xa150
movq -0x618(%rbp), %rdi
movq %rax, -0x130(%rbp)
callq 0xa150
movq %rax, -0x140(%rbp)
movslq 0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xa180
movq %rax, -0x138(%rbp)
leaq -0x141(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x4650
movq -0x610(%rbp), %rcx
movq -0x130(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0x128(%rbp), %rdi
callq 0xa1c0
jmp 0x114db
movq -0x620(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x10e40
jmp 0x114f0
leaq -0x128(%rbp), %rdi
callq 0x6130
leaq -0x141(%rbp), %rdi
callq 0x4420
movq -0x590(%rbp), %rdi
movl -0x10(%rbp), %esi
movl 0x18(%rbp), %ecx
leaq -0x40(%rbp), %rdx
callq 0x10e70
movb %al, -0x621(%rbp)
jmp 0x11526
movb -0x621(%rbp), %al
andb $0x1, %al
movb %al, -0x142(%rbp)
testb $0x1, -0x142(%rbp)
jne 0x11648
movb $0x1, -0x16a(%rbp)
movl $0x28, %edi
callq 0x41b0
movq %rax, -0x638(%rbp)
leaq -0x169(%rbp), %rdi
movq %rdi, -0x630(%rbp)
callq 0x4650
movq -0x630(%rbp), %rdx
leaq 0x7f0c(%rip), %rsi      # 0x19486
leaq -0x168(%rbp), %rdi
callq 0x4bf0
jmp 0x11588
movq -0x638(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x9240
jmp 0x1159d
movq -0x638(%rbp), %rdi
movb $0x0, -0x16a(%rbp)
leaq 0x12746(%rip), %rsi     # 0x23cf8
leaq -0x8309(%rip), %rdx     # 0x92b0
callq 0x4610
jmp 0x1204f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x115e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x6130
leaq -0x141(%rbp), %rdi
callq 0x4420
jmp 0x1203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11620
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4250
leaq -0x169(%rbp), %rdi
callq 0x4420
testb $0x1, -0x16a(%rbp)
jne 0x11637
jmp 0x11643
movq -0x638(%rbp), %rdi
callq 0x42d0
jmp 0x1203d
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9430
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x11664
movb $0x1, -0xe3(%rbp)
jmp 0x11321
jmp 0x11990
movl 0x18(%rbp), %eax
movl %eax, -0x170(%rbp)
jmp 0x11679
movl -0x14(%rbp), %eax
movl %eax, -0x644(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9410
movl -0x644(%rbp), %edi
movq %rax, %rsi
movl $0xffff, %edx           # imm = 0xFFFF
xorl %ecx, %ecx
callq 0x40f0
movq %rax, -0x640(%rbp)
jmp 0x116a9
movq -0x640(%rbp), %rax
movl %eax, 0x18(%rbp)
cmpl $-0x1, 0x18(%rbp)
jne 0x1178d
movb $0x1, -0x192(%rbp)
movl $0x28, %edi
callq 0x41b0
movq %rax, -0x658(%rbp)
leaq -0x191(%rbp), %rdi
movq %rdi, -0x650(%rbp)
callq 0x4650
movq -0x650(%rbp), %rdx
leaq 0x7d6f(%rip), %rsi      # 0x19465
leaq -0x190(%rbp), %rdi
callq 0x4bf0
jmp 0x11704
movq -0x658(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x9240
jmp 0x11719
movq -0x658(%rbp), %rdi
movb $0x0, -0x192(%rbp)
leaq 0x125ca(%rip), %rsi     # 0x23cf8
leaq -0x8485(%rip), %rdx     # 0x92b0
callq 0x4610
jmp 0x1204f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11765
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4250
leaq -0x191(%rbp), %rdi
callq 0x4420
testb $0x1, -0x192(%rbp)
jne 0x1177c
jmp 0x11788
movq -0x658(%rbp), %rdi
callq 0x42d0
jmp 0x1203d
cmpl $0x0, 0x18(%rbp)
jne 0x11798
jmp 0x1198e
jmp 0x1179a
movq 0x10(%rbp), %rax
movq %rax, -0x670(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x668(%rbp)
callq 0xa150
movq -0x668(%rbp), %rdi
movq %rax, -0x1b8(%rbp)
callq 0xa150
movq %rax, -0x1c8(%rbp)
movslq 0x18(%rbp), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0xa180
movq %rax, -0x1c0(%rbp)
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x660(%rbp)
callq 0x4650
movq -0x660(%rbp), %rcx
movq -0x1b8(%rbp), %rsi
movq -0x1c0(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
callq 0xa1c0
jmp 0x1181c
movq -0x670(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x10e40
jmp 0x11831
leaq -0x1b0(%rbp), %rdi
callq 0x6130
leaq -0x1c9(%rbp), %rdi
callq 0x4420
movq -0x590(%rbp), %rdi
movl -0x10(%rbp), %esi
movl 0x18(%rbp), %ecx
leaq -0x40(%rbp), %rdx
callq 0x10e70
movb %al, -0x671(%rbp)
jmp 0x11867
movb -0x671(%rbp), %al
andb $0x1, %al
movb %al, -0x1ca(%rbp)
testb $0x1, -0x1ca(%rbp)
jne 0x11989
movb $0x1, -0x1f2(%rbp)
movl $0x28, %edi
callq 0x41b0
movq %rax, -0x688(%rbp)
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x680(%rbp)
callq 0x4650
movq -0x680(%rbp), %rdx
leaq 0x7bcb(%rip), %rsi      # 0x19486
leaq -0x1f0(%rbp), %rdi
callq 0x4bf0
jmp 0x118c9
movq -0x688(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x9240
jmp 0x118de
movq -0x688(%rbp), %rdi
movb $0x0, -0x1f2(%rbp)
leaq 0x12405(%rip), %rsi     # 0x23cf8
leaq -0x864a(%rip), %rdx     # 0x92b0
callq 0x4610
jmp 0x1204f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1192a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x6130
leaq -0x1c9(%rbp), %rdi
callq 0x4420
jmp 0x1203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11961
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x4250
leaq -0x1f1(%rbp), %rdi
callq 0x4420
testb $0x1, -0x1f2(%rbp)
jne 0x11978
jmp 0x11984
movq -0x688(%rbp), %rdi
callq 0x42d0
jmp 0x1203d
jmp 0x11677
jmp 0x11990
jmp 0x11992
movq -0x20(%rbp), %rsi
leaq -0x310(%rbp), %rdi
callq 0x4150
jmp 0x119a4
movq 0x10(%rbp), %rsi
leaq -0x328(%rbp), %rdi
callq 0xddf0
jmp 0x119b6
movq -0x28(%rbp), %rsi
leaq -0x348(%rbp), %rdi
callq 0x4150
jmp 0x119c8
leaq -0x2f0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x328(%rbp), %rdx
leaq -0x348(%rbp), %rcx
callq 0x12b30
jmp 0x119eb
leaq -0x348(%rbp), %rdi
callq 0x4250
leaq -0x328(%rbp), %rdi
callq 0x5a00
leaq -0x310(%rbp), %rdi
callq 0x4250
movq -0x590(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x12c70
jmp 0x11a24
movl -0xc(%rbp), %esi
leaq -0x3e8(%rbp), %rdi
callq 0x7bb0
jmp 0x11a35
leaq 0x79e1(%rip), %rdx      # 0x1941d
leaq -0x3c8(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0x7b60
jmp 0x11a51
leaq -0x2e8(%rbp), %rdx
leaq -0x3a8(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0x7b10
jmp 0x11a6d
leaq 0x767e(%rip), %rdx      # 0x190f2
leaq -0x388(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x7b60
jmp 0x11a89
leaq -0x2c8(%rbp), %rdx
leaq -0x368(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x7b10
jmp 0x11aa5
leaq -0x388(%rbp), %rdi
callq 0x4250
leaq -0x3a8(%rbp), %rdi
callq 0x4250
leaq -0x3c8(%rbp), %rdi
callq 0x4250
leaq -0x3e8(%rbp), %rdi
callq 0x4250
movq -0x590(%rbp), %rdi
addq $0x8, %rdi
leaq -0x368(%rbp), %rsi
callq 0x7cd0
jmp 0x11aee
movl -0xc(%rbp), %esi
leaq -0x448(%rbp), %rdi
callq 0x7bb0
jmp 0x11aff
leaq 0x7923(%rip), %rdx      # 0x19429
leaq -0x428(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x7b60
jmp 0x11b1b
leaq -0x2e8(%rbp), %rdx
leaq -0x408(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x7b10
jmp 0x11b37
leaq -0x368(%rbp), %rdi
movq %rdi, -0x690(%rbp)
leaq -0x408(%rbp), %rsi
movq %rsi, -0x698(%rbp)
callq 0x4490
movq -0x698(%rbp), %rdi
callq 0x4250
leaq -0x428(%rbp), %rdi
callq 0x4250
leaq -0x448(%rbp), %rdi
callq 0x4250
movq -0x590(%rbp), %rdi
movq -0x690(%rbp), %rsi
addq $0x8, %rdi
callq 0x7cd0
jmp 0x11b95
testb $0x1, -0x238(%rbp)
jne 0x11cf5
movq 0x20(%rbp), %rdi
leaq 0x7576(%rip), %rsi      # 0x19123
callq 0x81a0
testb $0x1, %al
jne 0x11bbb
jmp 0x11cf5
movq -0x590(%rbp), %rdi
addq $0x250, %rdi            # imm = 0x250
movq -0x20(%rbp), %rsi
leaq -0x2f0(%rbp), %rdx
callq 0x12cd0
jmp 0x11bdb
jmp 0x11cf5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11c20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11c14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x4250
leaq -0x328(%rbp), %rdi
callq 0x5a00
leaq -0x310(%rbp), %rdi
callq 0x4250
jmp 0x1203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x12031
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11c9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11c90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11c84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x4250
leaq -0x3a8(%rbp), %rdi
callq 0x4250
leaq -0x3c8(%rbp), %rdi
callq 0x4250
leaq -0x3e8(%rbp), %rdi
callq 0x4250
jmp 0x12031
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x12025
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11ce4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x4250
leaq -0x448(%rbp), %rdi
callq 0x4250
jmp 0x12025
movq 0x20(%rbp), %rdi
leaq 0x7423(%rip), %rsi      # 0x19123
callq 0x81a0
testb $0x1, %al
jne 0x11d0e
jmp 0x11ffb
cmpl $0xc8, -0x2f0(%rbp)
jne 0x11ffb
leaq -0x468(%rbp), %rdi
callq 0x4510
testb $0x1, -0x238(%rbp)
je 0x11dc2
movl -0xc(%rbp), %esi
leaq -0x4a8(%rbp), %rdi
callq 0x7bb0
jmp 0x11d48
leaq 0x775d(%rip), %rdx      # 0x194ac
leaq -0x488(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0x7b60
jmp 0x11d64
leaq -0x468(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x4490
leaq -0x488(%rbp), %rdi
callq 0x4250
leaq -0x4a8(%rbp), %rdi
callq 0x4250
jmp 0x11fc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11fed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x4250
jmp 0x11fed
leaq -0x2f0(%rbp), %rdi
addq $0xd8, %rdi
callq 0x45f0
testb $0x1, %al
jne 0x11ddb
jmp 0x11de5
cmpq $0x0, -0x220(%rbp)
je 0x11e5f
movl -0xc(%rbp), %esi
leaq -0x4e8(%rbp), %rdi
callq 0x7bb0
jmp 0x11df6
leaq 0x76e0(%rip), %rdx      # 0x194dd
leaq -0x4c8(%rbp), %rdi
leaq -0x4e8(%rbp), %rsi
callq 0x7b60
jmp 0x11e12
leaq -0x468(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x4490
leaq -0x4c8(%rbp), %rdi
callq 0x4250
leaq -0x4e8(%rbp), %rdi
callq 0x4250
jmp 0x11fc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x4250
jmp 0x11fed
leaq -0x228(%rbp), %rdi
callq 0x42e0
movq %rax, -0x4f0(%rbp)
movq -0x4f0(%rbp), %rdi
callq 0x4140
movq %rax, -0x4f8(%rbp)
movq -0x4f8(%rbp), %rax
movq %rax, -0x6a8(%rbp)
leaq -0x519(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0x4650
movq -0x6a8(%rbp), %rsi
movq -0x6a0(%rbp), %rdx
leaq -0x518(%rbp), %rdi
callq 0x4bf0
jmp 0x11ec2
leaq -0x519(%rbp), %rdi
callq 0x4420
movl -0xc(%rbp), %esi
leaq -0x580(%rbp), %rdi
callq 0x7bb0
jmp 0x11edf
leaq 0x761c(%rip), %rdx      # 0x19502
leaq -0x560(%rbp), %rdi
leaq -0x580(%rbp), %rsi
callq 0x7b60
jmp 0x11efb
leaq -0x540(%rbp), %rdi
leaq -0x560(%rbp), %rsi
leaq -0x518(%rbp), %rdx
callq 0x7b10
jmp 0x11f17
leaq -0x468(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x4490
leaq -0x540(%rbp), %rdi
callq 0x4250
leaq -0x560(%rbp), %rdi
callq 0x4250
leaq -0x580(%rbp), %rdi
callq 0x4250
leaq -0x518(%rbp), %rdi
callq 0x4250
jmp 0x11fc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x519(%rbp), %rdi
callq 0x4420
jmp 0x11fed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11fb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x11faa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x4250
leaq -0x580(%rbp), %rdi
callq 0x4250
leaq -0x518(%rbp), %rdi
callq 0x4250
jmp 0x11fed
jmp 0x11fc6
movq -0x590(%rbp), %rdi
addq $0x8, %rdi
leaq -0x468(%rbp), %rsi
callq 0x7cd0
jmp 0x11fdf
leaq -0x468(%rbp), %rdi
callq 0x4250
jmp 0x11ffb
leaq -0x468(%rbp), %rdi
callq 0x4250
jmp 0x12025
leaq -0x368(%rbp), %rdi
callq 0x4250
leaq -0x2f0(%rbp), %rdi
callq 0x5970
leaq -0x40(%rbp), %rdi
callq 0x6130
addq $0x6b0, %rsp            # imm = 0x6B0
popq %rbp
retq
leaq -0x368(%rbp), %rdi
callq 0x4250
leaq -0x2f0(%rbp), %rdi
callq 0x5970
leaq -0x40(%rbp), %rdi
callq 0x6130
movq -0x50(%rbp), %rdi
callq 0x4640
nop