LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: page_merge_dirty
static Page * page_merge_dirty(Page *pA, Page *pB)
{
	Page result, *pTail;
    /* Prevent compiler warning */
	result.pDirtyNext = result.pDirtyPrev = 0;
	pTail = &result;
	while( pA && pB ){
		if( pA->iPage < pB->iPage ){
			pTail->pDirtyPrev = pA;
			pA->pDirtyNext = pTail;
			pTail = pA;
			pA = pA->pDirtyPrev;
		}else{
			pTail->pDirtyPrev = pB;
			pB->pDirtyNext = pTail;
			pTail = pB;
			pB = pB->pDirtyPrev;
		}
	}
	if( pA ){
		pTail->pDirtyPrev = pA;
		pA->pDirtyNext = pTail;
	}else if( pB ){
		pTail->pDirtyPrev = pB;
		pB->pDirtyNext = pTail;
	}else{
		pTail->pDirtyPrev = pTail->pDirtyNext = 0;
	}
	return result.pDirtyPrev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x8(%rbp)
movb %al, -0x81(%rbp)
je 0xae7f2
cmpq $0x0, -0x10(%rbp)
setne %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0xae7fe
jmp 0xae86f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xae83e
movq -0x8(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xae86a
movq -0x10(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x80(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xae7d5
cmpq $0x0, -0x8(%rbp)
je 0xae890
movq -0x8(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0xae8cb
cmpq $0x0, -0x10(%rbp)
je 0xae8b1
movq -0x10(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x80(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0xae8c9
movq -0x80(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x80(%rbp), %rax
movq $0x0, 0x40(%rax)
jmp 0xae8cb
movq -0x38(%rbp), %rax
addq $0x8, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: iobuf_resize
void iobuf_resize(struct iobuf *io, size_t new_size) {
  char *p;
  if ((new_size > io->size || (new_size < io->size && new_size >= io->len)) &&
      (p = (char *) NS_REALLOC(io->buf, new_size)) != NULL) {
    io->size = new_size;
    io->buf = p;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
ja 0xaeb7a
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xaebab
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0xaebab
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xd160
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xaebab
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
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: iobuf_append
size_t iobuf_append(struct iobuf *io, const void *buf, size_t len) {
  char *p = NULL;

  assert(io != NULL);
  assert(io->len <= io->size);

  /* check overflow */
  if (len > ~(size_t)0 - (size_t)(io->buf + io->len)) {
    return 0;
  }

  if (len <= 0) {
  } else if (io->len + len <= io->size) {
    memcpy(io->buf + io->len, buf, len);
    io->len += len;
  } else if ((p = (char *) NS_REALLOC(io->buf, io->len + len)) != NULL) {
    io->buf = p;
    memcpy(io->buf + io->len, buf, len);
    io->len += len;
    io->size = io->len;
  } else {
    len = 0;
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xaec75
jmp 0xaec94
leaq 0x17ed4(%rip), %rdi     # 0xc6b50
leaq 0x17ed8(%rip), %rsi     # 0xc6b5b
movl $0x175, %edx            # imm = 0x175
leaq 0x17ee6(%rip), %rcx     # 0xc6b75
callq 0xd280
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
ja 0xaeca8
jmp 0xaecc7
leaq 0x17f00(%rip), %rdi     # 0xc6baf
leaq 0x17ea5(%rip), %rsi     # 0xc6b5b
movl $0x176, %edx            # imm = 0x176
leaq 0x17eb3(%rip), %rcx     # 0xc6b75
callq 0xd280
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdx
movq -0x10(%rbp), %rcx
addq 0x8(%rcx), %rdx
movq $-0x1, %rcx
subq %rdx, %rcx
cmpq %rcx, %rax
jbe 0xaecf6
movq $0x0, -0x8(%rbp)
jmp 0xaedc5
cmpq $0x0, -0x20(%rbp)
ja 0xaed02
jmp 0xaedbd
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
ja 0xaed46
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xd100
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
jmp 0xaedbb
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
addq -0x20(%rbp), %rsi
callq 0xd160
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xaedb1
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xd100
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xaedb9
movq $0x0, -0x20(%rbp)
jmp 0xaedbb
jmp 0xaedbd
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_avprintf
int ns_avprintf(char **buf, size_t size, const char *fmt, va_list ap) {
  va_list ap_copy;
  int len;

  va_copy(ap_copy, ap);
  len = vsnprintf(*buf, size, fmt, ap_copy);
  va_end(ap_copy);

  if (len < 0) {
    // eCos and Windows are not standard-compliant and return -1 when
    // the buffer is too small. Keep allocating larger buffers until we
    // succeed or out of memory.
    *buf = NULL;
    while (len < 0) {
      if (*buf) NS_FREE(*buf);
      size *= 2;
      if ((*buf = (char *) NS_MALLOC(size)) == NULL) break;
      va_copy(ap_copy, ap);
      len = vsnprintf(*buf, size, fmt, ap_copy);
      va_end(ap_copy);
    }
  } else if (len > (int) size) {
    // Standard-compliant code path. Allocate a buffer that is large enough.
    if ((*buf = (char *) NS_MALLOC(len + 1)) == NULL) {
      len = -1;
    } else {
      va_copy(ap_copy, ap);
      len = vsnprintf(*buf, len + 1, fmt, ap_copy);
      va_end(ap_copy);
    }
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0xdf48
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rax
cmpl $0x0, -0x44(%rbp)
jge 0xaef1a
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
cmpl $0x0, -0x44(%rbp)
jge 0xaef18
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xaeebe
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xd2c0
movq -0x10(%rbp), %rax
shlq %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xdb70
movq -0x8(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0xaeee1
jmp 0xaef18
leaq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0xdf48
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rax
jmp 0xaeea2
jmp 0xaef87
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl %ecx, %eax
jle 0xaef85
movl -0x44(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0xdb70
movq -0x8(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0xaef49
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
jmp 0xaef83
leaq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x44(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0xdf48
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rax
jmp 0xaef85
jmp 0xaef87
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_vprintf
int ns_vprintf(struct ns_connection *nc, const char *fmt, va_list ap) {
  char mem[NS_VPRINTF_BUFFER_SIZE], *buf = mem;
  int len;

  if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) {
    ns_out(nc, buf, len);
  }
  if (buf != mem && buf != NULL) {
    NS_FREE(buf);
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x210(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x218(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0xaee40
movl %eax, -0x21c(%rbp)
cmpl $0x0, %eax
jle 0xaeff0
movq -0x8(%rbp), %rdi
movq -0x218(%rbp), %rsi
movslq -0x21c(%rbp), %rdx
callq 0xaf030
movq -0x218(%rbp), %rax
leaq -0x210(%rbp), %rcx
cmpq %rcx, %rax
je 0xaf019
cmpq $0x0, -0x218(%rbp)
je 0xaf019
movq -0x218(%rbp), %rdi
callq 0xd2c0
movl -0x21c(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_out
static size_t ns_out(struct ns_connection *nc, const void *buf, size_t len) {
  if (nc->flags & NSF_UDP) {
    long n = sendto(nc->sock, (const char *) buf, len, 0, &nc->sa.sa,
                    sizeof(nc->sa.sin));
    DBG(("%p %d send %ld (%d %s)", nc, nc->sock, n, errno, strerror(errno)));
    return n < 0 ? 0 : n;
  } else {
    return iobuf_append(&nc->send_iobuf, buf, len);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0xa0(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xaf0a1
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %r8
addq $0x24, %r8
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0xd990
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0xaf08f
xorl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0xaf097
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xaf0ba
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xaec50
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
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: ns_printf
int ns_printf(struct ns_connection *conn, const char *fmt, ...) {
  int len;
  va_list ap;
  va_start(ap, fmt);
  len = ns_vprintf(conn, fmt, ap);
  va_end(ap);
  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xaf108
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x10, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xaef90
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_bind
struct ns_connection *ns_bind(struct ns_mgr *srv, const char *str,
                              ns_callback_t callback, void *user_data) {
  union socket_address sa;
  struct ns_connection *nc = NULL;
  int use_ssl, proto;
  char cert[100], ca_cert[100];
  sock_t sock;

  ns_parse_address(str, &sa, &proto, &use_ssl, cert, ca_cert);
  if (use_ssl && cert[0] == '\0') return NULL;

  if ((sock = ns_open_listening_socket(&sa, proto)) == INVALID_SOCKET) {
  } else if ((nc = ns_add_sock(srv, sock, callback, NULL)) == NULL) {
    closesocket(sock);
  } else {
    nc->sa = sa;
    nc->flags |= NSF_LISTENING;
    nc->user_data = user_data;
    nc->callback = callback;

    if (proto == SOCK_DGRAM) {
      nc->flags |= NSF_UDP;
    }

#ifdef NS_ENABLE_SSL
    if (use_ssl) {
      nc->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
      if (ns_use_cert(nc->ssl_ctx, cert) != 0 ||
          ns_use_ca_cert(nc->ssl_ctx, ca_cert) != 0) {
        ns_close_conn(nc);
        nc = NULL;
      }
    }
#endif

    DBG(("%p sock %d/%d ssl %p %p", nc, sock, proto, nc->ssl_ctx, nc->ssl));
  }

  return nc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq -0xb0(%rbp), %r8
leaq -0x120(%rbp), %r9
leaq -0x38(%rbp), %rsi
leaq -0x48(%rbp), %rdx
leaq -0x44(%rbp), %rcx
callq 0xaf5a0
cmpl $0x0, -0x44(%rbp)
je 0xaf4d5
movsbl -0xb0(%rbp), %eax
cmpl $0x0, %eax
jne 0xaf4d5
movq $0x0, -0x8(%rbp)
jmp 0xaf58f
movl -0x48(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0xaf840
movl %eax, -0x124(%rbp)
cmpl $-0x1, %eax
jne 0xaf4f1
jmp 0xaf587
movq -0x10(%rbp), %rdi
movl -0x124(%rbp), %esi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xaf920
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0xaf51f
movl -0x124(%rbp), %edi
callq 0xd350
jmp 0xaf585
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x24(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x2c(%rax)
movq -0x40(%rbp), %rax
movl 0xa0(%rax), %ecx
orl $0x80, %ecx
movl %ecx, 0xa0(%rax)
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x98(%rax)
cmpl $0x2, -0x48(%rbp)
jne 0xaf583
movq -0x40(%rbp), %rax
movl 0xa0(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0xa0(%rax)
jmp 0xaf585
jmp 0xaf587
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_open_listening_socket
static sock_t ns_open_listening_socket(union socket_address *sa, int proto) {
  socklen_t sa_len = (sa->sa.sa_family == AF_INET) ?
    sizeof(sa->sin) : sizeof(sa->sin6);
  sock_t sock = INVALID_SOCKET;
#ifndef _WIN32
  int on = 1;
#endif

  if ((sock = socket(sa->sa.sa_family, proto, 0)) != INVALID_SOCKET &&
#ifndef _WIN32
      // SO_RESUSEADDR is not enabled on Windows because the semantics of
      // SO_REUSEADDR on UNIX and Windows is different. On Windows,
      // SO_REUSEADDR allows to bind a socket to a port without error even if
      // the port is already open by another program. This is not the behavior
      // SO_REUSEADDR was designed for, and leads to hard-to-track failure
      // scenarios. Therefore, SO_REUSEADDR was disabled on Windows.
      !setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) &&
#endif
      !bind(sock, &sa->sa, sa_len) &&
      (proto == SOCK_DGRAM || listen(sock, SOMAXCONN) == 0)) {
    ns_set_non_blocking_mode(sock);
    // In case port was set to 0, get the real port number
    (void) getsockname(sock, &sa->sa, &sa_len);
  } else if (sock != INVALID_SOCKET) {
    closesocket(sock);
    sock = INVALID_SOCKET;
  }

  return sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %ecx
movl $0x10, %eax
cmpl $0x2, %ecx
cmoveq %rax, %rax
movl %eax, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x18(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %edi
movl -0xc(%rbp), %esi
xorl %edx, %edx
callq 0xd640
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0xaf8f3
movl -0x14(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x18(%rbp), %rcx
movl $0x4, %r8d
callq 0xd210
cmpl $0x0, %eax
jne 0xaf8f3
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rsi
movl -0x10(%rbp), %edx
callq 0xdbf0
cmpl $0x0, %eax
jne 0xaf8f3
cmpl $0x2, -0xc(%rbp)
je 0xaf8d9
movl -0x14(%rbp), %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0xde10
cmpl $0x0, %eax
jne 0xaf8f3
movl -0x14(%rbp), %edi
callq 0xb0920
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rsi
leaq -0x10(%rbp), %rdx
callq 0xd090
jmp 0xaf90a
cmpl $-0x1, -0x14(%rbp)
je 0xaf908
movl -0x14(%rbp), %edi
callq 0xd350
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
jmp 0xaf90a
movl -0x14(%rbp), %eax
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: ns_add_sock
struct ns_connection *ns_add_sock(struct ns_mgr *s, sock_t sock,
                                  ns_callback_t callback, void *user_data) {
  struct ns_connection *conn;
  if ((conn = (struct ns_connection *) NS_MALLOC(sizeof(*conn))) != NULL) {
    memset(conn, 0, sizeof(*conn));
    ns_set_non_blocking_mode(sock);
    ns_set_close_on_exec(sock);
    conn->sock = sock;
    conn->user_data = user_data;
    conn->callback = callback;
    conn->mgr = s;
    conn->last_io_time = time(NULL);
    ns_add_conn(s, conn);
    DBG(("%p %d", conn, sock));
  }
  return conn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0xa8, %edi
callq 0xdb70
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xaf9c3
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0xa8, %edx
callq 0xd430
movl -0xc(%rbp), %edi
callq 0xb0920
movl -0xc(%rbp), %edi
callq 0xaf170
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0xd980
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xb09e0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_sock_to_str
void ns_sock_to_str(sock_t sock, char *buf, size_t len, int flags) {
  union socket_address sa;
  socklen_t slen = sizeof(sa);

  if (buf != NULL && len > 0) {
    buf[0] = '\0';
    memset(&sa, 0, sizeof(sa));
    if (flags & 4) {
      getpeername(sock, &sa.sa, &slen);
    } else {
      getsockname(sock, &sa.sa, &slen);
    }
    if (flags & 1) {
#if defined(NS_ENABLE_IPV6)
      inet_ntop(sa.sa.sa_family, sa.sa.sa_family == AF_INET ?
                (void *) &sa.sin.sin_addr :
                (void *) &sa.sin6.sin6_addr, buf, len);
#elif defined(_WIN32)
      // Only Windoze Vista (and newer) have inet_ntop()
      strncpy(buf, inet_ntoa(sa.sin.sin_addr), len);
#else
      inet_ntop(sa.sa.sa_family, (void *) &sa.sin.sin_addr, buf,(socklen_t)len);
#endif
    }
    if (flags & 2) {
      snprintf(buf + strlen(buf), len - (strlen(buf) + 1), "%s%d",
               flags & 1 ? ":" : "", (int) ntohs(sa.sin.sin_port));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x10, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xafb06
cmpq $0x0, -0x18(%rbp)
jbe 0xafb06
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd430
movl -0x1c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xafa37
movl -0x4(%rbp), %edi
leaq -0x2c(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xdee0
jmp 0xafa47
movl -0x4(%rbp), %edi
leaq -0x2c(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xd090
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xafa6d
movzwl -0x2c(%rbp), %edi
leaq -0x2c(%rbp), %rsi
addq $0x4, %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movl %eax, %ecx
callq 0xd310
movl -0x1c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xafb04
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd550
movq %rax, %rcx
movq -0x58(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd550
movq %rax, %rcx
movq -0x50(%rbp), %rax
addq $0x1, %rcx
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %edx
andl $0x1, %edx
leaq 0x16080(%rip), %rax     # 0xc5b4b
leaq 0x10165(%rip), %rcx     # 0xbfc37
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x38(%rbp)
movzwl -0x2a(%rbp), %edi
callq 0xddc0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
movzwl %ax, %r8d
leaq 0x170c6(%rip), %rdx     # 0xc6bc3
movb $0x0, %al
callq 0xd6e0
jmp 0xafb06
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_add_to_set
static void ns_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
  if ( (sock != INVALID_SOCKET) && (sock < FD_SETSIZE) ) {
    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 0xb02f0
cmpl $0x400, -0x4(%rbp)      # imm = 0x400
jge 0xb02f0
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 0xb02e5
movl -0x4(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xb02ee
movl -0x4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb02f0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_call
static void ns_call(struct ns_connection *nc, int ev, void *p) {
  if (nc->mgr->hexdump_file != NULL && ev != NS_POLL) {
    int len = (ev == NS_RECV || ev == NS_SEND) ? * (int *) p : 0;
    hexdump(nc, nc->mgr->hexdump_file, len, ev);
  }

  nc->callback(nc, ev, p);
}

// 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 0x18(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0xb0367
cmpl $0x0, -0xc(%rbp)
je 0xb0367
cmpl $0x3, -0xc(%rbp)
je 0xb0334
cmpl $0x4, -0xc(%rbp)
jne 0xb033f
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
jmp 0xb0346
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0xb0346
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
movl -0x1c(%rbp), %edx
movl -0xc(%rbp), %ecx
callq 0xb5f80
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
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: ns_close_conn
static void ns_close_conn(struct ns_connection *conn) {
  DBG(("%p %d", conn, conn->flags));
  ns_call(conn, NS_CLOSE, NULL);
  ns_remove_conn(conn);
  ns_destroy_conn(conn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xb0300
movq -0x8(%rbp), %rdi
callq 0xb6210
movq -0x8(%rbp), %rdi
callq 0xb6280
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_handle_udp
static void ns_handle_udp(struct ns_connection *ls) {
  struct ns_connection nc;
  char buf[NS_UDP_RECEIVE_BUFFER_SIZE];
  ssize_t n;
  socklen_t s_len = sizeof(nc.sa);

  memset(&nc, 0, sizeof(nc));
  n = recvfrom(ls->sock, buf, sizeof(buf), 0, &nc.sa.sa, &s_len);
  if (n <= 0) {
    DBG(("%p recvfrom: %s", ls, strerror(errno)));
  } else {
    nc.mgr = ls->mgr;
    nc.recv_iobuf.buf = buf;
    nc.recv_iobuf.len = nc.recv_iobuf.size = n;
    nc.sock = ls->sock;
    nc.callback = ls->callback;
    nc.user_data = ls->user_data;
    nc.proto_data = ls->proto_data;
    nc.mgr = ls->mgr;
    nc.listener = ls;
    nc.flags = NSF_UDP;
    DBG(("%p %d bytes received", ls, n));
    ns_call(&nc, NS_RECV, &n);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x890, %rsp            # imm = 0x890
movq %rdi, -0x8(%rbp)
movl $0x10, -0x88c(%rbp)
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0xa8, %edx
callq 0xd430
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
leaq -0x880(%rbp), %rsi
leaq -0xb0(%rbp), %r8
addq $0x24, %r8
movl $0x7d0, %edx            # imm = 0x7D0
xorl %ecx, %ecx
leaq -0x88c(%rbp), %r9
callq 0xd3d0
movq %rax, -0x888(%rbp)
cmpq $0x0, -0x888(%rbp)
jg 0xb047e
jmp 0xb051a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
leaq -0x880(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x888(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x100, -0x10(%rbp)     # imm = 0x100
leaq -0xb0(%rbp), %rdi
movl $0x3, %esi
leaq -0x888(%rbp), %rdx
callq 0xb0300
addq $0x890, %rsp            # imm = 0x890
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: accept_conn
static struct ns_connection *accept_conn(struct ns_connection *ls) {
  struct ns_connection *c = NULL;
  union socket_address sa;
  socklen_t len = sizeof(sa);
  sock_t sock = INVALID_SOCKET;

  // NOTE(lsm): on Windows, sock is always > FD_SETSIZE
  if ((sock = accept(ls->sock, &sa.sa, &len)) == INVALID_SOCKET) {
  } else if ((c = ns_add_sock(ls->mgr, sock, ls->callback,
              ls->user_data)) == NULL) {
    closesocket(sock);
#ifdef NS_ENABLE_SSL
  } else if (ls->ssl_ctx != NULL &&
             ((c->ssl = SSL_new(ls->ssl_ctx)) == NULL ||
              SSL_set_fd(c->ssl, sock) != 1)) {
    DBG(("SSL error"));
    ns_close_conn(c);
    c = NULL;
#endif
  } else {
    c->listener = ls;
    c->proto_data = ls->proto_data;
    ns_call(c, NS_ACCEPT, &sa);
    DBG(("%p %d %p %p", c, c->sock, c->ssl_ctx, c->ssl));
  }

  return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl $0x10, -0x24(%rbp)
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0xdac0
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
jne 0xb0570
jmp 0xb05e0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x28(%rbp), %esi
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rcx
callq 0xaf920
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0xb05aa
movl -0x28(%rbp), %edi
callq 0xd350
jmp 0xb05de
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq -0x20(%rbp), %rdx
callq 0xb0300
jmp 0xb05e0
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_write_to_socket
static void ns_write_to_socket(struct ns_connection *conn) {
  struct iobuf *io = &conn->send_iobuf;
  int n = 0;

#ifdef NS_ENABLE_SSL
  if (conn->ssl != NULL) {
    n = SSL_write(conn->ssl, io->buf, io->len);
    if (n <= 0) {
      int ssl_err = ns_ssl_err(conn, n);
      if (ssl_err == SSL_ERROR_WANT_READ || ssl_err == SSL_ERROR_WANT_WRITE) {
        return; // Call us again
      } else {
        conn->flags |= NSF_CLOSE_IMMEDIATELY;
      }
    } else {
      conn->flags &= ~(NSF_WANT_READ | NSF_WANT_WRITE);
    }
  } else
#endif
  { n = (int) send(conn->sock, io->buf, io->len, 0); }

  DBG(("%p %d -> %d bytes", conn, conn->flags, n));

  ns_call(conn, NS_SEND, &n);
  if (ns_is_error(n)) {
    conn->flags |= NSF_CLOSE_IMMEDIATELY;
  } else if (n > 0) {
    iobuf_remove(io, n);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %ecx, %ecx
callq 0xd4a0
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
leaq -0x14(%rbp), %rdx
callq 0xb0300
movl -0x14(%rbp), %edi
callq 0xb0960
cmpl $0x0, %eax
je 0xb07a3
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0xa0(%rax)
jmp 0xb07b8
cmpl $0x0, -0x14(%rbp)
jle 0xb07b6
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0xaedd0
jmp 0xb07b8
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_connect
struct ns_connection *ns_connect(struct ns_mgr *mgr, const char *address,
                                 ns_callback_t callback, void *user_data) {
  sock_t sock = INVALID_SOCKET;
  struct ns_connection *nc = NULL;
  union socket_address sa;
  char cert[100], ca_cert[100];
  int rc, use_ssl, proto;

  ns_parse_address(address, &sa, &proto, &use_ssl, cert, ca_cert);
  if ((sock = socket(AF_INET, proto, 0)) == INVALID_SOCKET) {
    return NULL;
  }
  ns_set_non_blocking_mode(sock);
  rc = (proto == SOCK_DGRAM) ? 0 : connect(sock, &sa.sa, sizeof(sa.sin));

  if (rc != 0 && ns_is_error(rc)) {
    closesocket(sock);
    return NULL;
  } else if ((nc = ns_add_sock(mgr, sock, callback, user_data)) == NULL) {
    closesocket(sock);
    return NULL;
  }

  nc->sa = sa;   // Important, cause UDP conns will use sendto()
  nc->flags = (proto == SOCK_DGRAM) ? NSF_UDP : NSF_CONNECTING;

#ifdef NS_ENABLE_SSL
  if (use_ssl) {
    if ((nc->ssl_ctx = SSL_CTX_new(SSLv23_client_method())) == NULL ||
        ns_use_cert(nc->ssl_ctx, cert) != 0 ||
        ns_use_ca_cert(nc->ssl_ctx, ca_cert) != 0 ||
        (nc->ssl = SSL_new(nc->ssl_ctx)) == NULL) {
      ns_close_conn(nc);
      return NULL;
    } else {
      SSL_set_fd(nc->ssl, sock);
    }
  }
#endif

  return nc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rdi
leaq -0xb0(%rbp), %r8
leaq -0x120(%rbp), %r9
leaq -0x48(%rbp), %rsi
leaq -0x12c(%rbp), %rdx
leaq -0x128(%rbp), %rcx
callq 0xaf5a0
movl -0x12c(%rbp), %esi
movl $0x2, %edi
xorl %edx, %edx
callq 0xd640
movl %eax, -0x2c(%rbp)
cmpl $-0x1, %eax
jne 0xb083a
movq $0x0, -0x8(%rbp)
jmp 0xb0911
movl -0x2c(%rbp), %edi
callq 0xb0920
cmpl $0x2, -0x12c(%rbp)
jne 0xb0855
xorl %eax, %eax
movl %eax, -0x130(%rbp)
jmp 0xb086c
movl -0x2c(%rbp), %edi
leaq -0x48(%rbp), %rsi
movl $0x10, %edx
callq 0xd4f0
movl %eax, -0x130(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0x124(%rbp)
cmpl $0x0, -0x124(%rbp)
je 0xb08a3
movl -0x124(%rbp), %edi
callq 0xb0960
cmpl $0x0, %eax
je 0xb08a3
movl -0x2c(%rbp), %edi
callq 0xd350
movq $0x0, -0x8(%rbp)
jmp 0xb0911
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xaf920
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xb08d3
movl -0x2c(%rbp), %edi
callq 0xd350
movq $0x0, -0x8(%rbp)
jmp 0xb0911
jmp 0xb08d5
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x24(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x2c(%rax)
movl -0x12c(%rbp), %edx
movl $0x8, %ecx
movl $0x100, %eax            # imm = 0x100
cmpl $0x2, %edx
cmovel %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xa0(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_is_error
static int ns_is_error(int n) {
  return n == 0 ||
    (n < 0 && errno != EINTR && errno != EINPROGRESS &&
     errno != EAGAIN && errno != EWOULDBLOCK
#ifdef _WIN32
     && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK
#endif
    );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movb $0x1, %al
cmpl $0x0, -0x4(%rbp)
movb %al, -0x5(%rbp)
je 0xb09cb
xorl %eax, %eax
cmpl $0x0, -0x4(%rbp)
movb %al, -0x6(%rbp)
jge 0xb09c5
callq 0xdcc0
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x4, (%rcx)
movb %al, -0x6(%rbp)
je 0xb09c5
callq 0xdcc0
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x73, (%rcx)
movb %al, -0x6(%rbp)
je 0xb09c5
callq 0xdcc0
movq %rax, %rcx
xorl %eax, %eax
cmpl $0xb, (%rcx)
movb %al, -0x6(%rbp)
je 0xb09c5
callq 0xdcc0
cmpl $0xb, (%rax)
setne %al
movb %al, -0x6(%rbp)
movb -0x6(%rbp), %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/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_add_conn
static void ns_add_conn(struct ns_mgr *mgr, struct ns_connection *c) {
  c->next = mgr->active_connections;
  mgr->active_connections = c;
  c->prev = NULL;
  if (c->next != NULL) c->next->prev = c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
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 0xb0a2a
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_broadcast
void ns_broadcast(struct ns_mgr *mgr, ns_callback_t cb,void *data, size_t len) {
  struct ctl_msg ctl_msg;
  if (mgr->ctl[0] != INVALID_SOCKET && data != NULL &&
      len < sizeof(ctl_msg.message)) {
    ctl_msg.callback = cb;
    memcpy(ctl_msg.message, data, len);
    send(mgr->ctl[0], (char *) &ctl_msg,
         offsetof(struct ctl_msg, message) + len, 0);
    recv(mgr->ctl[0], (char *) &len, 1, 0);
  }
}

// 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 0xb0abd
cmpq $0x0, -0x18(%rbp)
je 0xb0abd
cmpq $0x2000, -0x20(%rbp)    # imm = 0x2000
jae 0xb0abd
movq -0x10(%rbp), %rax
movq %rax, -0x2028(%rbp)
leaq -0x2028(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xd100
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
leaq -0x2028(%rbp), %rsi
xorl %ecx, %ecx
callq 0xd4a0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
leaq -0x20(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xdc10
addq $0x2030, %rsp           # imm = 0x2030
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_mgr_init
void ns_mgr_init(struct ns_mgr *s, void *user_data) {
  memset(s, 0, sizeof(*s));
  s->ctl[0] = s->ctl[1] = INVALID_SOCKET;
  s->user_data = user_data;

#ifdef _WIN32
  { WSADATA data; WSAStartup(MAKEWORD(2, 2), &data); }
#else
  // Ignore SIGPIPE signal, so if client cancels the request, it
  // won't kill the whole process.
  signal(SIGPIPE, SIG_IGN);
#endif

#ifndef NS_DISABLE_SOCKETPAIR
  {
    int attempts = 0, max_attempts = NS_MAX_SOCKETPAIR_ATTEMPTS;
    do {
      ns_socketpair2(s->ctl, SOCK_DGRAM);
    } while (s->ctl[0] == INVALID_SOCKET && ++attempts < max_attempts);
  }
#endif

#ifdef NS_ENABLE_SSL
  {static int init_done; if (!init_done) { SSL_library_init(); init_done++; }}
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0xd430
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0xd, %edi
movl $0x1, %esi
callq 0xd4b0
movl $0x0, -0x14(%rbp)
movl $0xa, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movl $0x2, %esi
callq 0xaf1a0
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $-0x1, 0x10(%rcx)
movb %al, -0x19(%rbp)
jne 0xb0b62
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl -0x18(%rbp), %eax
setl %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0xb0b2f
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_mgr_free
void ns_mgr_free(struct ns_mgr *s) {
  struct ns_connection *conn, *tmp_conn;

  DBG(("%p", s));
  if (s == NULL) return;
  // Do one last poll, see https://github.com/cesanta/mongoose/issues/286
  ns_mgr_poll(s, 0);

  if (s->ctl[0] != INVALID_SOCKET) closesocket(s->ctl[0]);
  if (s->ctl[1] != INVALID_SOCKET) closesocket(s->ctl[1]);
  s->ctl[0] = s->ctl[1] = INVALID_SOCKET;

  for (conn = s->active_connections; conn != NULL; conn = tmp_conn) {
    tmp_conn = conn->next;
    ns_close_conn(conn);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xb0b85
jmp 0xb0c02
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xafd10
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x10(%rax)
je 0xb0ba6
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
callq 0xd350
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x14(%rax)
je 0xb0bbc
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
callq 0xd350
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xb0c02
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb0390
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xb0bdd
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_printf
size_t mg_printf(struct mg_connection *conn, const char *fmt, ...) {
  va_list ap;
  int ret;

  va_start(ap, fmt);
  ret = mg_vprintf(conn, fmt, ap);
  va_end(ap);

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0xb0ceb
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x10, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xb0d60
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_get_header
const char *mg_get_header(const struct mg_connection *ri, const char *s) {
  int i;

  for (i = 0; i < ri->num_headers; i++)
    if (!mg_strcasecmp(s, ri->http_headers[i].name))
      return ri->http_headers[i].value;

  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x84(%rcx), %eax
jge 0xb1058
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x88, %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0xb1070
cmpl $0x0, %eax
jne 0xb104b
movq -0x10(%rbp), %rax
addq $0x88, %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xb1060
jmp 0xb104d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb0ff7
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_strcasecmp
static int mg_strcasecmp(const char *s1, const char *s2) {
  int diff;

  do {
    diff = lowercase(s1++) - lowercase(s2++);
  } while (diff == 0 && s1[-1] != '\0');

  return diff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
callq 0xb1360
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
callq 0xb1360
movl %eax, %ecx
movl -0x18(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x19(%rbp)
jne 0xb10d1
movq -0x8(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0xb1080
movl -0x14(%rbp), %eax
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: mg_send_data
size_t mg_send_data(struct mg_connection *c, const void *data, int data_len) {
  struct connection *conn = MG_CONN_2_CONN(c);
  terminate_headers(c);
  write_chunk(MG_CONN_2_CONN(c), (const char *) data, data_len);
  return conn->ns_conn->send_iobuf.len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb1af0
movq -0x8(%rbp), %rdi
addq $-0x8, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0xb1b70
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x60(%rax), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: mg_send_status
void mg_send_status(struct mg_connection *c, int status) {
  struct connection *conn = MG_CONN_2_CONN(c);
  if (c->status_code == 0) {
    c->status_code = status;
    mg_printf(c, "HTTP/1.1 %d %s\r\n", status, status_code_to_str(status));
  }
  conn->ns_conn->flags |= MG_USING_CHUNKED_API;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x27c(%rax)
jne 0xb1633
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x27c(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %edi
callq 0xb1660
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %edx
movq %rax, %rcx
leaq 0x155b5(%rip), %rsi     # 0xc6be1
movb $0x0, %al
callq 0xb0cb0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl 0xa0(%rax), %ecx
orl $0x200000, %ecx         # imm = 0x200000
movl %ecx, 0xa0(%rax)
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: mg_send_header
void mg_send_header(struct mg_connection *c, const char *name, const char *v) {
  struct connection *conn = MG_CONN_2_CONN(c);
  if (c->status_code == 0) {
    c->status_code = 200;
    mg_printf(c, "HTTP/1.1 %d %s\r\n", 200, status_code_to_str(200));
  }
  mg_printf(c, "%s: %s\r\n", name, v);
  conn->ns_conn->flags |= MG_USING_CHUNKED_API;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x27c(%rax)
jne 0xb1ab7
movq -0x8(%rbp), %rax
movl $0xc8, 0x27c(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0xc8, %edi
callq 0xb1660
movq -0x28(%rbp), %rdi
movq %rax, %rcx
leaq 0x15136(%rip), %rsi     # 0xc6be1
movl $0xc8, %edx
movb $0x0, %al
callq 0xb0cb0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x15128(%rip), %rsi     # 0xc6bf2
movb $0x0, %al
callq 0xb0cb0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl 0xa0(%rax), %ecx
orl $0x200000, %ecx         # imm = 0x200000
movl %ecx, 0xa0(%rax)
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: terminate_headers
static void terminate_headers(struct mg_connection *c) {
  struct connection *conn = MG_CONN_2_CONN(c);
  if (!(conn->ns_conn->flags & MG_HEADERS_SENT)) {
    mg_send_header(c, "Transfer-Encoding", "chunked");
    mg_write(c, "\r\n", 2);
    conn->ns_conn->flags |= MG_HEADERS_SENT;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0xa0(%rax), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
jne 0xb1b64
movq -0x8(%rbp), %rdi
leaq 0x15662(%rip), %rsi     # 0xc718c
leaq 0x1566d(%rip), %rdx     # 0xc719e
callq 0xb1a50
movq -0x8(%rbp), %rdi
leaq 0x15130(%rip), %rsi     # 0xc6c71
movl $0x2, %edx
callq 0xb1580
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0xa0(%rax), %ecx
orl $0x100000, %ecx         # imm = 0x100000
movl %ecx, 0xa0(%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: write_chunk
static void write_chunk(struct connection *conn, const char *buf, int len) {
  char chunk_size[50];
  int n = mg_snprintf(chunk_size, sizeof(chunk_size), "%X\r\n", len);
  ns_send(conn->ns_conn, chunk_size, n);
  ns_send(conn->ns_conn, buf, len);
  ns_send(conn->ns_conn, "\r\n", 2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq -0x50(%rbp), %rdi
movl -0x14(%rbp), %ecx
movl $0x32, %esi
leaq 0x15610(%rip), %rdx     # 0xc71a6
movb $0x0, %al
callq 0xb3c50
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq -0x50(%rbp), %rsi
movslq -0x54(%rbp), %rdx
callq 0xafce0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0xafce0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1509b(%rip), %rsi     # 0xc6c71
movl $0x2, %edx
callq 0xafce0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)