LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_get_err(s_mchann*)
static int _chann_get_err(chann_t *n) {
   int error = 0;
   socklen_t errlen = sizeof(error);
   if (getsockopt(n->fd, SOL_SOCKET, SO_ERROR, (void *)&error, &errlen) == 0) {
      return error;
   }
   return -9999;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x4, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movl $0x1, %esi
movl $0x4, %edx
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0x3240
cmpl $0x0, %eax
jne 0x8f14
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8f1b
movl $0xffffd8f1, -0x4(%rbp) # imm = 0xFFFFD8F1
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_accept(s_mnet*, s_mchann*)
static chann_t*
_chann_accept(mnet_t *ss, chann_t *n) {
   struct sockaddr_in addr;
   socklen_t addr_len = sizeof(addr);
   int fd = accept(n->fd, (struct sockaddr*)&addr, &addr_len);
   if (fd > 0) {
      if (_set_nonblocking(fd) >= 0) {
         chann_t *c = _chann_create(ss, n->type, CHANN_STATE_CONNECTED);
         c->fd = fd;
         c->addr = addr;
         c->addr_len = addr_len;
         mm_log(n, MNET_LOG_VERBOSE, "chann accept %p fd %d, from %s, count %d\n",
                c, c->fd, _chann_addr(c), ss->chann_count);
         return c;
      }
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x10, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
leaq -0x28(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x30f0
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x9022
movl -0x30(%rbp), %edi
callq 0x8bb0
cmpl $0x0, %eax
jl 0x9020
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x14(%rax), %esi
movl $0x3, %edx
callq 0x71e0
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x28(%rax)
movl -0x2c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x6e90
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rcx
movl -0x3c(%rbp), %r8d
movq %rax, %r9
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl $0x3, %esi
leaq 0xa584(%rip), %rdx      # 0x13590
movl %eax, (%rsp)
movb $0x0, %al
callq 0x6c30
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x902a
jmp 0x9022
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: rwb_drain(s_rwbuf_head*, int)
static void
_rwb_drain(rwb_head_t *h, int drain_len) {
   while ((h->count>0) && (drain_len>0)) {
      rwb_t *b = h->head;
      int len = _min_of(drain_len, _rwb_buffered(b));
      drain_len -= len;
      b->ptr += len;
      _rwb_destroy_head(h);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x10(%rcx)
movb %al, -0x1d(%rbp)
jle 0x90d8
cmpl $0x0, -0xc(%rbp)
setg %al
movb %al, -0x1d(%rbp)
movb -0x1d(%rbp), %al
testb $0x1, %al
jne 0x90e1
jmp 0x9129
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8050
movl -0x24(%rbp), %edi
movl %eax, %esi
callq 0x8e00
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x8910
jmp 0x90bf
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x1505, -0x10(%rbp)    # imm = 0x1505
movl $0x4e67c6a7, -0x14(%rbp) # imm = 0x4E67C6A7
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x919d
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movl -0x10(%rbp), %eax
shll $0x5, %eax
movzbl -0x19(%rbp), %ecx
addl %ecx, %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
shll $0x5, %eax
movzbl -0x19(%rbp), %ecx
addl %ecx, %eax
movl -0x14(%rbp), %ecx
shrl $0x2, %ecx
addl %ecx, %eax
xorl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9150
movl -0x10(%rbp), %eax
shlq $0x20, %rax
movl -0x14(%rbp), %ecx
orq %rcx, %rax
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9130
movq %rax, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x8, %ecx
cmpl %ecx, %eax
jle 0x91fa
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x9285
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x92a0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x14c(%rbp), %rdi
callq 0x9490
movq -0x40(%rbp), %rax
xorq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %edi
callq 0x3250
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl %eax, %edi
movq -0x30(%rbp), %rax
shrq $0x20, %rax
xorl %eax, %edi
callq 0x3250
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
movslq -0x14(%rbp), %rcx
leaq -0x14c(%rbp), %rdi
callq 0x9540
movl -0x14(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_rc4.c
// Function: rc4_init(rc4_sbox*, unsigned long)
static void
rc4_init(struct rc4_sbox *rs, uint64_t seed) {
   rs->i=0;
   rs->j=0;
   int i;
   uint8_t k[8];
   for (i=0;i<8;i++) {
      k[i] = seed & 0xff;
      seed >>= 8;
   }
   for (i=0;i<256;i++) {
      rs->sbox[i] = (uint8_t)((i + k[i%8]) & 0xff);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x94e9
movq -0x10(%rbp), %rax
andq $0xff, %rax
movb %al, %cl
movslq -0x14(%rbp), %rax
movb %cl, -0x1c(%rbp,%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x94b8
movl $0x0, -0x14(%rbp)
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jge 0x9535
movl -0x14(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl -0x20(%rbp), %eax
movslq %edx, %rcx
movzbl -0x1c(%rbp,%rcx), %ecx
addl %ecx, %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb %dl, 0x8(%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x94f0
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_rc4.c
// Function: rc4_encode(rc4_sbox*, unsigned char const*, unsigned char*, unsigned long)
static void
rc4_encode(struct rc4_sbox *rs, const uint8_t *src, uint8_t *des, size_t sz) {
   size_t i;
   for (i=0;i<sz;i++) {
      rs->i = (rs->i + 1) % 256;
      rs->j = (rs->j + rs->sbox[rs->i]) % 256;
      uint8_t si = rs->sbox[rs->i];
      uint8_t sj = rs->sbox[rs->j];
      rs->sbox[rs->i] = sj;
      rs->sbox[rs->j] = si;
      uint8_t d = src[i] ^ rs->sbox[(si+sj) % 256];
      des[i] = d;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x9647
movq -0x8(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movq -0x8(%rbp), %rax
movl %edx, (%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq (%rdx), %rdx
movzbl 0x8(%rcx,%rdx), %ecx
addl %ecx, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movq -0x8(%rbp), %rax
movl %edx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
movb 0x8(%rax,%rcx), %al
movb %al, -0x29(%rbp)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x4(%rcx), %rcx
movb 0x8(%rax,%rcx), %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
movb %dl, 0x8(%rax,%rcx)
movb -0x29(%rbp), %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x4(%rcx), %rcx
movb %dl, 0x8(%rax,%rcx)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rcx
movzbl -0x29(%rbp), %eax
movzbl -0x2a(%rbp), %edx
addl %edx, %eax
movl $0x100, %esi            # imm = 0x100
cltd
idivl %esi
movl -0x30(%rbp), %eax
movslq %edx, %rdx
movzbl 0x8(%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, -0x2b(%rbp)
movb -0x2b(%rbp), %dl
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x955c
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl -0x14(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x9688
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x9694
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9759
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %edi
callq 0x3400
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %edi
callq 0x3400
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
subq -0x38(%rbp), %rax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x708, %eax            # imm = 0x708
jle 0x96db
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x9759
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %eax
movl %eax, %esi
callq 0x92a0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x9490
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq -0x20(%rbp), %rdx
movslq -0x14(%rbp), %rcx
leaq -0x150(%rbp), %rdi
callq 0x9540
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9130
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
xorq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x40(%rbp), %eax
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %rdx
shrq $0x20, %rdx
xorl %edx, %ecx
cmpl %ecx, %eax
je 0x9753
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x9759
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)
nopl (%rax,%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x988c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0x37, %esi
callq 0x98a0
movq %rax, %rcx
xorq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
shlq $0xe, %rax
xorq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
movl $0x24, %esi
callq 0x98a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9894
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x991b
cmpq $0x0, -0x20(%rbp)
je 0x991b
cmpl $0x10, -0x14(%rbp)
jl 0x991b
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9930
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x9922
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_xor64.c
// Function: 64bit_xor(unsigned char*, int)
static uint64_t
_64bit_xor(uint8_t *buf, int bytes) {
   uint64_t *p=(uint64_t*)buf, ret=0;
   for (int i=0; i<(bytes>>3); i++) {
      ret = ret ^ p[i];
   }
   if (bytes & 0x7) {
      uint8_t extra[8];
      memset(extra, 0, sizeof(uint8_t)*8);
      memcpy(extra, &buf[bytes & ~0x7], bytes & 0x7);
      ret = ret ^ *((uint64_t*)extra);
   }
   return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0xc(%rbp), %ecx
sarl $0x3, %ecx
cmpl %ecx, %eax
jge 0x9982
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x24(%rbp), %rdx
xorq (%rcx,%rdx,8), %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9956
movl -0xc(%rbp), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0x99ca
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x31c0
leaq -0x2c(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %eax
andl $-0x8, %eax
cltq
addq %rax, %rsi
movl -0xc(%rbp), %eax
andl $0x7, %eax
movslq %eax, %rdx
callq 0x3290
movq -0x20(%rbp), %rax
xorq -0x2c(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9a3c
cmpq $0x0, -0x20(%rbp)
je 0x9a3c
cmpl $0x10, -0x14(%rbp)
jl 0x9a3c
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9930
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movl $0x8, %edx
callq 0x3170
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x9a43
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq 0xe8ae(%rip), %rax      # 0x18368
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x3430
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9bb3
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x28, %rdx
xorl %esi, %esi
callq 0x31c0
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x14(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0x20(%rax)
movq -0x8(%rbp), %rcx
addq $0x28, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movw $0xf00d, 0x22(%rax)     # imm = 0xF00D
jmp 0x9b23
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl $0x1, %edx
lock
cmpxchgl %edx, (%rcx)
movl %eax, %ecx
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x9b21
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x9b67
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
incl %ecx
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
addq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movl $0x1, %eax
xorl %edx, %edx
lock
cmpxchgl %edx, (%rcx)
movq -0x28(%rbp), %rax
addq $0x28, %rax
addq $0x30, %rsp
popq %rbp
retq
leaq 0x94ea(%rip), %rdi      # 0x130a4
leaq 0x9c1f(%rip), %rsi      # 0x137e0
movl $0x41, %edx
leaq 0x9c39(%rip), %rcx      # 0x13806
callq 0x3210
nopw %cs:(%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $-0x28, %rax
movq %rax, -0x18(%rbp)
movq 0xe779(%rip), %rax      # 0x18378
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x9c2b
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x9c1d
movl $0x1, -0x4(%rbp)
jmp 0x9c54
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x9c03
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movzwl 0x20(%rax), %edx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x9bf5(%rip), %rdi      # 0x1383b
movb $0x0, %al
callq 0x3050
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq 0xe6ee(%rip), %rax      # 0x18368
movq %rax, -0x20(%rbp)
jmp 0x9c80
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl $0x1, %edx
lock
cmpxchgl %edx, (%rcx)
movl %eax, %ecx
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x9c7e
cmpq $0x0, -0x8(%rbp)
je 0x9dc8
movq -0x20(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x9dc8
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
addq $-0x28, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzwl 0x22(%rax), %eax
cmpl $0xf00d, %eax           # imm = 0xF00D
je 0x9d1b
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x30(%rbp), %rax
movzwl 0x20(%rax), %edx
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
leaq 0x9b60(%rip), %rdi      # 0x13855
movb $0x0, %al
callq 0x3050
leaq 0x93a1(%rip), %rdi      # 0x130a4
leaq 0x9ad6(%rip), %rsi      # 0x137e0
movl $0x5b, %edx
leaq 0x9b53(%rip), %rcx      # 0x13869
callq 0x3210
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x30(%rbp), %rax
jne 0x9d39
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x9d56
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x9d73
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
decl %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
addq $-0x28, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
callq 0x33d0
movq -0x20(%rbp), %rcx
movl $0x1, %eax
xorl %edx, %edx
lock
cmpxchgl %edx, (%rcx)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
leaq 0x92d5(%rip), %rdi      # 0x130a4
leaq 0x9a0a(%rip), %rsi      # 0x137e0
movl $0x68, %edx
leaq 0x9a87(%rip), %rcx      # 0x13869
callq 0x3210
nopw (%rax,%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
leaq 0xe55a(%rip), %rax      # 0x18368
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9f2c
movq -0x10(%rbp), %rax
addq $-0x28, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
callq 0x34e0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x9e52
movq $0x0, -0x8(%rbp)
jmp 0x9f40
jmp 0x9e54
jmp 0x9e56
movq -0x30(%rbp), %rcx
xorl %eax, %eax
movl $0x1, %edx
lock
cmpxchgl %edx, (%rcx)
movl %eax, %ecx
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x9e54
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x9e8a
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x40(%rbp), %rax
subq 0x18(%rax), %rcx
addq -0x18(%rbp), %rcx
addq $0x28, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0x9ec3
movq -0x40(%rbp), %rcx
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x9edd
movq -0x40(%rbp), %rcx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movw -0x24(%rbp), %cx
movq -0x40(%rbp), %rax
movw %cx, 0x20(%rax)
movq -0x18(%rbp), %rcx
addq $0x28, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movw $0xf00d, 0x22(%rax)     # imm = 0xF00D
movq -0x30(%rbp), %rcx
movl $0x1, %eax
xorl %edx, %edx
lock
cmpxchgl %edx, (%rcx)
movq -0x40(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x8(%rbp)
jmp 0x9f40
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x9aa0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xa32c
cmpl $0x0, -0xc(%rbp)
jl 0xa32c
jmp 0xa2de
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0xc(%rbp), %eax
jle 0xa32a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rdi
leaq 0x9603(%rip), %rsi      # 0x13921
movl $0x64, %edx
callq 0x9c60
jmp 0xa2de
jmp 0xa32c
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xa3b1
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa391
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x95a4(%rip), %rsi      # 0x13921
movl $0x6e, %edx
callq 0x9c60
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xa35f
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xa2c0
movq -0x8(%rbp), %rdi
leaq 0x957a(%rip), %rsi      # 0x13921
movl $0x72, %edx
callq 0x9c60
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa538
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa550
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xa4f7
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xa523
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa540
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_node_new(s_lst*, void*)
static inline lst_node_t*
_lst_node_new(lst_t *lst, void *data) {
   lst_node_t *n = NULL;
   if (lst->free_count > 0) {
      n = _lst_node_remove_free(lst);
      memset(n, 0, sizeof(*n));
   }
   else {
      n = (lst_node_t*)mm_malloc(sizeof(*n));
      /* assert(n); */
   }
   n->data = data;
   return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0xa591
movq -0x8(%rbp), %rdi
callq 0xac00
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x31c0
jmp 0xa5ab
movl $0x18, %edi
leaq 0x9384(%rip), %rsi      # 0x13921
movl $0x38, %edx
callq 0x9aa0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa648
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa550
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xa607
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xa633
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa650
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_node_delete(s_lst*, s_lst_node*)
static inline void*
_lst_node_delete(lst_t *lst, lst_node_t *n) {
   void *data = n->data;

   if (lst->first == n) lst->first = n->next;
   if (lst->last == n) lst->last = n->prev;

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

   if ( M_FREE_NODE_RESERVE ) {
      _lst_node_add_free(lst, n);
   }
   else {
      mm_free(n);
   }
   lst->count--;
   return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0xa6e9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0xa707
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xa726
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xa745
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xac40
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jle 0xa85a
cmpq $0x0, -0x18(%rbp)
je 0xa85a
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa862
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa936
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa936
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xa8d4
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0xa8b7
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xa8c6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xa90c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0xa8f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xa900
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xa92c
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xa93e
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa93e
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xaa0b
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xaa0b
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xaa0b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa3c0
cmpl $0x1, %eax
jg 0xa9c2
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0xa9f8
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0xa9e2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xa9f6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xa9f8
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xa6b0
movq %rax, -0x8(%rbp)
jmp 0xaa13
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xab1c
cmpq $0x0, -0x18(%rbp)
je 0xab1c
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xab1c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xa550
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xaae3
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xaaef
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xab24
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xabec
cmpq $0x0, -0x18(%rbp)
je 0xabec
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xabec
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xa550
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xabb3
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
jmp 0xabbf
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xabf4
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_list.c
// Function: lst_node_remove_free(s_lst*)
static inline lst_node_t*
_lst_node_remove_free(lst_t *lst) {
   lst_node_t *n = lst->free;
   lst->free = n->next;
   lst->free_count--;
   return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
subq $0x10, %rsp
movl $0x18, %edi
leaq 0x8cb4(%rip), %rsi      # 0x13948
movl $0x2e, %edx
callq 0x9aa0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xacf0
callq 0xb350
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
leaq 0x8c89(%rip), %rdi      # 0x13948
movl $0x31, %esi
callq 0xa260
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq 0x8c6d(%rip), %rdi      # 0x13948
movl $0x32, %esi
callq 0xa260
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xadd9
jmp 0xad19
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xb520
cmpl $0x0, %eax
jle 0xad40
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xba00
movq %rax, %rdi
callq 0xade0
jmp 0xad19
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xb470
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa3c0
cmpl $0x0, %eax
jle 0xad75
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa660
movq %rax, %rdi
callq 0xade0
jmp 0xad4c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa340
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa3c0
cmpl $0x0, %eax
jle 0xadb7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa660
movq %rax, %rdi
leaq 0x8b9d(%rip), %rsi      # 0x13948
movl $0x76, %edx
callq 0x9c60
jmp 0xad82
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa340
movq -0x8(%rbp), %rdi
leaq 0x8b79(%rip), %rsi      # 0x13948
movl $0x7a, %edx
callq 0x9c60
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa3c0
cmpl $0x0, %eax
jle 0xae21
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa660
movq %rax, %rdi
leaq 0x8b33(%rip), %rsi      # 0x13948
movl $0x5d, %edx
callq 0x9c60
jmp 0xadec
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa340
movq -0x8(%rbp), %rdi
leaq 0x8b0f(%rip), %rsi      # 0x13948
movl $0x61, %edx
callq 0x9c60
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xae78
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xb520
cmpl $0x0, %eax
jg 0xae7d
jmp 0xaf69
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xb9c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jle 0xae9f
jmp 0xaf69
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xb520
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
jge 0xaf69
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xb9c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jle 0xaee7
jmp 0xaf69
jmp 0xaee9
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa660
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rsi
callq *%rax
movq -0x30(%rbp), %rax
cmpb $0x0, 0x8(%rax)
je 0xaf2d
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xaf70
jmp 0xaf3a
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xb000
jmp 0xaf3c
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa3c0
cmpl $0x0, %eax
jg 0xaee9
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xb030
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xaea6
addq $0x40, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xb550
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xafbf
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xb2b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xa5c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)