LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/boundingbox.h
// Function: BoundingBox::testSubset(BoundingBox const&) const
bool testSubset(const BoundingBox& other) const
    {
        if (
                (m_Mins[0] >= other.m_Mins[0]) &&
                (m_Maxs[0] <= other.m_Maxs[0]) &&
                (m_Mins[1] >= other.m_Mins[1]) &&
                (m_Maxs[1] <= other.m_Maxs[1]) &&
                (m_Mins[2] >= other.m_Mins[2]) &&
                (m_Maxs[2] <= other.m_Maxs[2])
           )
        {
            return true;
        }
        return false;
    }

// Assembly:
movss (%rdi), %xmm0
ucomiss (%rsi), %xmm0
jb 0x11306
movss 0xc(%rsi), %xmm0
ucomiss 0xc(%rdi), %xmm0
jb 0x11306
movss 0x4(%rdi), %xmm0
ucomiss 0x4(%rsi), %xmm0
jb 0x11306
movss 0x10(%rsi), %xmm0
ucomiss 0x10(%rdi), %xmm0
jb 0x11306
movss 0x8(%rdi), %xmm0
ucomiss 0x8(%rsi), %xmm0
jb 0x11306
movss 0x14(%rsi), %xmm0
movb $0x1, %al
ucomiss 0x14(%rdi), %xmm0
jae 0x11308
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::Proxy()
Proxy() : 
		logger { "log.txt" },
		cache { LRUCache(CACHE_SIZE) }
	{
		// error shouldn't happen in the constructor
		// but if it does, release all the resouces allocated and exit the process
		constructServer();
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x98c9(%rip), %rsi      # 0xd020
leaq 0x98c9(%rip), %rdx      # 0xd027
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3c80
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3a14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x378d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movabsq $0x1f400000000, %rax    # imm = 0x1F400000000
movq %rax, 0x250(%r14)
leaq 0x258(%r14), %r15
movq %r15, 0x260(%r14)
movq %r15, 0x258(%r14)
movq $0x0, 0x268(%r14)
leaq 0x270(%r14), %r12
leaq 0x2a0(%r14), %rax
movq %rax, 0x270(%r14)
movq $0x1, 0x278(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x280(%r14)
movl $0x3f800000, 0x290(%r14) # imm = 0x3F800000
movups %xmm0, 0x298(%r14)
leaq 0x9825(%rip), %rax      # 0xd028
movq %rax, 0x2a8(%r14)
movq %r14, %rdi
callq 0x3aae
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r12, %rdi
callq 0x3db6
movq %r15, %rdi
callq 0x40ca
movq %rbx, %rdi
callq 0x3c30
jmp 0x3855
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3855
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movq %r14, %rdi
callq 0x3510
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::run()
void run()
	{
		unsigned client_id = 0; // id to mark different 

		// (1) wait until an request of sending arrives
		// (2) every time a client fd is caught, create a new thread to handle the request
		while(true)
		{ 
			std::string client_ip;
			int client_fd = acceptConnection(client_ip);
			if(client_fd == -1) // request error
			{
				continue;
			}
			std::thread thd(&Proxy::handleRequest, this, client_id, client_fd, client_ip);
			thd.detach();

			// assign every request/thread a unique id
			client_id = (client_id == INT_MAX) ? 0 : ++client_id;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq %rsp, %rax
movl $0x0, (%rax)
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r14
xorl %ebp, %ebp
movq %r13, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4110
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x390b
leaq 0x8c2(%rip), %rax       # 0x417e
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq %rbx, 0x30(%rsp)
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rsp, %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x51f0
movq %r12, %rdi
callq 0x3500
movl (%rsp), %eax
leal 0x1(%rax), %ecx
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmovel %ebp, %ecx
movl %ecx, (%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x3933
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x388e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x388e
cmpq $0x0, 0x8(%rsp)
je 0x393a
callq 0x30c0
jmp 0x393a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x3954
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::acceptConnection(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int acceptConnection(std::string & client_ip)
    {
    	// keep waiting until a client request
        struct sockaddr_storage socket_addr;
        socklen_t socket_addr_len = sizeof(socket_addr);
        int accept_fd = accept(socket_fd, (struct sockaddr *)&socket_addr, &socket_addr_len); // accept() implements blocking accept
        if(accept_fd == -1) 
        {
            return -1;
        }

        // get the client ip
        struct sockaddr_in * temp = (struct sockaddr_in *)&socket_addr;
  		client_ip = inet_ntoa(temp->sin_addr);

        return accept_fd;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
leaq 0x4(%rsp), %rdx
movl $0x80, (%rdx)
movl 0x2b4(%rdi), %edi
leaq 0x8(%rsp), %rsi
callq 0x30f0
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x416d
movl 0xc(%rsp), %edi
callq 0x3160
movq %rax, %r14
movq 0x8(%rbx), %r15
movq %rax, %rdi
callq 0x3150
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x3480
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Request.hpp
// Function: Request::operator=(Request const&)
Request & operator=(const Request & rhs)
	{
		if(this != &rhs)
		{
			request_time = rhs.request_time;
			first_line = rhs.first_line;
			httpAction = rhs.httpAction;
			url = rhs.url;
			hostname = rhs.hostname;
			port = rhs.port;
			content = rhs.content;
		}
		return *this;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x5533
movq %rsi, %r14
movq %rbx, %rdi
callq 0x31e0
leaq 0x20(%r14), %rsi
leaq 0x20(%rbx), %rdi
callq 0x31e0
leaq 0x40(%r14), %rsi
leaq 0x40(%rbx), %rdi
callq 0x31e0
leaq 0x60(%r14), %rsi
leaq 0x60(%rbx), %rdi
callq 0x31e0
movl $0x80, %edi
leaq (%r14,%rdi), %rsi
addq %rbx, %rdi
callq 0x31e0
movl $0xa0, %edi
leaq (%r14,%rdi), %rsi
addq %rbx, %rdi
callq 0x31e0
movl $0xc0, %edi
addq %rdi, %r14
addq %rbx, %rdi
movq %r14, %rsi
callq 0x708e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::handleGetPost(int, int, int, Request const&)
void handleGetPost(int client_id, int client_fd, int server_fd, const Request & request)
	{
		try
		{
			sendRequest(server_fd, request);
			getResponse(client_id, client_fd, server_fd, request);
		}
		catch(std::exception & e)
		{
			throw e;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
movl %ecx, %esi
movq %r8, %rdx
callq 0xc4b0
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xc58c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x6a6c
movq %rbx, %rdi
callq 0x3130
movl $0x8, %edi
callq 0x31a0
movq 0xb571(%rip), %rcx      # 0x11fb8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0xb57b(%rip), %rsi      # 0x11fd0
movq 0xb594(%rip), %rdx      # 0x11ff0
movq %rax, %rdi
callq 0x34e0
movq %rax, %rbx
callq 0x34c0
movq %rbx, %rdi
callq 0x3510
movq %rax, %rdi
callq 0x3d15
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::parseRequest(Request&)
void parseRequest(Request & request)
	{
		bool extractAddrPort_suc = false;
		std::string temp;
		for(char c : request.content)
		{
			// extract the first line of the request
			if(c == '\r') 
			{
				break;
			}
			request.first_line += c;

			// extract http action, hostname, port
			if(!extractAddrPort_suc && c == ' ')
			{
				// get HTTP action and url from request
				if(request.httpAction.empty())
				{
					pushClear(temp, request.httpAction);
				}
				else
				{
					pushClear(temp, request.url);
					extractAddrPort(request.url, request.hostname, request.port);
					extractAddrPort_suc = true;
				}
			}
			else
			{
				temp += c;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0xc0(%rsi), %r12
movq 0xc8(%rsi), %r14
cmpq %r14, %r12
je 0x6df5
leaq 0x20(%rsi), %r15
leaq 0x40(%rsi), %rax
movq %rax, 0x30(%rsp)
leaq 0x60(%rsi), %rax
movq %rax, 0x28(%rsp)
leaq 0x80(%rsi), %rax
movq %rax, 0x40(%rsp)
movq %rsi, 0x50(%rsp)
leaq 0xa0(%rsi), %rax
movq %rax, 0x38(%rsp)
xorl %r13d, %r13d
movb (%r12), %bl
cmpb $0xd, %bl
je 0x6dd9
movsbl %bl, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x32c0
cmpb $0x20, %bl
setne %al
orb %r13b, %al
testb $0x1, %al
je 0x6d51
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x32c0
jmp 0x6dcd
movq 0x50(%rsp), %rax
cmpq $0x0, 0x48(%rax)
movq 0x10(%rsp), %rax
je 0x6da5
testq %rax, %rax
je 0x6d87
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x31e0
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movb $0x1, %r13b
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
callq 0x6f0c
jmp 0x6dcd
testq %rax, %rax
je 0x6dca
movq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x31e0
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
xorl %r13d, %r13d
incq %r12
cmpq %r14, %r12
jne 0x6d1c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6df5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6e23
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rbx, %rdi
callq 0x3510
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::extractAddrPort(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void extractAddrPort(std::string & url, std::string & hostname, std::string & port)
	{
		// eg: http://people.duke.edu/~bmr23/ece568/
		// url: http://people.duke.edu/~bmr23/ece568/
		// hostname: people.duke.edu
		// port: 80
		if(url.find("http://") == 0)
		{
			// port number
			port = "80";

			// hostname
			int idx = 0;
			int N = url.length();
			int slash = 0;
			for(; idx < N; ++idx)
			{
				slash += url[idx] == '/';
				if(slash == 3) // "http://" has two slash
				{
					break;
				}
			}
			hostname = url.substr(7, idx - 7);
		}

		// eg: github.com:443
		// url: github.com
		// hostname: github.com
		// port: 443
		else
		{
			int idx = url.find_last_of(':');
			hostname = url.substr(0, idx);
			url = url.substr(0, idx);
			port = "443";
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x62b6(%rip), %rsi      # 0xd1df
movl $0x7, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34f0
testq %rax, %rax
je 0x6fe4
movq %rbx, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
callq 0x3570
movslq %eax, %r12
movq %rsp, %r13
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3360
movq %r14, %rdi
movq %r13, %rsi
callq 0x33b0
movq (%r13), %rdi
leaq 0x10(%rsp), %r13
cmpq %r13, %rdi
je 0x6f91
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3360
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33b0
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x6fc4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%r15), %rdx
leaq 0x621b(%rip), %rcx      # 0xd1ea
movl $0x3, %r8d
movq %r15, %rdi
xorl %esi, %esi
callq 0x3480
jmp 0x7080
movq 0x8(%r15), %rdx
leaq 0x61f8(%rip), %rcx      # 0xd1e7
xorl %r12d, %r12d
movl $0x2, %r8d
movq %r15, %rdi
xorl %esi, %esi
callq 0x3480
movq 0x8(%rbx), %rax
testl %eax, %eax
jle 0x7041
movq (%rbx), %rdx
movl %eax, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movl %r12d, %edi
xorl %r12d, %r12d
cmpb $0x2f, (%rdx,%rcx)
sete %r12b
addl %edi, %r12d
cmpl $0x3, %r12d
je 0x7039
incq %rcx
cmpq %rcx, %rsi
jne 0x7017
movq %rax, %rcx
addl $-0x7, %ecx
movslq %ecx, %rcx
jmp 0x7048
movq $-0x7, %rcx
movq %rsp, %r15
movl $0x7, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3360
movq %r14, %rdi
movq %r15, %rsi
callq 0x33b0
movq (%r15), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7080
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./LRUCache.hpp
// Function: LRUCache::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Response get(const std::string & url) 
    {
        std::unique_lock<std::mutex> lck(mtx1);

        // url doesn't exist in cache
        if(!existsUrl(url))
        {
            throw ProxyException("Url doesn't exist in cache");
        }

        Response ret = kv[url];
        cache.remove(url);
        cache.push_back(url);
        return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xafee(%rip), %rax      # 0x122f0
movq %rsp, %r12
movq %rax, (%r12)
movb $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x7218
movb $0x1, 0x8(%r12)
movq %r14, %rdi
movq %r15, %rsi
callq 0x727c
testb %al, %al
je 0x7384
leaq 0x20(%r14), %rdi
movq %r15, %rsi
callq 0x85ea
movq %rbx, %rdi
movq %rax, %rsi
callq 0x837c
leaq 0x8(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8556
movq %r12, %rdi
movq %r15, %rsi
callq 0x8d56
movq %rax, %rdi
movq %r12, %rsi
callq 0x3050
incq 0x18(%r14)
movq %rsp, %rdi
callq 0x7202
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x31a0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5fc4(%rip), %rsi      # 0xd365
leaq 0x5fd7(%rip), %rdx      # 0xd37f
leaq 0x10(%rsp), %rdi
callq 0x3c80
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a7c
xorl %ebp, %ebp
leaq 0xa93d(%rip), %rsi      # 0x11d08
leaq -0x90c(%rip), %rdx      # 0x6ac6
movq %rbx, %rdi
callq 0x34e0
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x73f4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
testb %bpl, %bpl
jne 0x73fe
jmp 0x7418
movq %rax, %r14
movq %rbx, %rdi
callq 0x3250
jmp 0x7418
movq %rax, %r14
movq %rbx, %rdi
callq 0x3eec
jmp 0x7418
movq %rax, %r14
movq %rsp, %rdi
callq 0x7202
movq %r14, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::respondCached(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void respondCached(int client_fd, const std::string & url)
	{
		// send response to the client
		Response response = cache.get(url);
		for(const auto & seg : response.content)
		{
			int sent_length = 0;
			int length_to_be_sent = seg.size();
			while(sent_length < length_to_be_sent)
			{
				int len = send(client_fd, &seg.data()[0] + sent_length, length_to_be_sent - sent_length, 0);
				if(len == -1)
				{
					throw ProxyException("Send with cached response error");
				}
				sent_length += len;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movl %esi, %ebx
leaq 0x250(%rdi), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x72e6
movq 0x68(%r14), %r15
movq 0x70(%r14), %r14
cmpq %r14, %r15
je 0x7498
movl 0x8(%r15), %ebp
subl (%r15), %ebp
testl %ebp, %ebp
jle 0x7492
xorl %r12d, %r12d
movslq %r12d, %rax
movq (%r15), %rsi
addq %rax, %rsi
movl %ebp, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x31b0
cmpl $-0x1, %eax
je 0x7540
addl %eax, %r12d
cmpl %ebp, %r12d
jl 0x7468
addq $0x18, %r15
jmp 0x7455
leaq 0x90(%rsp), %rbx
movq 0x70(%rbx), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x74c1
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
callq 0x3fc2
movq %rbx, %rdi
callq 0x3f6e
movq -0x38(%r14), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x74fa
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7515
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7530
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x31a0
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5e23(%rip), %rsi      # 0xd380
leaq 0x5e3b(%rip), %rdx      # 0xd39f
leaq 0x8(%rsp), %rdi
callq 0x3c80
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a7c
xorl %ebp, %ebp
leaq 0xa781(%rip), %rsi      # 0x11d08
leaq -0xac8(%rip), %rdx      # 0x6ac6
movq %rbx, %rdi
callq 0x34e0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x75b0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
testb %bpl, %bpl
jne 0x75ba
jmp 0x75c7
movq %rax, %r14
movq %rbx, %rdi
callq 0x3250
jmp 0x75c7
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x3eec
movq %r14, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::insertSectionToContent(std::vector<char, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::vector<char> insertSectionToContent(const std::vector<char> & content, const std::string & section)
	{
		int idx = findFirstLine(content); // idx is the index of the '\r' in the first line of response
		std::vector<char> content_to_send(content.begin(), content.begin() + idx);
		for(char c : section) content_to_send.push_back(c);
		content_to_send.insert(content_to_send.end(), content.begin() + idx, content.end());
		return content_to_send;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdi, %rbx
movl 0x8(%rdx), %eax
movq %rdx, 0x10(%rsp)
movq (%rdx), %rsi
subl %esi, %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
jl 0x76a5
decl %eax
xorl %ecx, %ecx
cmpb $0xd, (%rsi,%rcx)
jne 0x769b
cmpb $0xa, 0x1(%rsi,%rcx)
je 0x76a5
incq %rcx
cmpq %rcx, %rax
jne 0x768e
movl %eax, %ecx
movslq %ecx, %r15
leaq (%rsi,%r15), %rdx
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
callq 0x8da8
movq 0x8(%r12), %r13
testq %r13, %r13
je 0x76fd
movq (%r12), %rbp
xorl %r14d, %r14d
leaq 0xe(%rsp), %r12
movb (%rbp,%r14), %al
movb %al, 0xe(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x76ea
movb %al, (%rsi)
incq 0x8(%rbx)
jmp 0x76f5
movq %rbx, %rdi
movq %r12, %rdx
callq 0x8e50
incq %r14
cmpq %r14, %r13
jne 0x76cf
movq 0x8(%rbx), %rsi
movq 0x10(%rsp), %rax
addq (%rax), %r15
movq 0x8(%rax), %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8f42
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x772c
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x7743
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3340
movq %r14, %rdi
callq 0x3510
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::checkStatusCode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool checkStatusCode(const std::string & header)
	{
		int idx = header.find("\r\n");
		int i = 0;
		for(; i + 2 <= idx; ++i)
		{
			if(header[i] == '3' && header[i + 1] == '0' && header[i + 2] == '4')
			{
				return true;
			}
		}
		return false;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
leaq 0x43fe(%rip), %rsi      # 0xd537
xorl %ebx, %ebx
movl $0x2, %r15d
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x34f0
cmpl $0x2, %eax
jl 0x917d
movq (%r14), %rcx
cmpb $0x33, -0x2(%rcx,%r15)
jne 0x916f
cmpb $0x30, -0x1(%rcx,%r15)
jne 0x916f
cmpb $0x34, (%rcx,%r15)
je 0x917b
incq %r15
cmpl %eax, %r15d
jle 0x9158
xorl %ebx, %ebx
jmp 0x917d
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::extractContentLength(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int extractContentLength(const std::string & header)
	{
		// start extract content length
		int res = 0;
		int idx = header.find("Content-Length");
		int N = header.length();
		bool digit_found = false;
		for(int i = idx; i < N; ++i)
		{
			char c = header[i];
			if(digit_found && isdigit(c))
			{
				res = res * 10 + (c - '0');
			}
			else if(digit_found && !isdigit(c))
			{
				break;
			}
			else if(!digit_found && isdigit(c))
			{
				digit_found = true;
				res = c - '0';
			}
		}
		return res;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x2d66(%rip), %rsi      # 0xd46e
xorl %ebx, %ebx
movl $0xe, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x34f0
movl 0x8(%r14), %ecx
subl %eax, %ecx
jle 0xa761
cltq
addq (%r14), %rax
xorl %edx, %edx
xorl %ebx, %ebx
xorl %r8d, %r8d
movsbl (%rax,%rdx), %edi
addl $-0x30, %edi
cmpl $0xa, %edi
setb %sil
testb $0x1, %r8b
je 0xa751
cmpl $0x9, %edi
ja 0xa761
leal (%rbx,%rbx,4), %esi
leal (%rdi,%rsi,2), %ebx
movb $0x1, %sil
jmp 0xa757
cmpl $0xa, %edi
cmovbl %edi, %ebx
incq %rdx
movl %esi, %r8d
cmpl %edx, %ecx
jne 0xa72d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Response.hpp
// Function: Response::Response(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::vector<char, std::allocator<char>>, std::allocator<std::vector<char, std::allocator<char>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Response(const std::string _url, std::vector<std::vector<char>> buffer, const std::string h) : 
		status_code { -1 },
		url { _url },
		header { h },
		content { buffer },
		no_store { false }, // default can be stored in the cache
		no_cache { false }, // default can be cached in the cache(need to check e-tag)
		has_expiration { false }, // has expiration calculation machanism
		cur_time { time(NULL) },
		expiration_time { 0 },
		last_modified { 0 }
		{}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, %r15
movq %rdi, %rbx
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
leaq 0x18(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
leaq 0x28(%rdi), %r14
leaq 0x38(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rax, 0x28(%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3d20
leaq 0x48(%rbx), %r12
leaq 0x58(%rbx), %rbp
movq %rbp, 0x48(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3d20
leaq 0x68(%rbx), %rdi
movq %r15, %rsi
callq 0x8a1c
leaq 0xb0(%rbx), %rax
movq %rax, 0x80(%rbx)
movq $0x1, 0x88(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%rbx)
movl $0x3f800000, 0xa0(%rbx) # imm = 0x3F800000
movups %xmm0, 0xa8(%rbx)
movl $0x0, 0xb7(%rbx)
xorl %edi, %edi
callq 0x32f0
movq %rax, 0xc0(%rbx)
leaq 0xe8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%rbx)
movq %rax, 0xd8(%rbx)
movq $0x0, 0xe0(%rbx)
movb $0x0, 0xe8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq (%r12), %rdi
cmpq %rbp, %rdi
je 0xa895
movq (%rbp), %rsi
incq %rsi
callq 0x3340
jmp 0xa895
movq %rax, %r15
movq (%r14), %rdi
cmpq 0x8(%rsp), %rdi
je 0xa8b4
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3340
jmp 0xa8b4
movq %rax, %r15
movq 0x8(%rbx), %rdi
cmpq 0x10(%rsp), %rdi
je 0xa8cf
movq 0x10(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3340
movq %r15, %rdi
callq 0x3510
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::parseResponse(Response&)
void parseResponse(Response & response)
	{
		extractFirstLine(response);
		extractKV(response);
		extractAttri(response);	
		calcExpiration(response);
		extractLastModified(response);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0xaa34
movq %r14, %rdi
movq %rbx, %rsi
callq 0xabbe
movq %r14, %rdi
movq %rbx, %rsi
callq 0xaf42
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb150
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb328
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./LRUCache.hpp
// Function: LRUCache::put(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Response const&)
void put(const std::string & url, const Response & response) 
    {
        std::unique_lock<std::mutex> lck(mtx1);
        if(existsUrl(url))
        {
            cache.remove(url);
            kv[url] = response;
        }
        else
        {
            if(sz == capacity)
            {
                const std::string & url = cache.front(); cache.pop_front();
                kv.erase(url);
            }
            else
            {
                ++sz;
            }
            kv.insert(std::make_pair(url, response));
        }
        cache.push_back(url);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x79b8(%rip), %rax      # 0x122f0
movq %rsp, %r12
movq %rax, (%r12)
movb $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x7218
movb $0x1, 0x8(%r12)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x727c
testb %al, %al
je 0xa987
leaq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x8556
leaq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x85ea
movq %rax, %rdi
movq %r15, %rsi
callq 0xb91c
jmp 0xa9d9
movl (%rbx), %eax
cmpl 0x4(%rbx), %eax
jne 0xa9ad
leaq 0x8(%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq 0x10(%rsi), %r12
callq 0xc078
leaq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0xc0ae
jmp 0xa9b1
incl %eax
movl %eax, (%rbx)
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc336
leaq 0x20(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc1a8
leaq 0x10(%rsp), %rdi
callq 0xb9da
leaq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8d56
movq %rax, %rdi
movq %r15, %rsi
callq 0x3050
incq 0x18(%rbx)
movq %rsp, %rdi
callq 0x7202
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xaa21
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb9da
jmp 0xaa24
jmp 0xaa21
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7202
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::extractFirstLine(Response&)
void extractFirstLine(Response & response)
	{
		// first line
		const std::string header = response.header;
		for(char c : header)
		{
			if(c == '\r')
			{
				break;
			}
			else
			{
				response.first_line += c;
			}
		}

		// status code
		// eg: first line: HTTP/1.1 200 OK
		const std::string & first_line = response.first_line;
		int idx1 = first_line.find_first_of(' ');
		int idx2 = first_line.find_last_of(' ');
		response.status_code = std::stoi(first_line.substr(idx1, idx2 - idx1)); // [idx1, idx2)
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x48(%rsi), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %r14
movq %r14, %rdi
callq 0x3d20
movq 0x8(%r14), %r15
testq %r15, %r15
je 0xaa92
movq (%rsp), %r12
leaq 0x8(%rbx), %r14
xorl %ebp, %ebp
movb (%r12,%rbp), %al
cmpb $0xd, %al
je 0xaa92
movsbl %al, %esi
movq %r14, %rdi
callq 0x32c0
incq %rbp
cmpq %rbp, %r15
jne 0xaa77
leaq 0x8(%rbx), %r14
movq %r14, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x33e0
movq %rax, %r15
movq %r14, %rdi
movl $0x20, %esi
movq $-0x1, %rdx
callq 0x3570
movslq %r15d, %rdx
subl %edx, %eax
movslq %eax, %rcx
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3360
movq 0x20(%rsp), %r15
callq 0x3040
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x40(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x3400
cmpq %r15, (%r12)
je 0xab5a
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0xab66
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0xab66
testl %ecx, %ecx
jne 0xab18
movl %ebp, (%r14)
movl %eax, (%rbx)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xab35
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xab4b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29cf(%rip), %rdi      # 0xd530
callq 0x3200
leaq 0x29c3(%rip), %rdi      # 0xd530
callq 0x3420
jmp 0xab9d
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0xab80
movl %ebp, (%r14)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaba0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xaba0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xabb6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::extractAttri(Response&)
void extractAttri(Response & response)
	{
		std::unordered_map<std::string, std::string> & kv = response.kv; 

		// no-store and no-cache attribute
		if(kv.find("Cache-Control") != kv.end())
		{
			std::string cache_control = kv["Cache-Control"];
			if(cache_control.find("no-store") != -1)
			{
				response.no_store = true;
			}
			if(cache_control.find("no-cache") != -1)
			{
				response.no_cache = true;
			}
		}

		// e-tag
		if(kv.find("ETag") != kv.end())
		{
			response.etag = kv["ETag"];
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2586(%rip), %rsi      # 0xd4e7
leaq 0x258c(%rip), %rdx      # 0xd4f4
leaq 0x8(%rsp), %rdi
callq 0x3c80
leaq 0x80(%rbx), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xb8e2
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xafa0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
testq %r15, %r15
je 0xb066
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x252e(%rip), %rsi      # 0xd4e7
leaq 0x2534(%rip), %rdx      # 0xd4f4
leaq 0x28(%rsp), %rdi
callq 0x3c80
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0xc38a
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x3d20
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xb005
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x252e(%rip), %rsi      # 0xd53a
leaq 0x8(%rsp), %rdi
movl $0x8, %ecx
xorl %edx, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0xb02a
movb $0x1, 0xb8(%rbx)
leaq 0x2512(%rip), %rsi      # 0xd543
leaq 0x8(%rsp), %rdi
movl $0x8, %ecx
xorl %edx, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0xb04f
movb $0x1, 0xb9(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb066
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x24d7(%rip), %rsi      # 0xd54c
leaq 0x24d4(%rip), %rdx      # 0xd550
callq 0x3c80
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xb8e2
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb0a8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
testq %r15, %r15
je 0xb0fe
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2490(%rip), %rsi      # 0xd54c
leaq 0x248d(%rip), %rdx      # 0xd550
callq 0x3c80
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xc38a
addq $0xd8, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x31e0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb0fe
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xb114
jmp 0xb114
jmp 0xb119
jmp 0xb114
jmp 0xb119
movq %rax, %rbx
jmp 0xb147
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb147
movq 0x18(%rsp), %rsi
jmp 0xb13f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xb147
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rbx, %rdi
callq 0x3510
nop
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::calcExpiration(Response&)
void calcExpiration(Response & response)
	{
		std::unordered_map<std::string, std::string> & kv = response.kv;
		const time_t & response_time = response.cur_time;

		// get fressness time
		int fressness_time = 0;
		if(kv.find("Cache-Control") != kv.end())
		{
			const std::string & cache_control = kv["Cache-Control"];
			int idx = cache_control.find("max-age");
			if(idx != -1)
			{
				// eg: max-age=1234567
				std::string max_age_s = cache_control.substr(idx + 8);
				fressness_time = std::stoi(max_age_s);
			}
		}

		response.expiration_time = response.cur_time + fressness_time;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
leaq 0x20(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x2376(%rip), %rsi      # 0xd4e7
leaq 0x237c(%rip), %rdx      # 0xd4f4
leaq 0x10(%rsp), %rdi
callq 0x3c80
leaq 0x80(%rbx), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0xb8e2
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb1b0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
testq %r15, %r15
je 0xb2a4
leaq 0x10(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x231f(%rip), %rsi      # 0xd4e7
leaq 0x2325(%rip), %rdx      # 0xd4f4
callq 0x3c80
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0xc38a
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb1fb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x234f(%rip), %rsi      # 0xd551
xorl %r14d, %r14d
movl $0x7, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x34f0
cmpl $-0x1, %eax
je 0xb2a7
addl $0x8, %eax
movslq %eax, %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x3360
movq (%r14), %r12
callq 0x3040
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%r15)
leaq 0x30(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3400
cmpq %r12, (%r13)
je 0xb2c4
movq %rax, %r14
movslq %r14d, %rax
cmpq %r14, %rax
jne 0xb2d0
movl (%r15), %eax
cmpl $0x22, %eax
je 0xb2d0
testl %eax, %eax
jne 0xb28b
movl 0xc(%rsp), %eax
movl %eax, (%r15)
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb2a7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xb2a7
xorl %r14d, %r14d
addq 0xc0(%rbx), %r14
movq %r14, 0xc8(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2265(%rip), %rdi      # 0xd530
callq 0x3200
leaq 0x2259(%rip), %rdi      # 0xd530
callq 0x3420
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0xb2ec
movl 0xc(%rsp), %eax
movl %eax, (%r15)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x35bb
jmp 0xb320
jmp 0xb301
jmp 0xb31d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb320
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xb320
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::extractLastModified(Response&)
void extractLastModified(Response & response)
	{
		std::unordered_map<std::string, std::string> & kv = response.kv;
		if(kv.find("Last-Modified") != kv.end())
		{
			const char * time = kv["Last-Modified"].c_str();
			struct tm tm;
			memset(&tm, 0, sizeof(struct tm));
			strptime(time, "%a, %d %b %Y %H:%M:%S %z", &tm);
			response.last_modified = mktime(&tm);
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1ff4(%rip), %rsi      # 0xd33b
leaq 0x1ffa(%rip), %rdx      # 0xd348
movq %rsp, %rdi
callq 0x3c80
leaq 0x80(%rbx), %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0xb8e2
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0xb381
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
testq %r15, %r15
je 0xb400
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0x1fa8(%rip), %rsi      # 0xd33b
leaq 0x1fae(%rip), %rdx      # 0xd348
callq 0x3c80
movq %rsp, %rsi
movq %r14, %rdi
callq 0xc38a
movq (%rax), %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0xb3c3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq $0x0, 0x30(%r15)
leaq 0x2173(%rip), %rsi      # 0xd559
movq %r14, %rdi
movq %r15, %rdx
callq 0x3060
movq %r15, %rdi
callq 0x3210
movq %rax, 0xd0(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xb410
jmp 0xb42b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0xb42e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xb42e
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/./Response.hpp
// Function: Response::operator=(Response const&)
Response & operator=(const Response & rhs)
	{
		if(this != &rhs)
		{
			status_code = rhs.status_code;
			first_line = rhs.first_line;
			url = rhs.url;
			header = rhs.header;
			content = rhs.content;
			kv = rhs.kv;
			no_store = rhs.no_store;
			no_cache = rhs.no_cache;
			has_expiration = rhs.has_expiration;
			cur_time = rhs.cur_time;
			expiration_time = rhs.expiration_time;
			last_modified = rhs.last_modified;
			etag = rhs.etag;
		}
		return *this;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0xb9cf
movq %rsi, %r14
movl (%rsi), %eax
movl %eax, (%rbx)
addq $0x8, %rsi
leaq 0x8(%rbx), %rdi
callq 0x31e0
leaq 0x28(%r14), %rsi
leaq 0x28(%rbx), %rdi
callq 0x31e0
leaq 0x48(%r14), %rsi
leaq 0x48(%rbx), %rdi
callq 0x31e0
leaq 0x68(%r14), %rsi
leaq 0x68(%rbx), %rdi
callq 0xba76
movl $0x80, %esi
leaq (%rbx,%rsi), %rdi
addq %r14, %rsi
callq 0xbd0a
movb 0xb8(%r14), %al
movb %al, 0xb8(%rbx)
movb 0xb9(%r14), %al
movb %al, 0xb9(%rbx)
movb 0xba(%r14), %al
movb %al, 0xba(%rbx)
movups 0xc0(%r14), %xmm0
movups %xmm0, 0xc0(%rbx)
movq 0xd0(%r14), %rax
movq %rax, 0xd0(%rbx)
movl $0xd8, %edi
addq %rdi, %r14
addq %rbx, %rdi
movq %r14, %rsi
callq 0x31e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/dentiny[P]HTTP-Cache-Proxy/Proxy.cpp
// Function: Proxy::getResponseHeader(int, std::vector<char, std::allocator<char>>&)
int getResponseHeader(int server_fd, std::vector<char> & buffer)
	{
		int len = recv(server_fd, &buffer.data()[0], BUFFER_SIZE, 0);
	    if(len == -1)
	    {
	    	throw ProxyException("Receive header error");
	    }
	    buffer[len] = '\0';
	    return len;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, %edi
movq (%rdx), %rsi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
callq 0x3100
cmpl $-0x1, %eax
je 0xc96c
movslq %eax, %rcx
movq (%rbx), %rdx
movb $0x0, (%rdx,%rcx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x31a0
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xc24(%rip), %rsi       # 0xd5ad
leaq 0xc31(%rip), %rdx       # 0xd5c1
leaq 0x8(%rsp), %rdi
callq 0x3c80
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a7c
xorl %ebp, %ebp
leaq 0x5355(%rip), %rsi      # 0x11d08
leaq -0x5ef4(%rip), %rdx     # 0x6ac6
movq %rbx, %rdi
callq 0x34e0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xc9dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
testb %bpl, %bpl
jne 0xc9e6
jmp 0xc9ee
movq %rax, %r14
movq %rbx, %rdi
callq 0x3250
movq %r14, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/derekzwy[P]an-optimal-tcam-encoding-algorithm-for-packet-classification/cps-tss.cc
// Function: bitstring_from_rule(pc_rule*)
array<char, MAX_BITS> bitstring_from_rule(pc_rule *rule) 
{
    array<char, MAX_BITS> bitstring;
    int pos = 0;
    for(int i = 2; i < 4; i++) {
        int prefixlen;
        if(i == 0 || i == 1) 
            prefixlen = 32 - __builtin_popcount(rule->field[i].high - rule->field[i].low);
        if(i == 2 || i == 3)
            prefixlen = 16 - __builtin_popcount(rule->field[i].high - rule->field[i].low);
        if( i == 4) 
            prefixlen = 8 - __builtin_popcount(rule->field[i].high - rule->field[i].low);

        int tail = __builtin_popcount(rule->field[i].high - rule->field[i].low);

        uint32_t bits = rule->field[i].high >> tail;
        for(int j = prefixlen -1; j >= 0; j--) {
            //from high to low bits 
            if(bits & (1ULL<< j)) {
                bitstring[pos + prefixlen-j-1] = '1';
            }
            else {
                bitstring[pos + prefixlen-j-1] = '0';
            }
        }
        for(int j = 0; j< tail; j++) {
            bitstring[j+prefixlen+pos] = '*';
        }

        if(i==0 || i == 1) {
            pos += 32;
        }
        if(i==2 || i == 3) {
            pos += 16;
        }
        if(i==4)
            pos += 8;
    }
    return move(bitstring);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rax
addq $0x8, %rsi
xorl %edi, %edi
movl $0x2, %r8d
movl $0x10, %r9d
movl $0x33333333, %r10d      # imm = 0x33333333
movq %r8, %rcx
shlq $0x4, %rcx
movq 0x8(%rsi,%rcx), %rbx
movl (%rsi,%rcx), %ecx
movl %ebx, %r11d
subl %ecx, %r11d
movl %r11d, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
movl %r11d, %edx
subl %ecx, %edx
movl %edx, %ecx
andl %r10d, %ecx
shrl $0x2, %edx
andl %r10d, %edx
addl %ecx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
addl %edx, %ecx
andl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
imull $0x1010101, %ecx, %edx  # imm = 0x1010101
shrl $0x18, %edx
cmpl $0xf, %edx
ja 0x29a1
movl $0x10, %r14d
subl %edx, %r14d
movl %edx, %ecx
shrq %cl, %rbx
movl %ebx, %ebx
movl %r14d, %r14d
incq %r14
movl %edi, %r15d
leal -0x2(%r14), %ecx
movl $0x1, %r12d
shlq %cl, %r12
testl %r12d, %ebx
sete %cl
movslq %r15d, %r15
xorb $0x31, %cl
movb %cl, -0x40(%rbp,%r15)
decq %r14
incl %r15d
cmpq $0x1, %r14
ja 0x2977
testl %r11d, %r11d
je 0x29ce
cmpl $0x1, %edx
movl %edx, %ecx
adcl $0x0, %ecx
movl %r9d, %r11d
subl %edx, %r11d
movslq %r11d, %rdx
addq %rbp, %rdx
addq $-0x40, %rdx
xorl %r11d, %r11d
movb $0x2a, (%rdx,%r11)
incq %r11
cmpq %r11, %rcx
jne 0x29c1
addl $0x10, %edi
incq %r8
addl $0x10, %r9d
cmpq $0x4, %r8
jne 0x2911
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/derekzwy[P]an-optimal-tcam-encoding-algorithm-for-packet-classification/cps-tss.cc
// Function: print_bitstring(std::vector<pc_rule*, std::allocator<pc_rule*>>&)
void print_bitstring(vector<pc_rule*> &pc) 
{
    array<char, MAX_BITS> bitstring;
    int old_priority;
    for(auto rule = pc.begin(); rule != pc.end(); rule ++) {
        if((*rule)->priority != old_priority) {
            old_priority = (*rule)->priority;
            cout<<endl;
            cout<<(*rule)->priority<<endl;
        }
        bitstring = bitstring_from_rule(*rule);
        for_each(bitstring.begin(), bitstring.begin() + 32, [](char c){cout<<c<<" ";});
        cout<<endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq (%rdi), %rbx
movq %rdi, -0x38(%rbp)
cmpq 0x8(%rdi), %rbx
je 0x2b12
movq 0x75b5(%rip), %r15      # 0x9fd8
leaq -0x29(%rbp), %r12
leaq 0x461f(%rip), %r13      # 0x704d
movq (%rbx), %rsi
movl (%rsi), %eax
cmpl -0x30(%rbp), %eax
je 0x2a9c
movl %eax, -0x30(%rbp)
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rax
movl (%rax), %esi
movq %r15, %rdi
callq 0x2230
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rsi
leaq -0x58(%rbp), %rdi
callq 0x28eb
xorl %r14d, %r14d
movb -0x58(%rbp,%r14), %al
movb %al, -0x29(%rbp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2190
incq %r14
cmpq $0x20, %r14
jne 0x2aa8
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
addq $0x8, %rbx
movq -0x38(%rbp), %rax
cmpq 0x8(%rax), %rbx
jne 0x2a2e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/derekzwy[P]an-optimal-tcam-encoding-algorithm-for-packet-classification/cps-tss.cc
// Function: get_tuple(std::array<char, 32ul>&)
array<int, MAXDIMENSIONS> get_tuple(array<char, MAX_BITS> &bitstring) 
{
    array<int, MAXDIMENSIONS> field_prefixlen;
    field_prefixlen.fill(0);
    int start_pos[MAXDIMENSIONS] = {0, 32, 64, 80, 96}; 
    int bits[MAXDIMENSIONS] = {32,32,16,16,8};
    for(int i = 0; i < MAXDIMENSIONS; i++) {    
        int spos = start_pos[i];
        for(int j = spos; j < spos + bits[i]; j++) {
            if(bitstring[j] != '*') {
                field_prefixlen[i]++;
            }
        }

    }
    return move(field_prefixlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
xorl %ecx, %ecx
leaq 0x4591(%rip), %rdx      # 0x70d0
leaq 0x456a(%rip), %rdi      # 0x70b0
movslq (%rdx,%rcx,4), %r8
movslq (%rdi,%rcx,4), %r9
addq %r9, %r8
cmpb $0x2a, (%rsi,%r9)
je 0x2b5c
incl -0x20(%rbp,%rcx,4)
incq %r9
cmpq %r8, %r9
jl 0x2b51
incq %rcx
cmpq $0x5, %rcx
jne 0x2b46
movl -0x10(%rbp), %ecx
movl %ecx, 0x10(%rax)
movaps -0x20(%rbp), %xmm0
movups %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/derekzwy[P]an-optimal-tcam-encoding-algorithm-for-packet-classification/cps-tss.cc
// Function: main
int main(int argc, char *argv[])
{

    vector<pc_rule> pc_orig;
    vector<pc_rule> pc_prefix;
    vector<pc_rule*> pc;

    parseargs(argc, argv);
    loadrules(fpr, pc_orig);

    vector<pc_rule*> pc_r = remove_redund_pkg(pc_orig, pc_prefix);
    cout<<"load "<<pc_r.size()<<" rules"<<endl;

    //freopen ("tuple.txt","w",stdout);
    tuples_num(pc_r);
    freopen ("prefix.txt","w",stdout);
    print_bitstring(pc_r);
    fclose(stdout);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rbx
movaps %xmm0, (%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
callq 0x244c
movq 0x75ad(%rip), %rdi      # 0xa158
movq %rbx, %rsi
callq 0x335d
leaq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x24d3
movq 0x740d(%rip), %rdi      # 0x9fd8
leaq 0x448d(%rip), %rsi      # 0x705f
movl $0x5, %edx
callq 0x2190
movq -0x28(%rbp), %rbx
movq -0x20(%rbp), %rsi
subq %rbx, %rsi
sarq $0x3, %rsi
movq 0x73e6(%rip), %rdi      # 0x9fd8
callq 0x20c0
movq %rax, %r14
leaq 0x4464(%rip), %rsi      # 0x7065
movl $0x6, %edx
movq %rax, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq -0x28(%rbp), %rdi
callq 0x2712
movq 0x7373(%rip), %r14      # 0x9fb8
movq (%r14), %rdx
leaq 0x441d(%rip), %rdi      # 0x706c
leaq 0x4421(%rip), %rsi      # 0x7077
callq 0x2180
leaq -0x28(%rbp), %rdi
callq 0x29fa
movq (%r14), %rdi
callq 0x2150
testq %rbx, %rbx
je 0x2c79
movq %rbx, %rdi
callq 0x2130
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x2c87
callq 0x2130
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x2c95
callq 0x2130
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
jmp 0x2cbb
movq %rax, %rbx
jmp 0x2cc9
movq %rax, %rbx
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x2cbb
callq 0x2130
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x2cc9
callq 0x2130
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x2cd7
callq 0x2130
movq %rbx, %rdi
callq 0x2240
nop