LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/utils.h
// Function: int REST::Utils::parse_string<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
R parse_string(const S& str) {
  std::stringstream buf;
  buf << str;
  R val;
  buf >> val;
  return val;
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x313d0
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x319a0
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x31110
movl 0x4(%rsp), %ebx
leaq 0x8(%rsp), %rdi
callq 0x314e0
movl %ebx, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
jmp 0x37a90
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x314e0
movq %rbx, %rdi
callq 0x33510
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/router.cpp
// Function: REST::Router::print()
void Router::print() {
    std::cout << "Available routes:\n";

    for (auto& r : routes) {
      std::cout << "  " << std::get<1>(r);

      auto service = std::get<2>(r)[0];

      if (dynamic_cast< LambdaService* >(service) != nullptr) {
        std::cout << " - lambda";
      } else
      if (dynamic_cast< Resource* >(service) != nullptr) {
        std::cout << " - resource";
      } else {
        std::cout << " - service";
      }

      if (service->features.size() > 0) {
        std::cout << " (";
        int s = service->features.size();

        for (auto feature : service->features) {
          std::cout << feature->feature_name();
          if (--s)
            std::cout << ", ";
        }
        std::cout << ")";
      }

      std::cout << std::endl;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x2501b(%rip), %rbx     # 0x5ce70
leaq 0x13134(%rip), %rsi     # 0x4af90
movq %rdi, %r14
movq %rbx, %rdi
callq 0x31d30
movq 0x8(%r14), %rax
movq (%r14), %r12
leaq 0x18(%rsp), %r13
leaq 0x13150(%rip), %rbp     # 0x4afca
movq %rax, 0x8(%rsp)
cmpq 0x8(%rsp), %r12
je 0x37f9d
leaq 0x13112(%rip), %rsi     # 0x4afa3
movq %rbx, %rdi
callq 0x31d30
leaq 0x18(%r12), %rsi
movq %rax, %rdi
callq 0x319a0
movq (%r12), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x37efc
movq 0x2508f(%rip), %rsi     # 0x5cf48
movq 0x24d68(%rip), %rdx     # 0x5cc28
movq %r15, %rdi
pushq $-0x1
popq %rcx
callq 0x32100
leaq 0x130d4(%rip), %rsi     # 0x4afa6
testq %rax, %rax
jne 0x37f03
movq 0x2506a(%rip), %rsi     # 0x5cf48
movq 0x24dbb(%rip), %rdx     # 0x5cca0
movq %r15, %rdi
pushq $-0x1
popq %rcx
callq 0x32100
leaq 0x130b9(%rip), %rsi     # 0x4afb0
testq %rax, %rax
jne 0x37f03
leaq 0x130b9(%rip), %rsi     # 0x4afbc
movq %rbx, %rdi
callq 0x31d30
movq 0x20(%r15), %rax
cmpq 0x18(%r15), %rax
je 0x37f8c
leaq 0x130ab(%rip), %rsi     # 0x4afc7
movq %rbx, %rdi
movq %r12, 0x10(%rsp)
callq 0x31d30
movq 0x18(%r15), %r14
movq 0x20(%r15), %r12
movq %r12, %r15
subq %r14, %r15
shrq $0x3, %r15
decl %r15d
cmpq %r12, %r14
je 0x37f78
movq (%r14), %rsi
movq %r13, %rdi
movq (%rsi), %rax
callq *(%rax)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x319a0
movq %r13, %rdi
callq 0x33b38
subl $0x1, %r15d
jb 0x37f72
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x31d30
addq $0x8, %r14
jmp 0x37f3e
leaq 0x138f3(%rip), %rsi     # 0x4b872
movq %rbx, %rdi
callq 0x31d30
movq 0x10(%rsp), %r12
movq %rbx, %rdi
callq 0x30c80
addq $0x70, %r12
jmp 0x37e7f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
movq %rbx, %rdi
callq 0x33510
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/router.cpp
// Function: REST::Router::find(REST::Request&, int)
Service* Router::find(Request &request, int worker_id) {
    const std::string &path = request.path;

    for (const auto &route : instance()->routes) {
      std::smatch matches;
      std::regex_match(path, matches, std::get<0>(route).first);

      if (!matches.empty()) {
        const auto &params = std::get<0>(route).second;

        for (size_t i = 1; i < matches.size(); i++) {
          request.parameters[params[i-1]] = matches[i];
          request.parameters[std::to_string(i)] = matches[i];
        }

        return std::get<2>(route)[worker_id];
      }
    }

    return nullptr;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rdi), %r13
callq 0x30930
movq (%rax), %rcx
movq 0x8(%rax), %rax
movslq %ebp, %rdx
addq $0x58, %rbx
leaq 0x10(%rsp), %rbp
leaq 0x48(%rsp), %r12
movq %r13, 0x38(%rsp)
movq %rbx, 0x8(%rsp)
movq %rdx, 0x30(%rsp)
movq %rax, 0x40(%rsp)
cmpq 0x40(%rsp), %rcx
je 0x3855b
vxorps %xmm0, %xmm0, %xmm0
leaq 0x38(%rcx), %rdx
movq %rcx, (%rsp)
vmovups %ymm0, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
vzeroupper
callq 0x32e20
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rsi
movq %rcx, %rax
subq %rsi, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
movq %rax, %r15
cmpq $0x4, %rax
jb 0x3853f
pushq $0x18
popq %rbp
xorl %r13d, %r13d
pushq $0x1
popq %r14
cmpq %rcx, %rsi
je 0x38525
subq %rsi, %rcx
movq %rcx, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
addq $-0x3, %rax
cmpq %rax, %r14
jae 0x38525
addq %rbp, %rsi
movq %r12, %rdi
callq 0x33530
movq (%rsp), %rax
movq 0x58(%rax), %rsi
addq %r13, %rsi
movq 0x8(%rsp), %rdi
callq 0x30100
movq %rax, %rdi
movq %r12, %rsi
callq 0x32380
movq %r12, %rdi
callq 0x33b38
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rcx
subq %rsi, %rcx
je 0x384c6
movq %rcx, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
addq $-0x3, %rax
cmpq %r14, %rax
jbe 0x384c6
addq %rbp, %rsi
jmp 0x384cb
leaq -0x48(%rsi,%rcx), %rsi
movq %r12, %rdi
callq 0x33530
leaq 0x68(%rsp), %rbx
movq %r14, %rsi
movq %rbx, %rdi
callq 0x308e0
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x33820
movq %rax, %rdi
movq %r12, %rsi
callq 0x32380
movq %rbx, %rdi
callq 0x33b38
movq %r12, %rdi
callq 0x33b38
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rcx
incq %r14
addq $0x20, %r13
addq $0x18, %rbp
jmp 0x38447
movq (%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq (%rax), %rax
movq (%rax,%rcx,8), %r14
movq %rbp, %rdi
callq 0x31810
movq (%rsp), %rcx
addq $0x70, %rcx
cmpq $0x4, %r15
jb 0x383eb
jmp 0x3855e
xorl %r14d, %r14d
movq %r14, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3857e
jmp 0x38577
movq %rax, %rbx
jmp 0x38590
jmp 0x3857e
movq %rax, %rbx
jmp 0x3859a
leaq 0x68(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
leaq 0x48(%rsp), %rdi
callq 0x33b38
leaq 0x10(%rsp), %rdi
callq 0x31810
movq %rbx, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/router.cpp
// Function: REST::Router::match(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::function<void (REST::LambdaService*)>)
void Router::match(std::string path, LambdaService::function lambda) {
    auto r = to_regex(path, false);

    std::vector<Service*> services;
    services.resize(Worker::POOL_SIZE);
    for (int i = 0; i < Worker::POOL_SIZE; i++)
      services[i] = new LambdaService(lambda);

    path = nested_path(path);

    routes.emplace_back(r, path, services);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0x30(%rsp), %r12
movq %rdi, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, %rbx
movq %r12, %rdi
callq 0x328c0
leaq 0x50(%rsp), %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x30370
leaq 0x30(%rsp), %rdi
callq 0x33b38
movq 0x2461b(%rip), %rbp     # 0x5cc10
leaq 0x10(%rsp), %rdi
vxorps %xmm0, %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
vmovaps %xmm0, (%rdi)
movslq (%rbp), %rsi
callq 0x33490
leaq 0xa8(%rsp), %r12
xorl %r14d, %r14d
movslq (%rbp), %rax
cmpq %rax, %r14
jge 0x38665
movl $0x98, %edi
callq 0x31d40
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x339d0
movq %r13, %rdi
movq %r12, %rsi
callq 0x320b0
movq (%r13), %rax
movq 0x10(%rsp), %rcx
movq %r12, %rdi
addq -0x18(%rax), %r13
movq %r13, (%rcx,%r14,8)
callq 0x31390
incq %r14
jmp 0x3861b
movq 0x8(%rsp), %r14
leaq 0x88(%rsp), %rdi
movq %rbx, %rdx
movq %r14, %rsi
callq 0x32590
leaq 0x88(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32380
movq %r15, %rdi
callq 0x33b38
leaq 0x50(%rsp), %rsi
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x30780
leaq 0x10(%rsp), %rdi
callq 0x30520
leaq 0x50(%rsp), %rdi
callq 0x30a70
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x38705
leaq 0x30(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
jmp 0x3871c
jmp 0x38705
leaq 0xa8(%rsp), %rdi
movq %rax, %rbx
callq 0x31390
jmp 0x386fb
movq %rax, %rbx
movq %r13, %rdi
callq 0x31c00
jmp 0x38708
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30520
leaq 0x50(%rsp), %rdi
callq 0x30a70
movq %rbx, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/router.h
// Function: REST::Router::nested_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string nested_path(std::string const& path) {
      std::string np;
      for (auto& p : nested_paths)
        np += p;

      return np + path;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0x10(%rsp), %rax
movq %rdx, %r14
movq %rdi, %rbx
movq %rsp, %r12
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x18(%rsi), %r15
movq 0x20(%rsi), %r13
cmpq %r13, %r15
je 0x38a35
movq %r12, %rdi
movq %r15, %rsi
callq 0x33a00
addq $0x20, %r15
jmp 0x38a1f
movq %rsp, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x339c0
movq %rsp, %rdi
callq 0x33b38
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x38a5e
movq %rsp, %rdi
movq %rax, %rbx
callq 0x33b38
movq %rbx, %rdi
callq 0x33510
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/features/authorization.cpp
// Function: REST::Features::Authorization::feature_push()
void Authorization::feature_push() {
  std::string auth_header = request->header("Authorization", "");
  if (!auth_header.empty()) {
    if (auth_header.find("Basic") == 0) {
      std::string decoded = Utils::base64_decode(auth_header.substr(auth_header.find(" ")+1));
      size_t colon = decoded.find(":");
      authorization = std::make_pair(decoded.substr(0, colon), decoded.substr(colon+1));
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq (%rdi), %rax
movq %rdi, %rbx
movq -0x18(%rax), %rax
movq 0x10(%rdi,%rax), %r14
leaq 0x7561(%rip), %rsi      # 0x4beb1
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x30a10
leaq 0x5cc0(%rip), %rcx      # 0x4a626
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %r14, %rsi
callq 0x335f0
leaq 0x48(%rsp), %rdi
callq 0x33b38
cmpq $0x0, 0x30(%rsp)
je 0x44a8a
leaq 0x752a(%rip), %rsi      # 0x4bebf
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x33aa0
testq %rax, %rax
jne 0x44a8a
leaq 0x28(%rsp), %r14
leaq 0x65ee(%rip), %rsi      # 0x4afa4
xorl %edx, %edx
movq %r14, %rdi
callq 0x33aa0
leaq 0x1(%rax), %rdx
leaq 0x48(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r14, %rsi
callq 0x31ea0
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x33b10
leaq 0x48(%rsp), %rdi
callq 0x33b38
leaq 0x8(%rsp), %r15
leaq 0x80a4(%rip), %rsi      # 0x4ca9d
xorl %edx, %edx
movq %r15, %rdi
callq 0x33aa0
movq %rax, %r14
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x31ea0
incq %r14
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %r14, %rdx
callq 0x31ea0
leaq 0x48(%rsp), %r14
leaq 0x88(%rsp), %r15
leaq 0xa8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32360
addq $0x8, %rbx
movq %r14, %rsi
movq %rbx, %rdi
callq 0x309c0
movq %r14, %rdi
callq 0x32fe0
movq %r12, %rdi
callq 0x33b38
movq %r15, %rdi
callq 0x33b38
leaq 0x8(%rsp), %rdi
callq 0x33b38
leaq 0x28(%rsp), %rdi
callq 0x33b38
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x88(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
jmp 0x44ab8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x44ac7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x33b38
jmp 0x44ad1
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x44ae0
leaq 0x48(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
jmp 0x44aea
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/utils.cpp
// Function: REST::Utils::random_uuid[abi:cxx11]()
std::string random_uuid() {
  std::string uuid(36, ' ');

  for (int i = 0; i < 36; i++) {
    switch (i) {
      case 8:
      case 13:
      case 18:
      case 23:
        uuid[i] = '-';
        break;
      case 14:
        uuid[i] = '4';
        break;
      case 19:
        uuid[i] = DEC2HEX[rand()%4 + 8];
        break;
      default:
        uuid[i] = DEC2HEX[rand()%16];
    }
  }

  return uuid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x10(%rdi), %rax
movq %rdi, %rbx
movq %rax, (%rdi)
pushq $0x24
popq %rsi
pushq $0x20
popq %rdx
callq 0x321e0
xorl %r14d, %r14d
pushq $0x10
popq %rbp
leaq 0x72cb(%rip), %r15      # 0x4c070
leaq 0x7194(%rip), %r12      # 0x4bf40
pushq $0x4
popq %r13
cmpq $0x24, %r14
je 0x44e01
movb $0x2d, %al
leal -0xd(%r14), %ecx
cmpl $0xa, %ecx
ja 0x44dce
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movb $0x34, %al
jmp 0x44df5
cmpl $0x8, %r14d
je 0x44df5
callq 0x30650
cltd
idivl %ebp
movslq %edx, %rax
movb (%rax,%r15), %al
jmp 0x44df5
callq 0x30650
cltd
idivl %r13d
addl $0x8, %edx
movb (%rdx,%r15), %al
movq (%rbx), %rcx
movb %al, (%rcx,%r14)
incq %r14
jmp 0x44db0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/utils.cpp
// Function: REST::Utils::uri_decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string uri_decode(const std::string & sSrc) {
   // Note from RFC1630: "Sequences which start with a percent
   // sign but are not followed by two hexadecimal characters
   // (0-9, A-F) are reserved for future extension"

   const unsigned char * pSrc = (const unsigned char *)sSrc.c_str();
   const int SRC_LEN = sSrc.length();
   const unsigned char * const SRC_END = pSrc + SRC_LEN;
   // last decodable '%'
   const unsigned char * const SRC_LAST_DEC = SRC_END - 2;

   char * const pStart = new char[SRC_LEN];
   char * pEnd = pStart;

   while (pSrc < SRC_LAST_DEC)
   {
      if (*pSrc == '%')
      {
         char dec1, dec2;
         if (-1 != (dec1 = HEX2DEC[*(pSrc + 1)])
            && -1 != (dec2 = HEX2DEC[*(pSrc + 2)]))
         {
            *pEnd++ = (dec1 << 4) + dec2;
            pSrc += 3;
            continue;
         }
      }

      *pEnd++ = *pSrc++;
   }

   // the last 2- chars
   while (pSrc < SRC_END)
      *pEnd++ = *pSrc++;

   std::string sResult(pStart, pEnd);
   delete [] pStart;
   return sResult;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x8(%rsi), %rax
movq (%rsi), %r15
movq %rdi, %rbx
leaq -0x2(%r15,%rax), %r13
leaq (%r15,%rax), %r12
testq %rax, %rax
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x30060
movq %rax, %r14
leaq 0x7128(%rip), %rax      # 0x4bf70
movq %r14, %rdx
cmpq %r13, %r15
jae 0x44e9b
movb (%r15), %cl
cmpb $0x25, %cl
jne 0x44e86
movzbl 0x1(%r15), %esi
movb (%rsi,%rax), %sil
cmpb $-0x1, %sil
je 0x44e86
movzbl 0x2(%r15), %edi
movb (%rdi,%rax), %dil
cmpb $-0x1, %dil
je 0x44e86
shlb $0x4, %sil
addq $0x3, %r15
addb %sil, %dil
movb %dil, (%rdx)
jmp 0x44e8b
incq %r15
movb %cl, (%rdx)
incq %rdx
jmp 0x44e4b
movb (%r15), %al
incq %r15
movb %al, (%rdx)
incq %rdx
cmpq %r12, %r15
jb 0x44e90
leaq 0x10(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, (%rbx)
callq 0x30a20
movq %r14, %rdi
callq 0x324f0
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/utils.cpp
// Function: REST::Utils::rfc1123_datetime[abi:cxx11](long)
std::string rfc1123_datetime( time_t time ) {
  struct tm * timeinfo;
  char buffer [80];

  timeinfo = gmtime ( &time );
  strftime (buffer,80,"%a, %d %b %Y %H:%M:%S GMT",timeinfo);

  return buffer;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rsi, (%rdi)
callq 0x31950
leaq 0x719b(%rip), %rdx      # 0x4c080
leaq 0x10(%rsp), %r14
pushq $0x50
popq %rsi
movq %r14, %rdi
movq %rax, %rcx
callq 0x316a0
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30a10
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/utils.cpp
// Function: REST::Utils::base64_encode[abi:cxx11](unsigned char const*, unsigned int)
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
  std::string ret;
  int i = 0;
  int j = 0;
  unsigned char char_array_3[3];
  unsigned char char_array_4[4];

  while (in_len--) {
    char_array_3[i++] = *(bytes_to_encode++);
    if (i == 3) {
      char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
      char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
      char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
      char_array_4[3] = char_array_3[2] & 0x3f;

      for(i = 0; (i <4) ; i++)
        ret += base64_chars[char_array_4[i]];
      i = 0;
    }
  }

  if (i)
  {
    for(j = i; j < 3; j++)
      char_array_3[j] = '\0';

    char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
    char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
    char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
    char_array_4[3] = char_array_3[2] & 0x3f;

    for (j = 0; (j < i + 1); j++)
      ret += base64_chars[char_array_4[j]];

    while((i++ < 3))
      ret += '=';

  }

  return ret;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x10(%rdi), %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
xorl %r15d, %r15d
subl $0x1, %ebp
movl %r15d, %eax
jb 0x44fbc
movb (%r14), %cl
incq %r14
incl %r15d
movb %cl, 0x9(%rsp,%rax)
cmpl $0x3, %r15d
jne 0x44f3a
movb 0x9(%rsp), %al
movb 0xa(%rsp), %cl
movb 0xb(%rsp), %sil
xorl %r15d, %r15d
movl %eax, %edx
shlb $0x4, %al
shrb $0x2, %dl
movb %dl, 0xc(%rsp)
movl %ecx, %edx
shlb $0x2, %cl
shrb $0x4, %dl
orb %dl, %al
movl %esi, %edx
andb $0x3f, %sil
shrb $0x6, %dl
andb $0x3f, %al
orb %dl, %cl
movb %al, 0xd(%rsp)
andb $0x3f, %cl
movb %cl, 0xe(%rsp)
movb %sil, 0xf(%rsp)
cmpq $0x4, %r15
je 0x44f37
movzbl 0xc(%rsp,%r15), %eax
movq 0x1a2a5(%rip), %rcx     # 0x5f250
movsbl (%rcx,%rax), %esi
movq %rbx, %rdi
callq 0x31800
incq %r15
jmp 0x44f98
testl %r15d, %r15d
jne 0x44fd9
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x9(%rsp,%rax)
incq %rax
cmpl $0x2, %eax
jle 0x44fd1
movb 0x9(%rsp), %al
movb 0xa(%rsp), %cl
movb 0xb(%rsp), %sil
movslq %r15d, %r14
xorl %r12d, %r12d
movl %eax, %edx
shlb $0x4, %al
shrb $0x2, %dl
movb %dl, 0xc(%rsp)
movl %ecx, %edx
shlb $0x2, %cl
shrb $0x4, %dl
orb %dl, %al
movl %esi, %edx
andb $0x3f, %sil
shrb $0x6, %dl
andb $0x3f, %al
orb %dl, %cl
movb %al, 0xd(%rsp)
andb $0x3f, %cl
movb %cl, 0xe(%rsp)
movb %sil, 0xf(%rsp)
cmpq %r14, %r12
jg 0x45047
movzbl 0xc(%rsp,%r12), %eax
movq 0x1a21a(%rip), %rcx     # 0x5f250
movsbl (%rcx,%rax), %esi
movq %rbx, %rdi
callq 0x31800
incq %r12
jmp 0x45024
decl %r15d
pushq $0x3d
popq %rbp
incl %r15d
cmpl $0x2, %r15d
jg 0x44fc1
movq %rbx, %rdi
movl %ebp, %esi
callq 0x31800
jmp 0x4504d
jmp 0x4506a
jmp 0x4506a
movq %rbx, %rdi
movq %rax, %r14
callq 0x33b38
movq %r14, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/service.cpp
// Function: REST::Service::make_action()
void Service::make_action() {
    for (auto feature = features.cbegin(); feature != features.cend(); ++feature) {
      (*feature)->feature_push();
    }

    before();

    method(request->method);

    after();

    for (auto feature = features.crbegin(); feature != features.crend(); ++feature) {
      (*feature)->feature_pop();
    }
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %r14
movq %rdi, %rbx
cmpq 0x20(%rbx), %r14
je 0x4547e
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r14
jmp 0x45469
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x10(%rbx), %rcx
movq (%rbx), %rax
movq %rbx, %rdi
movl (%rcx), %esi
callq *0x28(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x20(%rbx), %r14
cmpq 0x18(%rbx), %r14
je 0x454b9
movq -0x8(%r14), %rdi
addq $-0x8, %r14
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x454a3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/resource.cpp
// Function: REST::Resource::method(REST::Request::Method)
void Resource::method(Request::Method method) {
  switch (method) {
    case Request::Method::POST:
      create();
      break;
    case Request::Method::GET:
      read();
      break;
    case Request::Method::PATCH:
    case Request::Method::PUT:
      update();
      break;
    case Request::Method::DELETE:
      destroy();
      break;
    default:
      throw HTTP::MethodNotAllowed();
  }
}

// Assembly:
cmpl $0x8, %esi
ja 0x455e5
leaq 0x6b6e(%rip), %rcx      # 0x4c128
movl %esi, %eax
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rdi), %rax
addq $0x10, %rax
jmpq *(%rax)
movq (%rdi), %rax
addq $0x18, %rax
jmpq *(%rax)
movq (%rdi), %rax
jmpq *(%rax)
movq (%rdi), %rax
addq $0x8, %rax
jmpq *(%rax)
pushq %rax
pushq $0x8
popq %rdi
callq 0x30c90
movq 0x17753(%rip), %rcx     # 0x5cd48
movq 0x178e4(%rip), %rsi     # 0x5cee0
movq 0x179ad(%rip), %rdx     # 0x5cfb0
movq %rax, %rdi
addq $0x10, %rcx
movq %rcx, (%rax)
callq 0x333b0
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/dispatcher.cpp
// Function: REST::Dispatcher::Dispatcher(int, int)
Dispatcher::Dispatcher(int wc, int sc) : workers_count(wc), streamers_count(sc) {
  Worker::POOL_SIZE = workers_count;
  workers.resize(workers_count);

  for (int i = 0; i < workers_count; i++) {
    workers[i] = new Worker(i, sc);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x17871(%rip), %rax     # 0x5cec0
leaq 0x10(%rdi), %rbx
vxorps %xmm0, %xmm0, %xmm0
movl %edx, %ebp
movq %rdi, %r14
addq $0x10, %rax
movq %rax, (%rdi)
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
andq $0x0, 0x20(%rdi)
movq 0x1759b(%rip), %rax     # 0x5cc10
vmovups %xmm0, 0x10(%rdi)
movl %esi, (%rax)
movslq %esi, %rsi
movq %rbx, %rdi
callq 0x30540
xorl %r15d, %r15d
movslq 0x8(%r14), %rax
cmpq %rax, %r15
jge 0x456b9
movl $0xe0, %edi
callq 0x31d40
movq %rax, %r12
movq %rax, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x314c0
movq (%rbx), %rax
movq %r12, (%rax,%r15,8)
incq %r15
jmp 0x4568a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x456d1
movq %r12, %rdi
movq %rax, %r14
callq 0x31c00
jmp 0x456d4
movq %rax, %r14
movq %rbx, %rdi
callq 0x32890
movq %r14, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/worker.cpp
// Function: REST::Worker::Worker(int, int)
Worker::Worker(int i, int sc) :
 id(i), streamers_count(sc), clients_queue(1024) {
  THREAD_NAME("rest-cpp - main thread");
  clients_count.store(0);
  server_header = "rest-cpp, worker " + std::to_string(id);
  streamers.reserve(sc);
  run();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x20(%rdi), %rax
andq $0x0, 0x8(%rdi)
leaq 0x10(%rdi), %rbx
leaq 0x48(%rdi), %r15
leaq 0x60(%rdi), %r12
vxorps %xmm0, %xmm0, %xmm0
movl %edx, %ebp
movq %rdi, %r14
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
movb $0x0, 0x20(%rdi)
movl %esi, 0x30(%rdi)
movl %edx, 0x38(%rdi)
vmovups %ymm0, 0x40(%rdi)
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
vzeroupper
callq 0x33260
callq 0x319e0
leaq 0x66f7(%rip), %rsi      # 0x4c1a3
movq %rax, %rdi
callq 0x32200
xorl %eax, %eax
xchgl %eax, (%r14)
movl 0x30(%r14), %esi
leaq 0x8(%rsp), %rdi
callq 0x325e0
leaq 0x66ec(%rip), %rsi      # 0x4c1ba
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x332a0
leaq 0x28(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x32380
movq %r13, %rdi
callq 0x33b38
leaq 0x8(%rsp), %rdi
callq 0x33b38
movslq %ebp, %rsi
movq %r15, %rdi
callq 0x326e0
movq %r14, %rdi
callq 0x30fc0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %rax, %r13
callq 0x33b38
jmp 0x45b3a
jmp 0x45b37
movq %rax, %r13
jmp 0x45b42
movq %rax, %r13
movq %r12, %rdi
callq 0x30b10
movq %r15, %rdi
addq $0x40, %r14
callq 0x301e0
movq %r14, %rdi
callq 0x32e30
movq %rbx, %rdi
callq 0x33b38
movq %r13, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/worker.cpp
// Function: REST::Worker::run()
void Worker::run() {
  should_run = true;

  thread = std::thread([this] () {
    THREAD_NAME(server_header.c_str());

    // while worker is alive
    while (should_run) {
      Request::client client;

      clients_queue.wait_dequeue(client);

      // make request
      Request request(client.handle, client.address);

      if (!should_run)
        break;

      Response response(request, streamers);
      response.headers["Server"] = server_header + ", waiting " + std::to_string(clients_count);

      try {
        request.process();

        make_action(request, response);
      } catch (HTTP::Error &e) {
        response.error(e);
      }

      response.send();

      clear_streamers();

      clients_count--;
      total_clients_count++;
    }

    std::cout << "Stopped worker #" << id << " with " << clients_count << " clients in queue (processed " << total_clients_count << ")" << std::endl;
  });
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x10(%rsp), %r14
movb $0x1, 0x34(%rdi)
movq %rdi, %rbx
andq $0x0, (%r14)
pushq $0x10
popq %rdi
callq 0x31d40
leaq 0x169b4(%rip), %rcx     # 0x5c540
leaq 0x8(%rsp), %rsi
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, (%rsi)
movq %r14, %rdi
xorl %edx, %edx
callq 0x31a90
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x45bb5
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x40, %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33150
movq %r14, %rdi
callq 0x32e30
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rsp), %rdi
movq %rax, %rbx
testq %rdi, %rdi
je 0x45bec
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/worker.cpp
// Function: REST::Worker::make_action(REST::Request&, REST::Response&)
void Worker::make_action(Request &request, Response &response) {
  Service* service = Router::find(request, id);

  if (service == nullptr)
    throw HTTP::NotFound();

  service->request = &request;
  service->response = &response;

  service->make_action();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl 0x30(%rdi), %esi
movq %r14, %rdi
movq %rdx, %rbx
callq 0x32b10
testq %rax, %rax
je 0x45c37
movq %r14, 0x10(%rax)
movq %rbx, 0x8(%rax)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32680
pushq $0x8
popq %rdi
callq 0x30c90
movq 0x17062(%rip), %rcx     # 0x5cca8
movq 0x172a3(%rip), %rsi     # 0x5cef0
movq 0x1735c(%rip), %rdx     # 0x5cfb0
movq %rax, %rdi
addq $0x10, %rcx
movq %rcx, (%rax)
callq 0x333b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/worker.cpp
// Function: REST::Worker::stop()
void Worker::stop() {
  should_run = false;
  clear_streamers();
  Request::client c;
  clients_queue.enqueue(c);
  thread.join();
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
xorl %esi, %esi
movq %rdi, %rbx
movb $0x0, 0x34(%rdi)
callq 0x31bd0
leaq 0x60(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x30460
addq $0x40, %rbx
movq %rbx, %rdi
callq 0x333a0
addq $0x90, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/readerwriterqueue/readerwriterqueue.h
// Function: moodycamel::BlockingReaderWriterQueue<REST::Request::client, 512ul>::enqueue(REST::Request::client const&)
AE_FORCEINLINE bool enqueue(T const& element)
	{
		if (inner.enqueue(element)) {
			sema.signal();
			return true;
		}
		return false;
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x31790
movl %eax, %ebp
testb %al, %al
je 0x460d0
addq $0x58, %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x32cc0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/worker.cpp
// Function: REST::Worker::clear_streamers(bool)
void Worker::clear_streamers(bool force) {
  if (streamers.size() >= streamers_count || force)  {
    for (auto& s : streamers)
      s.join();
    streamers.clear();
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x50(%rdi), %r15
movq 0x48(%rdi), %r14
movl 0x38(%rdi), %ecx
xorb $0x1, %sil
movq %r15, %rax
subq %r14, %rax
sarq $0x3, %rax
cmpq %rcx, %rax
setb %al
testb %sil, %al
jne 0x46137
movq %rdi, %rbx
addq $0x48, %rbx
cmpq %r15, %r14
je 0x4613d
movq %r14, %rdi
callq 0x333a0
addq $0x8, %r14
jmp 0x46124
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x333e0
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/readerwriterqueue/readerwriterqueue.h
// Function: moodycamel::ReaderWriterQueue<REST::Request::client, 512ul>::ceilToPow2(unsigned long)
AE_FORCEINLINE static size_t ceilToPow2(size_t x)
	{
		// From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
		--x;
		x |= x >> 1;
		x |= x >> 2;
		x |= x >> 4;
		for (size_t i = 1; i < sizeof(size_t); i <<= 1) {
			x |= x >> (i << 3);
		}
		++x;
		return x;
	}

// Assembly:
leaq -0x1(%rdi), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x20, %rax
orq %rcx, %rax
incq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/readerwriterqueue/readerwriterqueue.h
// Function: moodycamel::ReaderWriterQueue<REST::Request::client, 512ul>::make_block(unsigned long)
static Block* make_block(size_t capacity)
	{
		// Allocate enough memory for the block itself, as well as all the elements it will contain
		auto size = sizeof(Block) + std::alignment_of<Block>::value - 1;
		size += sizeof(T) * capacity + std::alignment_of<T>::value - 1;
		auto newBlockRaw = static_cast<char*>(std::malloc(size));
		if (newBlockRaw == nullptr) {
			return nullptr;
		}
		
		auto newBlockAligned = align_for<Block>(newBlockRaw);
		auto newBlockData = align_for<T>(newBlockAligned + sizeof(Block));
		return new (newBlockAligned) Block(capacity, newBlockRaw, newBlockData);
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
imulq $0x88, %rdi, %rdi
addq $0xae, %rdi
callq 0x326b0
testq %rax, %rax
je 0x4642d
movl %eax, %edx
negl %edx
movq %rax, %rcx
vxorps %xmm0, %xmm0, %xmm0
decq %rbx
andl $0x7, %edx
leaq 0xa0(%rax,%rdx), %rsi
andq $0x0, 0x80(%rax,%rdx)
addq %rdx, %rcx
vmovups %xmm0, (%rax,%rdx)
vmovups %xmm0, 0x40(%rax,%rdx)
negl %esi
andl $0x7, %esi
leaq 0xa0(%rsi,%rcx), %rsi
movq %rsi, 0x88(%rax,%rdx)
movq %rbx, 0x90(%rax,%rdx)
movq %rax, 0x98(%rax,%rdx)
jmp 0x4642f
xorl %ecx, %ecx
movq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/readerwriterqueue/atomicops.h
// Function: moodycamel::spsc_sema::LightweightSemaphore::signal(long)
void signal(ssize_t count = 1)
		    {
		    	assert(count >= 0);
		        ssize_t oldCount = m_count.fetch_add_release(count);
		        assert(oldCount >= -1);
		        if (oldCount < 0)
		        {
		            m_sema.signal(1);
		        }
		    }

// Assembly:
pushq %rax
testq %rsi, %rsi
js 0x46515
lock
xaddq %rsi, (%rdi)
cmpq $-0x2, %rsi
jle 0x46534
testq %rsi, %rsi
js 0x46508
popq %rax
retq
addq $0x8, %rdi
pushq $0x1
popq %rsi
popq %rax
jmp 0x33060
leaq 0x5ffa(%rip), %rdi      # 0x4c516
leaq 0x5ca9(%rip), %rsi      # 0x4c1cc
leaq 0x5ff7(%rip), %rcx      # 0x4c521
movl $0x22a, %edx            # imm = 0x22A
callq 0x31260
leaq 0x6028(%rip), %rdi      # 0x4c563
leaq 0x5c8a(%rip), %rsi      # 0x4c1cc
leaq 0x5fd8(%rip), %rcx      # 0x4c521
movl $0x22c, %edx            # imm = 0x22C
callq 0x31260
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/readerwriterqueue/readerwriterqueue.h
// Function: moodycamel::ReaderWriterQueue<REST::Request::client, 512ul>::ReentrantGuard::ReentrantGuard(bool&)
ReentrantGuard(bool& _inSection)
			: inSection(_inSection)
		{
			assert(!inSection);
			if (inSection) {
				throw std::runtime_error("ReaderWriterQueue does not support enqueuing or dequeuing elements from other elements' ctors and dtors");
			}

			inSection = true;
		}

// Assembly:
movq %rsi, (%rdi)
cmpb $0x1, (%rsi)
je 0x46766
movb $0x1, (%rsi)
retq
pushq %rax
leaq 0x5d0e(%rip), %rdi      # 0x4c47c
leaq 0x5a94(%rip), %rsi      # 0x4c209
leaq 0x5d0b(%rip), %rcx      # 0x4c487
movl $0x222, %edx            # imm = 0x222
callq 0x31260
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/readerwriterqueue/readerwriterqueue.h
// Function: void moodycamel::BlockingReaderWriterQueue<REST::Request::client, 512ul>::wait_dequeue<REST::Request::client>(REST::Request::client&)
void wait_dequeue(U& result)
	{
		sema.wait();
		bool success = inner.try_dequeue(result);
		AE_UNUSED(result);
		assert(success);
		AE_UNUSED(success);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x58, %rdi
movq %rsi, %rbx
callq 0x32410
movq %r14, %rdi
movq %rbx, %rsi
callq 0x321a0
testb %al, %al
je 0x467d2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5dda(%rip), %rdi      # 0x4c5b3
leaq 0x5a29(%rip), %rsi      # 0x4c209
leaq 0x5dd4(%rip), %rcx      # 0x4c5bb
movl $0x2c9, %edx            # imm = 0x2C9
callq 0x31260
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/response.cpp
// Function: REST::Response::cache(unsigned long)
void Response::cache(unsigned long t) {
  if (t > 0) {
    headers["Cache-Control"] = "max-age=" + std::to_string(t) + ", public";
    headers["Expires"] = REST::Utils::rfc1123_datetime(time(0) + t);
  } else {
    headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
je 0x478de
leaq 0x70(%rsp), %r15
movq %rsi, %r14
movq %r15, %rdi
callq 0x308e0
leaq 0x5113(%rip), %rsi      # 0x4c918
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x332a0
leaq 0x5108(%rip), %rdx      # 0x4c921
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x30490
leaq 0x50fb(%rip), %rsi      # 0x4c92a
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x30a10
addq $0x48, %rbx
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x33820
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x32380
leaq 0x50(%rsp), %rdi
callq 0x33b38
movq %r15, %rdi
callq 0x33b38
leaq 0x30(%rsp), %rdi
callq 0x33b38
leaq 0x70(%rsp), %rdi
callq 0x33b38
xorl %edi, %edi
callq 0x31b20
addq %rax, %r14
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x31bb0
leaq 0x5095(%rip), %rsi      # 0x4c938
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x30a10
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x33820
leaq 0x10(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32380
leaq 0x30(%rsp), %rdi
callq 0x33b38
movq %rbx, %rdi
jmp 0x47919
leaq 0x5045(%rip), %rsi      # 0x4c92a
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x30a10
addq $0x48, %rbx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x33820
leaq 0x5034(%rip), %rsi      # 0x4c940
movq %rax, %rdi
callq 0x33930
leaq 0x10(%rsp), %rdi
callq 0x33b38
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x47985
leaq 0x30(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
jmp 0x4797b
jmp 0x47978
leaq 0x50(%rsp), %rdi
movq %rax, %rbx
callq 0x33b38
jmp 0x47953
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33b38
jmp 0x47962
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33b38
jmp 0x47971
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x47980
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33b38
movq %rbx, %rdi
callq 0x33510
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::empty() const
bool empty() const noexcept
    {
        switch (m_type)
        {
            case value_t::null:
            {
                // null values are empty
                return true;
            }

            case value_t::array:
            {
                assert(m_value.array != nullptr);
                return m_value.array->empty();
            }

            case value_t::object:
            {
                assert(m_value.object != nullptr);
                return m_value.object->empty();
            }

            default:
            {
                // all other types are nonempty
                return false;
            }
        }
    }

// Assembly:
pushq %rax
movzbl (%rdi), %eax
testl %eax, %eax
je 0x47d8f
cmpl $0x1, %eax
je 0x47d7c
cmpl $0x2, %eax
jne 0x47d93
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x47db6
movq (%rax), %rcx
cmpq 0x8(%rax), %rcx
jmp 0x47d8a
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x47d97
cmpq $0x0, 0x28(%rax)
sete %al
jmp 0x47d95
movb $0x1, %al
jmp 0x47d95
xorl %eax, %eax
popq %rcx
retq
leaq 0x2ddd(%rip), %rdi      # 0x4ab7b
leaq 0x24a4(%rip), %rsi      # 0x4a249
leaq 0x50a2(%rip), %rcx      # 0x4ce4e
movl $0xfe3, %edx            # imm = 0xFE3
callq 0x31260
leaq 0x2f37(%rip), %rdi      # 0x4acf4
leaq 0x2485(%rip), %rsi      # 0x4a249
leaq 0x5083(%rip), %rcx      # 0x4ce4e
movl $0xfdd, %edx            # imm = 0xFDD
callq 0x31260
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::dump(int) const
string_t dump(const int indent = -1) const
    {
        std::stringstream ss;

        if (indent >= 0)
        {
            dump(ss, true, static_cast<unsigned int>(indent));
        }
        else
        {
            dump(ss, false, 0);
        }

        return ss.str();
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movl %edx, %ebp
movq %rsi, %r14
callq 0x313d0
xorl %edx, %edx
testl %ebp, %ebp
movl %ebp, %eax
leaq 0x18(%rsp), %rsi
setns %dl
sarl $0x1f, %eax
andnl %ebp, %eax, %ecx
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x30120
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x32fa0
leaq 0x8(%rsp), %rdi
callq 0x314e0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x314e0
movq %rbx, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::size() const
size_type size() const noexcept
    {
        switch (m_type)
        {
            case value_t::null:
            {
                // null values are empty
                return 0;
            }

            case value_t::array:
            {
                assert(m_value.array != nullptr);
                return m_value.array->size();
            }

            case value_t::object:
            {
                assert(m_value.object != nullptr);
                return m_value.object->size();
            }

            default:
            {
                // all other types have size 1
                return 1;
            }
        }
    }

// Assembly:
pushq %rax
movzbl (%rdi), %eax
testl %eax, %eax
je 0x48676
cmpl $0x1, %eax
je 0x48664
cmpl $0x2, %eax
jne 0x48673
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x48697
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x4, %rax
jmp 0x48676
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x48678
movq 0x28(%rax), %rax
jmp 0x48676
pushq $0x1
popq %rax
popq %rcx
retq
leaq 0x24fc(%rip), %rdi      # 0x4ab7b
leaq 0x1bc3(%rip), %rsi      # 0x4a249
leaq 0x45d0(%rip), %rcx      # 0x4cc5d
movl $0x101d, %edx           # imm = 0x101D
callq 0x31260
leaq 0x2656(%rip), %rdi      # 0x4acf4
leaq 0x1ba4(%rip), %rsi      # 0x4a249
leaq 0x45b1(%rip), %rcx      # 0x4cc5d
movl $0x1017, %edx           # imm = 0x1017
callq 0x31260
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::operator[](unsigned long) const
const_reference operator[](size_type idx) const
    {
        // at only works for arrays
        if (is_array())
        {
            assert(m_value.array != nullptr);
            return m_value.array->operator[](idx);
        }
        else
        {
            throw std::domain_error("cannot use operator[] with " + type_name());
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
cmpb $0x2, (%rdi)
movq %rdi, %r14
jne 0x486e2
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x48734
shlq $0x4, %rsi
addq (%rax), %rsi
movq %rsi, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x30c90
movq %rax, %rbx
movq %rsp, %rdi
movq %r14, %rsi
callq 0x32730
leaq 0x209b(%rip), %rsi      # 0x4a79a
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x332a0
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x32320
xorl %ebp, %ebp
movq 0x145ab(%rip), %rsi     # 0x5ccd0
movq 0x14684(%rip), %rdx     # 0x5cdb0
movq %rbx, %rdi
callq 0x333b0
leaq 0x25b9(%rip), %rdi      # 0x4acf4
leaq 0x1b07(%rip), %rsi      # 0x4a249
leaq 0x4602(%rip), %rcx      # 0x4cd4b
movl $0xb96, %edx            # imm = 0xB96
callq 0x31260
leaq 0x20(%rsp), %rdi
movq %rax, %r14
callq 0x33b38
jmp 0x48768
movq %rax, %r14
movb $0x1, %bpl
movq %rsp, %rdi
callq 0x33b38
testb %bpl, %bpl
jne 0x4877a
jmp 0x48782
movq %rax, %r14
movq %rbx, %rdi
callq 0x31400
movq %r14, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/server.cpp
// Function: REST::Server::Server(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, REST::Dispatcher*)
Server::Server(std::string path, Dispatcher* d) : dispatcher(d) {
  srand(time(0));
  signal(SIGPIPE, SIG_IGN);
  Router::instance();

  unlink(path.c_str());
  struct sockaddr_un local;
  handle = socket(AF_UNIX, SOCK_STREAM, 0);
  local.sun_family = AF_UNIX;
  strcpy(local.sun_path, path.c_str());

  if (bind(handle, (struct sockaddr *)&local, strlen(local.sun_path) + sizeof(local.sun_family) + 1) == -1)
    throw PortInUseError();

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, (%rdi)
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, 0x8(%rdi)
xorl %edi, %edi
callq 0x31b20
movl %eax, %edi
callq 0x31c50
pushq $0xd
popq %rdi
pushq $0x1
popq %rsi
callq 0x32280
callq 0x30930
movq (%rbx), %rdi
callq 0x30c00
pushq $0x1
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x30590
movl %eax, 0x48(%r14)
leaq 0x4(%rsp), %r14
movl %eax, %ebp
movw $0x1, -0x2(%r14)
movq %r14, %rdi
movq (%rbx), %rsi
callq 0x31b70
movq %r14, %rdi
callq 0x30b60
leal 0x3(%rax), %edx
leaq 0x2(%rsp), %rsi
movl %ebp, %edi
callq 0x302b0
cmpl $-0x1, %eax
je 0x48dcb
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x30c90
movq 0x13e56(%rip), %rcx     # 0x5cc30
movq 0x13ef7(%rip), %rsi     # 0x5ccd8
movq 0x141c8(%rip), %rdx     # 0x5cfb0
movq %rax, %rdi
addq $0x10, %rcx
movq %rcx, (%rax)
callq 0x333b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/server.cpp
// Function: REST::Server::Server(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, REST::Dispatcher*)
Server::Server(std::string address, int port, Dispatcher* d) : dispatcher(d) {
  srand(time(0));
  signal(SIGPIPE, SIG_IGN);
  Router::instance();
  int status;

  memset(&host_info, 0, sizeof(host_info));

  host_info.ai_family = AF_UNSPEC;
  host_info.ai_socktype = SOCK_STREAM;

  status = getaddrinfo(address.c_str(), std::to_string(port).c_str(), &host_info, &host_info_list);
  if (status != 0)
    throw AddressResolvingError();

  handle = socket(host_info_list->ai_family, host_info_list->ai_socktype, host_info_list->ai_protocol);
  if (handle == -1)
    throw SocketCreationError();

  int yes = 1;
  status = setsockopt(handle, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
  status = bind(handle, host_info_list->ai_addr, host_info_list->ai_addrlen);
  if (status == -1)
    throw PortInUseError();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, (%rdi)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x1, 0x8(%rdi)
xorl %edi, %edi
callq 0x31b20
movl %eax, %edi
callq 0x31c50
pushq $0xd
popq %rdi
pushq $0x1
popq %rsi
callq 0x32280
callq 0x30930
vxorps %xmm0, %xmm0, %xmm0
movq %rsp, %r12
leaq 0x10(%rbx), %r15
movq %r12, %rdi
movl %ebp, %esi
vmovups %ymm0, 0x10(%rbx)
vmovups %ymm0, 0x20(%rbx)
movl $0x1, 0x18(%rbx)
movq (%r14), %r14
vzeroupper
callq 0x325e0
movq (%r12), %rsi
leaq 0x40(%rbx), %rcx
movq %r14, %rdi
movq %r15, %rdx
callq 0x32450
movq %rsp, %rdi
movl %eax, %ebp
callq 0x33b38
testl %ebp, %ebp
jne 0x48ed7
movq 0x40(%rbx), %rax
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x30590
movl %eax, 0x48(%rbx)
cmpl $-0x1, %eax
je 0x48eef
movq %rsp, %rcx
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x33570
movq 0x40(%rbx), %rax
movl 0x48(%rbx), %edi
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x302b0
cmpl $-0x1, %eax
je 0x48f07
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x30c90
movq 0x13e92(%rip), %rcx     # 0x5cd78
movq 0x13e23(%rip), %rsi     # 0x5cd10
jmp 0x48f1d
pushq $0x8
popq %rdi
callq 0x30c90
movq 0x13dba(%rip), %rcx     # 0x5ccb8
movq 0x1403b(%rip), %rsi     # 0x5cf40
jmp 0x48f1d
pushq $0x8
popq %rdi
callq 0x30c90
movq 0x13d1a(%rip), %rcx     # 0x5cc30
movq 0x13dbb(%rip), %rsi     # 0x5ccd8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x14085(%rip), %rdx     # 0x5cfb0
movq %rax, %rdi
callq 0x333b0
movq %rsp, %rdi
movq %rax, %rbx
callq 0x33b38
movq %rbx, %rdi
callq 0x33510
// File: /workspace/github_cpp_makefile_star2_O2/alfanick[P]rest-cpp/src/rest/server.cpp
// Function: REST::Server::~Server()
Server::~Server() {
  is_running = false;

  delete dispatcher;

  freeaddrinfo(host_info_list);
  close(handle);

#ifdef SERVER_PATH
  unlink(STR(SERVER_PATH));
#endif
}

// Assembly:
pushq %rbx
movb $0x0, 0x8(%rdi)
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x48f5c
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rdi
callq 0x32550
movl 0x48(%rbx), %edi
callq 0x33a20
popq %rbx
retq
movq %rax, %rdi
callq 0x34aa2
nop