LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_create_connection
mg_connection *mg_create_connection(
    struct mg_mgr *mgr, mg_event_handler_t callback,
    struct mg_add_sock_opts opts) {
  struct mg_connection *conn = mg_create_connection_base(mgr, callback, opts);

  if (conn != NULL && !conn->iface->vtable->create_conn(conn)) {
    MG_FREE(conn);
    conn = NULL;
  }
  if (conn == NULL) {
    MG_SET_PTRPTR(opts.error_string, "failed to init connection");
  }

  return conn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xbef0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb581
movq -0x18(%rbp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xb581
movq -0x18(%rbp), %rdi
callq 0x3050
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xb5ab
jmp 0xb58a
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xb5a7
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
leaq 0x14c33(%rip), %rcx     # 0x201d7
movq %rcx, (%rax)
jmp 0xb5a9
jmp 0xb5ab
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_add_conn
MG_INTERNAL void mg_add_conn(struct mg_mgr *mgr, struct mg_connection *c) {
  DBG(("%p %p", mgr, c));
  c->mgr = mgr;
  c->next = mgr->active_connections;
  mgr->active_connections = c;
  c->prev = NULL;
  if (c->next != NULL) c->next->prev = c;
  if (c->sock != INVALID_SOCKET) {
    c->iface->vtable->add_conn(c);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x4, %edi
leaq 0x14c15(%rip), %rsi     # 0x201f1
leaq 0x13f67(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xb603
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x14c01(%rip), %rdi     # 0x201fd
movb $0x0, %al
callq 0x47a0
jmp 0xb605
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb64f
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x20(%rax)
je 0xb672
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_if_sent_cb
void mg_if_sent_cb(struct mg_connection *nc, int num_sent) {
  DBG(("%p %d", nc, num_sent));
#if !defined(NO_LIBC) && MG_ENABLE_HEXDUMP
  if (nc->mgr && nc->mgr->hexdump_file != NULL) {
    char *buf = nc->send_mbuf.buf;
    mg_hexdump_connection(nc, nc->mgr->hexdump_file, buf, num_sent, MG_EV_SEND);
  }
#endif
  if (num_sent < 0) {
    nc->flags |= MG_F_CLOSE_IMMEDIATELY;
  } else {
    mbuf_remove(&nc->send_mbuf, num_sent);
    mbuf_trim(&nc->send_mbuf);
  }
  mg_call(nc, NULL, nc->user_data, MG_EV_SEND, &num_sent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x4, %edi
leaq 0x13f4f(%rip), %rsi     # 0x1f65a
leaq 0x13e38(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xb731
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq 0x13f3e(%rip), %rdi     # 0x1f668
movb $0x0, %al
callq 0x47a0
jmp 0xb733
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xb77b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0xb77b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movl -0xc(%rbp), %ecx
movl $0x4, %r8d
callq 0xb7f0
cmpl $0x0, -0xc(%rbp)
jge 0xb79c
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rcx
orq $0x800, %rcx            # imm = 0x800
movq %rcx, 0xc8(%rax)
jmp 0xb7ba
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movslq -0xc(%rbp), %rsi
callq 0x89f0
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x8720
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x4, %ecx
leaq -0xc(%rbp), %r8
callq 0xa8e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_create_connection_base
mg_connection *mg_create_connection_base(
    struct mg_mgr *mgr, mg_event_handler_t callback,
    struct mg_add_sock_opts opts) {
  struct mg_connection *conn;

  if ((conn = (struct mg_connection *) MG_CALLOC(1, sizeof(*conn))) != NULL) {
    conn->sock = INVALID_SOCKET;
    conn->handler = callback;
    conn->mgr = mgr;
    conn->last_io_time = (time_t) mg_time();
    conn->iface =
        (opts.iface != NULL ? opts.iface : mgr->ifaces[MG_MAIN_IFACE]);
    conn->flags = opts.flags & _MG_ALLOWED_CONNECT_FLAGS_MASK;
    conn->user_data = opts.user_data;
    /*
     * SIZE_MAX is defined as a long long constant in
     * system headers on some platforms and so it
     * doesn't compile with pedantic ansi flags.
     */
    conn->recv_mbuf_limit = ~0;
  } else {
    MG_SET_PTRPTR(opts.error_string, "failed to create connection");
  }

  return conn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
movl $0xd0, %esi
callq 0x3330
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xbfcc
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
callq 0xb6e0
movq -0x20(%rbp), %rax
cvttsd2si %xmm0, %rdx
movq -0x18(%rbp), %rcx
movq %rdx, 0x70(%rcx)
cmpq $0x0, 0x18(%rax)
je 0xbf76
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xbf85
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq %rdx, 0xc0(%rcx)
movl 0x8(%rax), %ecx
andl $0x3f05000, %ecx        # imm = 0x3F05000
movl %ecx, %ecx
movl %ecx, %edx
movq -0x18(%rbp), %rcx
movq %rdx, 0xc8(%rcx)
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x38(%rax)
jmp 0xbfef
jmp 0xbfce
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xbfeb
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
leaq 0x14249(%rip), %rcx     # 0x20231
movq %rcx, (%rax)
jmp 0xbfed
jmp 0xbfef
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_if_connect_cb
void mg_if_connect_cb(struct mg_connection *nc, int err) {
  DBG(("%p connect, err=%d", nc, err));
  nc->flags &= ~MG_F_CONNECTING;
  if (err != 0) {
    nc->flags |= MG_F_CLOSE_IMMEDIATELY;
  }
  mg_call(nc, NULL, nc->user_data, MG_EV_CONNECT, &err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x4, %edi
leaq 0x136e0(%rip), %rsi     # 0x1f6fb
leaq 0x13528(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xc041
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq 0x136d2(%rip), %rdi     # 0x1f70c
movb $0x0, %al
callq 0x47a0
jmp 0xc043
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rcx
andq $-0x9, %rcx
movq %rcx, 0xc8(%rax)
cmpl $0x0, -0xc(%rbp)
je 0xc078
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rcx
orq $0x800, %rcx            # imm = 0x800
movq %rcx, 0xc8(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %ecx
leaq -0xc(%rbp), %r8
callq 0xa8e0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: resolve_cb
static void resolve_cb(struct mg_dns_message *msg, void *data,
                       enum mg_resolve_err e) {
  struct mg_connection *nc = (struct mg_connection *) data;
  int i;
  int failure = -1;

  nc->flags &= ~MG_F_RESOLVING;
  if (msg != NULL) {
    /*
     * Take the first DNS A answer and run...
     */
    for (i = 0; i < msg->num_answers; i++) {
      if (msg->answers[i].rtype == MG_DNS_A_RECORD) {
        /*
         * Async resolver guarantees that there is at least one answer.
         * TODO(lsm): handle IPv6 answers too
         */
        mg_dns_parse_record_data(msg, &msg->answers[i], &nc->sa.sin.sin_addr,
                                 4);
        mg_do_connect(nc, nc->flags & MG_F_UDP ? SOCK_DGRAM : SOCK_STREAM,
                      &nc->sa);
        return;
      }
    }
  }

  if (e == MG_RESOLVE_TIMEOUT) {
    double now = mg_time();
    mg_call(nc, NULL, nc->user_data, MG_EV_TIMER, &now);
  }

  /*
   * If we get there was no MG_DNS_A_RECORD in the answer
   */
  mg_call(nc, NULL, nc->user_data, MG_EV_CONNECT, &failure);
  mg_call(nc, NULL, nc->user_data, MG_EV_CLOSE, NULL);
  mg_destroy_conn(nc, 1 /* destroy_if */);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq 0xc8(%rax), %rcx
andq $-0x5, %rcx
movq %rcx, 0xc8(%rax)
cmpq $0x0, -0x8(%rbp)
je 0xc92d
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0xc92b
movq -0x8(%rbp), %rax
addq $0x620, %rax            # imm = 0x620
movslq -0x24(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, 0x10(%rax)
jne 0xc91b
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x620, %rsi            # imm = 0x620
movslq -0x24(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
addq $0x28, %rdx
addq $0x4, %rdx
movl $0x4, %ecx
callq 0x17f80
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xc8(%rax), %rcx
andq $0x2, %rcx
movl $0x1, %esi
movl $0x2, %eax
cmpq $0x0, %rcx
cmovnel %eax, %esi
movq -0x20(%rbp), %rdx
addq $0x28, %rdx
callq 0xc9c0
jmp 0xc9ae
jmp 0xc91d
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc88a
jmp 0xc92d
cmpl $0x3, -0x14(%rbp)
jne 0xc95e
callq 0xb6e0
movsd %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xa0(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x6, %ecx
leaq -0x30(%rbp), %r8
callq 0xa8e0
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xa0(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %ecx
leaq -0x28(%rbp), %r8
callq 0xa8e0
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0xa0(%rax), %rdx
xorl %eax, %eax
movl %eax, %r8d
movl $0x5, %ecx
movq %r8, %rsi
callq 0xa8e0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0xabf0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_do_connect
mg_connection *mg_do_connect(struct mg_connection *nc,
                                                int proto,
                                                union socket_address *sa) {
  DBG(("%p %s://%s:%hu", nc, proto == SOCK_DGRAM ? "udp" : "tcp",
       inet_ntoa(sa->sin.sin_addr), ntohs(sa->sin.sin_port)));

  nc->flags |= MG_F_CONNECTING;
  if (proto == SOCK_DGRAM) {
    nc->iface->vtable->connect_udp(nc);
  } else {
    nc->iface->vtable->connect_tcp(nc, sa);
  }
  mg_add_conn(nc->mgr, nc);
  return nc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x4, %edi
leaq 0x138a3(%rip), %rsi     # 0x20282
leaq 0x12b64(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xca4f
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %edx
leaq 0x12de4(%rip), %rax     # 0x1f7e6
leaq 0x13896(%rip), %rcx     # 0x2029f
cmpl $0x2, %edx
cmoveq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x3140
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x34e0
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
movzwl %ax, %r8d
leaq 0x13848(%rip), %rdi     # 0x20290
movb $0x0, %al
callq 0x47a0
jmp 0xca51
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rcx
orq $0x8, %rcx
movq %rcx, 0xc8(%rax)
cmpl $0x2, -0xc(%rbp)
jne 0xca88
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0xcaa5
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xb5c0
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_tun_bind_opt
struct mg_connection *mg_tun_bind_opt(struct mg_mgr *mgr,
                                      const char *dispatcher,
                                      MG_CB(mg_event_handler_t handler,
                                            void *user_data),
                                      struct mg_bind_opts opts) {
#if MG_ENABLE_SSL
  struct mg_tun_ssl_opts ssl = {opts.ssl_cert, opts.ssl_key, opts.ssl_ca_cert};
#else
  struct mg_tun_ssl_opts ssl = {0};
#endif
  struct mg_tun_client *client = mg_tun_create_client(mgr, dispatcher, ssl);
  if (client == NULL) {
    return NULL;
  }
#if MG_ENABLE_SSL
  /* these options don't make sense in the local mouth of the tunnel */
  opts.ssl_cert = NULL;
  opts.ssl_key = NULL;
  opts.ssl_ca_cert = NULL;
#endif
  return mg_tun_do_bind(client, MG_CB(handler, user_data), opts);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x3260
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x19580
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xceb1
movq $0x0, -0x8(%rbp)
jmp 0xcee8
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x19640
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_broadcast
void mg_broadcast(struct mg_mgr *mgr, mg_event_handler_t cb, void *data,
                  size_t len) {
  struct ctl_msg ctl_msg;

  /*
   * Mongoose manager has a socketpair, `struct mg_mgr::ctl`,
   * where `mg_broadcast()` pushes the message.
   * `mg_mgr_poll()` wakes up, reads a message from the socket pair, and calls
   * specified callback for each connection. Thus the callback function executes
   * in event manager thread.
   */
  if (mgr->ctl[0] != INVALID_SOCKET && data != NULL &&
      len < sizeof(ctl_msg.message)) {
    size_t dummy;

    ctl_msg.callback = cb;
    memcpy(ctl_msg.message, data, len);
    dummy = MG_SEND_FUNC(mgr->ctl[0], (char *) &ctl_msg,
                         offsetof(struct ctl_msg, message) + len, 0);
    dummy = MG_RECV_FUNC(mgr->ctl[0], (char *) &len, 1, 0);
    (void) dummy; /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 */
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2030, %rsp           # imm = 0x2030
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x10(%rax)
je 0xcf9b
cmpq $0x0, -0x18(%rbp)
je 0xcf9b
cmpq $0x2000, -0x20(%rbp)    # imm = 0x2000
jae 0xcf9b
movq -0x10(%rbp), %rax
movq %rax, -0x2028(%rbp)
leaq -0x2028(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x33b0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
leaq -0x2028(%rbp), %rsi
xorl %ecx, %ecx
callq 0x31d0
movq %rax, -0x2030(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
leaq -0x20(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x3060
movq %rax, -0x2030(%rbp)
addq $0x2030, %rsp           # imm = 0x2030
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_check_ip_acl
int mg_check_ip_acl(const char *acl, uint32_t remote_ip) {
  int allowed, flag;
  uint32_t net, mask;
  struct mg_str vec;

  /* If any ACL is set, deny by default */
  allowed = (acl == NULL || *acl == '\0') ? '+' : '-';

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

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

  DBG(("%08x %c", (unsigned int) remote_ip, allowed));
  return allowed == '+';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movb $0x1, %al
cmpq $0x0, -0x10(%rbp)
movb %al, -0x39(%rbp)
je 0xcfdb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %dl
movl $0x2d, %eax
movl $0x2b, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xa320
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0xd05a
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x2b, -0x1c(%rbp)
je 0xd022
cmpl $0x2d, -0x1c(%rbp)
jne 0xd03c
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0xd0b0
cmpl $0x0, %eax
jne 0xd045
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd09e
movl -0x20(%rbp), %eax
movl -0x14(%rbp), %ecx
andl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jne 0xd058
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0xcff1
jmp 0xd05c
movl $0x4, %edi
leaq 0x12734(%rip), %rsi     # 0x1f79c
leaq 0x124db(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xd08d
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
leaq 0x12726(%rip), %rdi     # 0x1f7ac
movb $0x0, %al
callq 0x47a0
jmp 0xd08f
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
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/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 0x131c6(%rip), %rsi     # 0x202a3
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 0x3460
cmpl $0x5, %eax
je 0xd13d
movq -0x8(%rbp), %rdi
leaq 0x1319f(%rip), %rsi     # 0x202b4
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 0x3460
cmpl $0x4, %eax
jne 0xd1d0
movl -0x20(%rbp), %edi
callq 0x198c0
cmpl $0x0, %eax
je 0xd1d0
movl -0x24(%rbp), %edi
callq 0x198c0
cmpl $0x0, %eax
je 0xd1d0
movl -0x28(%rbp), %edi
callq 0x198c0
cmpl $0x0, %eax
je 0xd1d0
movl -0x2c(%rbp), %edi
callq 0x198c0
cmpl $0x0, %eax
je 0xd1d0
cmpl $0x0, -0x30(%rbp)
jl 0xd1d0
cmpl $0x21, -0x30(%rbp)
jge 0xd1d0
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 0xd1c0
movl $0x20, %ecx
subl -0x30(%rbp), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
movl %eax, -0x38(%rbp)
jmp 0xd1c7
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0xd1c7
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/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_set_timer
double mg_set_timer(struct mg_connection *c, double timestamp) {
  double result = c->ev_timer_time;
  c->ev_timer_time = timestamp;
  /*
   * If this connection is resolving, it's not in the list of active
   * connections, so not processed yet. It has a DNS resolver connection
   * linked to it. Set up a timer for the DNS connection.
   */
  DBG(("%p %p %d -> %lu", c, c->priv_2, (c->flags & MG_F_RESOLVING ? 1 : 0),
       (unsigned long) timestamp));
  if ((c->flags & MG_F_RESOLVING) && c->priv_2 != NULL) {
    ((struct mg_connection *) c->priv_2)->ev_timer_time = timestamp;
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsd 0x78(%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x78(%rax)
movl $0x4, %edi
leaq 0x1254b(%rip), %rsi     # 0x1f7b4
leaq 0x122da(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xd2cc
movq -0x8(%rbp), %rsi
movq 0xb0(%rsi), %rdx
movb 0xc8(%rsi), %al
andb $0x4, %al
shrb $0x2, %al
movzbl %al, %ecx
movsd -0x10(%rbp), %xmm0
movsd 0x12068(%rip), %xmm2    # 0x1f308
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
cvttsd2si %xmm0, %r8
movq %r8, %rdi
sarq $0x3f, %rdi
andq %rdi, %rax
orq %rax, %r8
leaq 0x124fc(%rip), %rdi     # 0x1f7c1
movb $0x0, %al
callq 0x47a0
jmp 0xd2ce
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0xd306
movq -0x8(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0xd306
movsd -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rax
movsd %xmm0, 0x78(%rax)
movsd -0x18(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_add_sock_opt
struct mg_connection *mg_add_sock_opt(struct mg_mgr *s, sock_t sock,
                                      MG_CB(mg_event_handler_t callback,
                                            void *user_data),
                                      struct mg_add_sock_opts opts) {
#if MG_ENABLE_CALLBACK_USERDATA
  opts.user_data = user_data;
#endif

  struct mg_connection *nc = mg_create_connection_base(s, callback, opts);
  if (nc != NULL) {
    mg_sock_set(nc, sock);
    mg_add_conn(nc->mgr, nc);
  }
  return nc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xbef0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xd40e
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xd320
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xb5c0
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_find_iface
struct mg_iface *mg_find_iface(struct mg_mgr *mgr,
                               const struct mg_iface_vtable *vtable,
                               struct mg_iface *from) {
  int i = 0;
  if (from != NULL) {
    for (i = 0; i < mgr->num_ifaces; i++) {
      if (mgr->ifaces[i] == from) {
        i++;
        break;
      }
    }
  }

  for (; i < mgr->num_ifaces; i++) {
    if (mgr->ifaces[i]->vtable == vtable) {
      return mgr->ifaces[i];
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xd4e1
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0xd4df
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x20(%rbp), %rax
jne 0xd4d2
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd4df
jmp 0xd4d4
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd4a5
jmp 0xd4e1
jmp 0xd4e3
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0xd52c
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xd51f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
jmp 0xd534
jmp 0xd521
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd4e3
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_connect_tcp
void mg_socket_if_connect_tcp(struct mg_connection *nc,
                              const union socket_address *sa) {
  int rc, proto = 0;
  nc->sock = socket(AF_INET, SOCK_STREAM, proto);
  if (nc->sock == INVALID_SOCKET) {
    nc->err = mg_get_errno() ? mg_get_errno() : 1;
    return;
  }
#if !defined(MG_ESP8266)
  mg_set_non_blocking_mode(nc->sock);
#endif
  rc = connect(nc->sock, &sa->sa, sizeof(sa->sin));
  nc->err = rc < 0 && mg_is_error() ? mg_get_errno() : 0;
  DBG(("%p sock %d rc %d errno %d err %d", nc, nc->sock, rc, mg_get_errno(),
       nc->err));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %edx
movl $0x2, %edi
movl $0x1, %esi
callq 0x36b0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x20(%rax)
jne 0xd5e9
callq 0xd6a0
cmpl $0x0, %eax
je 0xd5d0
callq 0xd6a0
movl %eax, -0x1c(%rbp)
jmp 0xd5da
movl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd5da
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0xd697
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
callq 0xd540
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
movq -0x10(%rbp), %rsi
movl $0x10, %edx
callq 0x3600
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xd627
callq 0xd6b0
cmpl $0x0, %eax
je 0xd627
callq 0xd6a0
movl %eax, -0x20(%rbp)
jmp 0xd62e
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0xd62e
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0x4, %edi
leaq 0x1218d(%rip), %rsi     # 0x1f7d1
leaq 0x11eff(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xd695
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
callq 0xd6a0
movq -0x30(%rbp), %rsi
movl -0x28(%rbp), %edx
movl -0x24(%rbp), %ecx
movl %eax, %r8d
movq -0x8(%rbp), %rax
movl 0x24(%rax), %r9d
leaq 0x1215c(%rip), %rdi     # 0x1f7ea
movb $0x0, %al
callq 0x47a0
jmp 0xd697
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_is_error
static int mg_is_error(void) {
  int err = mg_get_errno();
  return err != EINPROGRESS && err != EWOULDBLOCK
#ifndef WINCE
         && err != EAGAIN && err != EINTR
#endif
#ifdef _WIN32
         && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK
#endif
      ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0xd6a0
movl %eax, -0x4(%rbp)
xorl %eax, %eax
cmpl $0x73, -0x4(%rbp)
movb %al, -0x5(%rbp)
je 0xd6eb
xorl %eax, %eax
cmpl $0xb, -0x4(%rbp)
movb %al, -0x5(%rbp)
je 0xd6eb
xorl %eax, %eax
cmpl $0xb, -0x4(%rbp)
movb %al, -0x5(%rbp)
je 0xd6eb
cmpl $0x4, -0x4(%rbp)
setne %al
movb %al, -0x5(%rbp)
movb -0x5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_connect_udp
void mg_socket_if_connect_udp(struct mg_connection *nc) {
  nc->sock = socket(AF_INET, SOCK_DGRAM, 0);
  if (nc->sock == INVALID_SOCKET) {
    nc->err = mg_get_errno() ? mg_get_errno() : 1;
    return;
  }
  if (nc->flags & MG_F_ENABLE_BROADCAST) {
    int optval = 1;
    setsockopt(nc->sock, SOL_SOCKET, SO_BROADCAST, (const char *) &optval,
               sizeof(optval));
  }
  nc->err = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x36b0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x20(%rax)
jne 0xd757
callq 0xd6a0
cmpl $0x0, %eax
je 0xd741
callq 0xd6a0
movl %eax, -0x10(%rbp)
jmp 0xd74b
movl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd74b
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0xd7a0
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
andq $0x4000, %rax           # imm = 0x4000
cmpq $0x0, %rax
je 0xd795
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
movl $0x1, %esi
movl $0x6, %edx
leaq -0xc(%rbp), %rcx
movl $0x4, %r8d
callq 0x3120
movq -0x8(%rbp), %rax
movl $0x0, 0x24(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_listen_tcp
int mg_socket_if_listen_tcp(struct mg_connection *nc,
                            union socket_address *sa) {
  int proto = 0;
  sock_t sock = mg_open_listening_socket(sa, SOCK_STREAM, proto);
  if (sock == INVALID_SOCKET) {
    return (mg_get_errno() ? mg_get_errno() : 1);
  }
  mg_sock_set(nc, sock);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl $0x1, %esi
callq 0xd830
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
jne 0xd807
callq 0xd6a0
cmpl $0x0, %eax
je 0xd7f5
callq 0xd6a0
movl %eax, -0x24(%rbp)
jmp 0xd7ff
movl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd7ff
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xd81a
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0xd320
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_open_listening_socket
static sock_t mg_open_listening_socket(struct mg_connection *nc,
                                       union socket_address *sa, int type,
                                       int proto) {
  int r;
  socklen_t sa_len =
      (sa->sa.sa_family == AF_INET) ? sizeof(sa->sin) : sizeof(sa->sin6);
  sock_t sock = sl_Socket(sa->sa.sa_family, type, proto);
  if (sock < 0) return sock;
  if ((r = sl_Bind(sock, &sa->sa, sa_len)) < 0) goto clean;
  if (type != SOCK_DGRAM) {
#if MG_ENABLE_SSL
    if ((r = sl_set_ssl_opts(sock, nc)) < 0) goto clean;
#endif
    if ((r = sl_Listen(sock, SOMAXCONN)) < 0) goto clean;
  }
  mg_set_non_blocking_mode(sock);
clean:
  if (r < 0) {
    sl_Close(sock);
    sock = r;
  }
  return sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %ecx
movl $0x10, %eax
cmpl $0x2, %ecx
cmoveq %rax, %rax
movl %eax, -0x14(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x36b0
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
je 0xd8e7
movl -0x18(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x1c(%rbp), %rcx
movl $0x4, %r8d
callq 0x3120
cmpl $0x0, %eax
jne 0xd8e7
movl -0x18(%rbp), %edi
movq -0x8(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x3500
cmpl $0x0, %eax
jne 0xd8e7
cmpl $0x2, -0xc(%rbp)
je 0xd8cd
movl -0x18(%rbp), %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x3480
cmpl $0x0, %eax
jne 0xd8e7
movl -0x18(%rbp), %edi
callq 0xd540
movl -0x18(%rbp), %edi
movq -0x8(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x35a0
jmp 0xd8fe
cmpl $-0x1, -0x18(%rbp)
je 0xd8fc
movl -0x18(%rbp), %edi
callq 0x32a0
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8fe
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_listen_udp
int mg_socket_if_listen_udp(struct mg_connection *nc,
                            union socket_address *sa) {
  sock_t sock = mg_open_listening_socket(sa, SOCK_DGRAM, 0);
  if (sock == INVALID_SOCKET) return (mg_get_errno() ? mg_get_errno() : 1);
  mg_sock_set(nc, sock);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xd830
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0xd95f
callq 0xd6a0
cmpl $0x0, %eax
je 0xd94d
callq 0xd6a0
movl %eax, -0x20(%rbp)
jmp 0xd957
movl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xd957
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xd972
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xd320
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_destroy_conn
void mg_socket_if_destroy_conn(struct mg_connection *nc) {
  if (nc->sock == INVALID_SOCKET) return;
  if (!(nc->flags & MG_F_UDP)) {
    closesocket(nc->sock);
  } else {
    /* Only close outgoing UDP sockets or listeners. */
    if (nc->listener == NULL) closesocket(nc->sock);
  }
  nc->sock = INVALID_SOCKET;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x20(%rax)
jne 0xda18
jmp 0xda5f
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
jne 0xda3b
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x32a0
jmp 0xda54
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xda52
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x32a0
jmp 0xda54
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_handle_udp_read
static void mg_handle_udp_read(struct mg_connection *nc) {
  char *buf = NULL;
  union socket_address sa;
  socklen_t sa_len = sizeof(sa);
  int n = mg_recvfrom(nc, &sa, &sa_len, &buf);
  DBG(("%p %d bytes from %s:%d", nc, n, inet_ntoa(nc->sa.sin.sin_addr),
       ntohs(nc->sa.sin.sin_port)));
  mg_if_recv_udp_cb(nc, buf, n, &sa, sa_len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl $0x10, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
leaq -0x10(%rbp), %rcx
callq 0x198f0
movl %eax, -0x28(%rbp)
movl $0x4, %edi
leaq 0x12593(%rip), %rsi     # 0x202c2
leaq 0x11814(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xdd88
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x3140
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x2a(%rax), %edi
callq 0x34e0
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
movq -0x30(%rbp), %rcx
movzwl %ax, %r8d
leaq 0x12554(%rip), %rdi     # 0x202d5
movb $0x0, %al
callq 0x47a0
jmp 0xdd8a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x28(%rbp), %edx
movl -0x24(%rbp), %eax
movl %eax, %r8d
leaq -0x20(%rbp), %rcx
callq 0xbbf0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_accept_conn
static int mg_accept_conn(struct mg_connection *lc) {
  struct mg_connection *nc;
  union socket_address sa;
  socklen_t sa_len = sizeof(sa);
  /* NOTE(lsm): on Windows, sock is always > FD_SETSIZE */
  sock_t sock = accept(lc->sock, &sa.sa, &sa_len);
  if (sock == INVALID_SOCKET) {
    if (mg_is_error()) DBG(("%p: failed to accept: %d", lc, mg_get_errno()));
    return 0;
  }
  nc = mg_if_accept_new_conn(lc);
  if (nc == NULL) {
    closesocket(sock);
    return 0;
  }
  DBG(("%p conn from %s:%d", nc, inet_ntoa(sa.sin.sin_addr),
       ntohs(sa.sin.sin_port)));
  mg_sock_set(nc, sock);
#if MG_ENABLE_SSL
  if (lc->flags & MG_F_SSL) {
    if (mg_ssl_if_conn_accept(nc, lc) != MG_SSL_OK) mg_close_conn(nc);
  } else
#endif
  {
    mg_if_accept_tcp_cb(nc, &sa, sa_len);
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl $0x10, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edi
leaq -0x28(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x3590
movl %eax, -0x30(%rbp)
cmpl $-0x1, -0x30(%rbp)
jne 0xde3a
callq 0xd6b0
cmpl $0x0, %eax
je 0xde2e
jmp 0xddec
movl $0x4, %edi
leaq 0x1251e(%rip), %rsi     # 0x20316
leaq 0x1174b(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xde2a
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0xd6a0
movq -0x38(%rbp), %rsi
movl %eax, %edx
leaq 0x12502(%rip), %rdi     # 0x20325
movb $0x0, %al
callq 0x47a0
jmp 0xde2c
jmp 0xde2e
movl $0x0, -0x4(%rbp)
jmp 0xdedb
movq -0x10(%rbp), %rdi
callq 0xb390
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xde5f
movl -0x30(%rbp), %edi
callq 0x32a0
movl $0x0, -0x4(%rbp)
jmp 0xdedb
jmp 0xde61
movl $0x4, %edi
leaq 0x124a9(%rip), %rsi     # 0x20316
leaq 0x116d6(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xdeb4
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x24(%rbp), %edi
callq 0x3140
movq %rax, -0x40(%rbp)
movzwl -0x26(%rbp), %edi
callq 0x34e0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movzwl %ax, %ecx
leaq 0x12491(%rip), %rdi     # 0x2033e
movb $0x0, %al
callq 0x47a0
jmp 0xdeb6
movq -0x18(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0xd320
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %edx
leaq -0x28(%rbp), %rsi
callq 0xb680
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_sock_set
void mg_socket_if_sock_set(struct mg_connection *nc, sock_t sock) {
  mg_set_non_blocking_mode(sock);
  mg_set_close_on_exec(sock);
  nc->sock = sock;
  DBG(("%p %d", nc, sock));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0xd540
movl -0xc(%rbp), %edi
callq 0xe240
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movl $0x4, %edi
leaq 0x11677(%rip), %rsi     # 0x1f87c
leaq 0x1133e(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xe22b
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq 0x11444(%rip), %rdi     # 0x1f668
movb $0x0, %al
callq 0x47a0
jmp 0xe22d
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_add_to_set
void mg_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
  if (sock != INVALID_SOCKET
#ifdef __unix__
      && sock < (sock_t) FD_SETSIZE
#endif
      ) {
    FD_SET(sock, set);
    if (*max_fd == INVALID_SOCKET || sock > *max_fd) {
      *max_fd = sock;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $-0x1, -0x4(%rbp)
je 0xe580
cmpl $0x400, -0x4(%rbp)      # imm = 0x400
jge 0xe580
movl -0x4(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x28(%rbp), %rdx
movl %eax, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
je 0xe575
movl -0x4(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xe57e
movl -0x4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0xe580
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_mgr_handle_ctl_sock
static void mg_mgr_handle_ctl_sock(struct mg_mgr *mgr) {
  struct ctl_msg ctl_msg;
  int len =
      (int) MG_RECV_FUNC(mgr->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0);
  size_t dummy = MG_SEND_FUNC(mgr->ctl[1], ctl_msg.message, 1, 0);
  DBG(("read %d from ctl socket", len));
  (void) dummy; /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 */
  if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) {
    struct mg_connection *nc;
    for (nc = mg_next(mgr, NULL); nc != NULL; nc = mg_next(mgr, nc)) {
      ctl_msg.callback(nc, MG_EV_POLL,
                       ctl_msg.message MG_UD_ARG(nc->user_data));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2030, %rsp           # imm = 0x2030
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
leaq -0x2010(%rbp), %rsi
movl $0x2008, %edx           # imm = 0x2008
xorl %ecx, %ecx
callq 0x3060
movl %eax, -0x2014(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
leaq -0x2010(%rbp), %rsi
addq $0x8, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x31d0
movq %rax, -0x2020(%rbp)
movl $0x4, %edi
leaq 0x11712(%rip), %rsi     # 0x203f2
leaq 0x10863(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xed05
movl -0x2014(%rbp), %esi
leaq 0x1170b(%rip), %rdi     # 0x20409
movb $0x0, %al
callq 0x47a0
jmp 0xed07
cmpl $0x8, -0x2014(%rbp)
jl 0xed70
cmpq $0x0, -0x2010(%rbp)
je 0xed70
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbeb0
movq %rax, -0x2028(%rbp)
cmpq $0x0, -0x2028(%rbp)
je 0xed6e
movq -0x2010(%rbp), %rax
movq -0x2028(%rbp), %rdi
leaq -0x2010(%rbp), %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq *%rax
movq -0x8(%rbp), %rdi
movq -0x2028(%rbp), %rsi
callq 0xbeb0
movq %rax, -0x2028(%rbp)
jmp 0xed2e
jmp 0xed70
addq $0x2030, %rsp           # imm = 0x2030
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socketpair_accept
MG_INTERNAL sock_t
mg_socketpair_accept(sock_t sock, union socket_address *sa, socklen_t sa_len) {
  sock_t rc;
  while (1) {
    if ((rc = accept(sock, &sa->sa, &sa_len)) == INVALID_SOCKET &&
        errno == EINTR)
      continue;
    break;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x3590
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
jne 0xedb6
callq 0x3090
cmpl $0x4, (%rax)
jne 0xedb6
jmp 0xed92
jmp 0xedb8
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socketpair_close
MG_INTERNAL void mg_socketpair_close(sock_t *sock) {
  while (1) {
    if (closesocket(*sock) == -1 && errno == EINTR) continue;
    break;
  }
  *sock = INVALID_SOCKET;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x32a0
cmpl $-0x1, %eax
jne 0xedf8
callq 0x3090
cmpl $0x4, (%rax)
jne 0xedf8
jmp 0xeddc
jmp 0xedfa
movq -0x8(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_sock_get_addr
static void mg_sock_get_addr(sock_t sock, int remote,
                             union socket_address *sa) {
  socklen_t slen = sizeof(*sa);
  memset(sa, 0, slen);
  if (remote) {
    getpeername(sock, &sa->sa, &slen);
  } else {
    getsockname(sock, &sa->sa, &slen);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl $0x10, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x3260
cmpl $0x0, -0x8(%rbp)
je 0xeea1
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x3150
jmp 0xeeb1
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x35a0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_socket_if_get_conn_addr
void mg_socket_if_get_conn_addr(struct mg_connection *nc, int remote,
                                union socket_address *sa) {
  if ((nc->flags & MG_F_UDP) && remote) {
    memcpy(sa, &nc->sa, sizeof(*sa));
    return;
  }
  mg_sock_get_addr(nc->sock, remote, sa);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0xf047
cmpl $0x0, -0xc(%rbp)
je 0xf047
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rdx
movq %rdx, (%rax)
movq 0x30(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0xf05a
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0xee60
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_tun_if_tcp_send
void mg_tun_if_tcp_send(struct mg_connection *nc, const void *buf, size_t len) {
  struct mg_tun_client *client = (struct mg_tun_client *) nc->iface->data;
  uint32_t stream_id = (uint32_t)(uintptr_t) nc->mgr_data;
  struct mg_str msg = {(char *) buf, len};
#if MG_ENABLE_HEXDUMP
  char hex[512];
  mg_hexdump(buf, len, hex, sizeof(hex));
  LOG(LL_DEBUG, ("sending to stream 0x%x:\n%s", (unsigned int) stream_id, hex));
#endif

  mg_tun_send_frame(client->disp, stream_id, MG_TUN_DATA_FRAME, 0, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq -0x240(%rbp), %rdx
movl $0x200, %ecx            # imm = 0x200
callq 0xf170
movl $0x3, %edi
leaq 0x107bb(%rip), %rsi     # 0x1f8da
leaq 0x10424(%rip), %rdx     # 0x1f54a
callq 0x4650
cmpl $0x0, %eax
je 0xf148
movl -0x24(%rbp), %esi
leaq -0x240(%rbp), %rdx
leaq 0x107ac(%rip), %rdi     # 0x1f8ed
movb $0x0, %al
callq 0x47a0
jmp 0xf14a
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
movl -0x24(%rbp), %esi
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r9
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf1b0
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
nop