LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: check_password
static int check_password(const char *method, const char *ha1, const char *uri,
                          const char *nonce, const char *nc, const char *cnonce,
                          const char *qop, const char *response) {
  char ha2[32 + 1], expected_response[32 + 1];

#if 0
  // Check for authentication timeout
  if ((unsigned long) time(NULL) - (unsigned long) to64(nonce) > 3600 * 2) {
    return 0;
  }
#endif

  mg_md5(ha2, method, ":", uri, NULL);
  mg_md5(expected_response, ha1, ":", nonce, ":", nc,
      ":", cnonce, ":", qop, ":", ha2, NULL);

  return mg_strcasecmp(response, expected_response) == 0 ? MG_TRUE : MG_FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, -0x38(%rbp)
movq %r8, -0x30(%rbp)
movq %rcx, %r15
movq %rdx, %rcx
movq %rsi, %r12
movq %rdi, %rsi
movq 0x18(%rbp), %rbx
leaq 0x8d68(%rip), %r13      # 0x73c75
xorl %r14d, %r14d
leaq -0x90(%rbp), %rdi
movq %r13, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x6a8d8
subq $0x8, %rsp
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r13, %r8
movq -0x30(%rbp), %r9
xorl %eax, %eax
pushq $0x0
leaq -0x90(%rbp), %r10
pushq %r10
pushq %r13
pushq 0x10(%rbp)
pushq %r13
pushq -0x38(%rbp)
pushq %r13
callq 0x6a8d8
addq $0x40, %rsp
callq 0xc4a0
movq (%rax), %rax
movzbl (%rbx,%r14), %esi
movl (%rax,%rsi,4), %ecx
movzbl -0x60(%rbp,%r14), %edx
movl (%rax,%rdx,4), %edx
testl %esi, %esi
je 0x6af82
incq %r14
cmpl %edx, %ecx
je 0x6af66
xorl %eax, %eax
cmpl %edx, %ecx
sete %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_snprintf
static int mg_snprintf(char *buf, size_t buflen, const char *fmt, ...) {
  va_list ap;
  int n;
  va_start(ap, fmt);
  n = mg_vsnprintf(buf, buflen, fmt, ap);
  va_end(ap);
  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
leaq -0xe0(%rbp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x6c681
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %rsi, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, -0x30(%rbp)
testq %r14, %r14
je 0x6c6cb
movq %rdi, %rbx
leaq -0x30(%rbp), %rcx
movq %r14, %rsi
callq 0xcd48
movl %eax, %ecx
leal -0x1(%r14), %edx
cmpl %r14d, %eax
cmovll %eax, %edx
xorl %eax, %eax
testl %ecx, %ecx
cmovnsl %edx, %eax
movslq %eax, %rcx
movb $0x0, (%rbx,%rcx)
jmp 0x6c6cd
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: must_hide_file
static int must_hide_file(struct connection *conn, const char *path) {
  const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$";
  const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN];
  return mg_match_prefix(pw_pattern, strlen(pw_pattern), path) > 0 ||
    (pattern != NULL && mg_match_prefix(pattern, strlen(pattern), path) > 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq 0x2a8(%rdi), %rax
movq 0x98(%rax), %r14
leaq 0xe50d(%rip), %rdi      # 0x7ac05
movl $0xc, %esi
movq %rbx, %rdx
callq 0x698e5
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jg 0x6c738
testq %r14, %r14
je 0x6c736
movq %r14, %rdi
callq 0xc460
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x698e5
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setg %al
jmp 0x6c738
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_connect
struct mg_connection *mg_connect(struct mg_server *server, const char *addr) {
  struct ns_connection *nsconn;
  struct connection *conn;

  nsconn = ns_connect(&server->ns_mgr, addr, mg_ev_handler, NULL);
  if (nsconn == NULL) return 0;

  if ((conn = (struct connection *) NS_CALLOC(1, sizeof(*conn))) == NULL) {
    nsconn->flags |= NSF_CLOSE_IMMEDIATELY;
    return 0;
  }

  // Interlink two structs
  conn->ns_conn = nsconn;
  nsconn->user_data = conn;

  conn->server = server;
  conn->endpoint_type = EP_CLIENT;
  //conn->handler = handler;
  conn->mg_conn.server_param = server->ns_mgr.user_data;
  conn->ns_conn->flags = NSF_CONNECTING;

  return &conn->mg_conn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x1c36(%rip), %rdx     # 0x6b350
xorl %r15d, %r15d
xorl %ecx, %ecx
callq 0x693ba
testq %rax, %rax
je 0x6cff1
movq %rax, %r14
movl $0x1, %edi
movl $0x2e8, %esi            # imm = 0x2E8
callq 0xc980
testq %rax, %rax
je 0x6cfe6
movq %r14, (%rax)
movq %rax, 0x80(%r14)
movq %rbx, 0x2a8(%rax)
movl $0x5, 0x2b8(%rax)
movq 0x18(%rbx), %rcx
movq %rax, %r15
addq $0x8, %r15
movq %rcx, 0x290(%rax)
movl $0x8, 0xa0(%r14)
jmp 0x6cff1
orb $0x10, 0xa0(%r14)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_destroy_server
void mg_destroy_server(struct mg_server **server) {
  if (server != NULL && *server != NULL) {
    struct mg_server *s = *server;
    int i;

    ns_mgr_free(&s->ns_mgr);
    for (i = 0; i < (int) ARRAY_SIZE(s->config_options); i++) {
      NS_FREE(s->config_options[i]);  // It is OK to free(NULL)
    }
    NS_FREE(s);
    *server = NULL;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x6d05c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x6d052
movq %r14, %rdi
callq 0x695dc
movl $0x7, %r15d
movq (%r14,%r15,8), %rdi
callq 0xc250
incq %r15
cmpq $0x1a, %r15
jne 0x6d031
movq %r14, %rdi
callq 0xc250
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_next
struct mg_connection *mg_next(struct mg_server *s, struct mg_connection *c) {
  struct ns_connection *nc = ns_next(&s->ns_mgr, c == NULL ? NULL :
                                     MG_CONN_2_CONN(c)->ns_conn);
  if (nc != NULL && nc->user_data != NULL) {
    return & ((struct connection *) nc->user_data)->mg_conn;
  } else {
    return NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rsi, %rsi
je 0x6d06c
movq -0x8(%rsi), %rax
jmp 0x6d06e
xorl %eax, %eax
testq %rax, %rax
cmovneq %rax, %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x6d091
movq 0x80(%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
cmoveq %rcx, %rax
jmp 0x6d093
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_get_var_n
int mg_get_var_n(const struct mg_connection *conn, const char *name,
               char *dst, size_t dst_len, int n) {
  int len = get_var(conn->query_string, conn->query_string == NULL ? 0 :
                    strlen(conn->query_string), name, dst, dst_len, n);
  if (len == -1) {
    len = get_var(conn->content, conn->content_len, name, dst, dst_len, n);
  }
  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, -0x2c(%rbp)
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq 0x18(%rdi), %rbx
testq %rbx, %rbx
je 0x6d0c9
movq %rbx, %rdi
callq 0xc460
movq %rax, %rsi
jmp 0x6d0cb
xorl %esi, %esi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rbx
movq %r14, %rcx
movq %r15, %r8
movl -0x2c(%rbp), %r14d
movl %r14d, %r9d
callq 0x6d124
cmpl $-0x1, %eax
je 0x6d0fa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x268(%r13), %rdi
movq 0x270(%r13), %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq %r15, %r8
movl %r14d, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6d124
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: get_var
static int get_var(const char *data, size_t data_len, const char *name,
                   char *dst, size_t dst_len, int n) {
  const char *p, *e = data + data_len, *s;
  size_t name_len;
  int i = 0, len = -1;

  if (dst == NULL || dst_len == 0) {
    len = -2;
  } else if (data == NULL || name == NULL || data_len == 0) {
    dst[0] = '\0';
  } else {
    name_len = strlen(name);
    dst[0] = '\0';

    // data is "var1=val1&var2=val2...". Find variable first
    for (p = data; p + name_len < e; p++) {
      if ((p == data || p[-1] == '&') && p[name_len] == '=' &&
          !mg_strncasecmp(name, p, name_len)) {

        if (n != i++) continue;

        // 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
        len = mg_url_decode(p, (size_t)(s - p), dst, dst_len, 1);

        // Redirect error code from -1 to -2 (destination buffer too small).
        if (len == -1) {
          len = -2;
        }
        break;
      }
    }
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, -0x3c(%rbp)
movq %rcx, %r14
movq %rdx, -0x38(%rbp)
testq %rcx, %rcx
sete %al
testq %r8, %r8
sete %cl
orb %al, %cl
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x6d205
movq %rsi, %r13
testq %rsi, %rsi
je 0x6d1fc
movq %rdi, %r12
testq %rdi, %rdi
je 0x6d1fc
cmpq $0x0, -0x38(%rbp)
je 0x6d1fc
movq %r8, %rbx
movq -0x38(%rbp), %rdi
callq 0xc460
movb $0x0, (%r14)
cmpq %r13, %rax
jge 0x6d200
movq %r14, -0x48(%rbp)
movq %rbx, -0x50(%rbp)
movq %r13, -0x58(%rbp)
leaq (%r12,%r13), %rbx
leaq (%r12,%rax), %r13
xorl %r14d, %r14d
movl $0x0, -0x2c(%rbp)
testq %r14, %r14
je 0x6d1bc
cmpb $0x26, -0x1(%r12,%r14)
jne 0x6d1eb
cmpb $0x3d, (%r13,%r14)
jne 0x6d1eb
leaq (%r12,%r14), %rsi
movq -0x38(%rbp), %rdi
movq %rax, %r15
movq %rax, %rdx
callq 0x6ae41
testl %eax, %eax
jne 0x6d1e8
movl -0x2c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0x6d214
incl %eax
movl %eax, -0x2c(%rbp)
movq %r15, %rax
leaq (%r14,%r13), %rcx
incq %rcx
incq %r14
cmpq %rbx, %rcx
jb 0x6d1af
jmp 0x6d200
movb $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r14,%r13), %r12
incq %r12
notq %r15
addq -0x58(%rbp), %r15
subq %r14, %r15
movq %r12, %rdi
movl $0x26, %esi
movq %r15, %rdx
callq 0xc4d0
testq %rax, %rax
cmovneq %rax, %rbx
cmpq %r12, %rbx
jb 0x6d270
notq %r13
addq %r13, %rbx
subq %r14, %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movl $0x1, %r8d
callq 0x6971e
cmpl $-0x2, %eax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmovael %ecx, %eax
jmp 0x6d205
leaq 0xe5a8(%rip), %rdi      # 0x7b81f
leaq 0xcfe5(%rip), %rsi      # 0x7a263
leaq 0xe5a1(%rip), %rcx      # 0x7b826
movl $0x13c4, %edx           # imm = 0x13C4
callq 0xc210
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: get_request_len
static int get_request_len(const char *s, size_t buf_len) {
  const unsigned char *buf = (unsigned char *) s;
  size_t i;

  for (i = 0; i < buf_len; i++) {
    // Control characters are not allowed but >=128 are.
    // Abort scan as soon as one malformed character is found.
    if (!isprint(buf[i]) && buf[i] != '\r' && buf[i] != '\n' && buf[i] < 128) {
      return -1;
    } else if (buf[i] == '\n' && i + 1 < buf_len && buf[i + 1] == '\n') {
      return i + 2;
    } else if (buf[i] == '\n' && i + 2 < buf_len && buf[i + 1] == '\r' &&
               buf[i + 2] == '\n') {
      return i + 3;
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x6d553
movq %rsi, %r14
movq %rdi, %r15
callq 0xc170
movq (%rax), %rcx
movq %r14, %rdx
negq %rdx
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
movl $0x2, %esi
movzbl -0x2(%r15,%rsi), %edi
cmpl $0xa, %edi
je 0x6d509
testb %dil, %dil
js 0x6d509
cmpb $0xd, %dil
je 0x6d509
movzwl (%rcx,%rdi,2), %r8d
andl $0x4000, %r8d           # imm = 0x4000
je 0x6d54e
cmpb $0xa, %dil
jne 0x6d53a
leaq -0x1(%rsi), %r8
cmpq %r14, %r8
jae 0x6d520
cmpb $0xa, -0x1(%r15,%rsi)
je 0x6d560
cmpb $0xa, %dil
jne 0x6d53a
cmpq %r14, %rsi
jae 0x6d53a
cmpb $0xd, -0x1(%r15,%rsi)
jne 0x6d53a
cmpb $0xa, (%r15,%rsi)
je 0x6d564
decl %eax
leaq (%rdx,%rsi), %rdi
incq %rdi
incq %rsi
cmpq $0x2, %rdi
jne 0x6d4e5
jmp 0x6d553
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %ebx
jmp 0x6d553
negl %eax
movl %eax, %ebx
jmp 0x6d553
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_copy_listeners
void mg_copy_listeners(struct mg_server *s, struct mg_server *to) {
  struct ns_connection *c;
  for (c = ns_next(&s->ns_mgr, NULL); c != NULL; c = ns_next(&s->ns_mgr, c)) {
    struct ns_connection *tmp;
    if ((c->flags & NSF_LISTENING) &&
        (tmp = (struct ns_connection *) NS_MALLOC(sizeof(*tmp))) != NULL) {
      memcpy(tmp, c, sizeof(*tmp));

#if defined(NS_ENABLE_SSL) && defined(HEADER_SSL_H)
      /* OpenSSL only. See https://github.com/cesanta/mongoose/issues/441 */
      if (tmp->ssl_ctx != NULL) {
        tmp->ssl_ctx->references++;
      }
#endif

      tmp->mgr = &to->ns_mgr;
      ns_add_conn(tmp->mgr, tmp);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x6d5de
movq %rsi, %rbx
testb $-0x80, 0xa0(%r14)
je 0x6d5d6
movl $0xa8, %edi
callq 0xca00
testq %rax, %rax
je 0x6d5d6
movq %rax, %r15
movl $0xa8, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc0e0
movq %rbx, 0x18(%r15)
movq (%rbx), %rax
movq %rax, (%r15)
movq %r15, (%rbx)
movq $0x0, 0x8(%r15)
testq %rax, %rax
je 0x6d5d6
movq %r15, 0x8(%rax)
movq (%r14), %r14
testq %r14, %r14
jne 0x6d58c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: get_option_index
static int get_option_index(const char *name) {
  int i;

  for (i = 0; static_config_options[i * 2] != NULL; i++) {
    if (strcmp(static_config_options[i * 2], name) == 0) {
      return i;
    }
  }
  return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x29096(%rip), %rdi     # 0x96950
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x6d8ef
xorl %r15d, %r15d
leaq 0x29092(%rip), %r12     # 0x96960
movq %r14, %rsi
callq 0xc950
testl %eax, %eax
je 0x6d8ec
movq (%r12), %rdi
incl %r15d
addq $0x10, %r12
testq %rdi, %rdi
jne 0x6d8ce
jmp 0x6d8ef
movl %r15d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_strdup
static char *mg_strdup(const char *str) {
  char *copy = (char *) NS_MALLOC(strlen(str) + 1);
  if (copy != NULL) {
    strcpy(copy, str);
  }
  return copy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xc460
leaq 0x1(%rax), %rdi
callq 0xca00
testq %rax, %rax
je 0x6d927
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xc490
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/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 %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6d973
movq %rdi, %r12
cmpb $0x0, (%rdi)
je 0x6d973
movq %rdx, %r15
movq %rsi, %rbx
movq %r12, (%rsi)
movq %r12, %rdi
movl $0x2c, %esi
callq 0xc5f0
testq %rax, %rax
je 0x6d978
movq %rax, %r14
subq %r12, %rax
movq %rax, 0x8(%rbx)
incq %r14
jmp 0x6d988
xorl %r14d, %r14d
jmp 0x6d9d2
movq %r12, %rdi
callq 0xc460
leaq (%r12,%rax), %r14
movq %rax, 0x8(%rbx)
testq %r15, %r15
je 0x6d9d2
movq $0x0, 0x8(%r15)
movq 0x8(%rbx), %r13
movq %r12, %rdi
movl $0x3d, %esi
movq %r13, %rdx
callq 0xc4d0
movq %rax, (%r15)
testq %rax, %rax
je 0x6d9d2
leaq 0x1(%rax), %rcx
movq %rcx, (%r15)
movq (%rbx), %rdx
addq %rdx, %r13
subq %rcx, %r13
movq %r13, 0x8(%r15)
notq %rdx
addq %rdx, %rax
incq %rax
movq %rax, 0x8(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_wakeup_server_ex
void mg_wakeup_server_ex(struct mg_server *server, mg_handler_t cb,
                         const char *fmt, ...) {
  va_list ap;
  char buf[8 * 1024];
  int len;

  // Encode callback (cb) into a buffer
  len = snprintf(buf, sizeof(buf), "%p ", cb);
  va_start(ap, fmt);
  len += vsnprintf(buf + len, sizeof(buf) - len, fmt, ap);
  va_end(ap);

  // "len + 1" is to include terminating \0 in the message
  ns_broadcast(&server->ns_mgr, iter2, buf, len + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20c8, %rsp           # imm = 0x20C8
movq %rdx, %r15
movq %rsi, %r10
movq %rdi, %rbx
leaq -0xf0(%rbp), %r13
movq %rcx, 0x18(%r13)
movq %r8, 0x20(%r13)
movq %r9, 0x28(%r13)
testb %al, %al
je 0x6da44
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
leaq 0xca1c(%rip), %rdx      # 0x7a467
leaq -0x20f0(%rbp), %r14
movl $0x2000, %r12d          # imm = 0x2000
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
movq %r10, %rcx
xorl %eax, %eax
callq 0xc5d0
movabsq $0x3000000018, %rdx     # imm = 0x3000000018
leaq -0x40(%rbp), %rcx
movq %rdx, (%rcx)
leaq 0x10(%rbp), %rdx
movq %rdx, 0x8(%rcx)
movq %r13, 0x10(%rcx)
movslq %eax, %r13
leaq -0x20f0(,%r13), %rdi
addq %rbp, %rdi
subq %r13, %r12
movq %r12, %rsi
movq %r15, %rdx
callq 0xcd48
addl %r13d, %eax
incl %eax
movslq %eax, %rcx
leaq 0x1d(%rip), %rsi        # 0x6dacf
movq %rbx, %rdi
movq %r14, %rdx
callq 0x69504
addq $0x20c8, %rsp           # imm = 0x20C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: iter2
static void iter2(struct ns_connection *nc, int ev, void *param) {
  mg_handler_t func = NULL;
  struct connection *conn = (struct connection *) nc->user_data;
  const char *msg = (const char *) param;
  int n;
  (void) ev;

  //DBG(("%p [%s]", conn, msg));
  if (sscanf(msg, "%p %n", &func, &n) && func != NULL && conn != NULL) {
    conn->mg_conn.callback_param = (void *) (msg + n);
    func(&conn->mg_conn, MG_POLL);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
leaq -0x28(%rbp), %r14
movq $0x0, (%r14)
movq 0x80(%rdi), %r15
leaq 0xdf4d(%rip), %rsi      # 0x7ba45
leaq -0x1c(%rbp), %rcx
movq %rdx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc100
testl %eax, %eax
setne %cl
movq (%r14), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
testq %r15, %r15
setne %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x6db42
movslq -0x1c(%rbp), %rcx
addq %rcx, %rbx
movq %r15, %rdi
addq $0x8, %rdi
movq %rbx, 0x2a0(%r15)
movl $0x64, %esi
callq *%rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_create_server
struct mg_server *mg_create_server(void *server_data, mg_handler_t handler) {
  struct mg_server *server = (struct mg_server *) NS_CALLOC(1, sizeof(*server));
  ns_mgr_init(&server->ns_mgr, server_data);
  set_default_option_values(server->config_options);
  server->event_handler = handler;
  return server;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl $0x1, %edi
movl $0xd0, %esi
callq 0xc980
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x69585
cmpq $0x0, 0x28d82(%rip)     # 0x96950
je 0x6dc0b
xorl %r15d, %r15d
leaq 0x28d76(%rip), %r12     # 0x96950
movq 0x8(%r12,%r15,2), %rdi
cmpq $0x0, 0x38(%r14,%r15)
sete %al
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6dbff
callq 0x6d8fa
movq %rax, 0x38(%r14,%r15)
cmpq $0x0, 0x10(%r12,%r15,2)
leaq 0x8(%r15), %r15
jne 0x6dbda
movq %rbx, 0x30(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: compare_dir_entries
static int __cdecl compare_dir_entries(const void *p1, const void *p2) {
  const struct dir_entry *a = (const struct dir_entry *) p1,
        *b = (const struct dir_entry *) p2;
  const char *qs = a->conn->mg_conn.query_string ?
    a->conn->mg_conn.query_string : "na";
  int cmp_result = 0;

  if (S_ISDIR(a->st.st_mode) && !S_ISDIR(b->st.st_mode)) {
    return -1;  // Always put directories on top
  } else if (!S_ISDIR(a->st.st_mode) && S_ISDIR(b->st.st_mode)) {
    return 1;   // Always put directories on top
  } else if (*qs == 'n') {
    cmp_result = strcmp(a->file_name, b->file_name);
  } else if (*qs == 's') {
    cmp_result = a->st.st_size == b->st.st_size ? 0 :
      a->st.st_size > b->st.st_size ? 1 : -1;
  } else if (*qs == 'd') {
    cmp_result = a->st.st_mtime == b->st.st_mtime ? 0 :
      a->st.st_mtime > b->st.st_mtime ? 1 : -1;
  }

  return qs[1] == 'd' ? -cmp_result : cmp_result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
leaq 0xc88f(%rip), %rbx      # 0x7addc
cmovneq %rax, %rbx
movl $0xf000, %eax           # imm = 0xF000
movl 0x28(%rdi), %edx
andl %eax, %edx
cmpl $0x4000, %edx           # imm = 0x4000
jne 0x6e580
movl 0x28(%rsi), %r8d
andl %eax, %r8d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x4000, %r8d           # imm = 0x4000
jne 0x6e5e1
cmpl $0x4000, %edx           # imm = 0x4000
je 0x6e58f
andl 0x28(%rsi), %eax
movl $0x1, %ecx
cmpl $0x4000, %eax           # imm = 0x4000
je 0x6e5e1
movzbl (%rbx), %ecx
cmpl $0x64, %ecx
je 0x6e5c0
cmpl $0x73, %ecx
je 0x6e5b2
xorl %eax, %eax
cmpl $0x6e, %ecx
jne 0x6e5d6
movq 0x8(%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0xc950
jmp 0x6e5d6
movq 0x40(%rdi), %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq 0x40(%rsi), %rax
jmp 0x6e5cc
movq 0x68(%rdi), %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq 0x68(%rsi), %rax
setg %dl
leal -0x1(%rdx,%rdx), %eax
cmovel %ecx, %eax
movl %eax, %ecx
negl %ecx
cmpb $0x64, 0x1(%rbx)
cmovnel %eax, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: addenv
static char *addenv(struct cgi_env_block *block, const char *fmt, ...) {
  int n, space;
  char *added;
  va_list ap;

  // Calculate how much space is left in the buffer
  space = sizeof(block->buf) - block->len - 2;
  assert(space >= 0);

  // Make a pointer to the free space int the buffer
  added = block->buf + block->len;

  // Copy VARIABLE=VALUE\0 string into the free space
  va_start(ap, fmt);
  n = mg_vsnprintf(added, (size_t) space, fmt, ap);
  va_end(ap);

  // Make sure we do not overflow buffer and the envp array
  if (n > 0 && n + 1 < space &&
      block->nvars < (int) ARRAY_SIZE(block->vars) - 2) {
    // Append a pointer to the added string into the envp array
    block->vars[block->nvars++] = added;
    // Bump up used length counter. Include \0 terminator
    block->len += n + 1;
  }

  return added;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdx, -0xe0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %r8, -0xd0(%rbp)
movq %r9, -0xc8(%rbp)
testb %al, %al
je 0x6e648
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movslq 0x2208(%rdi), %r12
movl $0x1ffe, %r15d          # imm = 0x1FFE
subl %r12d, %r15d
js 0x6e709
movq %rdi, %rbx
leaq (%rdi,%r12), %r14
addq $0x8, %r14
leaq -0xf0(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x40(%rbp)
xorl %ecx, %ecx
cmpl $0x1ffe, %r12d          # imm = 0x1FFE
je 0x6e6c7
movq %rsi, %r10
movl %r15d, %esi
leaq -0x40(%rbp), %rcx
movq %r14, %rdi
movq %r10, %rdx
callq 0xcd48
movl $0x1ffd, %edx           # imm = 0x1FFD
subl %r12d, %edx
cmpl %r15d, %eax
cmovll %eax, %edx
xorl %ecx, %ecx
testl %eax, %eax
cmovnsl %edx, %ecx
movslq %ecx, %rax
movb $0x0, (%r14,%rax)
testl %ecx, %ecx
jle 0x6e6f6
incl %ecx
cmpl %r15d, %ecx
jge 0x6e6f6
movslq 0x220c(%rbx), %rax
cmpq $0x3d, %rax
jg 0x6e6f6
leal 0x1(%rax), %edx
movl %edx, 0x220c(%rbx)
movq %r14, 0x2008(%rbx,%rax,8)
addl %ecx, 0x2208(%rbx)
movq %r14, %rax
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc9c9(%rip), %rdi      # 0x7b0d9
leaq 0xbb4c(%rip), %rsi      # 0x7a263
leaq 0xc9c6(%rip), %rcx      # 0x7b0e4
movl $0x88a, %edx            # imm = 0x88A
callq 0xc210
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: get_mime_type
static void get_mime_type(const struct mg_server *server, const char *path,
                          struct vec *vec) {
  struct vec ext_vec, mime_vec;
  const char *list, *ext;
  size_t path_len;

  path_len = strlen(path);

  // Scan user-defined mime types first, in case user wants to
  // override default mime types.
  list = server->config_options[EXTRA_MIME_TYPES];
  while ((list = next_option(list, &ext_vec, &mime_vec)) != NULL) {
    // ext now points to the path suffix
    ext = path + path_len - ext_vec.len;
    if (mg_strncasecmp(ext, ext_vec.ptr, ext_vec.len) == 0) {
      *vec = mime_vec;
      return;
    }
  }

  vec->ptr = mg_get_mime_type(path, "text/plain");
  vec->len = strlen(vec->ptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xc460
movq %rax, %r15
movq 0x88(%rbx), %rbx
addq %r14, %r15
leaq -0x40(%rbp), %r12
leaq -0x50(%rbp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6d92e
testq %rax, %rax
je 0x6e7d4
movq %rax, %rbx
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq %r15, %rdi
subq %rdx, %rdi
callq 0x6ae41
testl %eax, %eax
jne 0x6e79a
movups -0x50(%rbp), %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
jmp 0x6e7f6
leaq 0x518a(%rip), %rsi      # 0x73965
movq %r14, %rdi
callq 0x6a3f3
movq -0x30(%rbp), %rbx
movq %rax, (%rbx)
movq %rax, %rdi
callq 0xc460
movq %rax, 0x8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: do_ssi_exec
static void do_ssi_exec(struct mg_connection *conn, char *tag) {
  char cmd[IOBUF_SIZE];
  FILE *fp;

  if (sscanf(tag, " \"%[^\"]\"", cmd) != 1) {
    mg_printf(conn, "Bad SSI #exec: [%s]", tag);
  } else if ((fp = popen(cmd, "r")) == NULL) {
    mg_printf(conn, "Cannot SSI #exec: [%s]: %s", cmd, strerror(errno));
  } else {
    send_file_data(conn, fp);
    pclose(fp);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc5e9(%rip), %rsi      # 0x7b277
leaq -0x2010(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
jne 0x6ecd4
leaq 0xc6aa(%rip), %rsi      # 0x7b355
leaq -0x2010(%rbp), %rdi
callq 0xc930
testq %rax, %rax
je 0x6ecea
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6ed1d
movq %r14, %rdi
callq 0xc0c0
jmp 0x6ed11
leaq 0xc5ea(%rip), %rsi      # 0x7b2c5
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x69675
jmp 0x6ed11
callq 0xcb20
movl (%rax), %edi
callq 0xc8c0
leaq 0xc5dc(%rip), %rsi      # 0x7b2d9
leaq -0x2010(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x69675
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: send_file_data
static void send_file_data(struct mg_connection *conn, FILE *fp) {
  char buf[IOBUF_SIZE];
  size_t n;
  while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) {
    mg_write(conn, buf, n);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x2020(%rbp), %rdi
movl $0x1, %esi
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rcx
callq 0xc600
testq %rax, %rax
je 0x6ed81
leaq -0x2020(%rbp), %r15
movq -0x8(%r14), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x681c0
movl $0x1, %esi
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
movq %rbx, %rcx
callq 0xc600
testq %rax, %rax
jne 0x6ed58
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: should_keep_alive
static int should_keep_alive(const struct mg_connection *conn) {
  struct connection *c = MG_CONN_2_CONN(conn);
  const char *method = conn->request_method;
  const char *http_version = conn->http_version;
  const char *header = mg_get_header(conn, "Connection");
  return method != NULL &&
    (!strcmp(method, "GET") || c->endpoint_type == EP_USER) &&
    ((header != NULL && !mg_strcasecmp(header, "keep-alive")) ||
     (header == NULL && http_version && !strcmp(http_version, "1.1")));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
movq (%rdi), %r13
movq 0x10(%rdi), %rbx
leaq 0x7b03(%rip), %rsi      # 0x768b1
callq 0x69863
xorl %r15d, %r15d
testq %r13, %r13
je 0x6ee4d
movq %rax, %r14
leaq 0x7bbc(%rip), %rsi      # 0x76985
movq %r13, %rdi
callq 0xc950
testl %eax, %eax
je 0x6ede0
cmpl $0x3, 0x2b0(%r12)
jne 0x6ee4d
testq %r14, %r14
je 0x6ee1c
callq 0xc4a0
movq (%rax), %rax
xorl %ecx, %ecx
leaq 0xc641(%rip), %rdx      # 0x7b437
movzbl (%r14,%rcx), %r8d
movl (%rax,%r8,4), %esi
movzbl (%rcx,%rdx), %edi
movl (%rax,%rdi,4), %edi
testl %r8d, %r8d
je 0x6ee12
incq %rcx
cmpl %edi, %esi
je 0x6edf6
movl $0x1, %r15d
cmpl %edi, %esi
je 0x6ee4d
testq %r14, %r14
sete %al
testq %rbx, %rbx
setne %cl
andb %al, %cl
movl $0x0, %r15d
cmpb $0x1, %cl
jne 0x6ee4d
leaq 0xc0ae(%rip), %rsi      # 0x7aeea
movq %rbx, %rdi
callq 0xc950
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/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 %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
callq 0x69863
testq %rax, %rax
je 0x6f6b7
leaq 0xbb84(%rip), %rsi      # 0x7b228
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xc260
leaq 0xbdc2(%rip), %rdi      # 0x7b480
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xc380
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: try_parse
static void try_parse(struct connection *conn) {
  struct iobuf *io = &conn->ns_conn->recv_iobuf;

  if (conn->request_len == 0 &&
      (conn->request_len = get_request_len(io->buf, io->len)) > 0) {
    // If request is buffered in, remove it from the iobuf. This is because
    // iobuf could be reallocated, and pointers in parsed request could
    // become invalid.
    conn->request = (char *) NS_MALLOC(conn->request_len);
    if (conn->request == NULL) {
      conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
      return;
    }
    memcpy(conn->request, io->buf, conn->request_len);
    //DBG(("%p [%.*s]", conn, conn->request_len, conn->request));
    iobuf_remove(io, conn->request_len);
    conn->request_len = parse_http_message(conn->request, conn->request_len,
                                           &conn->mg_conn);
    if (conn->request_len > 0) {
      const char *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length");
      conn->cl = cl_hdr == NULL ? 0 : to64(cl_hdr);
      conn->mg_conn.content_len = (size_t) conn->cl;
    }
  }
}

// Assembly:
cmpq $0x0, 0x2e0(%rdi)
je 0x6f6d7
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r12
movq 0x40(%r12), %r15
movq 0x48(%r12), %rsi
movq %r15, %rdi
callq 0x6d4b2
movslq %eax, %r14
movq %r14, 0x2e0(%rbx)
testl %r14d, %r14d
jle 0x6f7b2
movq %r14, %rdi
callq 0xca00
movq %rax, 0x2c8(%rbx)
testq %rax, %rax
je 0x6f797
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xc0e0
movq 0x48(%r12), %rdx
subq %r14, %rdx
jb 0x6f74c
movq 0x40(%r12), %rdi
leaq (%rdi,%r14), %rsi
callq 0xc1f0
subq %r14, 0x48(%r12)
movq 0x2c8(%rbx), %rdi
movq 0x2e0(%rbx), %rsi
leaq 0x8(%rbx), %r14
movq %r14, %rdx
callq 0x70033
movq %rax, 0x2e0(%rbx)
testq %rax, %rax
jle 0x6f7b2
leaq 0x71e3(%rip), %rsi      # 0x7695c
movq %r14, %rdi
callq 0x69863
testq %rax, %rax
je 0x6f7a2
movq %rax, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xc8b0
jmp 0x6f7a4
orb $0x10, 0xa0(%r12)
jmp 0x6f7b2
xorl %eax, %eax
movq %rax, 0x2d8(%rbx)
movq %rax, 0x278(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: skip
static char *skip(char **buf, const char *delimiters) {
  char *p, *begin_word, *end_word, *end_delimiters;

  begin_word = *buf;
  end_word = begin_word + strcspn(begin_word, delimiters);
  end_delimiters = end_word + strspn(end_word, delimiters);

  for (p = end_word; p < end_delimiters; p++) {
    *p = '\0';
  }

  *buf = end_delimiters;

  return begin_word;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r14
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0xc870
movq %rax, %r13
leaq (%rbx,%rax), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xc650
movq %rax, %r12
testq %rax, %rax
jle 0x7037e
leaq (%r15,%r12), %rax
leaq (%rbx,%r13), %rdx
incq %rdx
cmpq %rdx, %rax
cmovaq %rax, %rdx
subq %r15, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0xc360
addq %r12, %r15
movq %r15, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: parse_http_headers
static void parse_http_headers(char **buf, struct mg_connection *ri) {
  size_t i;

  for (i = 0; i < ARRAY_SIZE(ri->http_headers); i++) {
    ri->http_headers[i].name = skip(buf, ": ");
    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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %r13d
xorl %r15d, %r15d
leaq 0x9fd0(%rip), %r12      # 0x7a38a
movq %r14, %rdi
leaq 0x5da6(%rip), %rsi      # 0x7616a
callq 0x70326
movq %rax, 0x88(%rbx,%r15)
movq %r14, %rdi
movq %r12, %rsi
callq 0x70326
movq %rax, 0x90(%rbx,%r15)
movq 0x88(%rbx,%r15), %rax
cmpb $0x0, (%rax)
je 0x70408
movl %r13d, 0x84(%rbx)
addq $0x10, %r15
incl %r13d
cmpq $0x1e0, %r15            # imm = 0x1E0
jne 0x703ba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: SHA1Update
static void SHA1Update(SHA1_CTX *context, const unsigned char *data,
                       size_t len) {
  size_t i, j;

  j = context->count[0];
  if ((context->count[0] += len << 3) < j)
    context->count[1]++;
  context->count[1] += (len>>29);
  j = (j >> 3) & 63;
  if ((j + len) > 63) {
    memcpy(&context->buffer[j], data, (i = 64-j));
    SHA1Transform(context->state, context->buffer);
    for ( ; i + 63 < len; i += 64) {
      SHA1Transform(context->state, &data[i]);
    }
    j = 0;
  }
  else i = 0;
  memcpy(&context->buffer[j], &data[i], len - i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x14(%rdi), %r12d
leal (,%rdx,8), %eax
addl %r12d, %eax
movl %eax, 0x14(%rdi)
jae 0x70445
incl 0x18(%r15)
movq %rbx, %rax
shrq $0x1d, %rax
addl %eax, 0x18(%r15)
shrl $0x3, %r12d
andl $0x3f, %r12d
leaq (%r12,%rbx), %rax
cmpq $0x40, %rax
jb 0x704b9
leaq 0x1c(%r15), %rax
movq %rax, -0x30(%rbp)
leaq (%r15,%r12), %rdi
addq $0x1c, %rdi
movl $0x40, %r13d
subq %r12, %r13
movq %r14, %rsi
movq %r13, %rdx
callq 0xc0e0
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x704e3
xorq $0x7f, %r12
cmpq %rbx, %r12
jae 0x704b4
movq %r13, %r12
leaq (%r14,%r13), %rsi
movq %r15, %rdi
callq 0x704e3
addq $0x40, %r13
addq $0x7f, %r12
jmp 0x70496
xorl %r12d, %r12d
jmp 0x704bc
xorl %r13d, %r13d
leaq (%r15,%r12), %rdi
addq $0x1c, %rdi
addq %r13, %r14
subq %r13, %rbx
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc0e0
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: handle_mkcol
static void handle_mkcol(struct connection *conn, const char *path) {
  int status_code = 500;

  if (conn->mg_conn.content_len > 0) {
    status_code = 415;
  } else if (!mkdir(path, 0755)) {
    status_code = 201;
  } else if (errno == EEXIST) {
    status_code = 405;
  } else if (errno == EACCES) {
    status_code = 403;
  } else if (errno == ENOENT) {
    status_code = 409;
  }
  send_http_error(conn, status_code, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movl $0x19f, %esi            # imm = 0x19F
cmpq $0x0, 0x278(%rdi)
je 0x717ef
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6c73d
movq %rax, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0xc310
testl %eax, %eax
je 0x7181d
callq 0xcb20
movl (%rax), %eax
cmpl $0x2, %eax
je 0x7182b
cmpl $0x11, %eax
je 0x71824
cmpl $0xd, %eax
jne 0x71832
movl $0x193, %esi            # imm = 0x193
jmp 0x717dd
movl $0xc9, %esi
jmp 0x717dd
movl $0x195, %esi            # imm = 0x195
jmp 0x717dd
movl $0x199, %esi            # imm = 0x199
jmp 0x717dd
movl $0x1f4, %esi            # imm = 0x1F4
jmp 0x717dd
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: handle_delete
static void handle_delete(struct connection *conn, const char *path) {
  file_stat_t st;

  if (stat(path, &st) != 0) {
    send_http_error(conn, 404, NULL);
  } else if (S_ISDIR(st.st_mode)) {
    remove_directory(path);
    send_http_error(conn, 204, NULL);
  } else if (remove(path) == 0) {
    send_http_error(conn, 204, NULL);
  } else {
    send_http_error(conn, 423, NULL);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0xa0(%rbp), %rsi
movq %r14, %rdi
callq 0xcb70
movl $0x194, %esi            # imm = 0x194
testl %eax, %eax
jne 0x7189a
movl $0xf000, %eax           # imm = 0xF000
andl -0x88(%rbp), %eax
movq %r14, %rdi
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x71886
callq 0x71c25
movl $0xcc, %esi
jmp 0x7189a
callq 0xc290
testl %eax, %eax
movl $0xcc, %eax
movl $0x1a7, %esi            # imm = 0x1A7
cmovel %eax, %esi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x6c73d
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: print_props
static void print_props(struct connection *conn, const char *uri,
                        file_stat_t *stp) {
  char mtime[64];
  time_t t = stp->st_mtime;  // store in local variable for NDK compile
  gmt_time_string(mtime, sizeof(mtime), &t);
  mg_printf(&conn->mg_conn,
      "<d:response>"
       "<d:href>%s</d:href>"
       "<d:propstat>"
        "<d:prop>"
         "<d:resourcetype>%s</d:resourcetype>"
         "<d:getcontentlength>%" INT64_FMT "</d:getcontentlength>"
         "<d:getlastmodified>%s</d:getlastmodified>"
        "</d:prop>"
        "<d:status>HTTP/1.1 200 OK</d:status>"
       "</d:propstat>"
      "</d:response>\n",
      uri, S_ISDIR(stp->st_mode) ? "<d:collection/>" : "",
      (int64_t) stp->st_size, mtime);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rdx), %rax
leaq -0x28(%rbp), %rdi
movq %rax, (%rdi)
callq 0xc2f0
leaq 0x15a9(%rip), %rdx      # 0x7316e
leaq -0x70(%rbp), %r12
movl $0x40, %esi
movq %r12, %rdi
movq %rax, %rcx
callq 0xc9d0
addq $0x8, %r14
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r15), %eax
cmpl $0x4000, %eax           # imm = 0x4000
leaq 0x9bca(%rip), %rax      # 0x7b7bc
leaq 0x7a6e(%rip), %rcx      # 0x79667
cmoveq %rax, %rcx
movq 0x30(%r15), %r8
leaq 0x9ac0(%rip), %rsi      # 0x7b6c8
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %r9
xorl %eax, %eax
callq 0x69675
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: remove_directory
static int remove_directory(const char *dir) {
  char path[MAX_PATH_SIZE];
  struct dirent *dp;
  file_stat_t st;
  DIR *dirp;

  if ((dirp = opendir(dir)) == NULL) return 0;

  while ((dp = readdir(dirp)) != NULL) {
    if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue;
    mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name);
    stat(path, &st);
    if (S_ISDIR(st.st_mode)) {
      remove_directory(path);
    } else {
      remove(path);
    }
  }
  closedir(dirp);
  rmdir(dir);

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2098, %rsp           # imm = 0x2098
movq %rdi, %rbx
callq 0xc690
testq %rax, %rax
je 0x71d0d
movq %rax, %r14
movq %rax, %rdi
callq 0xc6a0
testq %rax, %rax
je 0x71cfd
movq %rax, %r12
leaq 0x206f(%rip), %r15      # 0x73cd7
leaq -0x20c0(%rbp), %r13
addq $0x13, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xc950
testl %eax, %eax
je 0x71ce9
movq %r12, %rdi
leaq 0x204a(%rip), %rsi      # 0x73cd6
callq 0xc950
testl %eax, %eax
je 0x71ce9
movl $0x2000, %esi           # imm = 0x2000
movq %r13, %rdi
leaq 0x9131(%rip), %rdx      # 0x7add5
movq %rbx, %rcx
movl $0x2f, %r8d
movq %r12, %r9
xorl %eax, %eax
callq 0x6c630
movq %r13, %rdi
leaq -0xb8(%rbp), %rsi
callq 0xcb70
movl -0xa0(%rbp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
movq %r13, %rdi
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x71ce4
callq 0x71c25
jmp 0x71ce9
callq 0xc290
movq %r14, %rdi
callq 0xc6a0
movq %rax, %r12
testq %rax, %rax
jne 0x71c6f
movq %r14, %rdi
callq 0xc660
movq %rbx, %rdi
callq 0xc4b0
addq $0x2098, %rsp           # imm = 0x2098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: set_ips
static void set_ips(struct ns_connection *nc, int is_rem) {
  struct connection *conn = (struct connection *) nc->user_data;
  struct mg_connection *c = &conn->mg_conn;
  char buf[100];

  ns_sock_to_str(nc->sock, buf, sizeof(buf), is_rem ? 7 : 3);
  sscanf(buf, "%47[^:]:%hu",
         is_rem ? c->remote_ip : c->local_ip,
         is_rem ? &c->remote_port : &c->local_port);
  //DBG(("%p %s %s", conn, is_rem ? "rem" : "loc", buf));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq 0x80(%rdi), %r15
movl 0x20(%rdi), %edi
leaq 0x28(%r15), %rbx
leaq 0x58(%r15), %rax
xorl %r12d, %r12d
xorl %ecx, %ecx
testl %esi, %esi
sete %r12b
setne %cl
leal 0x3(,%rcx,4), %ecx
cmoveq %rax, %rbx
leaq -0x90(%rbp), %r14
movl $0x64, %edx
movq %r14, %rsi
callq 0x688ca
leaq (%r15,%r12,2), %rcx
addq $0x88, %rcx
leaq 0x9c82(%rip), %rsi      # 0x7ba01
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc100
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq