LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: is_authorized_for_dav
static int is_authorized_for_dav(struct connection *conn) {
  const char *auth_file = conn->server->config_options[DAV_AUTH_FILE];
  const char *method = conn->mg_conn.request_method;
  FILE *fp;
  int authorized = MG_FALSE;

  // If dav_auth_file is not set, allow non-authorized PROPFIND
  if (method != NULL && !strcmp(method, "PROPFIND") && auth_file == NULL) {
    authorized = MG_TRUE;
  } else if (auth_file != NULL && (fp = fopen(auth_file, "r")) != NULL) {
    authorized = mg_authorize_digest(&conn->mg_conn, fp);
    fclose(fp);
  }

  return authorized;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x2a8(%rax), %rax
movq 0x60(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xbcede
movq -0x18(%rbp), %rdi
leaq 0xaed4(%rip), %rsi      # 0xc7d98
callq 0xdab0
cmpl $0x0, %eax
jne 0xbcede
cmpq $0x0, -0x10(%rbp)
jne 0xbcede
movl $0x1, -0x24(%rbp)
jmp 0xbcf1e
cmpq $0x0, -0x10(%rbp)
je 0xbcf1c
movq -0x10(%rbp), %rdi
leaq 0xad65(%rip), %rsi      # 0xc7c55
callq 0xdd20
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xbcf1c
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
callq 0xb2b90
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd5b0
jmp 0xbcf1e
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1f4, -0x14(%rbp)     # imm = 0x1F4
movq -0x8(%rbp), %rax
cmpq $0x0, 0x278(%rax)
jbe 0xbd19e
movl $0x19f, -0x14(%rbp)     # imm = 0x19F
jmp 0xbd1f9
movq -0x10(%rbp), %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0xd3c0
cmpl $0x0, %eax
jne 0xbd1ba
movl $0xc9, -0x14(%rbp)
jmp 0xbd1f7
callq 0xdcc0
cmpl $0x11, (%rax)
jne 0xbd1cd
movl $0x195, -0x14(%rbp)     # imm = 0x195
jmp 0xbd1f5
callq 0xdcc0
cmpl $0xd, (%rax)
jne 0xbd1e0
movl $0x193, -0x14(%rbp)     # imm = 0x193
jmp 0xbd1f3
callq 0xdcc0
cmpl $0x2, (%rax)
jne 0xbd1f1
movl $0x199, -0x14(%rbp)     # imm = 0x199
jmp 0xbd1f3
jmp 0xbd1f5
jmp 0xbd1f7
jmp 0xbd1f9
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xb3db0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xdd10
cmpl $0x0, %eax
je 0xbd25e
movq -0x8(%rbp), %rdi
movl $0x194, %esi            # imm = 0x194
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xb3db0
jmp 0xbd2cb
movl -0x88(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xbd28f
movq -0x10(%rbp), %rdi
callq 0xbd780
movq -0x8(%rbp), %rdi
movl $0xcc, %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xb3db0
jmp 0xbd2c9
movq -0x10(%rbp), %rdi
callq 0xd300
cmpl $0x0, %eax
jne 0xbd2b3
movq -0x8(%rbp), %rdi
movl $0xcc, %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xb3db0
jmp 0xbd2c7
movq -0x8(%rbp), %rdi
movl $0x1a7, %esi            # imm = 0x1A7
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xb3db0
jmp 0xbd2c9
jmp 0xbd2cb
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: open_auth_file
static FILE *open_auth_file(struct connection *conn, const char *path,
                            int is_directory) {
  char name[MAX_PATH_SIZE];
  const char *p, *gpass = conn->server->config_options[GLOBAL_AUTH_FILE];
  FILE *fp = NULL;

  if (gpass != NULL) {
    // Use global passwords file
    fp = fopen(gpass, "r");
  } else if (is_directory) {
    mg_snprintf(name, sizeof(name), "%s%c%s", path, '/', PASSWORDS_FILE_NAME);
    fp = fopen(name, "r");
  } else {
    // Try to find .htpasswd in requested directory.
    if ((p = strrchr(path, '/')) == NULL) p = path;
    mg_snprintf(name, sizeof(name), "%.*s%c%s",
                (int) (p - path), path, '/', PASSWORDS_FILE_NAME);
    fp = fopen(name, "r");
  }

  return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2040, %rsp           # imm = 0x2040
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x2a8(%rax), %rax
movq 0x90(%rax), %rax
movq %rax, -0x2030(%rbp)
movq $0x0, -0x2038(%rbp)
cmpq $0x0, -0x2030(%rbp)
je 0xbd603
movq -0x2030(%rbp), %rdi
leaq 0xa663(%rip), %rsi      # 0xc7c55
callq 0xdd20
movq %rax, -0x2038(%rbp)
jmp 0xbd6d1
cmpl $0x0, -0x14(%rbp)
je 0xbd650
leaq -0x2020(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0xa09c(%rip), %rdx      # 0xc76bc
movl $0x2f, %r8d
leaq 0xa93d(%rip), %r9       # 0xc7f6a
movb $0x0, %al
callq 0xb3c50
leaq -0x2020(%rbp), %rdi
leaq 0xa613(%rip), %rsi      # 0xc7c55
callq 0xdd20
movq %rax, -0x2038(%rbp)
jmp 0xbd6cf
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0xdbe0
movq %rax, -0x2028(%rbp)
cmpq $0x0, %rax
jne 0xbd676
movq -0x10(%rbp), %rax
movq %rax, -0x2028(%rbp)
leaq -0x2020(%rbp), %rdi
movq -0x2028(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %r8
movl $0x2000, %esi           # imm = 0x2000
leaq 0xa8d7(%rip), %rdx      # 0xc7f74
movl $0x2f, %r9d
leaq 0xa8c0(%rip), %rax      # 0xc7f6a
movq %rax, (%rsp)
movb $0x0, %al
callq 0xb3c50
leaq -0x2020(%rbp), %rdi
leaq 0xa592(%rip), %rsi      # 0xc7c55
callq 0xdd20
movq %rax, -0x2038(%rbp)
jmp 0xbd6d1
movq -0x2038(%rbp), %rax
addq $0x2040, %rsp           # imm = 0x2040
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x40, %esi
leaq -0x68(%rbp), %rdx
callq 0xb8ec0
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x18(%rax), %esi
andl $0xf000, %esi           # imm = 0xF000
leaq 0x8409(%rip), %rcx      # 0xc5b4b
leaq 0xa973(%rip), %rax      # 0xc80bc
cmpl $0x4000, %esi           # imm = 0x4000
cmoveq %rax, %rcx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %r8
leaq -0x60(%rbp), %r9
leaq 0xa862(%rip), %rsi      # 0xc7fc8
movb $0x0, %al
callq 0xb0cb0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20b0, %rsp           # imm = 0x20B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd7c0
movq %rax, -0x20b0(%rbp)
cmpq $0x0, %rax
jne 0xbd7b1
movl $0x0, -0x4(%rbp)
jmp 0xbd899
jmp 0xbd7b3
movq -0x20b0(%rbp), %rdi
callq 0xd7d0
movq %rax, -0x2018(%rbp)
cmpq $0x0, %rax
je 0xbd87d
movq -0x2018(%rbp), %rdi
addq $0x13, %rdi
leaq 0x24b7(%rip), %rsi      # 0xbfc99
callq 0xdab0
cmpl $0x0, %eax
je 0xbd808
movq -0x2018(%rbp), %rdi
addq $0x13, %rdi
leaq 0x249a(%rip), %rsi      # 0xbfc98
callq 0xdab0
cmpl $0x0, %eax
jne 0xbd80a
jmp 0xbd7b3
leaq -0x2010(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq -0x2018(%rbp), %r9
addq $0x13, %r9
movl $0x2000, %esi           # imm = 0x2000
leaq 0x9e90(%rip), %rdx      # 0xc76bc
movl $0x2f, %r8d
movb $0x0, %al
callq 0xb3c50
leaq -0x2010(%rbp), %rdi
leaq -0x20a8(%rbp), %rsi
callq 0xdd10
movl -0x2090(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xbd86c
leaq -0x2010(%rbp), %rdi
callq 0xbd780
jmp 0xbd878
leaq -0x2010(%rbp), %rdi
callq 0xd300
jmp 0xbd7b3
movq -0x20b0(%rbp), %rdi
callq 0xd780
movq -0x10(%rbp), %rdi
callq 0xd590
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20b0, %rsp           # imm = 0x20B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: put_dir
static int put_dir(const char *path) {
  char buf[MAX_PATH_SIZE];
  const char *s, *p;
  file_stat_t st;

  // Create intermediate directories if they do not exist
  for (s = p = path + 1; (p = strchr(s, '/')) != NULL; s = ++p) {
    if (p - path >= (int) sizeof(buf)) return -1; // Buffer overflow
    memcpy(buf, path, p - path);
    buf[p - path] = '\0';
    if (stat(buf, &st) != 0 && mkdir(buf, 0755) != 0) return -1;
    if (p[1] == '\0') return 0;  // Path is a directory itself
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20b0, %rsp           # imm = 0x20B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2020(%rbp)
movq %rax, -0x2018(%rbp)
movq -0x2018(%rbp), %rdi
movl $0x2f, %esi
callq 0xd710
movq %rax, -0x2020(%rbp)
cmpq $0x0, %rax
je 0xbd9bd
movq -0x2020(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
cmpq $0x2000, %rax           # imm = 0x2000
jl 0xbd919
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xbd9c4
leaq -0x2010(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x2020(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
callq 0xd100
movq -0x2020(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movb $0x0, -0x2010(%rbp,%rax)
leaq -0x2010(%rbp), %rdi
leaq -0x20b0(%rbp), %rsi
callq 0xdd10
cmpl $0x0, %eax
je 0xbd984
leaq -0x2010(%rbp), %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0xd3c0
cmpl $0x0, %eax
je 0xbd984
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xbd9c4
movq -0x2020(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0xbd99d
movl $0x0, -0x4(%rbp)
jmp 0xbd9c4
jmp 0xbd99f
movq -0x2020(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2020(%rbp)
movq %rax, -0x2018(%rbp)
jmp 0xbd8d5
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20b0, %rsp           # imm = 0x20B0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: call_request_handler
static int call_request_handler(struct connection *conn) {
  int result;
  conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf;
  if ((result = call_user(conn, MG_REQUEST)) == MG_TRUE) {
    if (conn->ns_conn->flags & MG_USING_CHUNKED_API) {
      terminate_headers(&conn->mg_conn);
      write_terminating_chunk(conn);
    }
    close_local_endpoint(conn);
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x270(%rax)
movq -0x8(%rbp), %rdi
movl $0x67, %esi
callq 0xb7300
movl %eax, -0xc(%rbp)
cmpl $0x1, %eax
jne 0xbdcbe
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0xa0(%rax), %eax
andl $0x200000, %eax         # imm = 0x200000
cmpl $0x0, %eax
je 0xbdcb5
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0xb1af0
movq -0x8(%rbp), %rdi
callq 0xb79c0
movq -0x8(%rbp), %rdi
callq 0xb23e0
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: on_accept
static void on_accept(struct ns_connection *nc, union socket_address *sa) {
  struct mg_server *server = (struct mg_server *) nc->mgr;
  struct connection *conn;

  if (!check_acl(server->config_options[ACCESS_CONTROL_LIST],
                 ntohl(* (uint32_t *) &sa->sin.sin_addr)) ||
      (conn = (struct connection *) NS_CALLOC(1, sizeof(*conn))) == NULL) {
    nc->flags |= NSF_CLOSE_IMMEDIATELY;
  } else {
    // Circularly link two connection structures
    nc->user_data = conn;
    conn->ns_conn = nc;

    // Initialize the rest of connection attributes
    conn->server = server;
    conn->mg_conn.server_param = nc->mgr->user_data;
    set_ips(nc, 1);
    set_ips(nc, 0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0xded0
movq -0x28(%rbp), %rdi
movl %eax, %esi
callq 0xbe440
cmpl $0x0, %eax
je 0xbdd4d
movl $0x1, %edi
movl $0x2e8, %esi            # imm = 0x2E8
callq 0xdaf0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0xbdd62
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0xa0(%rax)
jmp 0xbddbb
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x2a8(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x290(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xbddd0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xbddd0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
leaq -0x90(%rbp), %rsi
movl -0xc(%rbp), %edx
movl $0x3, %ecx
movl $0x7, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movl $0x64, %edx
callq 0xaf9d0
leaq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0xbde4d
movq -0x20(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xa0(%rbp)
jmp 0xbde5c
movq -0x20(%rbp), %rax
addq $0x50, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0xbde83
movq -0x20(%rbp), %rax
addq $0x80, %rax
movq %rax, -0xb0(%rbp)
jmp 0xbde94
movq -0x20(%rbp), %rax
addq $0x82, %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdx
movq -0x98(%rbp), %rdi
movq -0xb0(%rbp), %rcx
leaq 0xa451(%rip), %rsi      # 0xc8301
movb $0x0, %al
callq 0xd130
addq $0xb0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: process_udp
static void process_udp(struct ns_connection *nc) {
  struct iobuf *io = &nc->recv_iobuf;
  struct connection conn;

  memset(&conn, 0, sizeof(conn));
  conn.ns_conn = nc;
  conn.server = (struct mg_server *) nc->mgr;
  conn.request_len = parse_http_message(io->buf, io->len, &conn.mg_conn);
  on_recv_data(&conn);
  //ns_printf(nc, "%s", "HTTP/1.0 200 OK\r\n\r\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x10(%rbp)
leaq -0x2f8(%rbp), %rdi
xorl %esi, %esi
movl $0x2e8, %edx            # imm = 0x2E8
callq 0xd430
movq -0x8(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x2f8(%rbp), %rdx
addq $0x8, %rdx
callq 0xb9e30
movq %rax, -0x18(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0xb9310
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: process_response
static void process_response(struct connection *conn) {
  struct iobuf *io = &conn->ns_conn->recv_iobuf;

  try_parse(conn);
  DBG(("%p %d %lu", conn, conn->request_len, (unsigned long)io->len));
  if (conn->request_len < 0 ||
      (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE)) {
    call_http_client_handler(conn);
  } else if ((int64_t) io->len >= conn->cl) {
    call_http_client_handler(conn);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x40, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb9600
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2e0(%rax)
jl 0xbe1be
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2e0(%rax)
jne 0xbe1c9
movq -0x10(%rbp), %rax
cmpq $0x4000, 0x8(%rax)      # imm = 0x4000
jbe 0xbe1c9
movq -0x8(%rbp), %rdi
callq 0xbe1f0
jmp 0xbe1e9
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x2d8(%rcx), %rax
jl 0xbe1e7
movq -0x8(%rbp), %rdi
callq 0xbe1f0
jmp 0xbe1e9
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2d8(%rax)
jne 0xbe220
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x278(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x270(%rax)
movq -0x8(%rbp), %rdi
movl $0x68, %esi
callq 0xb7300
cmpl $0x0, %eax
jne 0xbe25f
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0xa0(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0xa0(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
addq $0x40, %rdi
movq -0x8(%rbp), %rax
movq 0x278(%rax), %rsi
callq 0xaedd0
movq -0x8(%rbp), %rax
movl $0x0, 0x284(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x2e0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x2d0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x2d8(%rax)
movq -0x8(%rbp), %rax
movq 0x2c8(%rax), %rdi
callq 0xd2c0
movq -0x8(%rbp), %rax
movq $0x0, 0x2c8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x2030, %rsp           # imm = 0x2030
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpq $0x4000, 0x60(%rax)     # imm = 0x4000
jbe 0xbe305
jmp 0xbe3e6
movq -0x8(%rbp), %rax
movl 0x2b0(%rax), %eax
movl %eax, -0x2024(%rbp)
leaq -0x2010(%rbp), %rax
movq %rax, -0x2020(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x2000, 0x2d8(%rax) # imm = 0x2000
jge 0xbe347
movq -0x8(%rbp), %rax
movq 0x2d8(%rax), %rax
movl %eax, -0x2028(%rbp)
jmp 0xbe354
movl $0x2000, %eax           # imm = 0x2000
movl %eax, -0x2028(%rbp)
jmp 0xbe354
movq -0x2020(%rbp), %rsi
movl -0x2024(%rbp), %edi
movl -0x2028(%rbp), %eax
movslq %eax, %rdx
callq 0xd9d0
movq %rax, -0x2018(%rbp)
cmpq $0x0, -0x2018(%rbp)
ja 0xbe38b
movq -0x8(%rbp), %rdi
callq 0xb23e0
jmp 0xbe3e6
cmpq $0x0, -0x2018(%rbp)
jbe 0xbe3e4
movq -0x2018(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x2d8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x2d8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq -0x2010(%rbp), %rsi
movq -0x2018(%rbp), %rdx
callq 0xafce0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2d8(%rax)
jg 0xbe3e2
movq -0x8(%rbp), %rdi
callq 0xb23e0
jmp 0xbe3e4
jmp 0xbe3e6
addq $0x2030, %rsp           # imm = 0x2030
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: check_acl
static int check_acl(const char *acl, uint32_t remote_ip) {
  int allowed, flag;
  uint32_t net, mask;
  struct vec vec;

  // If any ACL is set, deny by default
  allowed = acl == NULL ? '+' : '-';

  while ((acl = next_option(acl, &vec, NULL)) != NULL) {
    flag = vec.ptr[0];
    if ((flag != '+' && flag != '-') ||
        parse_net(&vec.ptr[1], &net, &mask) == 0) {
      return -1;
    }

    if (net == (remote_ip & mask)) {
      allowed = flag;
    }
  }

  return allowed == '+';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdx
movl $0x2d, %eax
movl $0x2b, %ecx
cmpq $0x0, %rdx
cmovel %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xb5ad0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0xbe4d0
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x2b, -0x1c(%rbp)
je 0xbe498
cmpl $0x2d, -0x1c(%rbp)
jne 0xbe4b2
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0xbe4f0
cmpl $0x0, %eax
jne 0xbe4bb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xbe4df
movl -0x20(%rbp), %eax
movl -0x14(%rbp), %ecx
andl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jne 0xbe4ce
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0xbe467
cmpl $0x2b, -0x18(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: parse_net
static int parse_net(const char *spec, uint32_t *net, uint32_t *mask) {
  int n, a, b, c, d, slash = 32, len = 0;

  if ((sscanf(spec, "%d.%d.%d.%d/%d%n", &a, &b, &c, &d, &slash, &n) == 5 ||
      sscanf(spec, "%d.%d.%d.%d%n", &a, &b, &c, &d, &n) == 4) &&
      isbyte(a) && isbyte(b) && isbyte(c) && isbyte(d) &&
      slash >= 0 && slash < 33) {
    len = n;
    *net = ((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | d;
    *mask = slash ? 0xffffffffU << (32 - slash) : 0;
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x20, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9dc5(%rip), %rsi      # 0xc82e2
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x28(%rbp), %r8
leaq -0x2c(%rbp), %r9
leaq -0x30(%rbp), %r10
leaq -0x1c(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xd130
cmpl $0x5, %eax
je 0xbe57d
movq -0x8(%rbp), %rdi
leaq 0x9d9e(%rip), %rsi      # 0xc82f3
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x28(%rbp), %r8
leaq -0x2c(%rbp), %r9
leaq -0x1c(%rbp), %rax
movq %rax, (%rsp)
movb $0x0, %al
callq 0xd130
cmpl $0x4, %eax
jne 0xbe610
movl -0x20(%rbp), %edi
callq 0xbe620
cmpl $0x0, %eax
je 0xbe610
movl -0x24(%rbp), %edi
callq 0xbe620
cmpl $0x0, %eax
je 0xbe610
movl -0x28(%rbp), %edi
callq 0xbe620
cmpl $0x0, %eax
je 0xbe610
movl -0x2c(%rbp), %edi
callq 0xbe620
cmpl $0x0, %eax
je 0xbe610
cmpl $0x0, -0x30(%rbp)
jl 0xbe610
cmpl $0x21, -0x30(%rbp)
jge 0xbe610
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x20(%rbp), %ecx
shll $0x18, %ecx
movl -0x24(%rbp), %eax
shll $0x10, %eax
orl %eax, %ecx
movl -0x28(%rbp), %eax
shll $0x8, %eax
orl %eax, %ecx
orl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x30(%rbp)
je 0xbe600
movl $0x20, %ecx
subl -0x30(%rbp), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
movl %eax, -0x38(%rbp)
jmp 0xbe607
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0xbe607
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movl $0x2, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x1274
movq -0x10(%rbp), %rdi
callq 0x1130
jmp 0x1250
movq -0x10(%rbp), %rdi
callq 0x10a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x10, %edx
callq 0x1050
cmpq $0x10, %rax
je 0x12b4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0xc, %edx
callq 0x1050
cmpq $0xc, %rax
je 0x12e1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movq -0x18(%rbp), %rdi
addq $0x24, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x6, %edx
callq 0x1050
cmpq $0x6, %rax
je 0x130e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movq -0x18(%rbp), %rdi
addq $0x2a, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x6, %edx
callq 0x1050
cmpq $0x6, %rax
je 0x133b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x8, %edx
callq 0x1050
cmpq $0x8, %rax
je 0x1365
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0xa, %edx
callq 0x1050
cmpq $0xa, %rax
je 0x138f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movq -0x18(%rbp), %rdi
addq $0x42, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x2, %edx
callq 0x1050
cmpq $0x2, %rax
je 0x13b9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x18(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0x1440
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x1440
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x14a5
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x1a(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: read_coff_section_header
int read_coff_section_header(
  FILE *in,
  struct coff_section_header_t *section_header)
{
  section_header->offset = ftell(in);

  if (fread(section_header->name, 1, 8, in) != 8) { return -1; }

  section_header->physical_address = read_uint32(in);
  section_header->virtual_address = read_uint32(in);
  section_header->size = read_uint32(in);
  section_header->file_offset_section_data = read_uint32(in);
  section_header->file_offset_relocation_table = read_uint32(in);
  section_header->file_offset_line_number = read_uint32(in);
  section_header->relocation_count = read_uint16(in);
  section_header->line_number_count = read_uint16(in);
  section_header->flags = read_uint32(in);

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x8, %edx
callq 0x1050
cmpq $0x8, %rax
je 0x15c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x166d
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x10(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x2e50
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x2a(%rax)
movq -0x10(%rbp), %rdi
callq 0x2df0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_file_header
void print_file_header(struct file_header_t *file_header)
{
  printf(" --- file header 0x%06lx ---\n", file_header->offset);
  printf("        name: %.16s\n", file_header->name);
  printf("        date: %.12s\n", file_header->date);
  printf("     user_id: %.6s\n", file_header->user_id);
  printf("    group_id: %.6s\n", file_header->group_id);
  printf("        mode: %.8s\n", file_header->mode);
  printf("        size: %.10s\n", file_header->size);
  printf("         end: %.2s\n", file_header->end);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x49a6(%rip), %rdi      # 0x6040
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
leaq 0x49ae(%rip), %rdi      # 0x605e
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x18, %rsi
leaq 0x49ad(%rip), %rdi      # 0x6073
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x24, %rsi
leaq 0x49ac(%rip), %rdi      # 0x6088
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x2a, %rsi
leaq 0x49aa(%rip), %rdi      # 0x609c
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x30, %rsi
leaq 0x49a8(%rip), %rdi      # 0x60b0
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x38, %rsi
leaq 0x49a6(%rip), %rdi      # 0x60c4
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x42, %rsi
leaq 0x49a5(%rip), %rdi      # 0x60d9
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_coff_header
void print_coff_header(struct coff_header_t *coff_header)
{
  printf(" --- coff header 0x%06lx ---\n", coff_header->offset);
  printf("                magic: 0x%04x\n", coff_header->magic);
  printf("        section_count: %d\n", coff_header->section_count);
  printf("            timestamp: %d\n", coff_header->timestamp);
  printf(" symbol_table_pointer: 0x%04x\n", coff_header->symbol_table_pointer);
  printf("         symbol_count: %d\n", coff_header->symbol_count);
  printf(" optional_header_size: %d\n", coff_header->optional_header_size);
  printf("                flags: %08x\n", coff_header->flags);
  printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x4983(%rip), %rdi      # 0x60ed
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %esi
leaq 0x498b(%rip), %rdi      # 0x610b
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %esi
leaq 0x4994(%rip), %rdi      # 0x612a
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x499a(%rip), %rdi      # 0x6145
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0x49a0(%rip), %rdi      # 0x6160
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x14(%rax), %esi
leaq 0x49aa(%rip), %rdi      # 0x617f
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %esi
leaq 0x49af(%rip), %rdi      # 0x619a
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x1a(%rax), %esi
leaq 0x4bc8(%rip), %rdi      # 0x63c9
movb $0x0, %al
callq 0x1070
leaq 0x4dcc(%rip), %rdi      # 0x65db
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_coff_optional_header
void print_coff_optional_header(struct coff_optional_header_t *optional_header)
{
  printf(" --- coff optional header 0x%06lx ---\n", optional_header->offset);
  printf("          magic: 0x%04x\n", optional_header->magic);
  printf("        version: 0x%04x\n", optional_header->version);
  printf("      text_size: %d\n", optional_header->text_size);
  printf("      data_size: %d\n", optional_header->data_size);
  printf("   uininit_size: %d\n", optional_header->uninit_size);
  printf("    entry_point: 0x%06x\n", optional_header->entry_point);
  printf("     text_start: 0x%06x\n", optional_header->text_start);
  printf("     data_start: 0x%06x\n", optional_header->data_start);
  printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x497b(%rip), %rdi      # 0x61b5
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %esi
leaq 0x48c1(%rip), %rdi      # 0x6111
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %esi
leaq 0x4976(%rip), %rdi      # 0x61dc
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x497a(%rip), %rdi      # 0x61f5
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0x497a(%rip), %rdi      # 0x620a
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x14(%rax), %esi
leaq 0x497a(%rip), %rdi      # 0x621f
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
leaq 0x497a(%rip), %rdi      # 0x6234
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %esi
leaq 0x497e(%rip), %rdi      # 0x624d
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x20(%rax), %esi
leaq 0x4982(%rip), %rdi      # 0x6266
movb $0x0, %al
callq 0x1070
leaq 0x4ce9(%rip), %rdi      # 0x65db
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_coff_section_header
void print_coff_section_header(struct coff_section_header_t *section_header)
{
  printf(" --- coff section header 0x%06lx ---\n", section_header->offset);
  printf("                       name: %.8s\n", section_header->name);
  printf("           physical_address: 0x%06x\n", section_header->physical_address);
  printf("            virtual_address: 0x%06x\n", section_header->virtual_address);
  printf("                       size: %d\n", section_header->size);
  printf("   file_offset_section_data: 0x%06x\n", section_header->file_offset_section_data);
  printf("file_offset_relocation_data: 0x%06x\n", section_header->file_offset_relocation_table);
  printf("    file_offset_line_number: 0x%06x\n", section_header->file_offset_line_number);
  printf("          line_number_count: %d\n", section_header->line_number_count);
  printf("                      flags: %08x\n", section_header->flags);
  printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x4965(%rip), %rdi      # 0x627f
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
leaq 0x4975(%rip), %rdi      # 0x62a5
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0x4983(%rip), %rdi      # 0x62c8
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x14(%rax), %esi
leaq 0x4993(%rip), %rdi      # 0x62ed
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
leaq 0x49a3(%rip), %rdi      # 0x6312
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %esi
leaq 0x49af(%rip), %rdi      # 0x6333
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x20(%rax), %esi
leaq 0x49bf(%rip), %rdi      # 0x6358
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x24(%rax), %esi
leaq 0x49cf(%rip), %rdi      # 0x637d
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x2a(%rax), %esi
leaq 0x49de(%rip), %rdi      # 0x63a2
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %esi
leaq 0x49ea(%rip), %rdi      # 0x63c3
movb $0x0, %al
callq 0x1070
leaq 0x4bf4(%rip), %rdi      # 0x65db
movb $0x0, %al
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_symbol
int print_symbol(FILE *in)
{
  while (1)
  {
    int ch = getc(in);
    if (ch == 0 || ch == EOF) { break; }
    printf("%c", ch);
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1130
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x1a24
cmpl $-0x1, -0xc(%rbp)
jne 0x1a26
jmp 0x1a39
movl -0xc(%rbp), %esi
leaq 0x5a8c(%rip), %rdi      # 0x74bc
movb $0x0, %al
callq 0x1070
jmp 0x1a0c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_symbol_offsets
int print_symbol_offsets(FILE *in, uint32_t size)
{
  long marker = ftell(in);
  int symbol_count = read_uint32_be(in);
  uint32_t *offsets = (uint32_t *)malloc(symbol_count * sizeof(uint32_t));
  int n;

  printf(" --- symbol_count: %d ---\n", symbol_count);

  for (n = 0; n < symbol_count; n++)
  {
    offsets[n] = read_uint32_be(in);
  }

  for (n = 0; n < symbol_count; n++)
  {
    printf("   0x%06x  ", offsets[n]);
    print_symbol(in);
    printf("\n");
  }

  printf("\n");

  free(offsets);

  long total = ftell(in) - marker;

  if (total != size)
  {
    printf("Error: Bad archive members size %ld vs %d.\n", total, size);
    return -1;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2f70
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x10c0
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %esi
leaq 0x4953(%rip), %rdi      # 0x63e6
movb $0x0, %al
callq 0x1070
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1aca
movq -0x10(%rbp), %rdi
callq 0x2f70
movl %eax, %edx
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1aa1
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1b14
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x4916(%rip), %rdi      # 0x6401
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rdi
callq 0x1a00
leaq 0x4ad9(%rip), %rdi      # 0x65db
movb $0x0, %al
callq 0x1070
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1ad1
leaq 0x4ac0(%rip), %rdi      # 0x65db
movb $0x0, %al
callq 0x1070
movq -0x30(%rbp), %rdi
callq 0x1030
movq -0x10(%rbp), %rdi
callq 0x10a0
subq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x14(%rbp), %ecx
cmpq %rcx, %rax
je 0x1b66
movq -0x40(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq 0x48b7(%rip), %rdi      # 0x640d
movb $0x0, %al
callq 0x1070
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1b6d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/mikeakohn[P]print_pe/build/../src/print_lib.c
// Function: print_symbol_header
int print_symbol_header(FILE *in)
{
  struct coff_symbol_header_t symbol_header;

  symbol_header.offset = ftell(in);
  symbol_header.version = read_uint16(in);
  symbol_header.machine = read_uint16(in);
  symbol_header.timestamp = read_uint32(in);
  symbol_header.size = read_uint32(in);
  symbol_header.unknown_0 = read_uint16(in);
  symbol_header.unknown_1 = read_uint16(in);

  printf("--- symbol %06lx ---\n", symbol_header.offset);
  printf("        version: 0x%04x\n", symbol_header.version);
  printf("        machine: 0x%04x\n", symbol_header.machine);
  printf("      timestamp: %d\n", symbol_header.timestamp);
  printf("           size: %d\n", symbol_header.size);
  printf("      unknown_0: %d\n", symbol_header.unknown_0);
  printf("      unknown_1: %d\n", symbol_header.unknown_1);
  printf("           name: ");
  print_symbol(in);
  printf("\n");
  printf("            DLL: ");
  print_symbol(in);
  printf("\n\n");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10a0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e50
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e50
movw %ax, -0x16(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2df0
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e50
movw %ax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e50
movw %ax, -0xa(%rbp)
movq -0x20(%rbp), %rsi
leaq 0x4849(%rip), %rdi      # 0x6439
movb $0x0, %al
callq 0x1070
movzwl -0x18(%rbp), %esi
leaq 0x45da(%rip), %rdi      # 0x61dc
movb $0x0, %al
callq 0x1070
movzwl -0x16(%rbp), %esi
leaq 0x5578(%rip), %rdi      # 0x718c
movb $0x0, %al
callq 0x1070
movl -0x14(%rbp), %esi
leaq 0x4526(%rip), %rdi      # 0x614b
movb $0x0, %al
callq 0x1070
movl -0x10(%rbp), %esi
leaq 0x46e8(%rip), %rdi      # 0x631e
movb $0x0, %al
callq 0x1070
movzwl -0xc(%rbp), %esi
leaq 0x4807(%rip), %rdi      # 0x644f
movb $0x0, %al
callq 0x1070
movzwl -0xa(%rbp), %esi
leaq 0x480a(%rip), %rdi      # 0x6464
movb $0x0, %al
callq 0x1070
leaq 0x4811(%rip), %rdi      # 0x6479
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rdi
callq 0x1a00
leaq 0x495c(%rip), %rdi      # 0x65db
movb $0x0, %al
callq 0x1070
leaq 0x47fe(%rip), %rdi      # 0x648b
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rdi
callq 0x1a00
leaq 0x4936(%rip), %rdi      # 0x65da
movb $0x0, %al
callq 0x1070
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)