LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x62fe
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x62d6
leaq 0x5692(%rip), %r14      # 0xb94f
movq 0x10(%rdi), %r15
movq %r14, %rsi
movl $0x6e, %edx
callq 0x5e57
movq %r15, %rdi
testq %r15, %r15
jne 0x62bd
movq %rbx, %rdi
xorl %esi, %esi
callq 0x623d
leaq 0x5668(%rip), %rsi      # 0xb94f
movq %rbx, %rdi
movl $0x72, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5e57
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x639b
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x639e
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 0x63b4
xorl %eax, %eax
retq
leaq 0x55aa(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5d4c
movq %r14, (%rax)
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x63cb
movq 0x8(%rbx), %rdx
movq %rax, 0x8(%rdx)
movq %rdx, 0x10(%rax)
jmp 0x63cf
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_O1/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 0x6416
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x6419
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 0x642f
xorl %eax, %eax
retq
leaq 0x552f(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5d4c
movq %r14, (%rax)
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x6449
leaq 0x10(%rbx), %rdx
movq (%rdx), %rsi
movq %rax, 0x10(%rsi)
movq %rsi, 0x8(%rax)
jmp 0x6451
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_O1/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 0x65a8
cmpl $0x0, (%rdi)
jle 0x65a8
movq %rdi, (%rsi)
movl %edx, 0x10(%rsi)
movq $0x0, 0x8(%rsi)
movq %rsi, %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x65f8
movq %rdi, %rax
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x65f8
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 0x65f6
movq $0x0, (%rax)
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6622
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x6622
movq 0x8(%rdi), %rdx
testq %rdx, %rdx
je 0x6622
pushq %rbp
movq %rsp, %rbp
cmpl $0x1, (%rcx)
jg 0x6625
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
jmp 0x6639
xorl %eax, %eax
retq
cmpl $0x0, 0x10(%rdi)
je 0x6631
movq 0x10(%rdx), %rax
jmp 0x6635
movq 0x8(%rdx), %rax
movq %rax, 0x8(%rdi)
movq (%rdx), %rax
cmpq %rdx, 0x8(%rcx)
jne 0x664a
movq 0x10(%rdx), %rsi
movq %rsi, 0x8(%rcx)
cmpq %rdx, 0x10(%rcx)
jne 0x6658
movq 0x8(%rdx), %rsi
movq %rsi, 0x10(%rcx)
movq 0x8(%rdx), %rsi
testq %rsi, %rsi
je 0x6669
movq 0x10(%rdx), %rdi
movq %rdi, 0x10(%rsi)
movq 0x10(%rdx), %rdi
testq %rdi, %rdi
je 0x6676
movq %rsi, 0x8(%rdi)
movq 0x18(%rcx), %rsi
movq %rsi, 0x10(%rdx)
movq %rdx, 0x18(%rcx)
incl 0x4(%rcx)
decl (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x66f4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x66f7
movq %rdx, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x66fb
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 0x6711
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0x673b
leaq 0x524d(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5d4c
movq %r14, (%rax)
movq 0x10(%r15), %rcx
movq %rbx, %rdx
movq %rax, %rsi
testq %rcx, %rcx
je 0x672d
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_O1/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 0x6797
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x679a
movq %rdx, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
jle 0x679e
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 0x67b4
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0x67df
leaq 0x51aa(%rip), %rsi      # 0xb94f
movl $0x18, %edi
movl $0x38, %edx
callq 0x5d4c
movq %r14, (%rax)
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x67ce
movq %rcx, 0x8(%rax)
movq 0x8(%r15), %rcx
addq $0x10, %rcx
jmp 0x67d2
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_O1/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 0x517c(%rip), %rsi      # 0xb976
movl $0x18, %edi
movl $0x2e, %edx
callq 0x5d4c
movq %rax, %rbx
testq %rax, %rax
je 0x6842
callq 0x6cc0
movq %rax, (%rbx)
leaq 0x5156(%rip), %r14      # 0xb976
movq %r14, %rdi
movl $0x31, %esi
callq 0x6214
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movl $0x32, %esi
callq 0x6214
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6907
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
jmp 0x686f
movq (%rbx), %rdi
callq 0x7089
movq %rax, %rdi
callq 0x6908
movq (%rbx), %rdi
callq 0x6df5
testl %eax, %eax
jg 0x685f
movq (%rbx), %rdi
callq 0x6d70
jmp 0x6896
movq 0x8(%rbx), %rdi
callq 0x645d
movq %rax, %rdi
callq 0x6908
movq 0x8(%rbx), %rdi
callq 0x62ff
testl %eax, %eax
jg 0x6885
movq 0x8(%rbx), %rdi
callq 0x629b
movq 0x10(%rbx), %rdi
callq 0x62ff
testl %eax, %eax
jle 0x68e6
leaq 0x50b6(%rip), %r14      # 0xb976
movq 0x10(%rbx), %rdi
callq 0x645d
movq %rax, %rdi
movq %r14, %rsi
movl $0x76, %edx
callq 0x5e57
movq 0x10(%rbx), %rdi
callq 0x62ff
testl %eax, %eax
jg 0x68c0
movq 0x10(%rbx), %rdi
callq 0x629b
leaq 0x5080(%rip), %rsi      # 0xb976
movq %rbx, %rdi
movl $0x7a, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x5e57
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x62ff
testl %eax, %eax
jle 0x694c
leaq 0x5050(%rip), %r14      # 0xb976
movq 0x8(%rbx), %rdi
callq 0x645d
movq %rax, %rdi
movq %r14, %rsi
movl $0x5d, %edx
callq 0x5e57
movq 0x8(%rbx), %rdi
callq 0x62ff
testl %eax, %eax
jg 0x6926
movq 0x8(%rbx), %rdi
callq 0x629b
leaq 0x501a(%rip), %rsi      # 0xb976
movq %rbx, %rdi
movl $0x61, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x5e57
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a4b
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 0x6df5
testl %eax, %eax
jle 0x6a3d
movq (%r14), %rdi
callq 0x7069
cmpq %rbx, (%rax)
jg 0x6a3d
movq (%r14), %rdi
callq 0x6df5
testl %eax, %eax
jle 0x6a3d
xorl %r13d, %r13d
movq (%r14), %rdi
callq 0x7069
movq %rax, %r15
movq (%rax), %rax
cmpq %rbx, %rax
jg 0x6a3d
movq %rax, -0x30(%rbp)
movq 0x8(%r15), %rdi
callq 0x645d
movq %rax, %r12
movq 0x18(%rax), %rsi
movq %rax, %rdi
callq *0x10(%rax)
cmpb $0x0, 0x8(%r12)
je 0x6a03
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6a4c
jmp 0x6a0f
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x63dc
movq 0x8(%r15), %rdi
callq 0x62ff
testl %eax, %eax
jg 0x69d5
movq %r14, %rdi
movq %r15, %rsi
callq 0x6afb
cmpq %rbx, -0x30(%rbp)
jg 0x6a3d
incl %r13d
movq (%r14), %rdi
callq 0x6df5
cmpl %eax, %r13d
jl 0x69be
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6e07
movq %rax, %r12
testq %rax, %rax
jne 0x6ad4
movq 0x8(%r15), %rdi
callq 0x62ff
testl %eax, %eax
jle 0x6a94
movq 0x8(%r15), %rdi
callq 0x645d
movq %rax, %r12
jmp 0x6ac2
leaq 0x4edb(%rip), %r13      # 0xb976
movl $0x10, %edi
movq %r13, %rsi
movl $0x41, %edx
callq 0x5d4c
movq %rax, %r12
movq %r13, %rdi
movl $0x42, %esi
callq 0x6214
movq %rax, 0x8(%r12)
movq %r14, (%r12)
movq (%r15), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6e43
movq %r12, 0x20(%rbx)
movq 0x8(%r12), %rdi
movq %rbx, %rsi
callq 0x63dc
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_O1/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 0x6bc5
movq %r9, %r15
movq %rdx, %rbx
movq %rdi, %r12
movq %r8, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq 0x10(%rdi), %rdi
callq 0x62ff
testl %eax, %eax
jle 0x6b83
movq 0x10(%r12), %rdi
callq 0x645d
jmp 0x6b99
leaq 0x4dec(%rip), %rsi      # 0xb976
movl $0x30, %edi
movl $0x86, %edx
callq 0x5d4c
movq %rax, %r14
testq %rax, %rax
je 0x6bc5
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 0x6a4c
jmp 0x6bc8
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_O1/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 0x6c4e
movq %rsi, %rbx
movq 0x20(%rsi), %rax
testq %rax, %rax
je 0x6c4e
movq %rdx, %r14
movq %rdi, %r15
movq 0x8(%rax), %rdi
movq 0x28(%rbx), %rsi
callq 0x6520
movq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x6afb
testl %r12d, %r12d
je 0x6c32
movq 0x18(%rbx), %rsi
movq %rbx, %rdi
callq *0x10(%rbx)
cmpb $0x0, 0x8(%rbx)
je 0x6c57
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6a4c
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 0x63dc
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6cba
movq %rsi, %r14
movq 0x20(%rsi), %rax
testq %rax, %rax
je 0x6cba
movq %rdi, %rbx
movq 0x8(%rax), %rdi
movq 0x28(%r14), %rsi
callq 0x6520
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x63dc
movq 0x20(%r14), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x6afb
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4ccd(%rip), %rsi      # 0xb99e
movl $0x30, %edi
movl $0x47, %edx
callq 0x5d4c
movq %rax, %rbx
testq %rax, %rax
je 0x6d62
movq %rbx, %r14
addq $0x20, %r14
movq %r14, %rdi
callq 0x5b80
leaq 0x4ca0(%rip), %r15      # 0xb99e
movl $0x18, %edi
movq %r15, %rsi
movl $0x30, %edx
callq 0x5d4c
movq %rax, 0x18(%rbx)
movq $-0x1, (%rax)
movq %r14, %rdi
callq 0x5be5
movl %eax, 0x4(%rbx)
movl $0xf, (%rbx)
movq $0x0, 0x8(%rbx)
movl $0x98, %edi
movq %r15, %rsi
movl $0x30, %edx
callq 0x5d4c
movq %rax, 0x10(%rbx)
xorl %eax, %eax
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
incq %rax
cmpq $0x10, %rax
jne 0x6d4c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6df4
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 0x6db1
leaq 0x4c07(%rip), %r14      # 0xb99e
movq 0x10(%rdi), %r15
movq %r14, %rsi
movl $0x64, %edx
callq 0x5e57
movq %r15, %rdi
cmpq 0x18(%rbx), %r15
jne 0x6d97
movq 0x10(%rbx), %rdi
leaq 0x4be2(%rip), %r14      # 0xb99e
movq %r14, %rsi
movl $0x67, %edx
callq 0x5e57
movq 0x18(%rbx), %rdi
movq %r14, %rsi
movl $0x68, %edx
callq 0x5e57
movq %rbx, %rdi
movq %r14, %rsi
movl $0x69, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5e57
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6e3a
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 0x6e1d
je 0x6e3d
leaq -0x1(%rcx), %rdi
testq %rcx, %rcx
movq %rdi, %rcx
jg 0x6e1a
jmp 0x6e41
xorl %eax, %eax
retq
movq 0x8(%rdi), %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_insert
void*
skt_insert(skt_t *lst, uint64_t key, void *value) {
   if (lst && key>0 && key<SKT_KEY_MASK && value) {
      int k;
      skt_node_t *p, *next;
      skt_node_t *update[kMaxNumberOfLevels];   
      
      p = lst->header;
      k = lst->level;
      do {
         while (next = p->forward[k], next->key < key) {
            p = next;
         }
         update[k] = p;
      } while(--k >= 0);

      if (next->key == key) {
         return NULL;
      }

      k = _randomLevel(lst);
      if (k > lst->level) {
         k = ++lst->level;
         update[k] = lst->header;
      }
      next = _newNodeOfLevel(k);
      next->key = key;
      next->value = value;
      do {
         p = update[k];
         next->forward[k] = p->forward[k];
         p->forward[k] = next;
      } while(--k >= 0);
      lst->count += 1;
      return value;
   }
   return NULL;
}

// Assembly:
xorl %eax, %eax
testq %rdx, %rdx
je 0x6f86
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
testq %rdi, %rdi
je 0x6f75
movq %rsi, %r15
leaq -0x1(%rsi), %rcx
cmpq $-0x3, %rcx
ja 0x6f75
movq 0x10(%r14), %rcx
movslq 0x8(%r14), %rax
movq %rcx, %rsi
movq %rsi, %rcx
movq 0x10(%rsi,%rax,8), %rsi
movq (%rsi), %rdi
cmpq %r15, %rdi
jb 0x6e8a
movq %rcx, -0xb0(%rbp,%rax,8)
leaq -0x1(%rax), %rsi
testq %rax, %rax
movq %rsi, %rax
jg 0x6e87
cmpq %r15, %rdi
jne 0x6eba
xorl %esi, %esi
jmp 0x6f72
movq %rdx, -0x30(%rbp)
leaq 0x20(%r14), %r12
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl 0x4(%r14), %ebx
movl %ebx, %eax
sarl $0x2, %eax
movl %eax, 0x4(%r14)
decl (%r14)
jne 0x6eed
movq %r12, %rdi
callq 0x5be5
movl %eax, 0x4(%r14)
movl $0xf, (%r14)
incl %r13d
testb $0x3, %bl
je 0x6ec8
andl $0x3, %ebx
cmpl $0x1, %ebx
adcl $0x0, %r13d
cmpl $0xf, %r13d
movl $0xf, %eax
cmovll %r13d, %eax
movslq 0x8(%r14), %rcx
cmpl %ecx, %eax
jle 0x6f28
leaq 0x1(%rcx), %rax
movl %eax, 0x8(%r14)
movq 0x10(%r14), %rdx
movq %rdx, -0xa8(%rbp,%rcx,8)
movslq %eax, %rbx
leaq 0x18(,%rbx,8), %rdi
leaq 0x4a64(%rip), %rsi      # 0xb99e
movl $0x30, %edx
callq 0x5d4c
movq %r15, (%rax)
movq -0x30(%rbp), %rsi
movq %rsi, 0x8(%rax)
incq %rbx
movq -0xb8(%rbp,%rbx,8), %rcx
movq 0x8(%rcx,%rbx,8), %rdx
movq %rdx, 0x8(%rax,%rbx,8)
movq %rax, 0x8(%rcx,%rbx,8)
decq %rbx
jg 0x6f52
incl 0xc(%r14)
movq %rsi, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_remove
void*
skt_remove(skt_t *lst, uint64_t key) {
   void *ret_value = NULL;
   if (lst && key>0 && key<SKT_KEY_MASK) {
      int k, m;
      skt_node_t *p, *next;
      skt_node_t *update[kMaxNumberOfLevels];      
      
      p = lst->header;
      k = m = lst->level;
      do {
         while (next = p->forward[k], next->key < key) {
            p = next;
         }
         update[k] = p;
      } while(--k >= 0);

      if (next->key == key) {
         ret_value = next->value;         
         for (k=0; k<=m && (p=update[k])->forward[k] == next; k++) {
            p->forward[k] = next->forward[k];
         }
         mm_free(next);
         while (lst->header->forward[m]==lst->tail && m>0) {
            m--;
         }
         lst->level = m;
         lst->count -= 1;
      }
   }
   return ret_value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
testq %rdi, %rdi
sete %al
leaq -0x1(%rsi), %rcx
cmpq $-0x2, %rcx
setae %cl
orb %al, %cl
jne 0x7055
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
movslq 0x8(%rdi), %r15
movl %r15d, %eax
movq %r15, %rdx
movq %rcx, %rdi
movq %rdi, %rcx
movq 0x10(%rdi,%rdx,8), %rdi
movq (%rdi), %r8
cmpq %rsi, %r8
jb 0x6fc4
movq %rcx, -0xa0(%rbp,%rdx,8)
leaq -0x1(%rdx), %r9
testq %rdx, %rdx
movq %r9, %rdx
jg 0x6fc1
cmpq %rsi, %r8
jne 0x7055
movq 0x8(%rdi), %r14
testl %eax, %eax
js 0x701b
incq %rax
xorl %ecx, %ecx
movq -0xa0(%rbp,%rcx,8), %rdx
cmpq %rdi, 0x10(%rdx,%rcx,8)
jne 0x701b
movq 0x10(%rdi,%rcx,8), %rsi
movq %rsi, 0x10(%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x6ffa
leaq 0x497c(%rip), %rsi      # 0xb99e
movl $0xc9, %edx
callq 0x5e57
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
leal 0x1(%r15), %edx
decl %edx
testq %r15, %r15
jle 0x704d
leaq -0x1(%r15), %rsi
cmpq %rcx, 0x10(%rax,%r15,8)
movq %rsi, %r15
je 0x7038
movl %edx, 0x8(%rbx)
decl 0xc(%rbx)
jmp 0x7058
xorl %r14d, %r14d
movq %r14, %rax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_popf
void*
skt_popf(skt_t *lst) {
   if (lst && lst->count>0) {
      skt_node_t *p = lst->header->forward[0];
      return skt_remove(lst, p->key);
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x70a9
cmpl $0x0, 0xc(%rdi)
jle 0x70a9
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
popq %rbp
jmp 0x6f87
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_iter_init
skt_iter_t*
skt_iter_init(skt_t *lst, skt_iter_t *it) {
   if (lst && lst->count>0 && it) {
      memset(it, 0, sizeof(*it));
      return it;
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x70d0
testq %rsi, %rsi
je 0x70d0
cmpl $0x0, 0xc(%rdi)
jle 0x70d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
movq %rsi, %rax
jmp 0x70d2
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_iter_next
skt_iter_t*
skt_iter_next(skt_t *lst, skt_iter_t *it) {
   if (lst && lst->count>0 && it) {
      if (it->prev == NULL) {
         it->prev = lst->header;
      } else if ( it->curr ) {
         it->prev = ((skt_node_t*)it->prev)->forward[0];
      }
      it->curr = ((skt_node_t*)it->prev)->forward[0];
      skt_node_t *node = (skt_node_t*)it->curr;
      if (node != lst->tail) {
         it->key = node->key;
         it->value = node->value;
         return it;
      }
   }
   return NULL;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x712e
testq %rsi, %rsi
je 0x712e
cmpl $0x0, 0xc(%rdi)
jle 0x712e
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rcx
movq %rdi, %rax
testq %rcx, %rcx
je 0x70ff
cmpq $0x0, 0x8(%rsi)
movq %rcx, %rax
je 0x7106
movq 0x10(%rax), %rax
movq %rax, (%rsi)
movq (%rsi), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsi)
cmpq 0x18(%rdi), %rax
je 0x712b
movq (%rax), %rcx
movq %rcx, 0x10(%rsi)
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsi)
movq %rsi, %rax
jmp 0x712d
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/m_foundation/src/model/m_skiplist.c
// Function: skt_iter_remove
void*
skt_iter_remove(skt_t *lst, skt_iter_t *it) {
   if (lst && lst->count>0 && it) {
      if (it->key > 0) {
         it->curr = NULL;
         return skt_remove(lst, it->key);
      }
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x715d
testq %rsi, %rsi
je 0x715d
cmpl $0x0, 0xc(%rdi)
jle 0x715d
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x715d
movq $0x0, 0x8(%rsi)
movq %rax, %rsi
popq %rbp
jmp 0x6f87
xorl %eax, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/session_proto.cpp
// Function: proto_probe(unsigned char const*, int, proto_t*)
int
proto_probe(const unsigned char *buf, int buf_len, proto_t *proto) {
   if (buf && buf_len>0 && proto) {
      proto->ptype = (buf[0] >> _TYPE_OFFSET);
      proto->sid = (buf[1]<<8) | buf[2];
      if (proto->ptype == PROTO_TYPE_CTRL) {
         proto->u.cmd = (buf[0] & _CMD_MASK);
      } else {
         proto->u.data = (unsigned char*)(buf + 3);

      }
      proto->data_length = buf_len - 3;
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %al
testl %esi, %esi
setle %cl
testq %rdx, %rdx
sete %r8b
orb %al, %r8b
xorl %eax, %eax
orb %cl, %r8b
jne 0x71bb
movzbl (%rdi), %eax
shrl $0x5, %eax
movl %eax, (%rdx)
movzwl 0x1(%rdi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, 0x4(%rdx)
cmpl $0x1, %eax
jne 0x71a8
movb (%rdi), %al
andb $0x1f, %al
movb %al, 0x8(%rdx)
jmp 0x71b0
addq $0x3, %rdi
movq %rdi, 0x8(%rdx)
addl $-0x3, %esi
movl %esi, 0x10(%rdx)
movl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/session_proto.cpp
// Function: proto_mark_cmd(unsigned char*, unsigned int, int)
int
proto_mark_cmd(unsigned char *buf, unsigned sid, int cmd) {
   if (buf && cmd>0) {
      buf[0] = (PROTO_TYPE_CTRL << _TYPE_OFFSET) | (cmd & _CMD_MASK);
      buf[1] = (sid >> 8) & 0xff;
      buf[2] = sid & 0xff;
      return 3;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %ecx
testq %rdi, %rdi
sete %sil
testl %edx, %edx
setle %r8b
xorl %eax, %eax
orb %sil, %r8b
jne 0x71ea
andb $0x1f, %dl
orb $0x20, %dl
movb %dl, (%rdi)
movb %ch, 0x1(%rdi)
movb %cl, 0x2(%rdi)
movl $0x3, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/session_proto.cpp
// Function: proto_mark_data(unsigned char*, unsigned int)
int
proto_mark_data(unsigned char *buf, unsigned sid) {
   if (buf) {
      buf[0] = (PROTO_TYPE_DATA << _TYPE_OFFSET);
      buf[1] = (sid >> 8) & 0xff;
      buf[2] = (sid & 0xff);
      return 3;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x7207
movl %esi, %eax
movb $0x40, (%rdi)
movb %ah, 0x1(%rdi)
movb %al, 0x2(%rdi)
movl $0x3, %eax
jmp 0x7209
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/kcp_local.cpp
// Function: local_tcpin_listen(chann_msg_t*)
void
_local_tcpin_listen(chann_msg_t *e) {
   if (e->event == CHANN_EVENT_ACCEPT) {

      tun_local_t *tun = (tun_local_t*)e->opaque;
      if ( tun ) {

         // setup local session
         unsigned sid = ++tun->session_idx;
         session_unit_t *u = session_create(tun->session_lst, sid, e->r, tun);
         if ( u ) {
            mnet_chann_set_cb(e->r, _local_tcpin_callback, u);

            // open remote tcp
            unsigned char buf[16] = { 0 };
            if ( proto_mark_cmd(buf, sid, PROTO_CMD_OPEN) ) {
               ikcp_send(tun->kcpout, (const char*)buf, 16);
            }

            cout << "accept tcpin: " << e->r << ", sid " << sid << endl;
            return;
         }
      }

      mnet_chann_disconnect(e->r);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpl $0x3, (%rdi)
jne 0x8adf
movq %rdi, %r14
movq 0x18(%rdi), %r15
testq %r15, %r15
je 0x8aea
movl 0x58(%r15), %ebx
incl %ebx
movl %ebx, 0x58(%r15)
movq 0x50(%r15), %rdi
movq 0x10(%r14), %rdx
movl %ebx, %esi
movq %r15, %rcx
callq 0x8fbc
testq %rax, %rax
je 0x8aea
movq 0x10(%r14), %rdi
leaq 0xed(%rip), %rsi        # 0x8b26
movq %rax, %rdx
callq 0x4b4c
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rdi
movaps %xmm0, (%rdi)
movl %ebx, %esi
movl $0x1, %edx
callq 0x71bd
testl %eax, %eax
je 0x8a6d
movq 0x48(%r15), %rdi
leaq -0x30(%rbp), %rsi
movl $0x10, %edx
callq 0x2cc4
movq 0x755c(%rip), %r15      # 0xffd0
leaq 0x3568(%rip), %rsi      # 0xbfe3
movl $0xe, %edx
movq %r15, %rdi
callq 0x22e0
movq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0x2210
movq %rax, %r14
leaq 0x3554(%rip), %rsi      # 0xbff2
movl $0x6, %edx
movq %rax, %rdi
callq 0x22e0
movl %ebx, %esi
movq %r14, %rdi
callq 0x21c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2270
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x21d0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4ab2
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/kcp_local.cpp
// Function: local_kcpout_callback(char const*, int, IKCPCB*, void*)
int
_local_kcpout_callback(const char *buf, int len, ikcpcb *kcp, void *user) {
   tun_local_t *tun = (tun_local_t*)user;
   chann_t *udpout = tun->udpout[tun->udpout_idx];
   tun->udpout_idx = (tun->udpout_idx + 1) % tun->conf->src_count;

   if (tun && mnet_chann_state(udpout) >= CHANN_STATE_CONNECTED) {
      const int rs_offset = tun->rt ? sizeof(uint16_t) : 0;
      int data_len = len;
      uint8_t *data = tun->buf + rs_offset;

      if ( tun->conf->crypto ) {
         data_len = rc4_encrypt(buf, len,
                                (char*)data, MKCP_BUF_SIZE - XOR64_CHECKSUM_SIZE,
                                tun->ukey, (tun->ti>>20));
      } else {
         memcpy(data, buf, len);
      }

      int ret = 0;
      
      if ( tun->rt ) {
         int plen = 0;
         *((uint16_t*)tun->buf) = data_len;
         int raw_len = rskcp_enc_info(tun->rt, (data_len + rs_offset), &plen);
         ret = rskcp_encode(tun->rt, tun->buf, (data_len + rs_offset), &tun->buf[raw_len]);
         data_len = raw_len + plen;
      } else {
         ret = xor64_checksum_gen((uint8_t*)data, data_len, &tun->buf[data_len]);
         data_len += XOR64_CHECKSUM_SIZE;
      }

      if (ret && data_len>0) {
         ret = mnet_chann_send(udpout, tun->buf, data_len);
         if (ret == data_len) {
            return len;
         }
      }
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movl %esi, %ebx
movq %rdi, %r14
movslq (%rcx), %rax
movq 0x8(%rcx,%rax,8), %r12
incl %eax
movq 0x78(%rcx), %rcx
cltd
idivl (%rcx)
movl %edx, (%r15)
movq %r12, %rdi
callq 0x466c
cmpl $0x3, %eax
jl 0x8fa9
movq %r12, -0x40(%rbp)
xorl %r13d, %r13d
cmpq $0x0, 0x90(%r15)
setne %r13b
addl %r13d, %r13d
leaq (%r15,%r13), %rcx
addq $0x98, %rcx
movq 0x78(%r15), %rax
cmpl $0x0, 0x148(%rax)
movq %rcx, -0x38(%rbp)
je 0x8f13
movq 0x60(%r15), %r8
movq 0x68(%r15), %r9
shrq $0x14, %r9
movq %r14, %rdi
movl %ebx, %esi
movq %rcx, %rdx
movl $0xfff8, %ecx           # imm = 0xFFF8
callq 0x5761
movl %eax, %r12d
jmp 0x8f24
movslq %ebx, %rdx
movq %rcx, %rdi
movq %r14, %rsi
callq 0x2220
movl %ebx, %r12d
leaq 0x98(%r15), %r14
movq 0x90(%r15), %rdi
testq %rdi, %rdi
je 0x8f76
leaq -0x2c(%rbp), %rdx
movl $0x0, (%rdx)
movw %r12w, 0x98(%r15)
addl %r12d, %r13d
movl %r13d, %esi
callq 0x9127
movq 0x90(%r15), %rdi
movslq %eax, %r12
leaq (%r14,%r12), %rcx
movq %r14, %rsi
movl %r13d, %edx
callq 0x9188
leaq -0x2c(%rbp), %rcx
addl (%rcx), %r12d
jmp 0x8f8c
movslq %r12d, %rdx
addq %r14, %rdx
movq -0x38(%rbp), %rdi
movl %r12d, %esi
callq 0x5c20
addl $0x8, %r12d
testl %eax, %eax
je 0x8fa9
testl %r12d, %r12d
jle 0x8fa9
movq -0x40(%rbp), %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x4d96
cmpl %r12d, %eax
je 0x8fab
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/session_mgnt.cpp
// Function: session_create(s_skt*, unsigned int, s_mchann*, void*)
session_unit_t*
session_create(skt_t *lst, unsigned sid, chann_t *tcp, void *opaque) {
   if (lst && tcp) {
      session_unit_t *u = (session_unit_t*)malloc(sizeof(*u));
      if (u) {
         u->sid = sid;
         u->tcp = tcp;
         u->opaque = opaque;
         u->connected = 0;
         if ( skt_insert(lst, sid, u) ) {
            return u;
         }
         free(u); // fail to insert
      }
   }
   return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
testq %rdi, %rdi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x9025
movq %rdx, %r13
movl %esi, %r15d
movq %rdi, %r14
movl $0x20, %edi
callq 0x2350
testq %rax, %rax
je 0x9025
movq %rax, %rbx
movl %r15d, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x18(%rax)
movl $0x0, 0x10(%rax)
movl %r15d, %esi
movq %r14, %rdi
movq %rax, %rdx
callq 0x6e43
testq %rax, %rax
jne 0x9027
movq %rbx, %rdi
callq 0x2310
xorl %ebx, %ebx
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_O1/xocoder[P]m_kcptun/src/session_mgnt.cpp
// Function: session_destroy(s_skt*, session_unit_t*)
void
session_destroy(skt_t *lst, session_unit_t *u) {
   if (lst && u) {
      skt_remove(lst, u->sid);
   }
   if ( u ) {
      memset(u, 0, sizeof(*u));
      free(u);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x907a
movl (%rbx), %esi
callq 0x6f87
testq %rbx, %rbx
je 0x9097
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2310
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/rs_kcp.cpp
// Function: rskcp_create(int, int)
rskcp_t*
rskcp_create(int data_bytes, int parity_bytes) {
   if ( cm256_init() ) {
      return (rskcp_t*)0;
   }

   rskcp_t *rt = (rskcp_t*)mm_malloc(sizeof(rskcp_t));
   if (rt) {
      cm256_encoder_params p = { data_bytes, parity_bytes, 1 };
      rt->param = p;
      for (int i=0; i<(data_bytes + parity_bytes); i++) {
         rt->blocks[i].Index = i;
      }
   }
   return rt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
movl $0x2, %edi
callq 0x932c
testl %eax, %eax
je 0x90c1
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3038(%rip), %rsi      # 0xc100
movl $0x1010, %edi           # imm = 0x1010
movl $0x1d, %edx
callq 0x5d4c
testq %rax, %rax
je 0x90bc
movl %r14d, (%rax)
movl %ebx, 0x4(%rax)
movl $0x1, 0x8(%rax)
addl %r14d, %ebx
jle 0x90bc
movl %ebx, %ecx
movq %rax, %rdx
addq $0x18, %rdx
xorl %esi, %esi
movb %sil, (%rdx)
incq %rsi
addq $0x10, %rdx
cmpq %rsi, %rcx
jne 0x90f9
jmp 0x90bc
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/rs_kcp.cpp
// Function: rskcp_enc_info(s_rskcp*, int, int*)
int
rskcp_enc_info(rskcp_t *rt, int raw_len, int *parity_len) {
   if (!rt || raw_len<=0 || !parity_len) {
      return 0;
   }

   cm256_encoder_params *p = &rt->param;
   int di=0, pi=0;
   do {
      di += p->OriginalCount;
      pi += p->RecoveryCount;
   } while (di < raw_len);

   *parity_len = pi;
   return di;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %al
testl %esi, %esi
setle %cl
testq %rdx, %rdx
sete %r8b
orb %al, %r8b
xorl %eax, %eax
orb %cl, %r8b
jne 0x915c
movl (%rdi), %ecx
movl 0x4(%rdi), %r8d
xorl %edi, %edi
xorl %eax, %eax
addl %r8d, %edi
addl %ecx, %eax
cmpl %esi, %eax
jl 0x9151
movl %edi, (%rdx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/rs_kcp.cpp
// Function: rskcp_dec_info(s_rskcp*, int)
int
rskcp_dec_info(rskcp_t *rt, int data_len) {
   if (!rt || data_len<=0) {
      return 0;
   }

   cm256_encoder_params *p = &rt->param;
   int di=0, pi=0;
   do {
      di += p->OriginalCount;
      pi += p->RecoveryCount;
   } while (data_len < di + pi);

   return di;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %cl
testl %esi, %esi
setle %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x9186
movl (%rdi), %ecx
movl 0x4(%rdi), %edx
addl %ecx, %edx
xorl %edi, %edi
xorl %eax, %eax
addl %edx, %edi
addl %ecx, %eax
cmpl %esi, %edi
jg 0x917e
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/rs_kcp.cpp
// Function: rskcp_encode(s_rskcp*, unsigned char*, int, unsigned char*)
int
rskcp_encode(rskcp_t *rt, unsigned char *raw, int raw_len, unsigned char *parity) {
   if (!rt || !raw_len || raw_len<=0 || !parity) {
      return 0;
   }

   cm256_encoder_params *p = &rt->param;
   cm256_block *blocks = rt->blocks;
   int ri=0, pi=0, ret=0;
   
   do {
      _rskcp_fill_blocks(blocks, &raw[ri], p->OriginalCount);

      ret = cm256_encode(*p, blocks, &parity[pi]);
      if ( !ret ) {
         ri += p->OriginalCount;
         pi += p->RecoveryCount;
      }
   } while (!ret && raw_len<ri);

   return !ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rsi, -0x38(%rbp)
testq %rdi, %rdi
sete %al
movl %edx, -0x2c(%rbp)
testl %edx, %edx
setle %dl
testq %rcx, %rcx
sete %sil
orb %al, %sil
xorl %ecx, %ecx
orb %dl, %sil
jne 0x9228
movq %rdi, %r12
leaq 0x10(%rdi), %r13
xorl %r15d, %r15d
xorl %r14d, %r14d
movslq (%r12), %rax
testq %rax, %rax
jle 0x91f3
movslq %r14d, %rcx
addq -0x38(%rbp), %rcx
shlq $0x4, %rax
xorl %edx, %edx
movq %rcx, (%r13,%rdx)
addq $0x10, %rdx
incq %rcx
cmpq %rdx, %rax
jne 0x91e2
movq (%r12), %rdi
movl 0x8(%r12), %esi
movslq %r15d, %rcx
addq %rbx, %rcx
movq %r13, %rdx
callq 0x946d
testl %eax, %eax
jne 0x9217
addl (%r12), %r14d
addl 0x4(%r12), %r15d
testl %eax, %eax
jne 0x9221
cmpl -0x2c(%rbp), %r14d
jg 0x91cc
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/src/rs_kcp.cpp
// Function: rskcp_decode(s_rskcp*, unsigned char*, int, unsigned char*)
int
rskcp_decode(rskcp_t *rt, unsigned char *data, int data_len, unsigned char *parity) {
   if (!rt || !data || data_len<=0 || !parity) {
      return 0;
   }

   cm256_encoder_params *p = &rt->param;
   cm256_block *blocks = rt->blocks;
   int di=0, pi=0, ret=0;
   
   do {
      _rskcp_fill_blocks(blocks, &data[di], p->OriginalCount);
      _rskcp_fill_blocks(blocks + p->OriginalCount, &parity[pi], p->RecoveryCount);
      
      ret = cm256_decode(*p, blocks);
      if ( !ret ) {
         di += p->OriginalCount;
         pi += p->RecoveryCount;
      }
   } while (!ret && data_len<di+pi);
   
   return !ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
testq %rdi, %rdi
sete %al
movq %rsi, -0x30(%rbp)
testq %rsi, %rsi
sete %dl
orb %al, %dl
testl %r14d, %r14d
setle %al
movq %rcx, -0x38(%rbp)
testq %rcx, %rcx
sete %sil
xorl %ecx, %ecx
orb %al, %sil
orb %dl, %sil
jne 0x9318
movq %rdi, %r12
leaq 0x10(%rdi), %r13
xorl %ebx, %ebx
xorl %r15d, %r15d
movslq (%r12), %rax
testq %rax, %rax
jle 0x92b4
movslq %r15d, %rcx
addq -0x30(%rbp), %rcx
movq %rax, %rdx
shlq $0x4, %rdx
xorl %esi, %esi
movq %rcx, (%r13,%rsi)
addq $0x10, %rsi
incq %rcx
cmpq %rsi, %rdx
jne 0x92a3
movslq 0x4(%r12), %rcx
testq %rcx, %rcx
jle 0x92e2
shlq $0x4, %rax
addq %r13, %rax
movslq %ebx, %rdx
addq -0x38(%rbp), %rdx
shlq $0x4, %rcx
xorl %esi, %esi
movq %rdx, (%rax,%rsi)
addq $0x10, %rsi
incq %rdx
cmpq %rsi, %rcx
jne 0x92d2
movq (%r12), %rdi
movl 0x8(%r12), %esi
movq %r13, %rdx
callq 0x9cf0
testl %eax, %eax
jne 0x9300
addl (%r12), %r15d
addl 0x4(%r12), %ebx
testl %eax, %eax
jne 0x9311
leal (%r15,%rbx), %ecx
cmpl %r14d, %ecx
jg 0x928a
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/xocoder[P]m_kcptun/vendor/cm256/cm256.cpp
// Function: cm256_encode
int cm256_encode(
    cm256_encoder_params params, // Encoder params
    cm256_block* originals,      // Array of pointers to original blocks
    void* recoveryBlocks)        // Output recovery blocks end-to-end
{
    // Validate input:
    if (params.OriginalCount <= 0 ||
        params.RecoveryCount <= 0 ||
        params.BlockBytes <= 0)
    {
        return -1;
    }
    if (params.OriginalCount + params.RecoveryCount > 256)
    {
        return -2;
    }
    if (!originals || !recoveryBlocks)
    {
        return -3;
    }

    uint8_t* recoveryBlock = static_cast<uint8_t*>(recoveryBlocks);

    for (int block = 0; block < params.RecoveryCount; ++block, recoveryBlock += params.BlockBytes)
    {
        cm256_encode_block(params, originals, (params.OriginalCount + block), recoveryBlock);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdi, %r15
movq %rdi, %r12
shrq $0x20, %r12
testl %r15d, %r15d
setle %al
testl %r12d, %r12d
setle %cl
testl %esi, %esi
setle %r8b
orb %al, %r8b
orb %cl, %r8b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x950c
leal (%r12,%r15), %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x100, %ecx            # imm = 0x100
jg 0x950c
testq %rdx, %rdx
sete %r8b
testq %rbx, %rbx
sete %cl
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
orb %r8b, %cl
jne 0x950c
xorl %eax, %eax
testl %r12d, %r12d
jle 0x950c
movl %esi, %r14d
movl %esi, %eax
movq %rax, -0x30(%rbp)
movl %r15d, %r13d
movq %rdx, -0x38(%rbp)
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %ecx
movq %rbx, %r8
callq 0x9347
movq -0x38(%rbp), %rdx
addq -0x30(%rbp), %rbx
incl %r13d
decl %r12d
jne 0x94e9
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop