LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_encode_seg(char*, IKCPSEG const*)
static char *ikcp_encode_seg(char *ptr, const IKCPSEG *seg)
{
	ptr = ikcp_encode32u(ptr, seg->conv);
	ptr = ikcp_encode8u(ptr, (IUINT8)seg->cmd);
	ptr = ikcp_encode8u(ptr, (IUINT8)seg->frg);
	ptr = ikcp_encode16u(ptr, (IUINT16)seg->wnd);
	ptr = ikcp_encode32u(ptr, seg->ts);
	ptr = ikcp_encode32u(ptr, seg->sn);
	ptr = ikcp_encode32u(ptr, seg->una);
	ptr = ikcp_encode32u(ptr, seg->len);
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x66c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movzbl %al, %esi
callq 0x66f0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movzbl %al, %esi
callq 0x66f0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movzwl %ax, %esi
callq 0x6720
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x66c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x66c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
callq 0x66c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %esi
callq 0x66c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_update
void ikcp_update(ikcpcb *kcp, IUINT32 current)
{
	IINT32 slap;

	kcp->current = current;

	if (kcp->updated == 0) {
		kcp->updated = 1;
		kcp->ts_flush = kcp->current;
	}

	slap = _itimediff(kcp->current, kcp->ts_flush);

	if (slap >= 10000 || slap < -10000) {
		kcp->ts_flush = kcp->current;
		slap = 0;
	}

	if (slap >= 0) {
		kcp->ts_flush += kcp->interval;
		if (_itimediff(kcp->current, kcp->ts_flush) >= 0) {
			kcp->ts_flush = kcp->current + kcp->interval;
		}
		ikcp_flush(kcp);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x70(%rax)
jne 0x625c
movq -0x8(%rbp), %rax
movl $0x1, 0x70(%rax)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x4ae0
movl %eax, -0x10(%rbp)
cmpl $0x2710, -0x10(%rbp)    # imm = 0x2710
jge 0x6284
cmpl $0xffffd8f0, -0x10(%rbp) # imm = 0xFFFFD8F0
jge 0x6299
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movl $0x0, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jl 0x62e7
movq -0x8(%rbp), %rax
movl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x54(%rax), %ecx
movl %ecx, 0x54(%rax)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x4ae0
cmpq $0x0, %rax
jl 0x62de
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x8(%rbp), %rdi
callq 0x56d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_check
IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current)
{
	IUINT32 ts_flush = kcp->ts_flush;
	IINT32 tm_flush = 0x7fffffff;
	IINT32 tm_packet = 0x7fffffff;
	IUINT32 minimal = 0;
	struct IQUEUEHEAD *p;

	if (kcp->updated == 0) {
		return current;
	}

	if (_itimediff(current, ts_flush) >= 10000 ||
		_itimediff(current, ts_flush) < -10000) {
		ts_flush = current;
	}

	if (_itimediff(current, ts_flush) >= 0) {
		return current;
	}

	tm_flush = _itimediff(ts_flush, current);

	for (p = kcp->snd_buf.next; p != &kcp->snd_buf; p = p->next) {
		const IKCPSEG *seg = iqueue_entry(p, const IKCPSEG, node);
		IINT32 diff = _itimediff(seg->resendts, current);
		if (diff <= 0) {
			return current;
		}
		if (diff < tm_packet) tm_packet = diff;
	}

	minimal = (IUINT32)(tm_packet < tm_flush ? tm_packet : tm_flush);
	if (minimal >= kcp->interval) minimal = kcp->interval;

	return current + minimal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x18(%rbp)
movl $0x7fffffff, -0x1c(%rbp) # imm = 0x7FFFFFFF
movl $0x7fffffff, -0x20(%rbp) # imm = 0x7FFFFFFF
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x70(%rax)
jne 0x6333
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x642c
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x4ae0
cmpq $0x2710, %rax           # imm = 0x2710
jge 0x6359
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x4ae0
cmpq $-0x2710, %rax          # imm = 0xD8F0
jge 0x635f
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x4ae0
cmpq $0x0, %rax
jl 0x637b
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x642c
movl -0x18(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x4ae0
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0xa8, %rcx
cmpq %rcx, %rax
je 0x63f1
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x30(%rax), %edi
movl -0x14(%rbp), %esi
callq 0x4ae0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jg 0x63d4
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x642c
movl -0x3c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x63e2
movl -0x3c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x63e4
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x6398
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6401
movl -0x20(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0x6407
movl -0x1c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jb 0x6423
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_setmtu
int ikcp_setmtu(ikcpcb *kcp, int mtu)
{
	char *buffer;
	if (mtu < 50 || mtu < (int)IKCP_OVERHEAD) 
		return -1;
	buffer = (char*)ikcp_malloc((mtu + IKCP_OVERHEAD) * 3);
	if (buffer == NULL) 
		return -2;
	kcp->mtu = mtu;
	kcp->mss = kcp->mtu - IKCP_OVERHEAD;
	ikcp_free(kcp->buffer);
	kcp->buffer = buffer;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x32, -0x14(%rbp)
jl 0x645b
cmpl $0x18, -0x14(%rbp)
jge 0x6464
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x64cb
movl -0x14(%rbp), %eax
addl $0x18, %eax
imull $0x3, %eax, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x3bd0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x648a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x64cb
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x18, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0x3c10
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xe0(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_interval(IKCPCB*, int)
int ikcp_interval(ikcpcb *kcp, int interval)
{
	if (interval > 5000) interval = 5000;
	else if (interval < 10) interval = 10;
	kcp->interval = interval;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x1388, -0xc(%rbp)     # imm = 0x1388
jle 0x64fd
movl $0x1388, -0xc(%rbp)     # imm = 0x1388
jmp 0x650c
cmpl $0xa, -0xc(%rbp)
jge 0x650a
movl $0xa, -0xc(%rbp)
jmp 0x650c
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
xorl %eax, %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_nodelay
int ikcp_nodelay(ikcpcb *kcp, int nodelay, int interval, int resend, int nc)
{
	if (nodelay >= 0) {
		kcp->nodelay = nodelay;
		if (nodelay) {
			kcp->rx_minrto = IKCP_RTO_NDL;	
		}	
		else {
			kcp->rx_minrto = IKCP_RTO_MIN;
		}
	}
	if (interval >= 0) {
		if (interval > 5000) interval = 5000;
		else if (interval < 10) interval = 10;
		kcp->interval = interval;
	}
	if (resend >= 0) {
		kcp->fastresend = resend;
	}
	if (nc >= 0) {
		kcp->nocwnd = nc;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x6565
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
cmpl $0x0, -0xc(%rbp)
je 0x6558
movq -0x8(%rbp), %rax
movl $0x1e, 0x34(%rax)
jmp 0x6563
movq -0x8(%rbp), %rax
movl $0x64, 0x34(%rax)
jmp 0x6565
cmpl $0x0, -0x10(%rbp)
jl 0x6596
cmpl $0x1388, -0x10(%rbp)    # imm = 0x1388
jle 0x657d
movl $0x1388, -0x10(%rbp)    # imm = 0x1388
jmp 0x658c
cmpl $0xa, -0x10(%rbp)
jge 0x658a
movl $0xa, -0x10(%rbp)
jmp 0x658c
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
cmpl $0x0, -0x14(%rbp)
jl 0x65a9
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xe8(%rax)
cmpl $0x0, -0x18(%rbp)
jl 0x65bc
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xec(%rax)
xorl %eax, %eax
popq %rbp
retq
// File: xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_wndsize
int ikcp_wndsize(ikcpcb *kcp, int sndwnd, int rcvwnd)
{
	if (kcp) {
		if (sndwnd > 0) {
			kcp->snd_wnd = sndwnd;
		}
		if (rcvwnd > 0) {   // must >= max fragment size
			kcp->rcv_wnd = _imax_(rcvwnd, IKCP_WND_RCV);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x6607
cmpl $0x0, -0xc(%rbp)
jle 0x65e9
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
cmpl $0x0, -0x10(%rbp)
jle 0x6605
movl -0x10(%rbp), %edi
movl $0x80, %esi
callq 0x6610
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
jmp 0x6607
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_init
int
mnet_init() {
   mnet_t *ss = _gmnet();
   if ( !ss->init ) {
#if MNET_OS_WIN
      WSADATA wdata;
      if (WSAStartup(MAKEWORD(2,2), &wdata) != 0) {
         mm_log(NULL, MNET_LOG_ERR, "fail to init !\n");
         return 0;
      }
      mm_log(NULL, MNET_LOG_VERBOSE, "init with select\n");
#else
      signal(SIGPIPE, SIG_IGN);
      _evt_init();
#endif
      ss->init = 1;
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x67b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x6791
movl $0xd, %edi
movl $0x1, %esi
callq 0x33c0
callq 0x67c0
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x6798
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: evt_init()
static int
_evt_init(void) {
   mnet_t *ss = _gmnet();
   if (ss->kq <= 0) {
#if (MNET_OS_MACOX || MNET_OS_FreeBSD)
      ss->kq = kqueue();
      mm_log(NULL, MNET_LOG_VERBOSE, "evt init with kqueue %d\n", ss->kq);
#else
      ss->kq = epoll_create(_KEV_EVT_ARRAY_SIZE);
      mm_log(NULL, MNET_LOG_VERBOSE, "evt init with epoll %d\n", ss->kq);
#endif
      ss->chg.size = _KEV_CHG_ARRAY_SIZE;
      ss->chg.array = (mevent_t*)mm_malloc(sizeof(mevent_t) * ss->chg.size);
      ss->evt.size = _KEV_EVT_ARRAY_SIZE;
      ss->evt.array = (mevent_t*)mm_malloc(sizeof(mevent_t) * ss->evt.size);
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x67b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jg 0x686b
movl $0x100, %edi            # imm = 0x100
callq 0x3550
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
xorl %eax, %eax
movl %eax, %edi
movl $0x3, %esi
leaq 0xcb53(%rip), %rdx      # 0x1335c
movb $0x0, %al
callq 0x6c30
movq -0x10(%rbp), %rax
movl $0x4, 0x18(%rax)
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
imulq $0xc, %rax, %rax
movl %eax, %edi
callq 0x8880
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0x100, 0x28(%rax)      # imm = 0x100
movq -0x10(%rbp), %rax
movslq 0x28(%rax), %rax
imulq $0xc, %rax, %rax
movl %eax, %edi
callq 0x8880
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x6872
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_fini
void
mnet_fini() {
   mnet_t *ss = _gmnet();
   if ( ss->init ) {
      chann_t *n = ss->channs;
      while ( n ) {
         chann_t *next = n->next;
         _chann_disconnect_socket(ss, n);
         _chann_close_socket(ss, n);
         _chann_destroy(ss, n);
         n = next;
      }
#if MNET_OS_WIN
      WSACleanup();
#else
      _kev_get_flags(NULL); // for compile warning
      _kev_get_events(NULL);
      _evt_fini();
#endif
      ss->init = 0;
      memset(ss, 0, sizeof(*ss));
      mm_log(NULL, MNET_LOG_VERBOSE, "fini\n");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x67b0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6936
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x68ee
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6940
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x69d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6a70
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x68aa
xorl %eax, %eax
movl %eax, %edi
callq 0x6b30
xorl %eax, %eax
movl %eax, %edi
callq 0x6b60
callq 0x6b90
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x31c0
xorl %eax, %eax
movl %eax, %edi
movl $0x3, %esi
leaq 0xc892(%rip), %rdx      # 0x131c1
movb $0x0, %al
callq 0x6c30
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_disconnect_socket(s_mnet*, s_mchann*)
static int
_chann_disconnect_socket(mnet_t *ss, chann_t *n) {
   if (n->fd > 0) {
      mm_log(n, MNET_LOG_VERBOSE, "chann disconnect fd:%d\n", n->fd);
      close(n->fd);
      _rwb_destroy(&n->rwb_send);
      n->fd = -1;
      n->state = CHANN_STATE_DISCONNECT;
#if (MNET_OS_MACOX || MNET_OS_LINUX || MNET_OS_FreeBSD)
      n->epoll_events = 0;
#endif
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x69ba
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movl $0x3, %esi
leaq 0xca05(%rip), %rdx      # 0x13374
movb $0x0, %al
callq 0x6c30
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x3570
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
callq 0x88c0
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x88(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x69c1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_close_socket(s_mnet*, s_mchann*)
static void
_chann_close_socket(mnet_t *ss, chann_t *n) {
   if (n->state > CHANN_STATE_CLOSED) {
#if (MNET_OS_MACOX || MNET_OS_LINUX || MNET_OS_FreeBSD)
      n->del_next = ss->del_channs;
      if (ss->del_channs) {
         ss->del_channs->del_prev = n;
      }
      ss->del_channs = n;
#endif
      n->state = CHANN_STATE_CLOSED;
      n->cb = NULL;
      n->opaque = NULL;
      mm_log(n, MNET_LOG_VERBOSE, "chann close fd:%d\n", n->fd);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x6a64
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x6a18
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movl $0x3, %esi
leaq 0xc92f(%rip), %rdx      # 0x1338c
movb $0x0, %al
callq 0x6c30
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_destroy(s_mnet*, s_mchann*)
static void
_chann_destroy(mnet_t *ss, chann_t *n) {
   if (n->state >= CHANN_STATE_CLOSED) {
      if (n->next) { n->next->prev = n->prev; }
      if (n->prev) { n->prev->next = n->next; }
      else { ss->channs = n->next; }
      _rwb_destroy(&n->rwb_send);
      ss->chann_count--;
      mm_log(n, MNET_LOG_VERBOSE, "chann destroy, count %d\n", ss->chann_count);
      n->state = (chann_state_t)-1;
      mm_free(n);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jl 0x6b2a
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x6aad
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x6ace
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x58(%rax)
jmp 0x6ade
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
callq 0x88c0
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x3, %esi
leaq 0xc890(%rip), %rdx      # 0x1339f
movb $0x0, %al
callq 0x6c30
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
callq 0x8990
addq $0x10, %rsp
popq %rbp
retq
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: kev_get_flags(epoll_event*)
static inline int
_kev_get_flags(mevent_t *kev) {
   if (kev) {
#if (MNET_OS_MACOX || MNET_OS_FreeBSD)
      return kev->flags;
#else
      return kev->events;
#endif
   }
   return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6b4a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b51
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: kev_get_events(epoll_event*)
static inline int
_kev_get_events(mevent_t *kev) {
   if (kev) {
#if (MNET_OS_MACOX || MNET_OS_FreeBSD)
      return kev->filter;
#else
      return kev->events;
#endif
   }
   return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6b7a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b81
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: evt_fini()
static void
_evt_fini(void) {
   mnet_t *ss = _gmnet();
   if (ss->kq) {
      close(ss->kq);
      mm_free(ss->chg.array);
      mm_free(ss->evt.array);
      memset(&ss->chg, 0, sizeof(ss->chg));
      memset(&ss->evt, 0, sizeof(ss->evt));
      mm_log(NULL, MNET_LOG_VERBOSE, "evt fini queue %d\n", ss->kq);
      ss->kq = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x67b0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x6c22
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x3570
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x8990
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x8990
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x31c0
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x31c0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
xorl %eax, %eax
movl %eax, %edi
movl $0x3, %esi
leaq 0xc7a8(%rip), %rdx      # 0x133b8
movb $0x0, %al
callq 0x6c30
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mm_log(s_mchann*, int, char const*, ...)
static inline void mm_log(chann_t *n, int level, const char *fmt, ...) {
   if (level <= _log_level) {
      char buf[192];
      va_list argptr;
      va_start(argptr, fmt);
      vsprintf(buf, fmt, argptr);
      va_end(argptr);
      mnet_log(n, level, buf);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
testb %al, %al
je 0x6c77
movaps %xmm0, -0x180(%rbp)
movaps %xmm1, -0x170(%rbp)
movaps %xmm2, -0x160(%rbp)
movaps %xmm3, -0x150(%rbp)
movaps %xmm4, -0x140(%rbp)
movaps %xmm5, -0x130(%rbp)
movaps %xmm6, -0x120(%rbp)
movaps %xmm7, -0x110(%rbp)
movq %r9, -0x188(%rbp)
movq %r8, -0x190(%rbp)
movq %rcx, -0x198(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x11650(%rip), %eax     # 0x182f0
jg 0x6cfe
leaq -0x100(%rbp), %rax
leaq -0x1b0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x18, (%rax)
leaq -0xe0(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x3180
leaq -0x100(%rbp), %rax
movq 0x1160a(%rip), %rax     # 0x182f8
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0xe0(%rbp), %rdx
callq *%rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_setlog
void
mnet_setlog(int level, mnet_log_cb cb) {
   if (level >= 0) {
      _log_level = level;
   }
   if (cb) {
      mnet_log = cb;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x6d7a
movl -0x4(%rbp), %eax
movl %eax, 0x11576(%rip)     # 0x182f0
cmpq $0x0, -0x10(%rbp)
je 0x6d8c
movq -0x10(%rbp), %rax
movq %rax, 0x1156c(%rip)     # 0x182f8
popq %rbp
retq
nop
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_report
int
mnet_report(int level) {
   mnet_t *ss = _gmnet();
   if (ss->init) {
      if (level > 0) {
         mm_log(NULL, 0, "-------- channs(%d) --------\n", ss->chann_count);
         chann_t *n = ss->channs;
         while (n) {
            mm_log(NULL, 0, "chann:%p fd:%d state:%d %s:%d\n", n, n->fd, n->state, _chann_addr(n), _chann_port(n));
            n = n->next;
         }
         mm_log(NULL, 0, "------------------------\n");
      }
      return ss->chann_count;
   }
   return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
callq 0x67b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6e74
cmpl $0x0, -0x8(%rbp)
jle 0x6e68
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
leaq 0xc3f8(%rip), %rdx      # 0x131c7
movb $0x0, %al
callq 0x6c30
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6e54
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6e90
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6ec0
movq -0x30(%rbp), %rcx
movl -0x28(%rbp), %r8d
movl -0x24(%rbp), %r9d
movq -0x20(%rbp), %r10
xorl %edx, %edx
movl %edx, %edi
xorl %esi, %esi
leaq 0xc3ae(%rip), %rdx      # 0x131e5
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x6c30
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x6de2
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
leaq 0xc3a3(%rip), %rdx      # 0x13204
movb $0x0, %al
callq 0x6c30
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6e7b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_parse_ipport
int
mnet_parse_ipport(const char *ipport, chann_addr_t *addr) {
   if (ipport && addr) {
      const char *p = strchr(ipport, ':');
      if (p >= ipport) {
         if ((p - ipport) >= 7) {
            addr->ip[p - ipport] = 0;
            strncpy(addr->ip, ipport, p - ipport);
         } else {
            strncpy(addr->ip, "0.0.0.0", 8);
         }
         addr->port = atoi(p+1);
         return 1;
      }
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7196
cmpq $0x0, -0x18(%rbp)
je 0x7196
movq -0x10(%rbp), %rdi
movl $0x3a, %esi
callq 0x3120
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jb 0x7194
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
cmpq $0x7, %rax
jl 0x7160
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
subq %rdx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
callq 0x31b0
jmp 0x7175
movq -0x18(%rbp), %rdi
leaq 0xc0ce(%rip), %rsi      # 0x13239
movl $0x8, %edx
callq 0x31b0
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x34a0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x719d
jmp 0x7196
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_create(s_mnet*, chann_type_t, chann_state_t)
static chann_t*
_chann_create(mnet_t *ss, chann_type_t type, chann_state_t state) {
   chann_t *n = (chann_t*)mm_malloc(sizeof(*n));
   n->state = state;
   n->type = type;
   n->next = ss->channs;
   if (ss->channs) {
      ss->channs->prev = n;
   }
   ss->channs = n;
   ss->chann_count++;
   mm_log(n, MNET_LOG_VERBOSE, "chann create, type:%d, count %d\n", type, ss->chann_count);
   return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x90, %edi
callq 0x8880
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x723f
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl 0x4(%rax), %r8d
movl $0x3, %esi
leaq 0xc163(%rip), %rdx      # 0x133d6
movb $0x0, %al
callq 0x6c30
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_close
void mnet_chann_close(chann_t *n) {
   if (n) {
      mnet_t *ss = _gmnet();
      _chann_disconnect_socket(ss, n);
      _chann_close_socket(ss, n);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x72c6
callq 0x67b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x6940
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x69d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_connect
int
mnet_chann_connect(chann_t *n, const char *host, int port) {
   if (n && host && port>0) {
      int fd = _chann_open_socket(n, host, port, 0);
      if (fd > 0) {
         n->fd = fd;
         if (n->type == CHANN_TYPE_STREAM) {
            int r = connect(fd, (struct sockaddr*)&n->addr, n->addr_len);
            if (r >= 0 || errno==EINPROGRESS || errno==EWOULDBLOCK) {
               n->state = CHANN_STATE_CONNECTING;
               _evt_add(n, MNET_SET_WRITE);
               mm_log(n, MNET_LOG_VERBOSE, "chann fd:%d type:%d connecting...\n", fd, n->type);
               return 1;
            }
         } else {
            n->state = CHANN_STATE_CONNECTED;
            _evt_add(n, MNET_SET_READ);
            mm_log(n, MNET_LOG_VERBOSE, "chann fd:%d type:%d connected\n", fd, n->type);
            return 1;
         }
      }
      mm_log(n, MNET_LOG_ERR, "chann %p fail to connect %d:%s\n", n, errno, strerror(errno));
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x746d
cmpq $0x0, -0x18(%rbp)
je 0x746d
cmpl $0x0, -0x1c(%rbp)
jle 0x746d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
xorl %ecx, %ecx
callq 0x7480
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jle 0x7425
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x14(%rax)
jne 0x73e2
movl -0x20(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edx
callq 0x32a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x7399
callq 0x3040
cmpl $0x73, (%rax)
je 0x7399
callq 0x3040
cmpl $0xb, (%rax)
jne 0x73e0
movq -0x10(%rbp), %rax
movl $0x2, 0x10(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x76d0
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x14(%rax), %r8d
movl $0x3, %esi
leaq 0xbe74(%rip), %rdx      # 0x13241
movb $0x0, %al
callq 0x6c30
movl $0x1, -0x4(%rbp)
jmp 0x7474
jmp 0x7423
movq -0x10(%rbp), %rax
movl $0x3, 0x10(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x76d0
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x14(%rax), %r8d
movl $0x3, %esi
leaq 0xbe51(%rip), %rdx      # 0x13264
movb $0x0, %al
callq 0x6c30
movl $0x1, -0x4(%rbp)
jmp 0x7474
jmp 0x7425
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x3040
movl (%rax), %eax
movl %eax, -0x28(%rbp)
callq 0x3040
movl (%rax), %edi
callq 0x3110
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rcx
movl -0x28(%rbp), %r8d
movq %rax, %r9
movl $0x1, %esi
leaq 0xbe1d(%rip), %rdx      # 0x13283
movb $0x0, %al
callq 0x6c30
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_listen
int
mnet_chann_listen(chann_t *n, const char *host, int port, int backlog) {
   if (n && port>0) {
      int fd = _chann_open_socket(n, host, port, backlog | 1);
      if (fd > 0) {
         n->fd = fd;
         n->state = CHANN_STATE_LISTENING;
         _evt_add(n, MNET_SET_READ);
         mm_log(n, MNET_LOG_VERBOSE, "chann %p, fd:%d listen\n", n, fd);
         return 1;
      }
      mm_log(n, MNET_LOG_ERR, "chann %p fail to listen\n", n);
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x793c
cmpl $0x0, -0x1c(%rbp)
jle 0x793c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
orl $0x1, %ecx
callq 0x7480
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x7921
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl $0x4, 0x10(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x76d0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl $0x3, %esi
leaq 0xb992(%rip), %rdx      # 0x132a3
movb $0x0, %al
callq 0x6c30
movl $0x1, -0x4(%rbp)
jmp 0x7943
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
leaq 0xb986(%rip), %rdx      # 0x132bb
movb $0x0, %al
callq 0x6c30
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_active_event
void
mnet_chann_active_event(chann_t *n, chann_event_t et, int active) {
   if ( n ) {
      if (et == CHANN_EVENT_SEND) {
         n->active_send_event = active;
         if (active) {
            _evt_add(n, MNET_SET_WRITE);
         } else {
            _evt_del(n, MNET_SET_WRITE);
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x79e1
cmpl $0x2, -0xc(%rbp)
jne 0x79df
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x70(%rax)
cmpl $0x0, -0x10(%rbp)
je 0x79cf
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x76d0
jmp 0x79dd
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x79f0
jmp 0x79df
jmp 0x79e1
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_recv
int
mnet_chann_recv(chann_t *n, void *buf, int len) {
   if (n && buf && len>0 && n->state>=CHANN_STATE_CONNECTED) {
      int ret = 0;
      if (n->type == CHANN_TYPE_STREAM) {
         ret = (int)recv(n->fd, buf, len, 0);
      } else {
         n->addr_len = sizeof(n->addr);
         ret = (int)recvfrom(n->fd, buf, len, 0, (struct sockaddr*)&(n->addr), &(n->addr_len));
      }
      if (ret < 0) {
         if (errno == EWOULDBLOCK) {
            ret = 0;
         } else {
            mnet_t *ss = _gmnet();
            mm_log(n, MNET_LOG_ERR, "chann %p fd:%d, recv errno %d:%s\n",
                   n, n->fd, errno, strerror(errno));
            _chann_disconnect_socket(ss, n);
            _chann_msg(n, CHANN_EVENT_DISCONNECT, NULL, errno);
         }
      }
      n->bytes_recv += ret;
      return ret;
   }
   return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7cd6
cmpq $0x0, -0x18(%rbp)
je 0x7cd6
cmpl $0x0, -0x1c(%rbp)
jle 0x7cd6
movq -0x10(%rbp), %rax
cmpl $0x3, 0x10(%rax)
jl 0x7cd6
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x14(%rax)
jne 0x7bdc
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3100
movl %eax, -0x20(%rbp)
jmp 0x7c0f
movq -0x10(%rbp), %rax
movl $0x10, 0x30(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
movq -0x10(%rbp), %r8
addq $0x20, %r8
movq -0x10(%rbp), %r9
addq $0x30, %r9
xorl %ecx, %ecx
callq 0x3260
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x7cbe
callq 0x3040
cmpl $0xb, (%rax)
jne 0x7c2f
movl $0x0, -0x20(%rbp)
jmp 0x7cbc
callq 0x67b0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
callq 0x3040
movl (%rax), %eax
movl %eax, -0x34(%rbp)
callq 0x3040
movl (%rax), %edi
callq 0x3110
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %r8d
movl -0x34(%rbp), %r9d
movl $0x1, %esi
leaq 0xb651(%rip), %rdx      # 0x132d4
movq %rax, (%rsp)
movb $0x0, %al
callq 0x6c30
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6940
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x3040
movq -0x30(%rbp), %rdi
movl (%rax), %ecx
movl $0x5, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x7cf0
jmp 0x7cbe
movslq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x68(%rax), %rcx
movq %rcx, 0x68(%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7cdd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_msg(s_mchann*, chann_event_t, s_mchann*, int)
static void
_chann_msg(chann_t *n, chann_event_t event, chann_t *r, int err) {
   chann_msg_t e;
   e.event = event;
   e.err = err;
   e.n = n;
   e.r = r;
   e.opaque = n->opaque;
   if ( n->cb ) {
      n->cb( &e );
   } else {
      mm_log(n, MNET_LOG_ERR, "chann fd:%d no callback\n", n->fd);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x7d46
movq -0x8(%rbp), %rax
leaq -0x40(%rbp), %rdi
callq *0x18(%rax)
jmp 0x7d63
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movl $0x1, %esi
leaq 0xb777(%rip), %rdx      # 0x134d3
movb $0x0, %al
callq 0x6c30
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: rwb_cache(s_rwbuf_head*, unsigned char*, int)
static void
_rwb_cache(rwb_head_t *h, unsigned char *buf, int buf_len) {
   int buf_ptr = 0;
   while (buf_ptr < buf_len) {
      rwb_t *b = _rwb_create_tail(h);
      int len = _min_of((buf_len - buf_ptr), _rwb_available(b));
      memcpy(&b->buf[b->ptw], &buf[buf_ptr], len);
      b->ptw += len;
      buf_ptr += len;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x803d
movq -0x8(%rbp), %rdi
callq 0x8d60
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8e30
movl -0x28(%rbp), %edi
movl %eax, %esi
callq 0x8e00
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movslq -0x18(%rbp), %rax
addq %rax, %rsi
movslq -0x24(%rbp), %rdx
callq 0x3290
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0x24(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x7fca
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_send(s_mchann*, void*, int)
static int
_chann_send(chann_t *n, void *buf, int len) {
   int ret = 0;
   if (n->type == CHANN_TYPE_STREAM) {
      ret = (int)send(n->fd, buf, len, 0);
   } else {
      ret = (int)sendto(n->fd, buf, len, 0, (struct sockaddr*)&n->addr, n->addr_len);
   }
   if (ret > 0) {
      n->bytes_send += ret;
   }
   return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x14(%rax)
jne 0x80be
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
xorl %ecx, %ecx
callq 0x31a0
movl %eax, -0x18(%rbp)
jmp 0x80e6
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
movq -0x8(%rbp), %r8
addq $0x20, %r8
movq -0x8(%rbp), %rax
movl 0x30(%rax), %r9d
xorl %ecx, %ecx
callq 0x3070
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x80fc
movslq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_set_bufsize
int
mnet_chann_set_bufsize(chann_t *n, int bufsize) {
   if (n && bufsize>0) {
      n->buf_size = bufsize;
      if (n->fd > 0) {
         return _set_bufsize(n->fd, bufsize);
      }
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x815b
cmpl $0x0, -0x14(%rbp)
jle 0x815b
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x74(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x8152
movq -0x10(%rbp), %rax
movl (%rax), %edi
movl -0x14(%rbp), %esi
callq 0x8170
movl %eax, -0x4(%rbp)
jmp 0x8162
movl $0x1, -0x4(%rbp)
jmp 0x8162
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_cached
int
mnet_chann_cached(chann_t *n) {
   if (n) {
      rwb_head_t *prh = &n->rwb_send;
      int count = _rwb_count(prh);
      if (count > 0) {
         return _rwb_buffered(prh->head) + (count - 1) * MNET_BUF_SIZE;
      }
   } 
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x821f
movq -0x10(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7f90
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x821d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x8050
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
shll $0x10, %ecx
addl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x8226
jmp 0x821f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_addr
int
mnet_chann_addr(chann_t *n, chann_addr_t *addr) {
   if (n && addr) {
      strncpy(addr->ip, _chann_addr(n), 16);
      addr->port = _chann_port(n);
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x828b
cmpq $0x0, -0x18(%rbp)
je 0x828b
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6e90
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0x31b0
movq -0x10(%rbp), %rdi
callq 0x6ec0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x8292
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: rwb_destroy(s_rwbuf_head*)
static void
_rwb_destroy(rwb_head_t *h) {
   while (h->count > 0) {
      rwb_t *b = h->head;
      b->ptr = b->ptw = 0;
      _rwb_destroy_head(h);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x8901
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rdi
callq 0x8910
jmp 0x88cc
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: rwb_destroy_head(s_rwbuf_head*)
static void
_rwb_destroy_head(rwb_head_t *h) {
   if (_rwb_buffered(h->head) <= 0) {
      rwb_t *b = h->head;
      h->head = b->next;
      mm_free(b);
      h->count -= 1;
      if (h->count <= 0) {
         h->head = h->tail = 0;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x8050
cmpl $0x0, %eax
jg 0x8980
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x8990
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jg 0x897e
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
jmp 0x8980
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_fill_addr(s_mchann*, char const*, int)
static void
_chann_fill_addr(chann_t *n, const char *host, int port) {
   memset(&n->addr, 0, sizeof(n->addr));
   n->addr.sin_family = AF_INET;
   n->addr.sin_port = htons(port);
   n->addr.sin_addr.s_addr = 
      host==NULL ? htonl(INADDR_ANY) : inet_addr(host);
   n->addr_len = sizeof(n->addr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x31c0
movq -0x8(%rbp), %rax
movw $0x2, 0x20(%rax)
movl -0x14(%rbp), %eax
movzwl %ax, %edi
callq 0x3060
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x22(%rax)
cmpq $0x0, -0x10(%rbp)
jne 0x8aca
xorl %edi, %edi
callq 0x3250
movl %eax, -0x18(%rbp)
jmp 0x8ad6
movq -0x10(%rbp), %rdi
callq 0x3320
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rax
movl $0x10, 0x30(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: set_nonblocking(int)
static int
_set_nonblocking(int fd) {
#if MNET_OS_WIN
   u_long imode = 1;
   int ret = ioctlsocket(fd, FIONBIO, (u_long*)&imode);
   if (ret == NO_ERROR) return 0;
#else
   int flag = fcntl(fd, F_GETFL, 0);
   if (flag != -1) return fcntl(fd, F_SETFL, flag | O_NONBLOCK);
#endif
   return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x31e0
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
je 0x8bf2
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x31e0
movl %eax, -0x4(%rbp)
jmp 0x8bf9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: evt_check_expand(s_event*)
static int
_evt_check_expand(struct s_event *ev) {
   if (ev->count < ev->size) {
      return 1;
   } else {
      int nsize = ev->size * 2;
      ev->array = (mevent_t*)mm_realloc(ev->array, sizeof(mevent_t) * nsize);
      if (ev->array) {
         mm_log(NULL, MNET_LOG_VERBOSE, "evt expand %p to %d\n", ev, nsize);
         ev->size = nsize;
      }
      return (ev->array != NULL);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x8cb4
movl $0x1, -0x4(%rbp)
jmp 0x8d26
movq -0x10(%rbp), %rax
movl (%rax), %eax
shll %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x14(%rbp), %rax
imulq $0xc, %rax, %rsi
callq 0x8d30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x8d12
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %r8d
xorl %eax, %eax
movl %eax, %edi
movl $0x3, %esi
leaq 0xa770(%rip), %rdx      # 0x13472
movb $0x0, %al
callq 0x6c30
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: rwb_create_tail(s_rwbuf_head*)
static rwb_t*
_rwb_create_tail(rwb_head_t *h) {
   if (h->count <= 0) {
      h->head = h->tail = _rwb_new();
      h->count++;
   }
   else if (_rwb_available(h->tail) <= 0) {
      h->tail->next = _rwb_new();
      h->tail = h->tail->next;
      h->count++;
   }
   return h->tail;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jg 0x8d9c
callq 0x8e60
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x8de5
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8e30
cmpl $0x0, %eax
jg 0x8de3
callq 0x8e60
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x8de5
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)