LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testl %edx, %edx
setle %dil
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
orb %cl, %dil
jne 0x4cdb
cmpl $0x3, 0x10(%rbx)
jl 0x4cdb
cmpl $0x1, 0x14(%rbx)
jne 0x4c54
movl (%rbx), %edi
movl %edx, %edx
xorl %ecx, %ecx
callq 0x20e0
jmp 0x4c6e
leaq 0x30(%rbx), %r9
movl $0x10, 0x30(%rbx)
movl (%rbx), %edi
movl %edx, %edx
leaq 0x20(%rbx), %r8
xorl %ecx, %ecx
callq 0x2210
movq %rax, %r14
testl %r14d, %r14d
jns 0x4cd1
callq 0x2050
movq %rax, %r15
movl (%rax), %r12d
xorl %eax, %eax
cmpl $0xb, %r12d
je 0x4cd4
movl (%rbx), %r13d
movl %r12d, %edi
callq 0x20f0
movq %rax, (%rsp)
leaq 0x6669(%rip), %rdx      # 0xb308
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rcx
movl %r13d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x41bd
movq %rbx, %rdi
callq 0x4069
movl (%r15), %ecx
movq %rbx, %rdi
movl $0x5, %esi
xorl %edx, %edx
callq 0x4cea
movl %r14d, %eax
movslq %eax, %rcx
addq %rcx, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x20, %rsp
movl %esi, -0x20(%rbp)
movl %ecx, -0x1c(%rbp)
movq %rdi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq 0x8(%rdi), %rax
movq %rax, -0x8(%rbp)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x4d1d
leaq -0x20(%rbp), %rdi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
movl (%rdi), %ecx
leaq 0x67e1(%rip), %rdx      # 0xb507
movl $0x1, %esi
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
jmp 0x41bd
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, -0x30(%rbp)
testl %edx, %edx
jle 0x4f92
movl %edx, %ebx
movq %rdi, %r15
xorl %r14d, %r14d
cmpl $0x0, 0x10(%r15)
jle 0x4f1b
movq 0x8(%r15), %r12
testq %r12, %r12
je 0x4ee6
movl 0x4(%r12), %eax
cmpl $0x10000, %eax          # imm = 0x10000
jl 0x4f52
movl $0x10018, %edi          # imm = 0x10018
callq *0xb35f(%rip)           # 0x10250
movq %rax, %r12
movl $0x10018, %edx          # imm = 0x10018
movq %rax, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x18(%r12), %rax
movq %rax, 0x10(%r12)
movq 0x8(%r15), %rax
movq %r12, 0x8(%rax)
movq %r12, 0x8(%r15)
jmp 0x4f49
movl $0x10018, %edi          # imm = 0x10018
callq *0xb32a(%rip)           # 0x10250
movq %rax, %r12
movl $0x10018, %edx          # imm = 0x10018
movq %rax, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x18(%r12), %rax
movq %rax, 0x10(%r12)
movq %r12, 0x8(%r15)
movq %r12, (%r15)
incl 0x10(%r15)
movl 0x4(%r12), %eax
movl %ebx, %ecx
subl %r14d, %ecx
movl $0x10000, %edx          # imm = 0x10000
subl %eax, %edx
cmpl %edx, %ecx
cmovll %ecx, %edx
movslq %eax, %rdi
addq 0x10(%r12), %rdi
movslq %r14d, %r14
movq -0x30(%rbp), %rax
leaq (%rax,%r14), %rsi
movslq %edx, %r13
movq %r13, %rdx
callq 0x2230
addl %r13d, 0x4(%r12)
addl %r13d, %r14d
cmpl %ebx, %r14d
jl 0x4eca
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
cmpl $0x1, 0x14(%rbx)
movslq %edx, %rdx
jne 0x4fbe
xorl %ecx, %ecx
callq 0x2160
jmp 0x4fcd
leaq 0x20(%rbx), %r8
movl 0x30(%rbx), %r9d
xorl %ecx, %ecx
callq 0x2070
testl %eax, %eax
jle 0x4fdd
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
testq %rdi, %rdi
sete %cl
testl %esi, %esi
setle %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x500a
movl %esi, 0x74(%rdi)
movl (%rdi), %edi
testl %edi, %edi
jle 0x5005
popq %rbp
jmp 0x500c
movl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
xorl %eax, %eax
testq %rdi, %rdi
je 0x5091
movl 0x48(%rdi), %ecx
testl %ecx, %ecx
jle 0x5091
pushq %rbp
movq %rsp, %rbp
movq 0x38(%rdi), %rdx
testq %rdx, %rdx
je 0x5084
movl 0x4(%rdx), %eax
subl (%rdx), %eax
jmp 0x5086
xorl %eax, %eax
shll $0x10, %ecx
addl %ecx, %eax
addl $0xffff0000, %eax       # imm = 0xFFFF0000
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x5549
movl 0x4(%rdi), %eax
cmpl (%rdi), %eax
jg 0x556a
movq 0x8(%rdi), %rax
movq %rax, (%rbx)
callq *0xad0a(%rip)           # 0x10260
movl 0x10(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
cmpl $0x1, %eax
jg 0x556a
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rbx
pushq %rax
movl 0xaca6(%rip), %ebx      # 0x102b0
movl $0x1, %eax
cmpl %ebx, 0xac9f(%rip)      # 0x102b4
jl 0x5672
movq 0xac9a(%rip), %rdi      # 0x102b8
leal (,%rbx,8), %eax
leal (%rax,%rax,2), %esi
callq *0xac2a(%rip)           # 0x10258
movq %rax, 0xac83(%rip)      # 0x102b8
testq %rax, %rax
je 0x5670
addl %ebx, %ebx
leaq 0x5e63(%rip), %rdx      # 0xb4a6
leaq 0xac66(%rip), %rcx      # 0x102b0
xorl %edi, %edi
movl $0x3, %esi
movl %ebx, %r8d
xorl %eax, %eax
callq 0x41bd
movl %ebx, 0xac4f(%rip)      # 0x102b0
xorl %eax, %eax
cmpq $0x0, 0xac4d(%rip)      # 0x102b8
setne %al
jmp 0x5672
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_rc4.c
// Function: rc4_hash_key
uint64_t
rc4_hash_key(const char * str, int sz) {
   uint32_t djb_hash = 5381L;
   uint32_t js_hash = 1315423911L;

   int i;
   for (i=0;i<sz;i++) {
      uint8_t c = (uint8_t)str[i];
      djb_hash += (djb_hash << 5) + c;
      js_hash ^= ((js_hash << 5) + c + (js_hash >> 2));
   }

   return (uint64_t) djb_hash << 32 | js_hash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
jle 0x56cd
movl %esi, %edx
movl $0x4e67c6a7, %eax       # imm = 0x4E67C6A7
movl $0x1505, %ecx           # imm = 0x1505
xorl %esi, %esi
movl %eax, %r8d
movzbl (%rdi,%rsi), %r9d
movl %ecx, %r10d
shll $0x5, %r10d
addl %r10d, %ecx
addl %r9d, %ecx
movl %eax, %r10d
shll $0x5, %r10d
shrl $0x2, %eax
addl %r10d, %eax
addl %r9d, %eax
xorl %r8d, %eax
incq %rsi
cmpq %rsi, %rdx
jne 0x5692
shlq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
jmp 0x56d7
movabsq $0x15054e67c6a7, %rax   # imm = 0x15054E67C6A7
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_rc4.c
// Function: rc4_encrypt
int
rc4_encrypt(const char *in, int in_sz, char *out, int out_sz, uint64_t key, time_t ti) {
   uint64_t h = rc4_hash_key(in, in_sz);
   uint32_t tmp;
   struct rc4_sbox rs;
   if (in_sz > out_sz - RC4_CRYPTO_OCCUPY) {
      return RC4_ERR_INSUFFICIENT_OUT_BUFFER_SIZE;
   }
   key = hmac(key, ti);
   rc4_init(&rs, key);
   key ^= h;
   tmp = htonl(ti);
   memcpy(out, &tmp, 4);
   tmp = htonl((uint32_t)key ^ (uint32_t)(key >> 32));
   memcpy(out+4, &tmp, 4);
   rc4_encode(&rs, (const uint8_t *)in, (uint8_t *)out+8, in_sz);

   return in_sz + RC4_CRYPTO_OCCUPY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, %r12
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
testl %esi, %esi
jle 0x5746
movl %ebx, %esi
movl $0x4e67c6a7, %edx       # imm = 0x4E67C6A7
movl $0x1505, %eax           # imm = 0x1505
xorl %edi, %edi
movl %edx, %r9d
movzbl (%r15,%rdi), %r10d
movl %eax, %r11d
shll $0x5, %r11d
addl %r11d, %eax
addl %r10d, %eax
movl %edx, %r11d
shll $0x5, %r11d
shrl $0x2, %edx
addl %r11d, %edx
addl %r10d, %edx
xorl %r9d, %edx
incq %rdi
cmpq %rdi, %rsi
jne 0x570a
shlq $0x20, %rax
movl %edx, %r13d
orq %rax, %r13
jmp 0x5750
movabsq $0x15054e67c6a7, %r13   # imm = 0x15054E67C6A7
addl $-0x8, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl %ebx, %ecx
jl 0x57e3
movq %r8, %rdi
movq %r12, %rsi
callq 0x57f5
movq $0x0, -0x138(%rbp)
xorl %ecx, %ecx
movq %rax, %rdx
movb %dl, -0x30(%rbp,%rcx)
shrq $0x8, %rdx
incq %rcx
cmpq $0x8, %rcx
jne 0x577b
xorl %ecx, %ecx
movl %ecx, %edx
andl $0x7, %edx
movzbl -0x30(%rbp,%rdx), %edx
addl %ecx, %edx
movb %dl, -0x130(%rbp,%rcx)
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x578e
xorq %r13, %rax
bswapl %r12d
movl %r12d, (%r14)
movq %rax, %rcx
shrq $0x20, %rcx
xorl %eax, %ecx
bswapl %ecx
movl %ecx, 0x4(%r14)
addq $0x8, %r14
movslq %ebx, %rcx
leaq -0x138(%rbp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x590a
addl $0x8, %ebx
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_rc4.c
// Function: rc4_decrypt
int
rc4_decrypt(const char *in, int in_sz, char *out, int out_sz, uint64_t key, time_t ti) {
   uint32_t pt, check;
   uint64_t h;
   struct rc4_sbox rs;
   in_sz -= RC4_CRYPTO_OCCUPY;
   if (in_sz < 0 || out_sz < in_sz) {
      return RC4_ERR_INSUFFICIENT_IN_BUFFER_SIZE;
   }

   memcpy(&pt, in, 4);
   memcpy(&check, in+4, 4);
   pt = ntohl(pt);
   check = ntohl(check);
   if (abs((int)(pt - ti)) > DEF_TIME_DIFF) {
      return RC4_ERR_OVER_TIME_SECOND;
   }
   key = hmac(key, pt);
   rc4_init(&rs, key);

   rc4_encode(&rs, (const uint8_t *)in + RC4_CRYPTO_OCCUPY, (uint8_t *)out, in_sz);
   h = rc4_hash_key(out, in_sz);
   key ^= h;

   if (check != ((uint32_t)key ^ (uint32_t)(key >> 32))) {
      return RC4_ERR_KEY_INVALID;
   }
   return in_sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %esi, %r15d
leal -0x8(%r15), %r14d
cmpl $0x8, %esi
setl %al
cmpl %ecx, %r14d
setg %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x5ae5
movq %rdx, %rbx
movq %rdi, %r12
movl (%rdi), %ecx
bswapl %ecx
movl %ecx, %eax
subl %r9d, %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
cmpl $0x708, %edx            # imm = 0x708
ja 0x5ae5
movl 0x4(%r12), %eax
bswapl %eax
movl %eax, -0x2c(%rbp)
movl %ecx, %esi
movq %r8, %rdi
callq 0x57f5
movq %rax, %rcx
movq $0x0, -0x148(%rbp)
xorl %eax, %eax
movq %rcx, -0x38(%rbp)
movb %cl, -0x40(%rbp,%rax)
shrq $0x8, %rcx
incq %rax
cmpq $0x8, %rax
jne 0x5a2d
xorl %eax, %eax
movl %eax, %ecx
andl $0x7, %ecx
movzbl -0x40(%rbp,%rcx), %ecx
addl %eax, %ecx
movb %cl, -0x140(%rbp,%rax)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x5a40
addq $0x8, %r12
movl %r14d, %r13d
leaq -0x148(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x590a
cmpl $0x9, %r15d
jl 0x5ac2
movl $0x4e67c6a7, %ecx       # imm = 0x4E67C6A7
movl $0x1505, %eax           # imm = 0x1505
xorl %edx, %edx
movl %ecx, %esi
movzbl (%rbx,%rdx), %edi
movl %eax, %r8d
shll $0x5, %r8d
addl %r8d, %eax
addl %edi, %eax
movl %ecx, %r8d
shll $0x5, %r8d
shrl $0x2, %ecx
addl %r8d, %ecx
addl %edi, %ecx
xorl %esi, %ecx
incq %rdx
cmpq %rdx, %r13
jne 0x5a8c
shlq $0x20, %rax
movl %ecx, %ecx
orq %rax, %rcx
jmp 0x5acc
movabsq $0x15054e67c6a7, %rcx   # imm = 0x15054E67C6A7
xorq -0x38(%rbp), %rcx
movq %rcx, %rax
shrq $0x20, %rax
xorl %ecx, %eax
cmpl %eax, -0x2c(%rbp)
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
cmovel %r14d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_prng.c
// Function: prng_next
uint64_t
prng_next(prng_t *rng) {
   if ( rng ) {
      const uint64_t s0 = rng->seed[0];
      uint64_t s1 = rng->seed[1];
      const uint64_t result = s0 + s1;

      s1 ^= s0;
      rng->seed[0] = _rotl(s0, 55) ^ s1 ^ (s1 << 14); // a, b
      rng->seed[1] = _rotl(s1, 36); // c

      return result;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x5b92
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
leaq (%rdx,%rcx), %rax
xorq %rcx, %rdx
rolq $0x37, %rcx
movq %rdx, %rsi
shlq $0xe, %rsi
xorq %rcx, %rsi
xorq %rdx, %rsi
movq %rsi, (%rdi)
rolq $0x24, %rdx
movq %rdx, 0x8(%rdi)
jmp 0x5b94
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_xor64.c
// Function: xor64_checksum_gen
int
xor64_checksum_gen(uint8_t *buf, int len, uint8_t *checksum) {
   if (buf && checksum && len>=16) {
      uint64_t ret = _64bit_xor(buf, len);
      memcpy(checksum, &ret, sizeof(ret));
      return 1;
   }
   return 0;
}

// Assembly:
xorl %eax, %eax
cmpl $0x10, %esi
jl 0x5c0c
movq %rdi, %rcx
testq %rdi, %rdi
je 0x5c0c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x5c02
movl %esi, %eax
shrl $0x3, %eax
xorl %edx, %edx
xorl %r15d, %r15d
xorq (%rcx,%rdx,8), %r15
incq %rdx
cmpq %rdx, %rax
jne 0x5bc3
movl %esi, %eax
andl $0x7, %eax
je 0x5bfa
leaq -0x20(%rbp), %r14
movq $0x0, (%r14)
andl $0x7ffffff8, %esi       # imm = 0x7FFFFFF8
addq %rsi, %rcx
movl %eax, %edx
movq %r14, %rdi
movq %rcx, %rsi
callq 0x2230
xorq (%r14), %r15
movq %r15, (%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_xor64.c
// Function: xor64_checksum_check
int
xor64_checksum_check(uint8_t *buf, int len, uint8_t *checksum) {
   if (buf && checksum && len>=16) {
      uint64_t ret = _64bit_xor(buf, len);
      return (0 == memcmp((void*)&ret, (void*)checksum, sizeof(ret)));
   }
   return 0;
}

// Assembly:
xorl %eax, %eax
cmpl $0x10, %esi
jl 0x5c85
movq %rdi, %rcx
testq %rdi, %rdi
je 0x5c85
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x5c7b
movl %esi, %eax
shrl $0x3, %eax
xorl %edx, %edx
xorl %r15d, %r15d
xorq (%rcx,%rdx,8), %r15
incq %rdx
cmpq %rdx, %rax
jne 0x5c38
movl %esi, %eax
andl $0x7, %eax
je 0x5c6f
leaq -0x20(%rbp), %r14
movq $0x0, (%r14)
andl $0x7ffffff8, %esi       # imm = 0x7FFFFFF8
addq %rsi, %rcx
movl %eax, %edx
movq %r14, %rdi
movq %rcx, %rsi
callq 0x2230
xorq (%r14), %r15
movq %r15, -0x20(%rbp)
xorl %eax, %eax
cmpq (%rbx), %r15
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_mem.c
// Function: mm_malloc_ex
void* mm_malloc_ex(unsigned long sz, const char *fname, int line) {
   memhead_t *mh = &g_mh;
   mem_t *m = (mem_t*)malloc(sz + sizeof(mem_t));
   if ( m ) {
      memset(m, 0, sizeof(*m) + sz);
      m->fname = fname;
      m->line = (unsigned short)line;
      m->size = sz + sizeof(*m);
      m->magic = _MAGIC_MARK;

      _lock(mh->lock);
      if ( mh->head ) {
         m->next = mh->head;
         mh->head->prev = m;
      }
      mh->head = m;
      mh->count++;
      mh->size += m->size;
      _unlock(mh->lock);
      return _MEM_TO_PTR(m);
   }
   assert(0);
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
addq $0x28, %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x21c0
testq %rax, %rax
je 0x5d5e
movq %rax, %rcx
movq %r15, 0x10(%rax)
movw %bx, 0x20(%rax)
movq %r14, 0x18(%rax)
movw $0xf00d, 0x22(%rax)     # imm = 0xF00D
movl $0x1, %edx
xorl %eax, %eax
lock
cmpxchgl %edx, 0xa5c8(%rip)      # 0x102d8
jne 0x5d06
movq 0xa5cf(%rip), %rax      # 0x102e8
testq %rax, %rax
je 0x5d25
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
movq %rcx, 0xa5bc(%rip)      # 0x102e8
incl 0xa5aa(%rip)            # 0x102dc
movq 0x18(%rcx), %rax
addq %rax, 0xa5a3(%rip)      # 0x102e0
xorl %edx, %edx
movl $0x1, %eax
lock
cmpxchgl %edx, 0xa58c(%rip)      # 0x102d8
addq $0x28, %rcx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x537b(%rip), %rdi      # 0xb0e0
leaq 0x5aa4(%rip), %rsi      # 0xb810
leaq 0x5ac3(%rip), %rcx      # 0xb836
movl $0x41, %edx
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_mem.c
// Function: mm_has
int mm_has(void *p) {
   mem_t *m = _PTR_TO_MEM(p);
   mem_t *h = g_mh.head;
   while ( h ) {
      if (h == m) {
         return 1;
      }
      h = h->next;
   }
   _log("[mem] invalid %p, %d, %s\n", m, m->line, m->fname);
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0x28(%rdi), %rsi
movq 0xa55a(%rip), %rax      # 0x102e8
testq %rax, %rax
je 0x5d9e
cmpq %rsi, %rax
je 0x5db8
movq 0x8(%rax), %rax
jmp 0x5d8e
movzwl -0x8(%rdi), %edx
movq -0x18(%rdi), %rcx
leaq 0x5abe(%rip), %rdi      # 0xb86b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2060
jmp 0x5dbd
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_mem.c
// Function: mm_free_ex
unsigned long mm_free_ex(void *p, const char *fname, int line) {
   memhead_t *mh = &g_mh;
   _lock(mh->lock); 
   if (p && mh->count>0) {
      unsigned long sz = 0;
      mem_t *m = _PTR_TO_MEM(p);
        
      if (m->magic != _MAGIC_MARK) {
         _log("[mem] (%s:%d), %lu\n", m->fname, m->line, m->size);
         assert(0);
      }

      if (mh->head == m) mh->head = m->next;
      if (m->prev) m->prev->next = m->next;
      if (m->next) m->next->prev = m->prev;
      mh->count--;
      mh->size -= m->size;
      sz = m->size - sizeof(*m);
      free(m);
      _unlock(mh->lock);
      return sz;
   }
   assert(0);
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, %ecx
xorl %eax, %eax
lock
cmpxchgl %ecx, 0xa4fd(%rip)      # 0x102d8
jne 0x5dd1
testq %rdi, %rdi
je 0x5e61
movl 0xa4f4(%rip), %ecx      # 0x102dc
testl %ecx, %ecx
je 0x5e61
cmpw $0xf00d, -0x6(%rdi)     # imm = 0xF00D
jne 0x5e80
leaq -0x28(%rdi), %rax
cmpq %rax, 0xa4e5(%rip)      # 0x102e8
jne 0x5e10
movq -0x20(%rdi), %rdx
movq %rdx, 0xa4d8(%rip)      # 0x102e8
movq -0x28(%rdi), %rdx
movq -0x20(%rdi), %rsi
testq %rdx, %rdx
je 0x5e21
movq %rsi, 0x8(%rdx)
testq %rsi, %rsi
je 0x5e29
movq %rdx, (%rsi)
decl %ecx
movl %ecx, 0xa4ab(%rip)      # 0x102dc
movq -0x10(%rdi), %rbx
subq %rbx, 0xa4a4(%rip)      # 0x102e0
addq $-0x28, %rbx
movq %rax, %rdi
callq 0x2320
xorl %ecx, %ecx
movl $0x1, %eax
lock
cmpxchgl %ecx, 0xa481(%rip)      # 0x102d8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5278(%rip), %rdi      # 0xb0e0
leaq 0x59a1(%rip), %rsi      # 0xb810
leaq 0x5a23(%rip), %rcx      # 0xb899
movl $0x68, %edx
callq 0x21b0
movzwl -0x8(%rdi), %edx
movq -0x18(%rdi), %rsi
movq -0x10(%rdi), %rcx
leaq 0x59f2(%rip), %rdi      # 0xb885
xorl %eax, %eax
callq 0x2060
leaq 0x523f(%rip), %rdi      # 0xb0e0
leaq 0x5968(%rip), %rsi      # 0xb810
leaq 0x59ea(%rip), %rcx      # 0xb899
movl $0x5b, %edx
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_mem.c
// Function: mm_realloc_ex
void* mm_realloc_ex(void *p, unsigned long sz, const char *fname, int line) {
   memhead_t *mh = &g_mh;
   if ( p ) {
      mem_t *m = _PTR_TO_MEM(p);
      mem_t *nm = (mem_t*)realloc(m, sz + sizeof(*m));
      if (nm == NULL) { return NULL; }

      _lock(mh->lock);
      if (mh->head == m) { mh->head = nm; }
      mh->size = mh->size - nm->size + sz + sizeof(*nm);

      if (nm->prev) nm->prev->next = nm;
      if (nm->next) nm->next->prev = nm;

      nm->fname = fname;
      nm->line = (unsigned short)line;
      nm->size = sz + sizeof(*nm);
      nm->magic = _MAGIC_MARK;
      _unlock(mh->lock);
      return _MEM_TO_PTR(nm);
   }
   return mm_malloc_ex(sz, fname, line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
testq %rdi, %rdi
je 0x5f6c
movq %rdi, %r12
addq $-0x28, %r12
addq $0x28, %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x23f0
testq %rax, %rax
je 0x5f81
movq %rax, %rcx
movl $0x1, %edx
xorl %eax, %eax
lock
cmpxchgl %edx, 0xa3d2(%rip)      # 0x102d8
jne 0x5efc
cmpq %r12, 0xa3d9(%rip)      # 0x102e8
jne 0x5f18
movq %rcx, 0xa3d0(%rip)      # 0x102e8
movq 0xa3c1(%rip), %rax      # 0x102e0
addq %r14, %rax
subq 0x18(%rcx), %rax
movq %rax, 0xa3b3(%rip)      # 0x102e0
movq (%rcx), %rax
testq %rax, %rax
je 0x5f39
movq %rcx, 0x8(%rax)
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x5f45
movq %rcx, (%rax)
movq %r15, 0x10(%rcx)
movw %bx, 0x20(%rcx)
movq %r14, 0x18(%rcx)
movw $0xf00d, 0x22(%rcx)     # imm = 0xF00D
xorl %edx, %edx
movl $0x1, %eax
lock
cmpxchgl %edx, 0xa372(%rip)      # 0x102d8
addq $0x28, %rcx
jmp 0x5f83
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5cc4
xorl %ecx, %ecx
movq %rcx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_fnode_keep
void lst_fnode_keep(lst_t *lst, int count) {
   if (lst && count>=0) {
      while (lst->free_count > count) {
         lst_node_t *n = lst->free;
         lst->free = n->next;
         lst->free_count--;
         mm_free(n);
      }
   }
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
sets %cl
orb %al, %cl
jne 0x61fa
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl %esi, %eax
jle 0x61f0
leaq 0x5786(%rip), %r15      # 0xb94f
movq 0x18(%r14), %rdi
movq 0x10(%rdi), %rcx
movq %rcx, 0x18(%r14)
decl %eax
movl %eax, 0x4(%r14)
movq %r15, %rsi
movl $0x64, %edx
callq 0x5dc6
movl 0x4(%r14), %eax
cmpl %ebx, %eax
jg 0x61c9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_destroy
void lst_destroy(lst_t *lst) {
   if (lst) {
      lst_node_t *f = lst->first;
      while ( f ) {
         lst_node_t *n = f->next;
         mm_free(f);
         f = n;
      }
      lst_fnode_keep(lst, 0);
      mm_free(lst);
   }
}

// Assembly:
testq %rdi, %rdi
je 0x625e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x6236
leaq 0x5732(%rip), %r14      # 0xb94f
movq 0x10(%rdi), %r15
movq %r14, %rsi
movl $0x6e, %edx
callq 0x5dc6
movq %r15, %rdi
testq %r15, %r15
jne 0x621d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x619d
leaq 0x5708(%rip), %rsi      # 0xb94f
movq %rbx, %rdi
movl $0x72, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5dc6
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_pushf
lst_node_t* lst_pushf(lst_t *lst, void *data) {
   if ( lst ) {
      lst_node_t *n = _lst_node_new(lst, data);
      if (lst->count == 0) {
         lst->first = lst->last = n;
      }
      else {
         lst->first->prev = n;
         n->next = lst->first;
         lst->first = n;
      }
      lst->count++;
      return n;
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x62fb
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x62fe
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rdx, 0x18(%rbx)
decl %ecx
movl %ecx, 0x4(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0x6314
xorl %eax, %eax
retq
leaq 0x564a(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5cc4
movq %r14, (%rax)
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x632b
movq 0x8(%rbx), %rdx
movq %rax, 0x8(%rdx)
movq %rdx, 0x10(%rax)
jmp 0x632f
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
incl %ecx
movl %ecx, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_pushl
lst_node_t* lst_pushl(lst_t *lst, void *data) {
   if ( lst ) {
      lst_node_t *n = _lst_node_new(lst, data);
      if (lst->count == 0) {
         lst->first = lst->last = n;
      }
      else {
         lst->last->next = n;
         n->prev = lst->last;
         lst->last = n;
      }
      lst->count++;
      return n;
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x6376
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x6379
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rdx, 0x18(%rbx)
decl %ecx
movl %ecx, 0x4(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0x638f
xorl %eax, %eax
retq
leaq 0x55cf(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5cc4
movq %r14, (%rax)
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x63a9
leaq 0x10(%rbx), %rdx
movq (%rdx), %rsi
movq %rax, 0x10(%rsi)
movq %rsi, 0x8(%rax)
jmp 0x63b1
movq %rax, 0x10(%rbx)
leaq 0x8(%rbx), %rdx
movq %rax, (%rdx)
incl %ecx
movl %ecx, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_iter_init
lst_iter_t*
lst_iter_init(lst_t *lst, lst_iter_t *it, lst_direction_t from) {
   if ((lst->count>0) && it) {
      it->lst = lst;
      it->from = from;
      it->node = NULL;
      return it;
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
testq %rsi, %rsi
je 0x64ec
cmpl $0x0, (%rdi)
jle 0x64ec
movq %rdi, (%rsi)
movl %edx, 0x10(%rsi)
movq $0x0, 0x8(%rsi)
movq %rsi, %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_iter_next
lst_iter_t* lst_iter_next(lst_iter_t *it) {
   if (it && it->lst) {
      if (it->node == NULL) {
         it->node = (it->from==LST_FIRST) ? it->lst->first : it->lst->last;
      }
      else {
         it->node = (it->from==LST_FIRST) ? it->node->next : it->node->prev;
      }
      if (it->node == NULL) {
         it->lst = NULL;
         return NULL;
      }
      return it;
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x653c
movq %rdi, %rax
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x653c
pushq %rbp
movq %rsp, %rbp
xorl %edx, %edx
xorl %esi, %esi
cmpl $0x0, 0x10(%rax)
movq 0x8(%rax), %rdi
setne %dl
sete %sil
testq %rdi, %rdi
leaq (%rdi,%rsi,8), %rsi
leaq (%rcx,%rdx,8), %rcx
cmovneq %rsi, %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
testq %rcx, %rcx
jne 0x653a
movq $0x0, (%rax)
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_iter_remove
void* lst_iter_remove(lst_iter_t *it) {
   if (it && it->lst && it->node) {
      lst_t *lst = it->lst;
      lst_node_t *n = it->node;
      if (lst_count(lst) <= 1) {
         it->lst = NULL;
         it->node = NULL;
      }
      else {
         if (it->from == LST_FIRST) it->node = it->node->prev;
         else it->node = it->node->next;
      }
      return _lst_node_delete(lst, n);
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x6568
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x6568
movq 0x8(%rdi), %rdx
testq %rdx, %rdx
je 0x6568
pushq %rbp
movq %rsp, %rbp
movl (%rcx), %esi
cmpl $0x1, %esi
jg 0x656b
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
jmp 0x657f
xorl %eax, %eax
retq
cmpl $0x0, 0x10(%rdi)
je 0x6577
movq 0x10(%rdx), %rax
jmp 0x657b
movq 0x8(%rdx), %rax
movq %rax, 0x8(%rdi)
movq (%rdx), %rax
cmpq %rdx, 0x8(%rcx)
jne 0x6590
movq 0x10(%rdx), %rdi
movq %rdi, 0x8(%rcx)
movq 0x8(%rdx), %rdi
cmpq %rdx, 0x10(%rcx)
jne 0x659e
movq %rdi, 0x10(%rcx)
movq 0x10(%rdx), %r8
testq %rdi, %rdi
je 0x65ab
movq %r8, 0x10(%rdi)
testq %r8, %r8
je 0x65b4
movq %rdi, 0x8(%r8)
movq 0x18(%rcx), %rdi
movq %rdi, 0x10(%rdx)
movq %rdx, 0x18(%rcx)
incl 0x4(%rcx)
decl %esi
movl %esi, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_iter_insert_next
lst_node_t* lst_iter_insert_next(lst_t *lst, lst_iter_t *it, void *data) {
   if (lst && it && it->node) {
      lst_node_t *n = it->node;
      lst_node_t *m = _lst_node_new(lst, data);
      if (n->next) {
         n->next->prev = m;
         m->next = n->next;
      }
      else {
         lst->last = m;
      }
      n->next = m;
      m->prev = n;
      lst->count++;
      return m;
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6634
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x6637
movq %rdx, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x663b
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rdx, 0x18(%rbx)
decl %ecx
movl %ecx, 0x4(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0x6651
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0x667b
leaq 0x530d(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5cc4
movq %r14, (%rax)
movq 0x10(%r15), %rcx
movq %rbx, %rdx
movq %rax, %rsi
testq %rcx, %rcx
je 0x666d
movq %rax, 0x8(%rcx)
movq %rax, %rdx
movq %rcx, %rsi
movq %rsi, 0x10(%rdx)
movq %rax, 0x10(%r15)
movq %r15, 0x8(%rax)
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_iter_insert_prev
lst_node_t* lst_iter_insert_prev(lst_t *lst, lst_iter_t *it, void *data) {
   if (lst && it && it->node) {
      lst_node_t *n = it->node;
      lst_node_t *m = _lst_node_new(lst, data);
      if (n->prev) {
         m->prev = n->prev;
         n->prev->next = m;
      }
      else {
         lst->first = m;
      }
      n->prev = m;
      m->next = n;
      lst->count++;
      return m;
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x66d7
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x66da
movq %rdx, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x66de
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rdx, 0x18(%rbx)
decl %ecx
movl %ecx, 0x4(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0x66f4
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0x671f
leaq 0x526a(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5cc4
movq %r14, (%rax)
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x670e
movq %rcx, 0x8(%rax)
movq 0x8(%r15), %rcx
addq $0x10, %rcx
jmp 0x6712
leaq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%r15)
movq %r15, 0x10(%rax)
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_create_lst
tmr_t*
tmr_create_lst(void) {
   
   tmr_t *tmr = (tmr_t*)mm_malloc(sizeof(*tmr));
   if (tmr) {
      tmr->unit_skt = skt_create();
      tmr->unit_free = lst_create();
      tmr->tm_free = lst_create();
   }
   return tmr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x523c(%rip), %rsi      # 0xb976
movl $0x18, %edi
movl $0x2e, %edx
callq 0x5cc4
movq %rax, %rbx
testq %rax, %rax
je 0x6782
callq 0x6bf0
movq %rax, (%rbx)
leaq 0x5216(%rip), %r14      # 0xb976
movq %r14, %rdi
movl $0x31, %esi
callq 0x6174
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movl $0x32, %esi
callq 0x6174
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_destroy_lst
void
tmr_destroy_lst(tmr_t *tmr) {
   
   if (tmr) {
      
      while (skt_count(tmr->unit_skt) > 0) {
         _tmr_unit_destroy( (tmr_unit_t*)skt_popf(tmr->unit_skt) );
      }
      skt_destroy(tmr->unit_skt);

      while (lst_count(tmr->unit_free) > 0) {
         _tmr_unit_destroy( (tmr_unit_t*)lst_popf(tmr->unit_free) );
      }
      lst_destroy(tmr->unit_free);

      while (lst_count(tmr->tm_free) > 0) {
         mm_free( lst_popf(tmr->tm_free) );
      }
      lst_destroy(tmr->tm_free);

      mm_free(tmr);
   }
}

// Assembly:
testq %rdi, %rdi
je 0x6847
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
jmp 0x67af
movq (%rbx), %rdi
callq 0x6fc4
movq %rax, %rdi
callq 0x6848
movq (%rbx), %rdi
callq 0x6d2c
testl %eax, %eax
jg 0x679f
movq (%rbx), %rdi
callq 0x6ca0
jmp 0x67d6
movq 0x8(%rbx), %rdi
callq 0x63bd
movq %rax, %rdi
callq 0x6848
movq 0x8(%rbx), %rdi
callq 0x625f
testl %eax, %eax
jg 0x67c5
movq 0x8(%rbx), %rdi
callq 0x61fb
movq 0x10(%rbx), %rdi
callq 0x625f
testl %eax, %eax
jle 0x6826
leaq 0x5176(%rip), %r14      # 0xb976
movq 0x10(%rbx), %rdi
callq 0x63bd
movq %rax, %rdi
movq %r14, %rsi
movl $0x76, %edx
callq 0x5dc6
movq 0x10(%rbx), %rdi
callq 0x625f
testl %eax, %eax
jg 0x6800
movq 0x10(%rbx), %rdi
callq 0x61fb
leaq 0x5140(%rip), %rsi      # 0xb976
movq %rbx, %rdi
movl $0x7a, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x5dc6
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_unit_destroy(tmr_unit_t*)
static void
_tmr_unit_destroy(tmr_unit_t *u) {

   while (lst_count(u->tm_lst) > 0) {
      mm_free( lst_popf(u->tm_lst) );
   }

   lst_destroy(u->tm_lst);
   mm_free(u);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x625f
testl %eax, %eax
jle 0x688c
leaq 0x5110(%rip), %r14      # 0xb976
movq 0x8(%rbx), %rdi
callq 0x63bd
movq %rax, %rdi
movq %r14, %rsi
movl $0x5d, %edx
callq 0x5dc6
movq 0x8(%rbx), %rdi
callq 0x625f
testl %eax, %eax
jg 0x6866
movq 0x8(%rbx), %rdi
callq 0x61fb
leaq 0x50da(%rip), %rsi      # 0xb976
movq %rbx, %rdi
movl $0x61, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x5dc6
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_update_lst
void
tmr_update_lst(tmr_t *tmr, int64_t current_ti) {
   
   if (tmr==NULL || skt_count(tmr->unit_skt)<=0) {
      return;
   }

   // check first fire unit
   tmr_unit_t *u = (tmr_unit_t*)skt_first(tmr->unit_skt);
   if (u->fire_ti > current_ti) {
      return;
   }
   
   // check timer in list
   for (int i=0; i<skt_count(tmr->unit_skt); i++) {
      
      tmr_unit_t *u = (tmr_unit_t*)skt_first(tmr->unit_skt);
      if (u->fire_ti > current_ti) {
         break;
      }

      do {
         tmr_timer_t *tm = (tmr_timer_t*)lst_popf(u->tm_lst);

         tm->cb(tm, tm->opaque);
         
         if (tm->repeat) {
            _tmr_add_tm(tmr, tm, current_ti);
         } else {
            _tmr_tm_recycle(tmr, tm);
         }
         
      } while (lst_count(u->tm_lst) > 0);

      _tmr_unit_try_suspend(tmr, u);
   }
}

// Assembly:
testq %rdi, %rdi
je 0x697a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x6d2c
testl %eax, %eax
jle 0x696c
movq (%r14), %rdi
callq 0x6fa4
cmpq %rbx, (%rax)
jg 0x696c
movq (%r14), %rdi
callq 0x6d2c
testl %eax, %eax
jle 0x696c
xorl %r13d, %r13d
movq (%r14), %rdi
callq 0x6fa4
cmpq %rbx, (%rax)
jg 0x696c
movq %rax, %r15
movq 0x8(%r15), %rdi
callq 0x63bd
movq %rax, %r12
movq 0x18(%rax), %rsi
movq %rax, %rdi
callq *0x10(%rax)
cmpb $0x0, 0x8(%r12)
je 0x6938
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x697b
jmp 0x6944
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x633c
movq 0x8(%r15), %rdi
callq 0x625f
testl %eax, %eax
jg 0x690a
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a2a
incl %r13d
movq (%r14), %rdi
callq 0x6d2c
cmpl %eax, %r13d
jl 0x68fa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_add_tm(s_tmr*, s_tmr_timer*, long)
static tmr_timer_t*
_tmr_add_tm(tmr_t *tmr,
            tmr_timer_t *tm,
            int64_t current_ti)
{
   int64_t fire_ti = current_ti + tm->interval_ti;
   tmr_unit_t *u = (tmr_unit_t*)skt_query(tmr->unit_skt, fire_ti);
   
   if (u == NULL) {
      u = _tmr_unit_create(tmr, fire_ti);
   }

   tm->unit = u;
   tm->node = lst_pushl(u->tm_lst, tm);
   return tm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
addq (%rsi), %r14
movq (%rdi), %rdi
movq %r14, %rsi
callq 0x6d3e
movq %rax, %r12
testq %rax, %rax
jne 0x6a03
movq 0x8(%r15), %rdi
callq 0x625f
testl %eax, %eax
jle 0x69c3
movq 0x8(%r15), %rdi
callq 0x63bd
movq %rax, %r12
jmp 0x69f1
leaq 0x4fac(%rip), %r13      # 0xb976
movl $0x10, %edi
movq %r13, %rsi
movl $0x41, %edx
callq 0x5cc4
movq %rax, %r12
movq %r13, %rdi
movl $0x42, %esi
callq 0x6174
movq %rax, 0x8(%r12)
movq %r14, (%r12)
movq (%r15), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6d7a
movq %r12, 0x20(%rbx)
movq 0x8(%r12), %rdi
movq %rbx, %rsi
callq 0x633c
movq %rax, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_add
tmr_timer_t*
tmr_add(tmr_t *tmr,
        int64_t current_ti,
        int64_t interval_ti,
        int repeat,
        void *opaque,
        tmr_callback cb)
{
   if (tmr && cb) {
      
      tmr_timer_t *tm = _tmr_tm_create(tmr);
      if ( tm ) {
         tm->interval_ti = interval_ti;
         tm->repeat = repeat;
         tm->cb = cb;
         tm->opaque = opaque;
         return _tmr_add_tm(tmr, tm, current_ti);
      }
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
testq %rdi, %rdi
sete %al
testq %r9, %r9
sete %cl
orb %al, %cl
jne 0x6af4
movq %r9, %r15
movq %rdx, %rbx
movq %rdi, %r12
movq %r8, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq 0x10(%rdi), %rdi
callq 0x625f
testl %eax, %eax
jle 0x6ab2
movq 0x10(%r12), %rdi
callq 0x63bd
jmp 0x6ac8
leaq 0x4ebd(%rip), %rsi      # 0xb976
movl $0x30, %edi
movl $0x86, %edx
callq 0x5cc4
movq %rax, %r14
testq %rax, %rax
je 0x6af4
movq %rbx, (%r14)
movb %r13b, 0x8(%r14)
movq %r15, 0x10(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x18(%r14)
movq %r12, %rdi
movq %r14, %rsi
movq -0x38(%rbp), %rdx
callq 0x697b
jmp 0x6af7
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_fire
void
tmr_fire(tmr_t *tmr,
         tmr_timer_t *tm,
         int64_t current_ti,
         int run_callback)
{
   if (tmr && tm && tm->unit) {

      _tmr_tm_suspend(tmr, tm);
      _tmr_unit_try_suspend(tmr, tm->unit);
      
      if (run_callback) {
         tm->cb(tm, tm->opaque);
      }

      if ( !tm->repeat ) {
         _tmr_tm_recycle(tmr, tm);
         return;
      }

      _tmr_add_tm(tmr, tm, current_ti);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r12d
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6b7d
movq %rsi, %rbx
movq 0x20(%rsi), %rax
testq %rax, %rax
je 0x6b7d
movq %rdx, %r14
movq %rdi, %r15
movq 0x28(%rbx), %rsi
movq 0x8(%rax), %rdi
callq 0x646c
movq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x6a2a
testl %r12d, %r12d
je 0x6b61
movq 0x18(%rbx), %rsi
movq %rbx, %rdi
callq *0x10(%rbx)
cmpb $0x0, 0x8(%rbx)
je 0x6b86
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x697b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x633c
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_timer.c
// Function: tmr_invalidate
void
tmr_invalidate(tmr_t *tmr, tmr_timer_t *tm) {
   
   if (tmr && tm && tm->unit) {
      _tmr_tm_suspend(tmr, tm);
      _tmr_tm_recycle(tmr, tm);
      _tmr_unit_try_suspend(tmr, tm->unit);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6be9
movq %rsi, %r14
movq 0x20(%rsi), %rax
testq %rax, %rax
je 0x6be9
movq %rdi, %rbx
movq 0x28(%r14), %rsi
movq 0x8(%rax), %rdi
callq 0x646c
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x633c
movq 0x20(%r14), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x6a2a
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_create
skt_t*
skt_create(void) {
   skt_t *lst = (skt_t*)mm_malloc(sizeof(*lst));
   if (lst) {
      prng_init(&lst->rng);
      
      lst->tail = _newNodeOfLevel(0);
      lst->tail->key = SKT_KEY_MASK;
      
      lst->randomBits = prng_next(&lst->rng);
      lst->randomsLeft = kBitsInRandom / 2;
      
      lst->level = 0;
      lst->count = 0;
      
      lst->header = _newNodeOfLevel(kMaxNumberOfLevels);
      
      for (int i=0; i<kMaxNumberOfLevels; i++) {
         lst->header->forward[i] = lst->tail;
      }
   }
   return lst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x4d9d(%rip), %rsi      # 0xb99e
movl $0x30, %edi
movl $0x47, %edx
callq 0x5cc4
movq %rax, %rbx
testq %rax, %rax
je 0x6c92
movq %rbx, %r14
addq $0x20, %r14
movq %r14, %rdi
callq 0x5af8
leaq 0x4d70(%rip), %r15      # 0xb99e
movl $0x18, %edi
movq %r15, %rsi
movl $0x30, %edx
callq 0x5cc4
movq %rax, 0x18(%rbx)
movq $-0x1, (%rax)
movq %r14, %rdi
callq 0x5b5d
movl %eax, 0x4(%rbx)
movl $0xf, (%rbx)
movq $0x0, 0x8(%rbx)
movl $0x98, %edi
movq %r15, %rsi
movl $0x30, %edx
callq 0x5cc4
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rax
xorl %ecx, %ecx
movq 0x10(%rbx), %rdx
movq %rax, 0x10(%rdx,%rcx,8)
incq %rcx
cmpq $0x10, %rcx
jne 0x6c80
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_destroy
void
skt_destroy(skt_t *lst) {
   if (lst) {
      skt_node_t *next, *p = lst->header->forward[0];
      while (p != lst->tail) {
         next = p->forward[0];
         mm_free(p);
         p = next;
      }
      mm_free(lst->header);
      mm_free(lst->tail);
      mm_free(lst);
   }
}

// Assembly:
testq %rdi, %rdi
je 0x6d2b
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rdi
cmpq 0x18(%rbx), %rdi
je 0x6ce9
leaq 0x4cd3(%rip), %r14      # 0xb99e
movq 0x10(%rdi), %r15
movq %r14, %rsi
movl $0x64, %edx
callq 0x5dc6
movq %r15, %rdi
cmpq 0x18(%rbx), %r15
jne 0x6ccb
movq 0x10(%rbx), %rax
leaq 0x4cae(%rip), %r14      # 0xb99e
movq %rax, %rdi
movq %r14, %rsi
movl $0x67, %edx
callq 0x5dc6
movq 0x18(%rbx), %rdi
movq %r14, %rsi
movl $0x68, %edx
callq 0x5dc6
movq %rbx, %rdi
movq %r14, %rsi
movl $0x69, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5dc6
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_query
void*
skt_query(skt_t *lst, uint64_t key) {
   int k;
   skt_node_t *p, *next;
   
   if (lst) {
      p = lst->header;
      k = lst->level;
      do {
         while (next = p->forward[k], next->key < key) {
            p = next;
         }

         if (next->key == key) {
            return next->value;
         }         
      } while (--k >= 0);
   }
   return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x6d71
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rdx
movslq 0x8(%rdi), %rcx
xorl %eax, %eax
movq %rdx, %rdi
movq %rdi, %rdx
movq 0x10(%rdi,%rcx,8), %rdi
cmpq %rsi, (%rdi)
jb 0x6d54
je 0x6d74
leaq -0x1(%rcx), %rdi
testq %rcx, %rcx
movq %rdi, %rcx
jg 0x6d51
jmp 0x6d78
xorl %eax, %eax
retq
movq 0x8(%rdi), %rax
popq %rbp
retq