LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x5c0e1
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x5c0d7
movq %r14, %rdi
callq 0x58b77
pushq $0x7
popq %r15
cmpq $0x1a, %r15
je 0x5c0cb
movq (%r14,%r15,8), %rdi
callq 0xc250
incq %r15
jmp 0x5c0b7
movq %r14, %rdi
callq 0xc250
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5c0f1
movq -0x8(%rsi), %rax
jmp 0x5c0f3
xorl %eax, %eax
testq %rax, %rax
cmovneq %rax, %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x5c116
movq 0x80(%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
cmoveq %rcx, %rax
jmp 0x5c118
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5c14e
movq %rbx, %rdi
callq 0xc470
movq %rax, %rsi
jmp 0x5c150
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 0x5c1a9
cmpl $-0x1, %eax
je 0x5c17f
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 0x5c1a9
// File: /workspace/github_c_makefile_star2_O2/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, -0x34(%rbp)
movq %rcx, %rbx
movq %rdx, -0x30(%rbp)
testq %rcx, %rcx
sete %al
testq %r8, %r8
sete %cl
orb %al, %cl
je 0x5c1d9
pushq $-0x2
jmp 0x5c257
testq %rsi, %rsi
je 0x5c252
movq %rdi, %r12
testq %rdi, %rdi
je 0x5c252
cmpq $0x0, -0x30(%rbp)
je 0x5c252
movq %r8, -0x58(%rbp)
movq %rsi, -0x48(%rbp)
leaq (%r12,%rsi), %r15
movq -0x30(%rbp), %rdi
callq 0xc470
movq %rbx, -0x50(%rbp)
movb $0x0, (%rbx)
movq %rax, -0x40(%rbp)
leaq (%r12,%rax), %r13
xorl %r14d, %r14d
xorl %ebx, %ebx
leaq (%r14,%r13), %rax
cmpq %r15, %rax
jae 0x5c255
testq %r14, %r14
je 0x5c22c
cmpb $0x26, -0x1(%r12,%r14)
jne 0x5c24d
cmpb $0x3d, (%rax)
jne 0x5c24d
leaq (%r12,%r14), %rsi
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rdx
callq 0x5a293
testl %eax, %eax
jne 0x5c24d
cmpl -0x34(%rbp), %ebx
je 0x5c267
incl %ebx
incq %r14
jmp 0x5c216
movb $0x0, (%rbx)
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r14,%r13), %rbx
incq %rbx
movq -0x40(%rbp), %rdx
notq %rdx
addq -0x48(%rbp), %rdx
subq %r14, %rdx
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0xc4d0
testq %rax, %rax
cmovneq %rax, %r15
cmpq %rbx, %r15
jb 0x5c2be
notq %r13
addq %r13, %r15
subq %r14, %r15
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r15, %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x58ca0
cmpl $-0x2, %eax
pushq $-0x2
popq %rcx
cmovael %ecx, %eax
jmp 0x5c258
leaq 0xd53a(%rip), %rdi      # 0x697ff
leaq 0xbf77(%rip), %rsi      # 0x68243
leaq 0xd533(%rip), %rcx      # 0x69806
movl $0x13c4, %edx           # imm = 0x13C4
callq 0xc220
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %r13
negq %r13
pushq $-0x3
popq %r12
pushq $0x2
popq %rbx
leaq (%rbx,%r13), %rax
cmpq $0x2, %rax
je 0x5c515
callq 0xc190
movzbl -0x2(%r15,%rbx), %ecx
cmpl $0xa, %ecx
je 0x5c4e3
testb %cl, %cl
js 0x5c4e3
cmpb $0xd, %cl
je 0x5c4e3
movq (%rax), %rax
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
je 0x5c519
cmpb $0xa, %cl
jne 0x5c50d
leaq -0x1(%rbx), %rax
cmpq %r14, %rax
jae 0x5c4f9
cmpb $0xa, -0x1(%r15,%rbx)
je 0x5c52b
cmpq %r14, %rbx
jae 0x5c50d
cmpb $0xd, -0x1(%r15,%rbx)
jne 0x5c50d
cmpb $0xa, (%r15,%rbx)
je 0x5c52f
decl %r12d
incq %rbx
jmp 0x5c4b2
xorl %eax, %eax
jmp 0x5c51c
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %eax
jmp 0x5c51c
negl %r12d
movl %r12d, %eax
jmp 0x5c51c
// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %rbx
movq %rdi, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x5c5d7
testb $-0x80, 0xa0(%r14)
je 0x5c586
movl $0xa8, %edi
callq 0xca30
testq %rax, %rax
je 0x5c586
movq %rax, %r15
movl $0xa8, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc0f0
movq %rbx, 0x18(%r15)
movq (%rbx), %rax
movq %rax, (%r15)
movq %r15, (%rbx)
andq $0x0, 0x8(%r15)
testq %rax, %rax
je 0x5c586
movq %r15, 0x8(%rax)
jmp 0x5c586
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %r15d, %r15d
leaq 0x2b0d9(%rip), %r12     # 0x87970
pushq $-0x1
popq %rbx
movq (%r12), %rdi
testq %rdi, %rdi
je 0x5c8bb
movq %r14, %rsi
callq 0xc970
testl %eax, %eax
je 0x5c8b8
incl %r15d
addq $0x10, %r12
jmp 0x5c89a
movl %r15d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc470
leaq 0x1(%rax), %rdi
callq 0xca30
testq %rax, %rax
je 0x5c8f3
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_O2/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 0x5c939
movq %rdi, %r12
cmpb $0x0, (%rdi)
je 0x5c939
movq %rdx, %r14
movq %rsi, %rbx
movq %r12, (%rsi)
pushq $0x2c
popq %rsi
movq %r12, %rdi
callq 0xc600
testq %rax, %rax
je 0x5c93e
movq %rax, %r15
subq %r12, %rax
incq %r15
jmp 0x5c94c
xorl %r15d, %r15d
jmp 0x5c995
movq %r12, %rdi
callq 0xc470
movq %rax, %r15
addq %r12, %r15
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0x5c995
andq $0x0, 0x8(%r14)
movq 0x8(%rbx), %r13
pushq $0x3d
popq %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0xc4d0
movq %rax, (%r14)
testq %rax, %rax
je 0x5c995
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
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5ca07
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 0xba39(%rip), %rdx      # 0x68447
leaq -0x20f0(%rbp), %r14
movl $0x2000, %r12d          # imm = 0x2000
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
movq %r10, %rcx
xorl %eax, %eax
callq 0xc5e0
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 0xcd90
addl %r13d, %eax
incl %eax
movslq %eax, %rcx
leaq 0x1d(%rip), %rsi        # 0x5ca92
movq %rbx, %rdi
movq %r14, %rdx
callq 0x58aa1
addq $0x20c8, %rsp           # imm = 0x20C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%r14)
movq 0x80(%rdi), %r15
leaq 0xcf6d(%rip), %rsi      # 0x69a25
leaq -0x1c(%rbp), %rcx
movq %rdx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc110
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 0x5cb00
movslq -0x1c(%rbp), %rcx
addq %rcx, %rbx
movq %r15, %rdi
addq $0x8, %rdi
movq %rbx, 0x2a0(%r15)
pushq $0x64
popq %rsi
callq *%rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0xd0, %esi
callq 0xc9a0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x58b20
pushq $0x38
popq %r15
leaq 0x2ade3(%rip), %r12     # 0x87970
cmpq $0x0, -0x70(%r12,%r15,2)
je 0x5cbbe
movq -0x68(%r12,%r15,2), %rdi
cmpq $0x0, (%r14,%r15)
sete %al
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x5cbb8
callq 0x5c8c6
movq %rax, (%r14,%r15)
addq $0x8, %r15
jmp 0x5cb8d
movq %rbx, 0x30(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_vsnprintf
static int mg_vsnprintf(char *buf, size_t buflen, const char *fmt, va_list ap) {
  int n;
  if (buflen < 1) return 0;
  n = vsnprintf(buf, buflen, fmt, ap);
  if (n < 0) {
    n = 0;
  } else if (n >= (int) buflen) {
    n = (int) buflen - 1;
  }
  buf[n] = '\0';
  return n;
}

// Assembly:
testq %rsi, %rsi
je 0x5d351
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0xcd90
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)
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb8a7(%rip), %rbx      # 0x68dbc
cmovneq %rax, %rbx
movl $0xf000, %eax           # imm = 0xF000
movl 0x28(%rdi), %ecx
andl %eax, %ecx
andl 0x28(%rsi), %eax
cmpl $0x4000, %ecx           # imm = 0x4000
jne 0x5d539
cmpl $0x4000, %eax           # imm = 0x4000
je 0x5d545
pushq $-0x1
jmp 0x5d542
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x5d545
pushq $0x1
popq %rcx
jmp 0x5d597
movzbl (%rbx), %ecx
cmpl $0x64, %ecx
je 0x5d576
cmpl $0x73, %ecx
je 0x5d568
xorl %eax, %eax
cmpl $0x6e, %ecx
jne 0x5d58c
movq 0x8(%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0xc970
jmp 0x5d58c
movq 0x40(%rdi), %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq 0x40(%rsi), %rax
jmp 0x5d582
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_O2/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 %rbx
subq $0xc8, %rsp
movq %rdx, -0xd0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %r8, -0xc0(%rbp)
movq %r9, -0xb8(%rbp)
testb %al, %al
je 0x5d618
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)
movslq 0x2208(%rdi), %rax
movl $0x1ffe, %r15d          # imm = 0x1FFE
subl %eax, %r15d
js 0x5d6ae
movq %rsi, %r10
movq %rdi, %rbx
leaq (%rdi,%rax), %r14
addq $0x8, %r14
leaq -0xe0(%rbp), %rax
leaq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movl %r15d, %esi
movq %r14, %rdi
movq %r10, %rdx
callq 0x5d31b
testl %eax, %eax
jle 0x5d69d
incl %eax
cmpl %r15d, %eax
jae 0x5d69d
movslq 0x220c(%rbx), %rcx
cmpq $0x3d, %rcx
jg 0x5d69d
leal 0x1(%rcx), %edx
movl %edx, 0x220c(%rbx)
movq %r14, 0x2008(%rbx,%rcx,8)
addl %eax, 0x2208(%rbx)
movq %r14, %rax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xba04(%rip), %rdi      # 0x690b9
leaq 0xab87(%rip), %rsi      # 0x68243
leaq 0xba01(%rip), %rcx      # 0x690c4
movl $0x88a, %edx            # imm = 0x88A
callq 0xc220
// File: /workspace/github_c_makefile_star2_O2/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 0xc470
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 0x5c8fa
testq %rax, %rax
je 0x5d779
movq %rax, %rbx
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq %r15, %rdi
subq %rdx, %rdi
callq 0x5a293
testl %eax, %eax
jne 0x5d73f
movups -0x50(%rbp), %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
jmp 0x5d79b
leaq 0x41b5(%rip), %rsi      # 0x61935
movq %r14, %rdi
callq 0x5994e
movq -0x30(%rbp), %rbx
movq %rax, (%rbx)
movq %rax, %rdi
callq 0xc470
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_O2/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 0xb676(%rip), %rsi      # 0x69257
leaq -0x2010(%rbp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0xc110
cmpl $0x1, %eax
jne 0x5dc27
leaq 0xb737(%rip), %rsi      # 0x69335
leaq -0x2010(%rbp), %rdi
callq 0xc940
testq %rax, %rax
je 0x5dc3d
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5dc70
movq %r14, %rdi
callq 0xc0d0
jmp 0x5dc64
leaq 0xb677(%rip), %rsi      # 0x692a5
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x58c06
jmp 0x5dc64
callq 0xcb50
movl (%rax), %edi
callq 0xc8d0
leaq 0xb669(%rip), %rsi      # 0x692b9
leaq -0x2010(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x58c06
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x2020(%rbp), %r15
pushq $0x1
popq %r12
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0xc610
testq %rax, %rax
je 0x5dcbb
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x59168
jmp 0x5dc93
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdi, %r15
movq (%rdi), %r12
movq 0x10(%rdi), %rbx
leaq 0x6b48(%rip), %rsi      # 0x64899
callq 0x58dc0
testq %r12, %r12
je 0x5ddac
movq %rax, %r14
leaq 0x6c08(%rip), %rsi      # 0x6496d
movq %r12, %rdi
callq 0xc970
testl %eax, %eax
je 0x5dd7b
cmpl $0x3, 0x2b0(%r15)
jne 0x5ddac
testq %r14, %r14
je 0x5dd91
leaq 0xb690(%rip), %rsi      # 0x69417
movq %r14, %rdi
callq 0x58e28
jmp 0x5dda5
testq %rbx, %rbx
je 0x5ddac
leaq 0xb12d(%rip), %rsi      # 0x68eca
movq %rbx, %rdi
callq 0xc970
testl %eax, %eax
sete %al
jmp 0x5ddae
xorl %eax, %eax
movzbl %al, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x58dc0
testq %rax, %rax
je 0x5e4ab
leaq 0xad70(%rip), %rsi      # 0x69208
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xc260
leaq 0xafae(%rip), %rdi      # 0x69460
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xc390
// File: /workspace/github_c_makefile_star2_O2/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 0x5e4cb
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x40(%r14), %r15
movq 0x48(%r14), %rsi
movq %r15, %rdi
callq 0x5c491
movslq %eax, %r12
movq %r12, 0x2e0(%rbx)
testl %r12d, %r12d
jle 0x5e593
movq %r12, %rdi
callq 0xca30
movq %rax, 0x2c8(%rbx)
testq %rax, %rax
je 0x5e579
addq $0x40, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xc0f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x5777d
movq 0x2c8(%rbx), %rdi
movq 0x2e0(%rbx), %rsi
leaq 0x8(%rbx), %r14
movq %r14, %rdx
callq 0x5f251
movq %rax, 0x2e0(%rbx)
testq %rax, %rax
jle 0x5e593
leaq 0x63e7(%rip), %rsi      # 0x64944
movq %r14, %rdi
callq 0x58dc0
testq %rax, %rax
je 0x5e583
pushq $0xa
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0xc8c0
jmp 0x5e585
orb $0x10, 0xa0(%r14)
jmp 0x5e593
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_O2/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 %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %r14
movq (%rdi), %rbx
movq %rbx, %rdi
callq 0xc890
movq %rax, %r15
addq %rbx, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xc670
addq %r15, %rax
cmpq %rax, %r15
jae 0x5f542
movb $0x0, (%r15)
incq %r15
jmp 0x5f534
movq %rax, (%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %r13
xorl %r15d, %r15d
leaq 0x8df7(%rip), %r12      # 0x6836a
cmpq $0x1e0, %r15            # imm = 0x1E0
je 0x5f5c3
movq %r14, %rdi
leaq 0x4bcc(%rip), %rsi      # 0x64152
callq 0x5f504
movq %rax, 0x88(%rbx,%r15)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5f504
movq %rax, 0x90(%rbx,%r15)
movq 0x88(%rbx,%r15), %rax
cmpb $0x0, (%rax)
je 0x5f5c3
movl %r13d, 0x84(%rbx)
addq $0x10, %r15
incl %r13d
jmp 0x5f573
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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), %r13d
leal (,%rdx,8), %eax
movq %rdx, %rcx
shrq $0x1d, %rcx
addl %r13d, %eax
movl %eax, 0x14(%rdi)
adcl %ecx, 0x18(%rdi)
shrl $0x3, %r13d
andl $0x3f, %r13d
leaq (%rdx,%r13), %rax
cmpq $0x40, %rax
jb 0x5f663
leaq 0x1c(%r15), %rax
movq %rax, -0x30(%rbp)
leaq (%r15,%r13), %rdi
addq $0x1c, %rdi
pushq $0x40
popq %r12
subq %r13, %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0xc0f0
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x5f68d
xorl %r13d, %r13d
leaq 0x3f(%r12), %rax
cmpq %rbx, %rax
jae 0x5f666
leaq (%r14,%r12), %rsi
movq %r15, %rdi
callq 0x5f68d
addq $0x40, %r12
jmp 0x5f647
xorl %r12d, %r12d
leaq (%r15,%r13), %rdi
addq $0x1c, %rdi
addq %r12, %r14
subq %r12, %rbx
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc0f0
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: send_options
static void send_options(struct connection *conn) {
  conn->mg_conn.status_code = 200;
  mg_printf(&conn->mg_conn, "%s",
            "HTTP/1.1 200 OK\r\nAllow: GET, POST, HEAD, CONNECT, PUT, "
            "DELETE, OPTIONS, PROPFIND, MKCOL\r\nDAV: 1\r\n\r\n");
  close_local_endpoint(conn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rdi
movl $0xc8, 0x284(%rbx)
leaq 0x5bdd(%rip), %rsi      # 0x6632f
leaq 0x8e8d(%rip), %rdx      # 0x695e6
xorl %eax, %eax
callq 0x58c06
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59b05
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x58(%rdx), %rax
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
leaq -0x70(%rbp), %r12
movq %r12, %rdi
callq 0x5dd09
addq $0x8, %r15
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rbx), %eax
cmpl $0x4000, %eax           # imm = 0x4000
leaq 0x8f83(%rip), %rax      # 0x6979c
leaq 0x6e32(%rip), %rcx      # 0x67652
cmoveq %rax, %rcx
movq 0x30(%rbx), %r8
leaq 0x8e79(%rip), %rsi      # 0x696a8
movq %r15, %rdi
movq %r14, %rdx
movq %r12, %r9
xorl %eax, %eax
callq 0x58c06
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc6b0
testq %rax, %rax
je 0x6090d
movq %rax, %r14
leaq -0x20c0(%rbp), %r12
leaq -0xb8(%rbp), %r15
movl $0xf000, %r13d          # imm = 0xF000
movq %r14, %rdi
callq 0xc6c0
testq %rax, %rax
je 0x608fd
cmpb $0x2e, 0x13(%rax)
jne 0x608ad
cmpb $0x0, 0x14(%rax)
je 0x60888
cmpb $0x2e, 0x14(%rax)
jne 0x608ad
cmpb $0x0, 0x15(%rax)
je 0x60888
addq $0x13, %rax
movl $0x2000, %esi           # imm = 0x2000
movq %r12, %rdi
leaq 0x84f5(%rip), %rdx      # 0x68db5
movq %rbx, %rcx
pushq $0x2f
popq %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x5bc9e
movq %r12, %rdi
movq %r15, %rsi
callq 0xcba0
movl -0xa0(%rbp), %eax
andl %r13d, %eax
movq %r12, %rdi
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x608f6
callq 0x6084c
jmp 0x60888
callq 0xc290
jmp 0x60888
movq %r14, %rdi
callq 0xc680
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_O2/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
pushq $0x64
popq %rdx
movq %r14, %rsi
callq 0x57f64
leaq (%r15,%r12,2), %rcx
addq $0x88, %rcx
leaq 0x9064(%rip), %rsi      # 0x699e1
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc110
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: on_cgi_data
static void on_cgi_data(struct ns_connection *nc) {
  struct connection *conn = (struct connection *) nc->user_data;
  const char *status = "500";
  struct mg_connection c;

  if (!conn) return;

  // Copy CGI data from CGI socket to the client send buffer
  ns_forward(nc, conn->ns_conn);

  // If reply has not been parsed yet, parse it
  if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) {
    struct iobuf *io = &conn->ns_conn->send_iobuf;
    size_t s_len = sizeof(cgi_status) - 1;
    int len = get_request_len(io->buf + s_len, io->len - s_len);
    char buf[MAX_REQUEST_SIZE], *s = buf;

    if (len == 0) return;

    if (len < 0 || len > (int) sizeof(buf)) {
      len = io->len;
      iobuf_remove(io, io->len);
      send_http_error(conn, 500, "CGI program sent malformed headers: [%.*s]",
        len, io->buf);
    } else {
      memset(&c, 0, sizeof(c));
      memcpy(buf, io->buf + s_len, len);
      buf[len - 1] = '\0';
      parse_http_headers(&s, &c);
      if (mg_get_header(&c, "Location") != NULL) {
        status = "302";
      } else if ((status = (char *) mg_get_header(&c, "Status")) == NULL) {
        status = "200";
      }
      memcpy(io->buf + 9, status, 3);
      conn->mg_conn.status_code = atoi(status);
    }
    conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x42a8, %rsp           # imm = 0x42A8
movq 0x80(%rdi), %rbx
testq %rbx, %rbx
je 0x60ae0
movq (%rbx), %rsi
callq 0x5f220
movq (%rbx), %r14
testb $0x2, 0xa0(%r14)
je 0x60ae0
movq 0x58(%r14), %r15
movq 0x60(%r14), %r12
addq $0x11, %r15
leaq -0x11(%r12), %rsi
movq %r15, %rdi
callq 0x5c491
movl %eax, %r13d
leaq -0x42d0(%rbp), %rax
movq %rax, -0x30(%rbp)
testl %r13d, %r13d
je 0x60ae0
addq $0x58, %r14
cmpl $0x4001, %r13d          # imm = 0x4001
jb 0x60a3d
movq %r14, %rdi
movq %r12, %rsi
callq 0x5777d
movq (%r14), %r8
leaq 0x8fc7(%rip), %rdx      # 0x699ed
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movl %r12d, %ecx
xorl %eax, %eax
callq 0x5bd71
jmp 0x60ad6
leaq -0x2d0(%rbp), %r12
movl $0x2a0, %edx            # imm = 0x2A0
movq %r12, %rdi
xorl %esi, %esi
callq 0xc370
movl %r13d, %edx
leaq -0x42d0(%rbp), %rdi
movq %r15, %rsi
callq 0xc0f0
decl %r13d
movb $0x0, -0x42d0(%rbp,%r13)
leaq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x5f551
leaq 0x8f94(%rip), %rsi      # 0x69a18
movq %r12, %rdi
callq 0x58dc0
testq %rax, %rax
je 0x60a9a
leaq 0x8f89(%rip), %rdi      # 0x69a21
jmp 0x60abb
leaq 0x7a99(%rip), %rsi      # 0x6853a
leaq -0x2d0(%rbp), %rdi
callq 0x58dc0
testq %rax, %rax
leaq 0x8440(%rip), %rdi      # 0x68ef7
cmovneq %rax, %rdi
movq (%r14), %rax
movb 0x2(%rdi), %cl
movb %cl, 0xb(%rax)
movzwl (%rdi), %ecx
movw %cx, 0x9(%rax)
callq 0xc380
movl %eax, 0x284(%rbx)
movq (%rbx), %rax
andl $-0x3, 0xa0(%rax)
addq $0x42a8, %rsp           # imm = 0x42A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: call_http_client_handler
static void call_http_client_handler(struct connection *conn) {
  //conn->mg_conn.status_code = code;
  // For responses without Content-Lengh, use the whole buffer
  if (conn->cl == 0) {
    conn->mg_conn.content_len = conn->ns_conn->recv_iobuf.len;
  }
  conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf;
  if (call_user(conn, MG_REPLY) == MG_FALSE) {
    conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
  }
  iobuf_remove(&conn->ns_conn->recv_iobuf, conn->mg_conn.content_len);
  conn->mg_conn.status_code = 0;
  conn->cl = conn->num_bytes_recv = conn->request_len = 0;
  NS_FREE(conn->request);
  conn->request = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x2d8(%rdi)
movq (%rdi), %rax
jne 0x60b13
movq 0x48(%rax), %rcx
movq %rcx, 0x278(%rbx)
movq 0x40(%rax), %rax
movq %rax, 0x270(%rbx)
pushq $0x68
popq %rsi
movq %rbx, %rdi
callq 0x5d354
movq (%rbx), %rdi
testl %eax, %eax
jne 0x60b37
orb $0x10, 0xa0(%rdi)
addq $0x40, %rdi
movq 0x278(%rbx), %rsi
callq 0x5777d
andl $0x0, 0x284(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x2d0(%rbx)
andq $0x0, 0x2e0(%rbx)
movq 0x2c8(%rbx), %rdi
callq 0xc250
andq $0x0, 0x2c8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: transfer_file_data
static void transfer_file_data(struct connection *conn) {
  char buf[IOBUF_SIZE];
  size_t n;

  // If output buffer is too big, don't send anything. Wait until
  // mongoose drains already buffered data to the client.
  if (conn->ns_conn->send_iobuf.len > sizeof(buf) * 2) return;

  // Do not send anyt
  n = read(conn->endpoint.fd, buf, conn->cl < (int64_t) sizeof(buf) ?
           (int) conn->cl : (int) sizeof(buf));

  if (n <= 0) {
    close_local_endpoint(conn);
  } else if (n > 0) {
    conn->cl -= n;
    ns_send(conn->ns_conn, buf, n);
    if (conn->cl <= 0) {
      close_local_endpoint(conn);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq (%rdi), %rax
cmpq $0x4000, 0x60(%rax)     # imm = 0x4000
ja 0x60bef
movq %rdi, %rbx
movl 0x2b0(%rdi), %edi
movq 0x2d8(%rbx), %rax
movl $0x2000, %ecx           # imm = 0x2000
cmpq %rcx, %rax
movslq %eax, %rdx
cmovgeq %rcx, %rdx
leaq -0x2010(%rbp), %rsi
callq 0xc8a0
testq %rax, %rax
je 0x60bf9
subq %rax, 0x2d8(%rbx)
movq (%rbx), %rdi
leaq -0x2010(%rbp), %rsi
movq %rax, %rdx
callq 0x57905
cmpq $0x0, 0x2d8(%rbx)
jg 0x60bef
movq %rbx, %rdi
callq 0x59b05
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %rbp
jmp 0x59b05
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: read_file_header
int read_file_header(FILE *in, struct file_header_t *file_header)
{
  // Align to 2 bytes if needed.
  while ((ftell(in) % 2) != 0) { getc(in); }

  file_header->offset = ftell(in);

  if (fread(file_header->name,     1, 16, in) != 16) { return -1; }
  if (fread(file_header->date,     1, 12, in) != 12) { return -1; }
  if (fread(file_header->user_id,  1,  6, in) !=  6) { return -1; }
  if (fread(file_header->group_id, 1,  6, in) !=  6) { return -1; }
  if (fread(file_header->mode,     1,  8, in) !=  8) { return -1; }
  if (fread(file_header->size,     1, 10, in) != 10) { return -1; }
  if (fread(file_header->end,      1,  2, in) !=  2) { return -1; }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x10c0
movq %rbx, %rdi
testb $0x1, %al
je 0x127c
callq 0x1150
jmp 0x1266
callq 0x10c0
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %rcx
callq 0x1070
pushq $-0x1
popq %rbp
cmpq $0x10, %rax
jne 0x1340
leaq 0x18(%r14), %rdi
pushq $0x1
popq %rsi
pushq $0xc
popq %rdx
movq %rbx, %rcx
callq 0x1070
cmpq $0xc, %rax
jne 0x1340
leaq 0x24(%r14), %rdi
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rcx
callq 0x1070
cmpq $0x6, %rax
jne 0x1340
leaq 0x2a(%r14), %rdi
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rcx
callq 0x1070
cmpq $0x6, %rax
jne 0x1340
leaq 0x30(%r14), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rcx
callq 0x1070
cmpq $0x8, %rax
jne 0x1340
leaq 0x38(%r14), %rdi
pushq $0x1
popq %rsi
pushq $0xa
popq %rdx
movq %rbx, %rcx
callq 0x1070
cmpq $0xa, %rax
jne 0x1340
addq $0x42, %r14
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x1070
xorl %ebp, %ebp
cmpq $0x2, %rax
setne %bpl
negl %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: read_coff_header
int read_coff_header(FILE *in, struct coff_header_t *coff_header)
{
  coff_header->offset = ftell(in);

  coff_header->magic = read_uint16(in);
  coff_header->section_count = read_uint16(in);

  // It seems like if the magic number is 0 (and I guess section count
  // is 0xffff) that this isn't a COFF section.
  if (coff_header->magic == 0 && coff_header->section_count == 0xffff)
  {
    return -2;
  }

  coff_header->timestamp = read_uint32(in);
  coff_header->symbol_table_pointer = read_uint32(in);
  coff_header->symbol_count = read_uint32(in);
  coff_header->optional_header_size = read_uint16(in);
  coff_header->flags = read_uint16(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x10c0
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0x8(%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0xa(%rbx)
notl %eax
orw 0x8(%rbx), %ax
jne 0x137e
pushq $-0x2
popq %rax
jmp 0x13b9
movq %r14, %rdi
callq 0x2422
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0x18(%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0x1a(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: read_coff_optional_header
int read_coff_optional_header(
  FILE *in,
  struct coff_optional_header_t *optional_header)
{
  optional_header->offset = ftell(in);

  optional_header->magic = read_uint16(in);
  optional_header->version = read_uint16(in);
  optional_header->text_size = read_uint32(in);
  optional_header->data_size = read_uint32(in);
  optional_header->uninit_size = read_uint32(in);
  optional_header->entry_point = read_uint32(in);
  optional_header->text_start = read_uint32(in);
  optional_header->data_start = read_uint32(in);

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x10c0
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0x8(%rbx)
movq %r14, %rdi
callq 0x2464
movw %ax, 0xa(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0xc(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x1c(%rbx)
movq %r14, %rdi
callq 0x2422
movl %eax, 0x20(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq