LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/./include/segtree.hpp
// Function: SegmentTree::_query_max(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
pui_t
    _query_max(uint_t ni, uint_t b, uint_t e, uint_t qf, uint_t ql) {
        // printf("_query_max(%u, %u, %u, %u, %u)\n", ni, b, e, qf, ql);
        if (b > e || qf > e || ql < b) {
            // printf("[1] Returning: (-1, -1)\n");
            return pui_t(minus_one, minus_one);
        }

        if (b >= qf && e <= ql) {
            // printf("[2] Returning: (%d, %d)\n", this->repr[ni].first, this->repr[ni].second);
            return this->repr[ni];
        }

        uint_t m = b + (e-b) / 2;
        pui_t lhs = this->_query_max(ni*2 + 1, b, m, qf, ql);
        pui_t rhs = this->_query_max(ni*2 + 2, m+1, e, qf, ql);

        // printf("lhs.second is minus_one: %d, rhs.second is minus_one: %d\n", lhs.second == minus_one, rhs.second == minus_one);

        if (lhs.second == minus_one) {
            // printf("[3] Returning: (%d, %d)\n", rhs.first, rhs.second);
            return rhs;
        }
        else if (rhs.second == minus_one) {
            // printf("[4] Returning: (%d, %d)\n", lhs.first, lhs.second);
            return lhs;
        }
        else {
            pui_t &tmp = lhs.first > rhs.first ? lhs : rhs;
            // printf("[5] Returning: (%d, %d)\n", tmp.first, tmp.second);
            return tmp;
        }

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
movl %edx, %r12d
movl %esi, %r13d
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
movl %ecx, %r15d
subl %edx, %r15d
setb %al
cmpl %ecx, %r8d
seta %cl
cmpl %edx, %r9d
setb %dl
orb %al, %dl
orb %cl, %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0xa09d
movl %r9d, %ebx
movl %r8d, %ebp
cmpl %r8d, %r12d
setb %al
cmpl %r9d, %r14d
seta %cl
orb %al, %cl
je 0xa090
shrl %r15d
leal (%r15,%r12), %ecx
leal 0x1(,%r13,2), %esi
movq %rdi, 0x10(%rsp)
movl %r12d, %edx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x9fc8
movq %rax, 0x8(%rsp)
leal 0x2(,%r13,2), %esi
leal (%r15,%r12), %edx
incl %edx
movq 0x10(%rsp), %rdi
movl %r14d, %ecx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x9fc8
movq 0x8(%rsp), %rdx
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
leaq -0x1(%rsi), %rcx
cmpq %rcx, %rdx
ja 0xa09a
cmpq %rcx, %rax
jbe 0xa0b1
andq %rdx, %rsi
movq %rdx, %rax
jmp 0xa09d
movl %r13d, %eax
movq (%rdi), %rcx
movq (%rcx,%rax,8), %rax
andq %rax, %rsi
movl %eax, %eax
orq %rsi, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %eax, %edx
cmovaq %rdx, %rax
jmp 0xa09a
nop
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/src/main.cpp
// Function: InputLineParser::on_snippet(char const*, int)
void
    on_snippet(const char *data, int len) {
        if (len && this->psnippet_proxy) {
            const char *base = this->mem_base + this->buff_offset + 
                (data - this->buff);
            DCERR("on_snippet::base: "<<(void*)base<<", len: "<<len<<"\n");
            this->psnippet_proxy->assign(base, len);
        }
    }

// Assembly:
testl %edx, %edx
je 0xb15a
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0xb15a
movq 0x8(%rdi), %rcx
addq 0x18(%rdi), %rcx
subq 0x10(%rdi), %rsi
addq %rcx, %rsi
movq %rsi, (%rax)
movl %edx, 0x8(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: get_option_index
static int get_option_index(const char *name) {
  int i;

  for (i = 0; config_options[i] != NULL; i += ENTRIES_PER_CONFIG_OPTION) {
    if (strcmp(config_options[i], name) == 0 ||
        strcmp(config_options[i + 1], name) == 0) {
      return i / ENTRIES_PER_CONFIG_OPTION;
    }
  }
  return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
xorl %r14d, %r14d
leaq 0xece7(%rip), %r12      # 0x1a5d0
pushq $-0x1
popq %rbx
movq (%r12,%r14,8), %rdi
testq %rdi, %rdi
je 0xb924
movq %r15, %rsi
callq 0x56c0
testl %eax, %eax
je 0xb918
movq 0x8(%r12,%r14,8), %rdi
movq %r15, %rsi
callq 0x56c0
testl %eax, %eax
je 0xb918
addq $0x3, %r14
jmp 0xb8ec
pushq $0x3
popq %rcx
movl %r14d, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: get_header
static const char *get_header(const struct mg_request_info *ri,
                              const char *name) {
  int i;

  for (i = 0; i < ri->num_headers; i++)
    if (!mg_strcasecmp(name, ri->http_headers[i].name))
      return ri->http_headers[i].value;

  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movl 0x4c(%rdi), %r12d
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
movq %rsi, %r15
shlq $0x4, %r12
addq $0x10, %r12
xorl %ecx, %ecx
leaq 0x10(%rcx), %r13
cmpq %r13, %r12
je 0xb988
movq 0x50(%r14,%rcx), %rsi
movq %r15, %rdi
callq 0xd3cf
movq %r13, %rcx
testl %eax, %eax
jne 0xb966
movq 0x48(%r14,%r13), %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_read
int mg_read(struct mg_connection *conn, void *buf, size_t len) {
  int n, buffered_len, nread;
  const char *buffered;

  assert((conn->content_len == -1 && conn->consumed_content == 0) ||
         conn->consumed_content <= conn->content_len);
  DEBUG_TRACE(("%p %zu %lld %lld", buf, len,
               conn->content_len, conn->consumed_content));
  nread = 0;
  if (conn->consumed_content < conn->content_len) {

    // Adjust number of bytes to read.
    int64_t to_read = conn->content_len - conn->consumed_content;
    if (to_read < (int64_t) len) {
      len = (int) to_read;
    }

    // How many bytes of data we have buffered in the request buffer?
    buffered = conn->buf + conn->request_len + conn->consumed_content;
    buffered_len = conn->data_len - conn->request_len;
    assert(buffered_len >= 0);

    // Return buffered data back if we haven't done that yet.
    if (conn->consumed_content < (int64_t) buffered_len) {
      buffered_len -= (int) conn->consumed_content;
      if (len < (size_t) buffered_len) {
        buffered_len = len;
      }
      memcpy(buf, buffered, (size_t)buffered_len);
      len -= buffered_len;
      buf = (char *) buf + buffered_len;
      conn->consumed_content += buffered_len;
      nread = buffered_len;
    }

    // We have returned all buffered data. Read new data from the remote socket.
    while (len > 0) {
      n = pull(NULL, conn->client.sock, conn->ssl, (char *) buf, (int) len);
      if (n <= 0) {
        break;
      }
      buf = (char *) buf + n;
      conn->consumed_content += n;
      nread += n;
      len -= n;
    }
  }
  return nread;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x4b8(%rdi), %rcx
movq 0x4c0(%rdi), %rax
xorl %r12d, %r12d
subq %rax, %rcx
jle 0xba4a
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rdx, %rcx
movslq %ecx, %r15
cmovgeq %rdx, %r15
movslq 0x4d4(%rdi), %rsi
movslq 0x4d8(%rdi), %rcx
subq %rsi, %rcx
xorl %r12d, %r12d
cmpq %rcx, %rax
jge 0xba45
addq 0x4c8(%r14), %rsi
addq %rax, %rsi
subl %eax, %ecx
movslq %ecx, %r12
cmpq %r12, %r15
cmovbl %r15d, %r12d
movslq %r12d, %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x53a0
subq %r13, %r15
addq %r13, %rbx
addq %r13, 0x4c0(%r14)
jmp 0xba45
movl 0x470(%r14), %esi
movq 0x460(%r14), %rdx
xorl %edi, %edi
movq %rbx, %rcx
movl %r15d, %r8d
callq 0xba57
testl %eax, %eax
jle 0xba4a
movl %eax, %ecx
addq %rcx, 0x4c0(%r14)
addq %rcx, %rbx
addl %eax, %r12d
subq %rcx, %r15
testq %r15, %r15
jne 0xba14
movl %r12d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: pull
static int pull(FILE *fp, SOCKET sock, SSL *ssl, char *buf, int len) {
  int nread;

  if (ssl != NULL) {
    nread = SSL_read(ssl, buf, len);
  } else if (fp != NULL) {
    // Use read() instead of fread(), because if we're reading from the CGI
    // pipe, fread() may block until IO buffer is filled up. We cannot afford
    // to block and must pass all read bytes immediately to the client.
    nread = read(fileno(fp), buf, (size_t) len);
    if (ferror(fp))
      nread = -1;
  } else {
    nread = recv(sock, buf, (size_t) len, 0);
  }

  return nread;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %r8d, %ebp
movq %rcx, %rbx
testq %rdx, %rdx
je 0xba7b
movq 0xedbb(%rip), %rax      # 0x1a828
movq %rdx, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
movq %rdi, %r14
testq %rdi, %rdi
je 0xbaaf
movq %r14, %rdi
callq 0x54e0
movslq %ebp, %rdx
movl %eax, %edi
movq %rbx, %rsi
callq 0x5710
movq %rax, %rbx
movq %r14, %rdi
callq 0x5960
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
orl %ebx, %eax
jmp 0xbabe
movslq %ebp, %rdx
movl %esi, %edi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x5160
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: push
static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf,
                    int64_t len) {
  int64_t sent;
  int n, k;

  sent = 0;
  while (sent < len) {

    /* How many bytes we send in this iteration */
    k = len - sent > INT_MAX ? INT_MAX : (int) (len - sent);

    if (ssl != NULL) {
      n = SSL_write(ssl, buf + sent, k);
    } else if (fp != NULL) {
      n = fwrite(buf + sent, 1, (size_t)k, fp);
      if (ferror(fp))
        n = -1;
    } else {
      n = send(sock, buf + sent, (size_t)k, 0);
    }

    if (n < 0)
      break;

    sent += n;
  }

  return sent;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, 0xc(%rsp)
movq %rdi, 0x10(%rsp)
xorl %eax, %eax
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %rax, %r13
movq %rbx, %rdx
subq %rax, %rdx
jle 0xbb8a
cmpq %r12, %rdx
cmovgeq %r12, %rdx
testq %r15, %r15
je 0xbb2a
leaq (%r14,%r13), %rsi
movq %r15, %rdi
callq *0xed12(%rip)           # 0x1a838
movl %eax, %ebp
jmp 0xbb7d
movq %r14, %r12
leaq (%r14,%r13), %rsi
movslq %edx, %rdx
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0xbb66
movq %rsi, %rdi
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x59c0
movq %rax, %rbp
movq %r14, %rdi
callq 0x5960
testl %eax, %eax
movq %r12, %r14
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
je 0xbb7d
jmp 0xbb8a
movl 0xc(%rsp), %edi
xorl %ecx, %ecx
callq 0x5250
movq %rax, %rbp
movq %r12, %r14
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movl %ebp, %eax
addq %r13, %rax
testl %ebp, %ebp
jns 0xbb02
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_printf
int mg_printf(struct mg_connection *conn, const char *fmt, ...) {
  char buf[BUFSIZ];
  int len;
  va_list ap;

  va_start(ap, fmt);
  len = mg_vsnprintf(conn, buf, sizeof(buf), fmt, ap);
  va_end(ap);

  return mg_write(conn, buf, (size_t)len);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xbbfc
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r8
movq %rsi, 0x10(%r8)
leaq 0x20f0(%rsp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r8)
leaq 0xd0(%rsp), %r14
movl $0x2000, %edx           # imm = 0x2000
movq %r14, %rsi
movq %r10, %rcx
callq 0xbc4d
movslq %eax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbac3
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_vsnprintf
static int mg_vsnprintf(struct mg_connection *conn, char *buf, size_t buflen,
                        const char *fmt, va_list ap) {
  int n;

  if (buflen == 0)
    return 0;

  n = vsnprintf(buf, buflen, fmt, ap);

  if (n < 0) {
    cry(conn, "vsnprintf error");
    n = 0;
  } else if (n >= (int) buflen) {
    cry(conn, "truncating vsnprintf buffer: [%.*s]",
        n > 200 ? 200 : n, buf);
    n = (int) buflen - 1;
  }
  buf[n] = '\0';

  return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xbca4
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x52c0
testl %eax, %eax
js 0xbca8
movl %eax, %ebp
cmpl %r14d, %eax
jl 0xbcbb
movl $0xc8, %edx
cmpl %edx, %ebp
cmovbl %ebp, %edx
leaq 0x6e58(%rip), %rsi      # 0x12ae7
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xcd67
decl %r14d
movl %r14d, %ebp
jmp 0xbcbb
xorl %ebp, %ebp
jmp 0xbcc2
leaq 0x6e28(%rip), %rsi      # 0x12ad7
xorl %ebp, %ebp
movq %r15, %rdi
xorl %eax, %eax
callq 0xcd67
movslq %ebp, %rax
movb $0x0, (%rbx,%rax)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_get_var
int mg_get_var(const char *buf, size_t buf_len, const char *name,
               char *dst, size_t dst_len) {
  const char *p, *e, *s;
  size_t name_len, len;

  name_len = strlen(name);
  e = buf + buf_len;
  len = -1;
  dst[0] = '\0';

  // buf is "var1=val1&var2=val2...". Find variable first
  for (p = buf; p != NULL && p + name_len < e; p++) {
    if ((p == buf || p[-1] == '&') && p[name_len] == '=' &&
        !mg_strncasecmp(name, p, name_len)) {

      // Point p to variable value
      p += name_len + 1;

      // Point s to the end of the value
      s = (const char *) memchr(p, '&', (size_t)(e - p));
      if (s == NULL) {
        s = e;
      }
      assert(s >= p);

      // Decode variable into destination buffer
      if ((size_t) (s - p) < dst_len) {
        len = url_decode(p, (size_t)(s - p), dst, dst_len, 1);
      }
      break;
    }
  }

  return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rdx, %rdi
callq 0x51e0
movq %rax, %r13
movq %r15, 0x8(%rsp)
addq %r14, %r15
movq %r12, (%rsp)
movb $0x0, (%r12)
leaq (%r14,%rax), %r12
xorl %ebp, %ebp
movq %r14, %rsi
addq %rbp, %rsi
je 0xbd47
leaq (%r12,%rbp), %rax
cmpq %r15, %rax
jae 0xbd47
testq %rbp, %rbp
je 0xbd2e
cmpb $0x26, -0x1(%r14,%rbp)
jne 0xbd42
cmpb $0x3d, (%rax)
jne 0xbd42
movq %rbx, %rdi
movq %r13, %rdx
callq 0xbdab
testl %eax, %eax
je 0xbd59
incq %rbp
jmp 0xbd10
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r12,%rbp), %rbx
incq %rbx
notq %r13
addq 0x8(%rsp), %r13
subq %rbp, %r13
pushq $0x26
popq %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x5530
testq %rax, %rax
cmovneq %rax, %r15
notq %r12
addq %r15, %r12
subq %rbp, %r12
movq 0x10(%rsp), %rcx
cmpq %rcx, %r12
pushq $-0x1
popq %rax
jae 0xbd4a
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
movq (%rsp), %rdx
callq 0xbdff
jmp 0xbd4a
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_strncasecmp
static int mg_strncasecmp(const char *s1, const char *s2, size_t len) {
  int diff = 0;

  if (len > 0)
    do {
      diff = lowercase(s1++) - lowercase(s2++);
    } while (diff == 0 && s1[-1] != '\0' && --len > 0);

  return diff;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xbdf0
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
decq %rbx
movq %r15, %rdi
callq 0xd409
movl %eax, %ebp
movq %r14, %rdi
callq 0xd409
subl %eax, %ebp
jne 0xbdf2
subq $0x1, %rbx
setb %al
cmpb $0x0, (%r15)
je 0xbdf0
incq %r14
incq %r15
testb %al, %al
je 0xbdc3
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: url_decode
static size_t url_decode(const char *src, size_t src_len, char *dst,
                         size_t dst_len, int is_form_url_encoded) {
  size_t i, j;
  int a, b;
#define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W')

  for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) {
    if (src[i] == '%' &&
        isxdigit(* (const unsigned char *) (src + i + 1)) &&
        isxdigit(* (const unsigned char *) (src + i + 2))) {
      a = tolower(* (const unsigned char *) (src + i + 1));
      b = tolower(* (const unsigned char *) (src + i + 2));
      dst[j] = (char) ((HEXTOI(a) << 4) | HEXTOI(b));
      i += 2;
    } else if (is_form_url_encoded && src[i] == '+') {
      dst[j] = ' ';
    } else {
      dst[j] = src[i];
    }
  }

  dst[j] = '\0'; /* Null-terminate the destination */

  return j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x14(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, 0x20(%rsp)
decq %rcx
movq %rcx, 0x18(%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
cmpq 0x20(%rsp), %rbx
jae 0xbef1
cmpq 0x18(%rsp), %rbp
jae 0xbef1
movb (%rdi,%rbx), %r12b
cmpb $0x25, %r12b
jne 0xbec5
movq %rdi, %r13
callq 0x5510
movq %r13, %rdi
movq (%rax), %r14
movzbl 0x1(%r13,%rbx), %r15d
testb $0x10, 0x1(%r14,%r15,2)
je 0xbedd
movzbl 0x2(%rdi,%rbx), %eax
testb $0x10, 0x1(%r14,%rax,2)
je 0xbedd
movq %rax, %r12
callq 0x50d0
movq %r13, %rdi
movq (%rax), %rax
movslq (%rax,%r15,4), %rcx
movslq (%rax,%r12,4), %rax
movzwl (%r14,%rcx,2), %edx
xorl %esi, %esi
btl $0xb, %edx
setae %sil
leal (%rsi,%rsi,8), %edx
addl %ecx, %edx
shll $0x4, %edx
movzwl (%r14,%rax,2), %ecx
leal 0xd0(%rax), %esi
addl $0xa9, %eax
btl $0xb, %ecx
cmovbl %esi, %eax
orl %edx, %eax
movq 0x8(%rsp), %rcx
movb %al, (%rcx,%rbp)
addq $0x2, %rbx
jmp 0xbee6
cmpl $0x0, 0x14(%rsp)
je 0xbedd
cmpb $0x2b, %r12b
jne 0xbedd
movq 0x8(%rsp), %rax
movb $0x20, (%rax,%rbp)
jmp 0xbee6
movq 0x8(%rsp), %rax
movb %r12b, (%rax,%rbp)
incq %rbx
incq %rbp
jmp 0xbe28
movq 0x8(%rsp), %rax
movb $0x0, (%rax,%rbp)
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_get_cookie
int mg_get_cookie(const struct mg_connection *conn, const char *cookie_name,
                  char *dst, size_t dst_size) {
  const char *s, *p, *end;
  int name_len, len = -1;

  dst[0] = '\0';
  if ((s = mg_get_header(conn, "Cookie")) == NULL) {
    return 0;
  }

  name_len = strlen(cookie_name);
  end = s + strlen(s);

  for (; (s = strstr(s, cookie_name)) != NULL; s += name_len)
    if (s[name_len] == '=') {
      s += name_len + 1;
      if ((p = strchr(s, ' ')) == NULL)
        p = end;
      if (p[-1] == ';')
        p--;
      if (*s == '"' && p[-1] == '"' && p > s + 1) {
        s++;
        p--;
      }
      if ((size_t) (p - s) < dst_size) {
        len = (p - s) + 1;
        mg_strlcpy(dst, s, (size_t)len);
      }
      break;
    }

  return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r15
movb $0x0, (%rdx)
addq $0x8, %rdi
leaq 0x683b(%rip), %rsi      # 0x1276c
callq 0xb940
testq %rax, %rax
je 0xbff2
movq %rax, %r14
movq %r12, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r15, %rdi
callq 0x51e0
movq %rax, %r13
movq %r14, %rdi
callq 0x51e0
movq %rax, %r12
addq %r14, %r12
movq %r13, %rbx
shlq $0x20, %rbx
movslq %r13d, %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x50f0
testq %rax, %rax
je 0xbff6
movq %rax, %r13
leaq (%rax,%rbp), %r14
cmpb $0x3d, (%rax,%rbp)
jne 0xbf6f
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
sarq $0x20, %rbx
movq %r13, %r15
addq %rbx, %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x51b0
testq %rax, %rax
cmovneq %rax, %r12
leaq -0x1(%r12), %r14
cmpb $0x3b, -0x1(%r12)
cmovneq %r12, %r14
cmpb $0x22, (%r13,%rbx)
jne 0xbffb
cmpb $0x22, -0x1(%r14)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
jne 0xc005
leaq -0x1(%r14), %rax
leaq 0x1(%r15), %rcx
cmpq %rcx, %r14
cmovaq %rax, %r14
cmovaq %rcx, %r15
jmp 0xc005
xorl %eax, %eax
jmp 0xc021
pushq $-0x1
popq %rax
jmp 0xc021
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
pushq $-0x1
popq %rax
subq %r15, %r14
cmpq %rdx, %r14
jae 0xc021
incl %r14d
movslq %r14d, %rdx
movq %r15, %rsi
callq 0xc030
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_stop
void mg_stop(struct mg_context *ctx) {
  ctx->stop_flag = 1;

  // Wait until mg_fini() stops
  while (ctx->stop_flag != 2) {
    (void) sleep(0);
  }
  free_context(ctx);

#if defined(_WIN32) && !defined(__SYMBIAN32__)
  (void) WSACleanup();
#endif // _WIN32
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, (%rdi)
movl (%rbx), %eax
cmpl $0x2, %eax
je 0xc533
xorl %edi, %edi
callq 0x5340
jmp 0xc523
movq %rbx, %rdi
popq %rbx
jmp 0xc539
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: free_context
static void free_context(struct mg_context *ctx) {
  int i;

  // Deallocate config parameters
  for (i = 0; i < NUM_OPTIONS; i++) {
    if (ctx->config[i] != NULL)
      free(ctx->config[i]);
  }

  // Deallocate SSL context
  if (ctx->ssl_ctx != NULL) {
    SSL_CTX_free(ctx->ssl_ctx);
  }
#ifndef NO_SSL
  if (ssl_mutexes != NULL) {
    free(ssl_mutexes);
  }
#endif // !NO_SSL

  // Deallocate context itself
  free(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2
popq %r14
cmpq $0x18, %r14
je 0xc558
movq (%rbx,%r14,8), %rdi
callq 0x55b0
incq %r14
jmp 0xc544
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xc567
callq *0xe371(%rip)           # 0x1a8d8
movq 0xe482(%rip), %rdi      # 0x1a9f0
callq 0x55b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x55b0
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: cry
static void cry(struct mg_connection *conn, const char *fmt, ...) {
  char buf[BUFSIZ];
  va_list ap;
  FILE *fp;
  time_t timestamp;

  va_start(ap, fmt);
  (void) vsnprintf(buf, sizeof(buf), fmt, ap);
  va_end(ap);

  // Do not lock when getting the callback value, here and below.
  // I suppose this is fine, since function cannot disappear in the
  // same way string option can.
  conn->request_info.log_message = buf;
  if (call_user(conn, MG_EVENT_LOG) == NULL) {
    fp = conn->ctx->config[ERROR_LOG_FILE] == NULL ? NULL :
      mg_fopen(conn->ctx->config[ERROR_LOG_FILE], "a+");

    if (fp != NULL) {
      flockfile(fp);
      timestamp = time(NULL);

      (void) fprintf(fp,
          "[%010lu] [error] [client %s] ",
          (unsigned long) timestamp,
          inet_ntoa(conn->client.rsa.u.sin.sin_addr));

      if (conn->request_info.request_method != NULL) {
        (void) fprintf(fp, "%s %s: ",
            conn->request_info.request_method,
            conn->request_info.uri);
      }

      (void) fprintf(fp, "%s", buf);
      fputc('\n', fp);
      funlockfile(fp);
      if (fp != stderr) {
        fclose(fp);
      }
    }
  }
  conn->request_info.log_message = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20d0, %rsp           # imm = 0x20D0
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xcdc9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x20f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
movq %r10, %rdx
callq 0x52c0
movq %r14, 0x38(%rbx)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xdb70
testq %rax, %rax
je 0xce27
andq $0x0, 0x38(%rbx)
addq $0x20d0, %rsp           # imm = 0x20D0
popq %rbx
popq %r14
popq %r15
retq
movq 0x458(%rbx), %rax
movq 0x60(%rax), %rdi
testq %rdi, %rdi
je 0xce15
leaq 0x593c(%rip), %rsi      # 0x1277a
callq 0x55a0
testq %rax, %rax
je 0xce15
movq %rax, %r14
movq %rax, %rdi
callq 0x5180
xorl %edi, %edi
callq 0x5420
movq %rax, %r15
movl 0x490(%rbx), %edi
callq 0x51f0
leaq 0x5cad(%rip), %rsi      # 0x12b1c
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x5700
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0xce9d
movq 0x18(%rbx), %rcx
leaq 0x5ca7(%rip), %rsi      # 0x12b3a
movq %r14, %rdi
xorl %eax, %eax
callq 0x5700
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq 0x5540
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x5610
movq %r14, %rdi
callq 0x53b0
movq 0xd101(%rip), %rax      # 0x19fc8
cmpq (%rax), %r14
je 0xce15
movq %r14, %rdi
callq 0x5490
jmp 0xce15
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: start_thread
static int start_thread(struct mg_context *ctx, mg_thread_func_t func,
                        void *param) {
  pthread_t thread_id;
  pthread_attr_t attr;
  int retval;

  (void) pthread_attr_init(&attr);
  (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
  // TODO(lsm): figure out why mongoose dies on Linux if next line is enabled
  // (void) pthread_attr_setstacksize(&attr, sizeof(struct mg_connection) * 5);

  if ((retval = pthread_create(&thread_id, &attr, func, param)) != 0) {
    cry(fc(ctx), "%s: %s", __func__, strerror(retval));
  }

  return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x55e0
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x5640
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x5950
movl %eax, %ebx
testl %eax, %eax
je 0xcf8c
movq %r14, 0xdeed(%rip)      # 0x1ae50
leaq 0xda8e(%rip), %r14      # 0x1a9f8
movl %ebx, %edi
callq 0x5170
leaq 0x5c07(%rip), %rsi      # 0x12b7f
leaq 0x5e69(%rip), %rdx      # 0x12de8
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xcd67
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_strcasecmp
static int mg_strcasecmp(const char *s1, const char *s2) {
  int diff;

  do {
    diff = lowercase(s1++) - lowercase(s2++);
  } while (diff == 0 && s1[-1] != '\0');

  return diff;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %r15, %rdi
callq 0xd409
movl %eax, %ebx
movq %r14, %rdi
callq 0xd409
cmpl %eax, %ebx
jne 0xd3ff
incq %r14
cmpb $0x0, (%r15)
leaq 0x1(%r15), %r15
jne 0xd3da
movl %ebx, %eax
subl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_stat
static int mg_stat(const char *path, struct mgstat *stp) {
  struct stat st;
  int ok;

  if (stat(path, &st) == 0) {
    ok = 0;
    stp->size = st.st_size;
    stp->mtime = st.st_mtime;
    stp->is_directory = S_ISDIR(st.st_mode);
  } else {
    ok = -1;
  }

  return ok;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
movq %rsp, %rsi
callq 0x5410
testl %eax, %eax
je 0xdbbb
pushq $-0x1
popq %rax
jmp 0xdbe4
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rbx)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rbx)
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsp), %eax
xorl %ecx, %ecx
cmpl $0x4000, %eax           # imm = 0x4000
sete %cl
movl %ecx, (%rbx)
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: load_dll
static int load_dll(struct mg_context *ctx, const char *dll_name,
                    struct ssl_func *sw) {
  union {void *p; void (*fp)(void);} u;
  void  *dll_handle;
  struct ssl_func *fp;

  if ((dll_handle = dlopen(dll_name, RTLD_LAZY)) == NULL) {
    cry(fc(ctx), "%s: cannot load %s", __func__, dll_name);
    return 0;
  }

  for (fp = sw; fp->name != NULL; fp++) {
#ifdef _WIN32
    // GetProcAddress() returns pointer to function
    u.fp = (void (*)(void)) dlsym(dll_handle, fp->name);
#else
    // dlsym() on UNIX returns void *. ISO C forbids casts of data pointers to
    // function pointers. We need to use a union to make a cast.
    u.p = dlsym(dll_handle, fp->name);
#endif /* _WIN32 */
    if (u.fp == NULL) {
      cry(fc(ctx), "%s: %s: cannot find %s", __func__, dll_name, fp->name);
      return 0;
    } else {
      fp->ptr = u.fp;
    }
  }

  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
pushq $0x1
popq %rbx
movq %rsi, %rdi
movl %ebx, %esi
callq 0x56a0
testq %rax, %rax
je 0xdc33
movq %rax, %r13
movq (%r15), %rsi
testq %rsi, %rsi
je 0xdc88
movq %r13, %rdi
callq 0x5440
testq %rax, %rax
je 0xdc5d
movq %rax, 0x8(%r15)
addq $0x10, %r15
jmp 0xdc14
movq %r12, 0xd216(%rip)      # 0x1ae50
leaq 0xcdb7(%rip), %rdi      # 0x1a9f8
leaq 0x4f6d(%rip), %rsi      # 0x12bb5
leaq 0x4f79(%rip), %rdx      # 0x12bc8
xorl %ebx, %ebx
movq %r14, %rcx
xorl %eax, %eax
callq 0xcd67
jmp 0xdc88
movq %r12, 0xd1ec(%rip)      # 0x1ae50
leaq 0xcd8d(%rip), %rdi      # 0x1a9f8
movq (%r15), %r8
leaq 0x4f5c(%rip), %rsi      # 0x12bd1
leaq 0x4f4c(%rip), %rdx      # 0x12bc8
xorl %ebx, %ebx
movq %r14, %rcx
xorl %eax, %eax
callq 0xcd67
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: next_option
static const char *next_option(const char *list, struct vec *val,
                               struct vec *eq_val) {
  if (list == NULL || *list == '\0') {
    /* End of the list */
    list = NULL;
  } else {
    val->ptr = list;
    if ((list = strchr(val->ptr, ',')) != NULL) {
      /* Comma found. Store length and shift the list ptr */
      val->len = list - val->ptr;
      list++;
    } else {
      /* This value is the last one */
      list = val->ptr + strlen(val->ptr);
      val->len = list - val->ptr;
    }

    if (eq_val != NULL) {
      /*
       * Value has form "x=y", adjust pointers and lengths
       * so that val points to "x", and eq_val points to "y".
       */
      eq_val->len = 0;
      eq_val->ptr = (const char *) memchr(val->ptr, '=', val->len);
      if (eq_val->ptr != NULL) {
        eq_val->ptr++;  /* Skip over '=' character */
        eq_val->len = val->ptr + val->len - eq_val->ptr;
        val->len = (eq_val->ptr - val->ptr) - 1;
      }
    }
  }

  return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xdd14
movq %rdi, %r12
cmpb $0x0, (%rdi)
je 0xdd14
movq %rdx, %r14
movq %rsi, %rbx
movq %r12, (%rsi)
pushq $0x2c
popq %rsi
movq %r12, %rdi
callq 0x51b0
testq %rax, %rax
je 0xdd19
movq %rax, %r15
subq %r12, %rax
incq %r15
jmp 0xdd27
xorl %r15d, %r15d
jmp 0xdd70
movq %r12, %rdi
callq 0x51e0
movq %rax, %r15
addq %r12, %r15
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0xdd70
andq $0x0, 0x8(%r14)
movq 0x8(%rbx), %r13
pushq $0x3d
popq %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x5530
movq %rax, (%r14)
testq %rax, %rax
je 0xdd70
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movq (%rbx), %rdx
addq %rdx, %r13
subq %rcx, %r13
movq %r13, 0x8(%r14)
notq %rdx
addq %rdx, %rax
incq %rax
movq %rax, 0x8(%rbx)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: close_all_listening_sockets
static void close_all_listening_sockets(struct mg_context *ctx) {
  struct socket *sp, *tmp;
  for (sp = ctx->listening_sockets; sp != NULL; sp = tmp) {
    tmp = sp->next;
    (void) closesocket(sp->sock);
    free(sp);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xd0(%rdi), %rbx
testq %rbx, %rbx
je 0xddb2
movq (%rbx), %r14
movl 0x8(%rbx), %edi
callq 0x59e0
movq %rbx, %rdi
callq 0x55b0
movq %r14, %rbx
jmp 0xdd95
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: close_connection
static void close_connection(struct mg_connection *conn) {
  if (conn->ssl) {
    SSL_free(conn->ssl);
    conn->ssl = NULL;
  }

  if (conn->client.sock != INVALID_SOCKET) {
    close_socket_gracefully(conn->client.sock);
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rdi, %rbx
movq 0x460(%rdi), %rdi
testq %rdi, %rdi
je 0x10440
callq *0xa3c0(%rip)           # 0x1a7f8
andq $0x0, 0x460(%rbx)
movl 0x470(%rbx), %ebx
cmpl $-0x1, %ebx
je 0x10495
pushq $0x1
popq %rsi
movl %ebx, %edi
callq 0x5680
pushq $0x3
popq %rsi
movl %ebx, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x5290
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebx, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x5290
movq %rsp, %r14
movl $0x2000, %edx           # imm = 0x2000
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x5160
testl %eax, %eax
jg 0x10479
movl %ebx, %edi
callq 0x59e0
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: get_request_len
static int get_request_len(const char *buf, int buflen) {
  const char *s, *e;
  int len = 0;

  DEBUG_TRACE(("buf: %p, len: %d", buf, buflen));
  for (s = buf, e = s + buflen - 1; len <= 0 && s < e; s++)
    // Control characters are not allowed but >=128 is.
    if (!isprint(* (const unsigned char *) s) && *s != '\r' &&
        *s != '\n' && * (const unsigned char *) s < 128) {
      len = -1;
    } else if (s[0] == '\n' && s[1] == '\n') {
      len = (int) (s - buf) + 2;
    } else if (s[0] == '\n' && &s[1] < e &&
        s[1] == '\r' && s[2] == '\n') {
      len = (int) (s - buf) + 3;
    }

  return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %esi, %rax
leaq (%rdi,%rax), %r14
decq %r14
leaq 0x1(%rdi), %r15
xorl %ebp, %ebp
pushq $0x2
popq %r12
movq %rdi, (%rsp)
movq %rdi, %r13
testl %ebp, %ebp
jg 0x10540
leaq -0x1(%r15), %rbx
cmpq %r14, %rbx
jae 0x10540
callq 0x5510
movq (%rax), %rax
movzbl (%rbx), %ecx
movb 0x1(%rax,%rcx,2), %al
andb $0x40, %al
cmpb $0x1, %al
movl $0x0, %eax
sbbl %eax, %eax
orl %ebp, %eax
cmpb $0xd, %cl
cmovel %ebp, %eax
testb %cl, %cl
cmovsl %ebp, %eax
cmpb $0xa, %cl
cmovel %ebp, %eax
jne 0x10533
movb (%r15), %cl
movl %r12d, %eax
cmpb $0xa, %cl
je 0x10533
cmpq %r14, %r15
setae %al
cmpb $0xd, %cl
setne %cl
orb %al, %cl
jne 0x10531
cmpb $0xa, 0x1(%r15)
movl %ebp, %eax
jne 0x10533
movl %r13d, %eax
subl (%rsp), %eax
addl $0x3, %eax
jmp 0x10533
movl %ebp, %eax
incq %r13
incq %r15
incl %r12d
movl %eax, %ebp
jmp 0x104c6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: read_request
static int read_request(FILE *fp, SOCKET sock, SSL *ssl, char *buf, int bufsiz,
                        int *nread) {
  int n, request_len;

  request_len = 0;
  while (*nread < bufsiz && request_len == 0) {
    n = pull(fp, sock, ssl, buf + *nread, bufsiz - *nread);
    if (n <= 0) {
      break;
    } else {
      *nread += n;
      request_len = get_request_len(buf, *nread);
    }
  }

  return request_len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, (%rsp)
movl %esi, %r12d
movq %rdi, %r13
movl (%r9), %r15d
xorl %eax, %eax
movl %ebp, %r8d
subl %r15d, %r8d
jle 0x105b1
testl %eax, %eax
jne 0x105b1
movslq %r15d, %rcx
addq %r14, %rcx
movq %r13, %rdi
movl %r12d, %esi
movq (%rsp), %rdx
callq 0xba57
testl %eax, %eax
jle 0x105af
movl %eax, %r15d
addl (%rbx), %r15d
movl %r15d, (%rbx)
movq %r14, %rdi
movl %r15d, %esi
callq 0x104a0
jmp 0x10574
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: send_http_error
static void send_http_error(struct mg_connection *conn, int status,
                            const char *reason, const char *fmt, ...) {
  char buf[BUFSIZ];
  va_list ap;
  int len;

  conn->request_info.status_code = status;

  if (call_user(conn, MG_HTTP_ERROR) == NULL) {
    buf[0] = '\0';
    len = 0;

    /* Errors 1xx, 204 and 304 MUST NOT send a body */
    if (status > 199 && status != 204 && status != 304) {
      len = mg_snprintf(conn, buf, sizeof(buf), "Error %d: %s", status, reason);
      cry(conn, "%s", buf);
      buf[len++] = '\n';

      va_start(ap, fmt);
      len += mg_vsnprintf(conn, buf + len, sizeof(buf) - len, fmt, ap);
      va_end(ap);
    }
    DEBUG_TRACE(("[%s]", buf));

    mg_printf(conn, "HTTP/1.1 %d %s\r\n"
              "Content-Type: text/plain\r\n"
              "Content-Length: %d\r\n"
              "Connection: %s\r\n\r\n", status, reason, len,
              suggest_connection_header(conn));
    conn->num_bytes_sent += mg_printf(conn, "%s", buf);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x10621
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movl %esi, 0x4c(%rdi)
pushq $0x1
popq %rsi
callq 0xdb70
testq %rax, %rax
jne 0x1072c
movb $0x0, 0xd0(%rsp)
xorl %r12d, %r12d
cmpl $0xcc, %ebp
je 0x106e6
cmpl $0x130, %ebp            # imm = 0x130
je 0x106e6
leaq 0x283b(%rip), %rcx      # 0x12e9a
leaq 0xd0(%rsp), %r12
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x108b0
movl %eax, %r13d
leaq 0x30e4(%rip), %rsi      # 0x1376d
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xcd67
movslq %r13d, %r12
leaq (%rsp,%r12), %rsi
addq $0xd1, %rsi
movb $0xa, -0x1(%rsi)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rsp, %r8
movq %rax, (%r8)
leaq 0x2110(%rsp), %rax
movq %rax, 0x8(%r8)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%r8)
movl $0x1fff, %edx           # imm = 0x1FFF
subq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rcx
callq 0xbc4d
addl %eax, %r12d
incl %r12d
movq %rbx, %rdi
callq 0x1092c
leaq 0x27b2(%rip), %rsi      # 0x12ea7
movq %rbx, %rdi
movl %ebp, %edx
movq %r14, %rcx
movl %r12d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0xbb9c
leaq 0x305c(%rip), %rsi      # 0x1376d
leaq 0xd0(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xbb9c
cltq
addq %rax, 0x4b0(%rbx)
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: log_access
static void log_access(const struct mg_connection *conn) {
  const struct mg_request_info *ri;
  FILE *fp;
  char date[64];

  fp = conn->ctx->config[ACCESS_LOG_FILE] == NULL ?  NULL :
    mg_fopen(conn->ctx->config[ACCESS_LOG_FILE], "a+");

  if (fp == NULL)
    return;

  (void) strftime(date, sizeof(date), "%d/%b/%Y:%H:%M:%S %z",
      localtime(&conn->birth_time));

  ri = &conn->request_info;

  flockfile(fp);

  (void) fprintf(fp,
      "%s - %s [%s] \"%s %s HTTP/%s\" %d %" INT64_FMT,
      inet_ntoa(conn->client.rsa.u.sin.sin_addr),
      ri->remote_user == NULL ? "-" : ri->remote_user,
      date,
      ri->request_method ? ri->request_method : "-",
      ri->uri ? ri->uri : "-",
      ri->http_version,
      conn->request_info.status_code, conn->num_bytes_sent);
  log_header(conn, "Referer", fp);
  log_header(conn, "User-Agent", fp);
  (void) fputc('\n', fp);
  (void) fflush(fp);

  funlockfile(fp);
  (void) fclose(fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
movq 0x458(%rdi), %rax
movq 0x48(%rax), %rdi
testq %rdi, %rdi
je 0x1084b
leaq 0x2015(%rip), %rsi      # 0x1277a
callq 0x55a0
testq %rax, %rax
je 0x1084b
movq %rax, %rbx
leaq 0x4a8(%r14), %rdi
callq 0x5330
leaq 0x27a7(%rip), %rdx      # 0x12f30
movq %rsp, %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
movq %rax, %rcx
callq 0x5390
movq %rbx, %rdi
callq 0x5180
movl 0x490(%r14), %edi
callq 0x51f0
movq 0x30(%r14), %rcx
testq %rcx, %rcx
leaq 0x27c1(%rip), %rdx      # 0x12f7d
cmoveq %rdx, %rcx
movq 0x10(%r14), %r9
movq 0x18(%r14), %r10
testq %r9, %r9
cmoveq %rdx, %r9
testq %r10, %r10
cmoveq %rdx, %r10
movl 0x4c(%r14), %r11d
leaq 0x2764(%rip), %rsi      # 0x12f45
movq %rbx, %rdi
movq %rax, %rdx
movq %r15, %r8
xorl %eax, %eax
pushq 0x4b0(%r14)
pushq %r11
pushq 0x20(%r14)
pushq %r10
callq 0x5700
addq $0x20, %rsp
leaq 0x275e(%rip), %rsi      # 0x12f69
movq %r14, %rdi
movq %rbx, %rdx
callq 0x10a86
leaq 0x2754(%rip), %rsi      # 0x12f71
movq %r14, %rdi
movq %rbx, %rdx
callq 0x10a86
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x5610
movq %rbx, %rdi
callq 0x5590
movq %rbx, %rdi
callq 0x53b0
movq %rbx, %rdi
callq 0x5490
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: should_keep_alive
static int should_keep_alive(const struct mg_connection *conn) {
  const char *http_version = conn->request_info.http_version;
  const char *header = mg_get_header(conn, "Connection");
  return (header == NULL && http_version && !strcmp(http_version, "1.1")) ||
      (header != NULL && !mg_strcasecmp(header, "keep-alive"));
}

// Assembly:
pushq %rbx
movq 0x20(%rdi), %rbx
addq $0x8, %rdi
leaq 0x34f5(%rip), %rsi      # 0x13d5a
callq 0xb940
testq %rax, %rax
sete %cl
testq %rbx, %rbx
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1088e
leaq 0x2d7c(%rip), %rsi      # 0x13600
movq %rbx, %rdi
callq 0x56c0
jmp 0x108a2
testq %rax, %rax
je 0x108ac
leaq 0x265e(%rip), %rsi      # 0x12ef8
movq %rax, %rdi
callq 0xd3cf
testl %eax, %eax
sete %al
movzbl %al, %eax
popq %rbx
retq
xorl %eax, %eax
jmp 0x108a7
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: mg_snprintf
static int mg_snprintf(struct mg_connection *conn, char *buf, size_t buflen,
                       const char *fmt, ...) {
  va_list ap;
  int n;

  va_start(ap, fmt);
  n = mg_vsnprintf(conn, buf, buflen, fmt, ap);
  va_end(ap);

  return n;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x108ff
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r8
movq %r10, 0x10(%r8)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%r8)
callq 0xbc4d
addq $0xd8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: parse_http_headers
static void parse_http_headers(char **buf, struct mg_request_info *ri) {
  int i;

  for (i = 0; i < (int) ARRAY_SIZE(ri->http_headers); i++) {
    ri->http_headers[i].name = skip_quoted(buf, ":", " ", 0);
    ri->http_headers[i].value = skip(buf, "\r\n");
    if (ri->http_headers[i].name[0] == '\0')
      break;
    ri->num_headers = i + 1;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rbp
xorl %r15d, %r15d
leaq 0x195b(%rip), %r12      # 0x122c8
leaq 0x28c9(%rip), %r13      # 0x1323d
cmpq $0x400, %r15            # imm = 0x400
je 0x109bb
movq %r14, %rdi
leaq 0x194f(%rip), %rsi      # 0x122d6
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x109ca
movq %rax, 0x50(%rbx,%r15)
movq %r14, %rdi
movq %r13, %rsi
callq 0x10948
movq %rax, 0x58(%rbx,%r15)
movq 0x50(%rbx,%r15), %rax
cmpb $0x0, (%rax)
je 0x109bb
movl %ebp, 0x4c(%rbx)
addq $0x10, %r15
incl %ebp
jmp 0x10974
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: skip_quoted
static char *skip_quoted(char **buf, const char *delimiters, const char *whitespace, char quotechar) {
  char *p, *begin_word, *end_word, *end_whitespace;

  begin_word = *buf;
  end_word = begin_word + strcspn(begin_word, delimiters);

  /* Check for quotechar */
  if (end_word > begin_word) {
    p = end_word - 1;
    while (*p == quotechar) {
      /* If there is anything beyond end_word, copy it */
      if (*end_word == '\0') {
        *p = '\0';
        break;
      } else {
        size_t end_off = strcspn(end_word + 1, delimiters);
        memmove (p, end_word, end_off + 1);
        p += end_off; /* p must correspond to end_word - 1 */
        end_word += end_off + 1;
      }
    }
    for (p++; p < end_word; p++) {
      *p = '\0';
    }
  }

  if (*end_word == '\0') {
    *buf = end_word;
  } else {
    end_whitespace = end_word + 1 + strspn(end_word + 1, whitespace);

    for (p = end_word; p < end_whitespace; p++) {
      *p = '\0';
    }

    *buf = end_whitespace;
  }

  return begin_word;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0x5080
leaq (%rbx,%rax), %r15
testq %rax, %rax
jle 0x10a41
leaq -0x1(%r15), %r13
cmpb %bpl, (%r13)
jne 0x10a39
cmpb $0x0, (%r15)
je 0x10a34
leaq 0x1(%r15), %rdi
movq %r12, %rsi
callq 0x5080
movq %rax, %r14
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x5880
addq %r14, %r13
addq %r14, %r15
incq %r15
jmp 0x109ff
movb $0x0, (%r13)
incq %r13
cmpq %r15, %r13
jb 0x10a34
cmpb $0x0, (%r15)
je 0x10a6c
leaq 0x1(%r15), %rdi
movq 0x8(%rsp), %rsi
callq 0x51d0
addq %r15, %rax
incq %rax
cmpq %rax, %r15
jae 0x10a69
movb $0x0, (%r15)
incq %r15
jmp 0x10a5b
movq %rax, %r15
movq 0x10(%rsp), %rax
movq %r15, (%rax)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: log_header
static void log_header(const struct mg_connection *conn, const char *header,
                       FILE *fp) {
  const char *header_value;

  if ((header_value = mg_get_header(conn, header)) == NULL) {
    (void) fprintf(fp, "%s", " -");
  } else {
    (void) fprintf(fp, " \"%s\"", header_value);
  }
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
addq $0x8, %rdi
callq 0xb940
testq %rax, %rax
je 0x10aad
leaq 0x2dce(%rip), %rsi      # 0x1386d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
popq %rbx
jmp 0x5700
leaq 0x24c8(%rip), %rdi      # 0x12f7c
movq %rbx, %rsi
popq %rbx
jmp 0x5540