// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %r9, %rbp
movq %r8, 0xc8(%rsp)
movl %ecx, 0x68(%rsp)
movl %edx, %r12d
movq %rsi, 0xd0(%rsp)
movq %rdi, %rbx
movl $0x10000, %edi          # imm = 0x10000
callq 0x3330
movl $0x10000, %edx          # imm = 0x10000
movq %rax, (%rsp)
movq %rax, %rdi
xorl %esi, %esi
callq 0x31f0
leaq 0x41c4(%rip), %rsi      # 0xd46e
movl $0xe, %ecx
movq %rbp, %rdi
xorl %edx, %edx
callq 0x34f0
cmpq $-0x1, %rax
movq %rbx, 0x90(%rsp)
movq %rbp, 0x98(%rsp)
je 0x93cf
movl 0x348(%rsp), %r14d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa85e
movl %eax, 0xc4(%rsp)
movl %r14d, 0x6c(%rsp)
cmpl %r14d, %eax
jle 0x94d1
xorl %r14d, %r14d
leaq 0x138(%rsp), %r15
movl $0xffff, %edx           # imm = 0xFFFF
movl 0x68(%rsp), %edi
movq (%rsp), %rsi
xorl %ecx, %ecx
callq 0x3100
movq %rax, %r13
cmpl $-0x1, %r13d
je 0xa0ca
movslq %r13d, %rax
movq (%rsp), %rsi
leaq (%rsi,%rax), %rdx
movb $0x0, (%rsi,%rax)
movq %r15, %rdi
leaq 0xa0(%rsp), %rcx
callq 0x6e9e
movq 0x340(%rsp), %rdi
movq %r15, %rsi
callq 0xa66c
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x9373
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x3340
addl %r13d, 0x6c(%rsp)
movslq %r13d, %rbp
xorl %ecx, %ecx
cmpl %r13d, %ecx
jge 0x93b1
movl %ecx, %ebx
movslq %ecx, %rsi
addq (%rsp), %rsi
movl %r12d, %edi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x31b0
cmpl $-0x1, %eax
movl %eax, %ecx
cmovel %r14d, %ecx
addl %ebx, %ecx
cmpl $-0x1, %eax
jne 0x937d
cmpl %r13d, %ebx
jl 0xa194
movl 0x6c(%rsp), %eax
cmpl 0xc4(%rsp), %eax
movq 0x98(%rsp), %rbp
jl 0x9306
jmp 0x94d1
leaq 0x40e6(%rip), %rsi      # 0xd4bc
xorl %r15d, %r15d
movl $0x7, %ecx
movq %rbp, %rdi
xorl %edx, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x9629
leaq 0x138(%rsp), %rbx
xorl %r14d, %r14d
movl $0xffff, %edx           # imm = 0xFFFF
movl 0x68(%rsp), %edi
movq (%rsp), %rsi
xorl %ecx, %ecx
callq 0x3100
movq %rax, %r13
cmpl $-0x1, %r13d
je 0xa12f
movslq %r13d, %rax
movq (%rsp), %rsi
leaq (%rsi,%rax), %rdx
movb $0x0, (%rsi,%rax)
movq %rbx, %rdi
leaq 0xa0(%rsp), %rcx
callq 0x6e9e
movq 0x340(%rsp), %rdi
movq %rbx, %rsi
callq 0xa66c
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x946a
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x3340
movslq %r13d, %rbp
xorl %ecx, %ecx
cmpl %r13d, %ecx
jge 0x94a3
movl %ecx, %ebx
movslq %ecx, %rsi
addq (%rsp), %rsi
movl %r12d, %edi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x31b0
cmpl $-0x1, %eax
movl %eax, %ecx
cmovel %r15d, %ecx
addl %ebx, %ecx
cmpl $-0x1, %eax
jne 0x946f
cmpl %r13d, %ebx
jl 0xa25b
movq (%rsp), %rax
cmpb $0x30, (%rax)
movzbl %r14b, %r14d
movl $0x1, %eax
cmovel %eax, %r14d
testb $0x1, %r14b
movq 0x98(%rsp), %rbp
leaq 0x138(%rsp), %rbx
je 0x93fd
leaq 0x128(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0xc8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x3d22
leaq 0x230(%rsp), %rdi
movq 0x340(%rsp), %rsi
callq 0x8ac2
leaq 0x108(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %rdi
callq 0x3d22
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x230(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
callq 0xa8ea
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0x9578
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x230(%rsp), %rdi
callq 0x3f6a
movq 0x118(%rsp), %rdi
cmpq %r15, %rdi
movq 0x90(%rsp), %rbx
je 0x95aa
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x138(%rsp), %rsi
movq %rbx, %rdi
callq 0xaa56
movq 0xd0(%rsp), %r15
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x9755
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x974c
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x9752
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x9755
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x95e7
addl $-0x3, %r14d
jmp 0x9755
leaq 0x138(%rsp), %r14
movl $0xffff, %edx           # imm = 0xFFFF
movl 0x68(%rsp), %edi
movq (%rsp), %rsi
xorl %ecx, %ecx
callq 0x3100
movq %rax, %r13
testl %r13d, %r13d
movq 0x98(%rsp), %rbp
je 0x94d1
cmpl $-0x1, %r13d
je 0xa1f9
movslq %r13d, %rdx
movq (%rsp), %rsi
addq %rsi, %rdx
movq %r14, %rdi
leaq 0xa0(%rsp), %rcx
callq 0x6e9e
movq 0x340(%rsp), %rdi
movq %r14, %rsi
callq 0xa66c
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x96aa
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x3340
movslq %r13d, %rbp
xorl %ecx, %ecx
cmpl %r13d, %ecx
jge 0x9631
movl %ecx, %ebx
movslq %ecx, %rsi
addq (%rsp), %rsi
movl %r12d, %edi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x31b0
cmpl $-0x1, %eax
movl %eax, %ecx
cmovel %r15d, %ecx
addl %ebx, %ecx
cmpl $-0x1, %eax
jne 0x96af
cmpl %r13d, %ebx
jge 0x9631
movl $0x28, %edi
callq 0x31a0
movq %rax, %r15
leaq 0x258(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3d96(%rip), %rsi      # 0xd49e
leaq 0x3dac(%rip), %rdx      # 0xd4bb
leaq 0x248(%rsp), %rdi
callq 0x3c86
movb $0x1, %bpl
leaq 0x248(%rsp), %rsi
movq %r15, %rdi
callq 0x6aa8
xorl %ebp, %ebp
leaq 0x85d0(%rip), %rsi      # 0x11d08
leaq -0x2c4d(%rip), %rdx     # 0x6af2
movq %r15, %rdi
callq 0x34e0
jmp 0xa2bb
addl $-0x2, %r14d
jmp 0x9755
decl %r14d
shrl $0x1f, %r15d
leal (%r14,%r15), %esi
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x70(%rsp), %rdi
movl $0x2d, %edx
callq 0x3390
movq %r15, %rbx
movl %r15d, %r15d
leaq 0x70(%rsp), %r12
movq (%r12), %rdi
addq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x71bb
leaq 0x3c9a(%rip), %rsi      # 0xd435
movq %r12, %rdi
callq 0x3550
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97ca
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x97d2
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
callq 0x30e0
leaq 0x38(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x982a
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x9830
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38b7(%rip), %rsi      # 0xd10a
callq 0x3550
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9880
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x9888
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x160(%rsp), %rsi
movq 0x168(%rsp), %rdx
callq 0x30e0
leaq 0xb0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x98e9
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb0(%rsp)
jmp 0x98ef
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x9921
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
movq 0x90(%rsp), %r14
je 0x9945
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x995c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x997e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x8(%r14), %r13
leaq 0xa0(%rsp), %rsi
movq %r13, %rdi
callq 0x5714
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x99e6
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x99dd
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x99e3
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x99e6
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x99aa
addl $-0x3, %r14d
jmp 0x99e6
addl $-0x2, %r14d
jmp 0x99e6
decl %r14d
leal (%r14,%rbx), %esi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x3390
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
addq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x71bb
leaq 0x3a23(%rip), %rsi      # 0xd441
movq %r12, %rdi
callq 0x3550
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x58(%rsp), %r12
je 0x9a53
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x9a59
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
callq 0x30e0
movq %r12, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9aad
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x9ab5
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xa0(%rsp), %rdi
movq %r14, %rsi
callq 0x33b0
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x9af6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x9b12
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9b2e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xa0(%rsp), %rsi
movq %r13, %rdi
callq 0x5714
movq 0x350(%rsp), %r14
cmpb $0x0, 0x1f0(%rsp)
jne 0x9b87
leaq 0x35e4(%rip), %rsi      # 0xd13b
movq %r14, %rdi
callq 0x30d0
testl %eax, %eax
jne 0x9b87
movq 0x90(%rsp), %rdi
addq $0x250, %rdi            # imm = 0x250
leaq 0x138(%rsp), %rdx
movq 0xc8(%rsp), %rsi
callq 0xaa98
leaq 0x35ad(%rip), %rsi      # 0xd13b
movq %r14, %rdi
callq 0x30d0
testl %eax, %eax
jne 0x9fe4
cmpl $0xc8, 0x138(%rsp)
jne 0x9fe4
movq %r12, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
cmpb $0x1, 0x1f0(%rsp)
jne 0x9c2a
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x9d21
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x9d18
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x9d1e
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x9d21
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x9be8
addl $-0x3, %r14d
jmp 0x9d21
movq 0x208(%rsp), %rax
orq 0x218(%rsp), %rax
jne 0x9cc5
leaq 0x200(%rsp), %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3140
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rax, %rsi
callq 0x39dc
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x9e4b
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x9d6b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x9e48
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x9e4b
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x9c83
addl $-0x3, %r14d
jmp 0x9e4b
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x9d77
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x9d65
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x9d74
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x9d77
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x9ce1
addl $-0x3, %r14d
jmp 0x9d77
addl $-0x2, %r14d
jmp 0x9d21
decl %r14d
movq %rbx, %rsi
addl %r14d, %esi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x3390
leaq 0x8(%rsp), %r12
addq (%r12), %r15
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x71bb
leaq 0x3769(%rip), %rsi      # 0xd4c4
movq %r12, %rdi
callq 0x3550
jmp 0x9db9
addl $-0x2, %r14d
jmp 0x9d77
addl $-0x2, %r14d
jmp 0x9e4b
decl %r14d
movq %rbx, %rsi
addl %r14d, %esi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x3390
leaq 0x8(%rsp), %r12
addq (%r12), %r15
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x71bb
leaq 0x3744(%rip), %rsi      # 0xd4f5
movq %r12, %rdi
callq 0x3550
leaq 0x38(%rsp), %r15
movq %r15, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9de1
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x9de8
movups (%rcx), %xmm0
movups %xmm0, (%r15)
leaq 0x58(%rsp), %rbx
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x33b0
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x9e2b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9fc0
movq 0x18(%rsp), %rsi
jmp 0x9fb8
decl %r14d
movq %rbx, %rsi
addl %r14d, %esi
leaq 0xe8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0xd8(%rsp), %rdi
movl $0x2d, %edx
callq 0x3390
leaq 0xd8(%rsp), %r12
addq (%r12), %r15
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x71bb
leaq 0x368b(%rip), %rsi      # 0xd51a
movq %r12, %rdi
callq 0x3550
movq %rbx, %rbp
leaq 0x80(%rsp), %r12
movq %r12, 0x70(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9ec8
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x9ed0
movups (%rcx), %xmm0
movups %xmm0, (%r12)
leaq 0x58(%rsp), %rbx
movq 0x8(%rax), %rdx
leaq 0x70(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x30e0
leaq 0x18(%rsp), %r15
movq %r15, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9f28
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x9f2f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x33b0
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x9f6d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x9f87
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9fa4
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x9fc0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x48(%rsp), %rsi
movq %r13, %rdi
callq 0x5714
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x9fe4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0xa009
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x220(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa02a
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x1b8(%rsp), %rdi
callq 0x3fb8
leaq 0x1a0(%rsp), %r14
movq %r14, %rdi
callq 0x3f6a
movq -0x20(%r14), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0xa068
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa089
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x150(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa0aa
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3340
movl $0x10000, %esi          # imm = 0x10000
movq (%rsp), %rdi
callq 0x3340
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x31a0
movq %rax, %r15
leaq 0x2f8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3392(%rip), %rsi      # 0xd47d
leaq 0x33ab(%rip), %rdx      # 0xd49d
leaq 0x2e8(%rsp), %rdi
callq 0x3c86
movb $0x1, %bpl
leaq 0x2e8(%rsp), %rsi
movq %r15, %rdi
callq 0x6aa8
xorl %ebp, %ebp
leaq 0x7bed(%rip), %rsi      # 0x11d08
leaq -0x3630(%rip), %rdx     # 0x6af2
movq %r15, %rdi
callq 0x34e0
jmp 0xa2bb
movl $0x28, %edi
callq 0x31a0
movq %rax, %r15
leaq 0x2b8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x332d(%rip), %rsi      # 0xd47d
leaq 0x3346(%rip), %rdx      # 0xd49d
leaq 0x2a8(%rsp), %rdi
callq 0x3c86
movb $0x1, %bpl
leaq 0x2a8(%rsp), %rsi
movq %r15, %rdi
callq 0x6aa8
xorl %ebp, %ebp
leaq 0x7b88(%rip), %rsi      # 0x11d08
leaq -0x3695(%rip), %rdx     # 0x6af2
movq %r15, %rdi
callq 0x34e0
jmp 0xa2bb
movl $0x28, %edi
callq 0x31a0
movq %rax, %r15
leaq 0x2d8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x32e9(%rip), %rsi      # 0xd49e
leaq 0x32ff(%rip), %rdx      # 0xd4bb
leaq 0x2c8(%rsp), %rdi
callq 0x3c86
movb $0x1, %bpl
leaq 0x2c8(%rsp), %rsi
movq %r15, %rdi
callq 0x6aa8
xorl %ebp, %ebp
leaq 0x7b23(%rip), %rsi      # 0x11d08
leaq -0x36fa(%rip), %rdx     # 0x6af2
movq %r15, %rdi
callq 0x34e0
jmp 0xa2bb
movl $0x28, %edi
callq 0x31a0
movq %rax, %r15
leaq 0x278(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3263(%rip), %rsi      # 0xd47d
leaq 0x327c(%rip), %rdx      # 0xd49d
leaq 0x268(%rsp), %rdi
callq 0x3c86
movb $0x1, %bpl
leaq 0x268(%rsp), %rsi
movq %r15, %rdi
callq 0x6aa8
xorl %ebp, %ebp
leaq 0x7abe(%rip), %rsi      # 0x11d08
leaq -0x375f(%rip), %rdx     # 0x6af2
movq %r15, %rdi
callq 0x34e0
jmp 0xa2bb
movl $0x28, %edi
callq 0x31a0
movq %rax, %r15
leaq 0x298(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3222(%rip), %rsi      # 0xd49e
leaq 0x3238(%rip), %rdx      # 0xd4bb
leaq 0x288(%rsp), %rdi
callq 0x3c86
movb $0x1, %bpl
leaq 0x288(%rsp), %rsi
movq %r15, %rdi
callq 0x6aa8
xorl %ebp, %ebp
leaq 0x7a5c(%rip), %rsi      # 0x11d08
leaq -0x37c1(%rip), %rdx     # 0x6af2
movq %r15, %rdi
callq 0x34e0
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xa2e0
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa2e0
movq %rbx, %rbp
movq %rax, %r14
movq 0xd8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xa302
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa302
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xa344
movq 0x38(%rsp), %rsi
jmp 0xa335
jmp 0xa31e
jmp 0xa341
jmp 0xa341
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa344
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa344
jmp 0xa341
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xa507
movq 0x58(%rsp), %rsi
jmp 0xa39a
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xa382
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa382
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xa507
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa507
jmp 0xa504
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0xa3cb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa3cb
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xa3ec
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa3ec
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xa408
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa408
movq %rax, %r14
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xa52c
movq 0x80(%rsp), %rsi
jmp 0xa524
jmp 0xa42d
movq %rax, %r14
jmp 0xa52c
movq %rax, %r14
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0xa45a
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa45a
movq %rax, %r14
leaq 0x230(%rsp), %rdi
callq 0x3f6a
jmp 0xa46c
movq %rax, %r14
movq 0x118(%rsp), %rdi
cmpq %r15, %rdi
je 0xa5e6
movq 0x128(%rsp), %rsi
incq %rsi
jmp 0xa5d8
jmp 0xa5e3
movq %rax, %r14
movq 0x248(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5a4
movq 0x258(%rsp), %rsi
jmp 0xa594
jmp 0xa59e
movq %rax, %r14
movq 0x288(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5a4
movq 0x298(%rsp), %rsi
jmp 0xa594
jmp 0xa59e
movq %rax, %r14
movq 0x268(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5a4
movq 0x278(%rsp), %rsi
jmp 0xa594
jmp 0xa59e
movq %rax, %r14
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0xa52c
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x138(%rsp), %rdi
callq 0x3ee8
jmp 0xa5e6
movq %rax, %r14
movq 0x2c8(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5a4
movq 0x2d8(%rsp), %rsi
jmp 0xa594
jmp 0xa59e
movq %rax, %r14
movq 0x2a8(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5a4
movq 0x2b8(%rsp), %rsi
jmp 0xa594
jmp 0xa59e
jmp 0xa5e3
jmp 0xa5bd
jmp 0xa5e3
movq %rax, %r14
movq 0x2e8(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5a4
movq 0x2f8(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xa5a4
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0xa5e6
movq %r15, %rdi
callq 0x3250
jmp 0xa5e6
jmp 0xa5e3
jmp 0xa5e3
jmp 0xa5bd
jmp 0xa5e3
jmp 0xa5e3
movq %rax, %r14
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0xa5e6
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x3340
jmp 0xa5e6
jmp 0xa5e3
jmp 0xa5e3
movq %rax, %r14
movl $0x10000, %esi          # imm = 0x10000
movq (%rsp), %rdi
callq 0x3340
movq %r14, %rdi
callq 0x3510