LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./bootstrap.c
// Function: isprime
int
isprime (unsigned long int t)
{
  unsigned long int q, r, d;

  if (t < 32)
    return (0xa08a28acUL >> t) & 1;
  if ((t & 1) == 0)
    return 0;

  if (t % 3 == 0)
    return 0;
  if (t % 5 == 0)
    return 0;
  if (t % 7 == 0)
    return 0;

  for (d = 11;;)
    {
      q = t / d;
      r = t - q * d;
      if (q < d)
	return 1;
      if (r == 0)
	break;
      d += 2;
      q = t / d;
      r = t - q * d;
      if (q < d)
	return 1;
      if (r == 0)
	break;
      d += 4;
    }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x1f, %rdi
ja 0x74fa
movl $0xa08a28ac, %eax       # imm = 0xA08A28AC
xorl %ecx, %ecx
btq %rdi, %rax
setb %cl
jmp 0x759d
xorl %ecx, %ecx
movabsq $0x3, %rsi
movq %rdi, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %rsi
movabsq $0x5, %r8
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movq %rdx, %r8
movabsq $0x7, %r9
movq %rdi, %rax
xorl %edx, %edx
divq %r9
testq %rdx, %rdx
je 0x759d
testq %r8, %r8
je 0x759d
movl %edi, %eax
andl $0x1, %eax
je 0x759d
testq %rsi, %rsi
je 0x759d
movabsq $0xd, %rsi
movl $0x1, %r8d
leaq -0x2(%rsi), %r9
movq %rdi, %rax
xorl %edx, %edx
divq %r9
cmpq %r9, %rax
jb 0x759a
imulq %r9, %rax
xorl %ecx, %ecx
cmpq %rdi, %rax
je 0x759d
movq %rdi, %rax
xorl %edx, %edx
divq %rsi
addq $0x2, %r9
cmpq %r9, %rax
jb 0x759a
imulq %rsi, %rax
addq $0x6, %rsi
cmpq %rdi, %rax
jne 0x755e
jmp 0x759d
movl %r8d, %ecx
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./bootstrap.c
// Function: log2_ceil
int
log2_ceil (int n)
{
  int  e;
  assert (n >= 1);
  for (e = 0; ; e++)
    if ((1 << e) >= n)
      break;
  return e;
}

// Assembly:
testl %edi, %edi
jle 0x75b8
pushq $-0x1
popq %rcx
pushq $0x1
popq %rax
incl %ecx
movl %eax, %edx
shll %cl, %edx
cmpl %edi, %edx
jl 0x75ab
movl %ecx, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1cd3(%rip), %rdi      # 0x9296
leaq 0x243a(%rip), %rsi      # 0x9a04
leaq 0x2441(%rip), %rcx      # 0x9a12
pushq $0x51
popq %rdx
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./bootstrap.c
// Function: mpz_preinv_invert
void
mpz_preinv_invert (mpz_t inv, mpz_t d, int numb_bits)
{
  mpz_t  t;
  int    norm;
  assert (SIZ(d) > 0);

  norm = numb_bits - mpz_sizeinbase (d, 2);
  assert (norm >= 0);
  mpz_init_set_ui (t, 1L);
  mpz_mul_2exp (t, t, 2*numb_bits - norm);
  mpz_tdiv_q (inv, t, d);
  mpz_set_ui (t, 1L);
  mpz_mul_2exp (t, t, numb_bits);
  mpz_sub (inv, inv, t);

  mpz_clear (t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x0, 0x4(%rsi)
jle 0x76aa
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x5844
movl %r12d, %r13d
subl %eax, %r13d
js 0x76c3
movslq %r12d, %rax
movq %rax, -0x30(%rbp)
pushq $0x1
popq %rax
leaq -0x40(%rbp), %r15
movl %eax, (%r15)
pushq $0x8
popq %rdi
callq *0x7a6a(%rip)           # 0xf098
movq %rax, 0x8(%r15)
pushq $0x1
popq %rcx
movq %rcx, (%rax)
pushq $0x1
popq %rax
movl %eax, 0x4(%r15)
addl %r12d, %r12d
subl %r13d, %r12d
movslq %r12d, %rdx
movq %r15, %rdi
movq %r15, %rsi
callq 0x304c
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x36c3
movq 0x8(%r15), %rax
pushq $0x1
popq %rcx
movq %rcx, (%rax)
pushq $0x1
popq %rax
movl %eax, 0x4(%r15)
movq %r15, %rdi
movq %r15, %rsi
movq -0x30(%rbp), %rdx
callq 0x304c
movq %rbx, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2e4a
movq 0x8(%r15), %rdi
xorl %esi, %esi
callq *0x7a0d(%rip)           # 0xf0a8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2374(%rip), %rdi      # 0x9a25
leaq 0x234c(%rip), %rsi      # 0x9a04
leaq 0x2371(%rip), %rcx      # 0x9a30
pushq $0x5f
jmp 0x76da
leaq 0x23a2(%rip), %rdi      # 0x9a6c
leaq 0x2333(%rip), %rsi      # 0x9a04
leaq 0x2358(%rip), %rcx      # 0x9a30
pushq $0x62
popq %rdx
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./bootstrap.c
// Function: mpz_invert_2exp
void
mpz_invert_2exp (mpz_t r, mpz_t a, unsigned long n)
{
  unsigned long  i;
  mpz_t  inv, prod;

  assert (mpz_odd_p (a));

  mpz_init_set_ui (inv, 1L);
  mpz_init (prod);

  for (i = 1; i < n; i++)
    {
      mpz_mul (prod, inv, a);
      if (mpz_tstbit (prod, i) != 0)
	mpz_setbit (inv, i);
    }

  mpz_mul (prod, inv, a);
  mpz_tdiv_r_2exp (prod, prod, n);
  assert (mpz_cmp_ui (prod, 1L) == 0);

  mpz_set (r, inv);

  mpz_clear (inv);
  mpz_clear (prod);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, -0x30(%rbp)
cmpl $0x0, 0x4(%rsi)
je 0x77d8
movq %rsi, %r15
movq 0x8(%rsi), %rax
movq (%rax), %rax
andl $0x1, %eax
je 0x77d8
movq %rdx, %r14
pushq $0x1
popq %rbx
leaq -0x50(%rbp), %r12
movl %ebx, (%r12)
pushq $0x8
popq %rdi
callq *0x796f(%rip)           # 0xf098
movq %rax, 0x8(%r12)
pushq $0x1
popq %r13
movq %r13, (%rax)
movl %ebx, 0x4(%r12)
leaq -0x40(%rbp), %rbx
movq %r13, (%rbx)
pushq $0x8
popq %rdi
callq *0x794e(%rip)           # 0xf098
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2f54
cmpq %r14, %r13
jae 0x7780
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6059
testl %eax, %eax
je 0x777b
movq %r12, %rdi
movq %r13, %rsi
callq 0x496f
incq %r13
jmp 0x774e
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3afd
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x292a
testl %eax, %eax
jne 0x77f5
leaq -0x50(%rbp), %rbx
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x2236
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq *0x78eb(%rip)           # 0xf0a8
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq *0x78df(%rip)           # 0xf0a8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2297(%rip), %rdi      # 0x9a76
leaq 0x221e(%rip), %rsi      # 0x9a04
leaq 0x2297(%rip), %rcx      # 0x9a84
pushq $0x74
popq %rdx
callq 0x1090
leaq 0x22cc(%rip), %rdi      # 0x9ac8
leaq 0x2201(%rip), %rsi      # 0x9a04
leaq 0x227a(%rip), %rcx      # 0x9a84
movl $0x82, %edx
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./bootstrap.c
// Function: mpz_invert_ui_2exp
void
mpz_invert_ui_2exp (mpz_t r, unsigned long a, unsigned long n)
{
  mpz_t  az;
  mpz_init_set_ui (az, a);
  mpz_invert_2exp (r, az, n);
  mpz_clear (az);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movl $0x1, -0x30(%rbp)
pushq $0x8
popq %rdi
callq *0x785c(%rip)           # 0xf098
movq %rax, %r14
movq %rax, -0x28(%rbp)
testq %r12, %r12
je 0x7850
movq %r12, (%r14)
pushq $0x1
popq %rax
jmp 0x7852
xorl %eax, %eax
leaq -0x30(%rbp), %rsi
movl %eax, 0x4(%rsi)
movq %r15, %rdi
movq %rbx, %rdx
callq 0x76e0
movq 0x783d(%rip), %rax      # 0xf0a8
movq %r14, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/gen-fac.c
// Function: main
int
main (int argc, char *argv[])
{
  int nail_bits, limb_bits, numb_bits;

  if (argc != 3)
    {
      fprintf (stderr, "Usage: gen-fac limbbits nailbits\n");
      exit (1);
    }
  limb_bits = atoi (argv[1]);
  nail_bits = atoi (argv[2]);
  numb_bits = limb_bits - nail_bits;
  if (limb_bits < 2 || nail_bits < 0 || numb_bits < 1)
    {
      fprintf (stderr, "Invalid limb/nail bits %d,%d\n", limb_bits,
	       nail_bits);
      exit (1);
    }
  gen_consts (numb_bits, nail_bits, limb_bits);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x3, %edi
jne 0x816c
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x10d0
movl %eax, %ebx
movq 0x10(%r14), %rdi
callq 0x10d0
cmpl $0x2, %ebx
jl 0x818a
testl %eax, %eax
js 0x818a
movl %ebx, %edi
subl %eax, %edi
testl %edi, %edi
jle 0x818a
callq 0x78a8
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x6e85(%rip), %rax      # 0xeff8
movq (%rax), %rcx
leaq 0x1d55(%rip), %rdi      # 0x9ed2
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x10f0
jmp 0x81a6
movq 0x6e67(%rip), %rcx      # 0xeff8
movq (%rcx), %rdi
leaq 0x1d59(%rip), %rsi      # 0x9ef4
movl %ebx, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x10a0
pushq $0x1
popq %rdi
callq 0x10e0
// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpn_limb_get_str
static size_t
mpn_limb_get_str (unsigned char *sp, mp_limb_t w,
		  const struct gmp_div_inverse *binv)
{
  mp_size_t i;
  for (i = 0; w > 0; i++)
    {
      mp_limb_t h, l, r;

      h = w >> (GMP_LIMB_BITS - binv->shift);
      l = w << binv->shift;

      gmp_udiv_qrnnd_preinv (w, r, h, l, binv->d1, binv->di);
      assert ( (r << (GMP_LIMB_BITS - binv->shift)) == 0);
      r >>= binv->shift;

      sp[i] = r;
    }
  return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %eax, %eax
movabsq $0x100000000, %r10      # imm = 0x100000000
testq %rsi, %rsi
je 0x82a3
movl (%rdx), %r8d
movl %r8d, %r9d
negb %r9b
movq %rsi, %r11
movl %r9d, %ecx
shrq %cl, %r11
movl %r8d, %ecx
shlq %cl, %rsi
movq 0x18(%rdx), %r15
movq %r11, %rbx
shrq $0x20, %rbx
movl %r15d, %r14d
shrq $0x20, %r15
movl %r11d, %ecx
movq %rcx, %r12
imulq %r14, %r12
imulq %r15, %rcx
imulq %rbx, %r14
imulq %rbx, %r15
movl %r12d, %ebx
shrq $0x20, %r12
addq %r14, %rcx
addq %r12, %rcx
leaq (%r15,%r10), %r12
cmpq %r14, %rcx
cmovaeq %r15, %r12
movq %rcx, %r14
shrq $0x20, %r14
shlq $0x20, %rcx
orq %rcx, %rbx
addq %rsi, %rbx
leaq 0x1(%r11,%r14), %r11
adcq %r12, %r11
movq 0x8(%rdx), %r14
movq %r11, %rcx
imulq %r14, %rcx
subq %rcx, %rsi
cmpq %rbx, %rsi
movl $0x0, %r12d
cmovaq %r14, %r12
addq %rsi, %r12
cmpq %r14, %r12
movl $0x0, %ecx
cmovaeq %r14, %rcx
movq %r12, %r15
subq %rcx, %r15
movq %r15, %r13
movl %r9d, %ecx
shlq %cl, %r13
testq %r13, %r13
jne 0x82b2
cmpq %rsi, %rbx
sbbq $0x0, %r11
cmpq %r14, %r12
sbbq $-0x1, %r11
movl %r8d, %ecx
shrq %cl, %r15
movb %r15b, (%rdi,%rax)
incq %rax
movq %r11, %rsi
jmp 0x81c8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d58(%rip), %rdi      # 0xa011
leaq 0xda4(%rip), %rsi       # 0x9064
leaq 0x1d74(%rip), %rcx      # 0xa03b
movl $0x4b0, %edx            # imm = 0x4B0
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/test1.cpp
// Function: main
int main()
{
    CoroOptions opt;
    opt.share_stack_count = 1;
    SchedulerManager::CreateSingleton(opt);
    for (int i = 0; i < 1000; i++)
    {
        StartCoro(testFunc, NULL);
    }

    sleep(100);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
leaq 0x28(%rsp), %rdi
movb $0x1, (%rdi)
movaps 0x3ac1(%rip), %xmm0     # 0x6010
movups %xmm0, 0x4(%rdi)
andq $0x0, 0x20(%rdi)
movabsq $-0xffffffff, %rax      # imm = 0xFFFFFFFF00000001
movq %rax, 0x14(%rdi)
callq 0x3ee4
movl $0x3e8, %ebp            # imm = 0x3E8
leaq 0x6d(%rip), %r14        # 0x25e4
leaq 0x1c0(%rip), %r15       # 0x273e
leaq 0x1c1(%rip), %r12       # 0x2746
leaq 0x8(%rsp), %rbx
subl $0x1, %ebp
jb 0x25b8
andq $0x0, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r15, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x404d
movq %rbx, %rdi
callq 0x2716
jmp 0x258a
pushq $0x64
popq %rdi
callq 0x2170
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2716
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/test1.cpp
// Function: testFunc(void*)
static void testFunc(void *data)
{
    CoroPtr self = CoroSelf();
    printf("###testFunc:%d\n", self->id);
    CoroSleep(2000);
    printf("###testFunc:%d after 2000\n", self->id);
    auto f = [](void* data)
    {
        CoroPtr self = CoroSelf();
        printf("###subrun:%d\n", self->id);
        int32_t sleep_ms = 2000 + 1000 - self->id;
        int64_t start = mstime();
        CoroSleep(sleep_ms);
        printf("###subTestFunc:%d after %lldms actual %lldms\n", self->id, sleep_ms, mstime() - start);
    };
    auto cid = StartCoro(f, NULL);
    printf("###Join coro:%d\n", cid);
    JoinCoro(cid);
    printf("###Join coro done:%d\n", cid);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
callq 0x3e98
movq %rax, %rbx
movq 0x10(%rax), %rsi
leaq 0x3a24(%rip), %rdi      # 0x6020
xorl %eax, %eax
callq 0x2050
movl $0x7d0, %edi            # imm = 0x7D0
callq 0x410c
movq 0x10(%rbx), %rsi
leaq 0x3a18(%rip), %rdi      # 0x6030
xorl %eax, %eax
callq 0x2050
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
leaq 0x65(%rip), %rax        # 0x2694
movq %rax, 0x18(%rdi)
leaq 0xc4(%rip), %rax        # 0x26fe
movq %rax, 0x10(%rdi)
xorl %esi, %esi
callq 0x404d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2716
leaq 0x39f4(%rip), %rdi      # 0x604b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x40a4
leaq 0x39ec(%rip), %rdi      # 0x605c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2716
movq %rbx, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::LibCoroCoroutine::LibCoroCoroutine(coroxx::CoroOptions const&, bool)
LibCoroCoroutine::LibCoroCoroutine(const CoroOptions& opt, bool main)
            : stack(NULL), id(0), ctx_inited(false), waiting(false), save_buffer(NULL), save_buffer_size(0), stack_sp(
            NULL)
    {
        id = g_coro_id_seed++;
        data_ctx.coro = this;

        g_create_mutex.Lock();
        if (main)
        {
            coro_create(&ctx, NULL, NULL, NULL, 0);
            ctx_inited = true;
        }
        g_create_mutex.Unlock();
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
andw $0x0, 0x48(%rdi)
movups %xmm0, 0x50(%rdi)
andq $0x0, 0x60(%rdi)
movq 0x7a77(%rip), %rax      # 0xa210
leaq 0x1(%rax), %rcx
movq %rcx, 0x7a6c(%rip)      # 0xa210
movq %rax, 0x10(%rdi)
movq %rdi, 0x40(%rdi)
leaq 0x7a2d(%rip), %rdi      # 0xa1e0
callq 0x2c04
testl %ebp, %ebp
je 0x27d1
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x59f1
movb $0x1, 0x48(%rbx)
leaq 0x7a08(%rip), %rdi      # 0xa1e0
popq %rbx
popq %r14
popq %rbp
jmp 0x2c16
movq %rax, %r14
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x2716
movq %r14, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::LibCoroCoroutine::SaveStackBuffer()
void LibCoroCoroutine::SaveStackBuffer()
    {
        if (NULL != stack && stack->shared && NULL != stack_sp)
        {
            if (NULL != save_buffer)
            {
                free(save_buffer);
            }
            save_buffer = malloc(save_buffer_size);
            memcpy(save_buffer, stack_sp, save_buffer_size);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2844
cmpb $0x1, 0x18(%rax)
jne 0x2844
movq %rdi, %rbx
cmpq $0x0, 0x60(%rdi)
je 0x2844
movq 0x50(%rbx), %rdi
callq 0x2210
movq 0x58(%rbx), %r14
movq %r14, %rdi
callq 0x2250
movq %rax, 0x50(%rbx)
movq 0x60(%rbx), %rsi
movq %rax, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21a0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::LibCoroCoroutine::ResumeStackBuffer()
void LibCoroCoroutine::ResumeStackBuffer()
    {
        if (NULL != save_buffer && NULL != stack && stack->shared)
        {
            memcpy(stack_sp, save_buffer, save_buffer_size);
            free(save_buffer);
            save_buffer = NULL;
            stack_sp = NULL;
            save_buffer_size = 0;

        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x50(%rdi), %rsi
testq %rsi, %rsi
je 0x2891
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2891
cmpb $0x1, 0x18(%rax)
jne 0x2891
leaq 0x50(%rbx), %r14
movq 0x58(%rbx), %rdx
movq 0x60(%rbx), %rdi
callq 0x21a0
movq 0x50(%rbx), %rdi
callq 0x2210
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::LibCoroCoroutine::~LibCoroCoroutine()
LibCoroCoroutine::~LibCoroCoroutine()
    {
        if (NULL != stack)
        {
            if (stack->shared)
            {
                if (stack->coro == this)
                {
                    stack->coro = NULL;
                }
            }
            else
            {
                delete stack;
            }
        }
        if (NULL != save_buffer)
        {
            free(save_buffer);
        }
        coro_destroy(&ctx);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x28f9
cmpb $0x1, 0x18(%r14)
jne 0x28e6
cmpq %rbx, 0x10(%r14)
jne 0x28f9
andq $0x0, 0x10(%r14)
jmp 0x28f9
movq %r14, %rdi
callq 0x2c28
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x21e0
movq 0x50(%rbx), %rdi
callq 0x2210
addq $0x18, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2716
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::LibCoroCoroutine::Yield(bool)
void LibCoroCoroutine::Yield(bool release_current)
    {
        CoroutineStack& coro_stack = getCoroEnv().coro_stack;
        LibCoroCoroutine* next = getCoroEnv().main;
        if (!coro_stack.empty())
        {
            next = coro_stack.top();
            coro_stack.pop();
        }
        next->Resume(release_current);

    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
callq 0x297a
movq %rax, %r14
callq 0x297a
movq 0x40(%r14), %rcx
cmpq 0x20(%r14), %rcx
je 0x2964
movq %r14, %rdi
addq $0x10, %rdi
cmpq 0x48(%r14), %rcx
jne 0x2959
movq 0x58(%r14), %rax
movl $0x200, %ecx            # imm = 0x200
addq -0x8(%rax), %rcx
movq -0x8(%rcx), %r14
callq 0x323a
jmp 0x2968
movq 0x8(%rax), %r14
movzbl %bl, %esi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2986
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::swapCoroFunc(void*)
static void swapCoroFunc(void* data)
    {
        while (1)
        {
            CoroEnv& coro_env = getCoroEnv();
            SwapContext& swap = coro_env.swap_ctx;
            swap.from->SaveStackBuffer();
            swap.to->ResumeStackBuffer();

            //printf("####%d resumex %d\n", swap.to->id,coro_env.current->id);
            coro_env.current = swap.to;
            coro_transfer(&(swap.swap_coro), &(swap.to->ctx));
        }
    }

// Assembly:
pushq %rbx
callq 0x297a
movq %rax, %rbx
movq 0x80(%rax), %rdi
callq 0x27f8
movq 0x88(%rbx), %rdi
callq 0x284c
movq 0x88(%rbx), %rsi
movq %rsi, (%rbx)
addq $0x90, %rbx
movq %rbx, %rdi
callq 0x59d4
jmp 0x2b59
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/./thread_mutex.h
// Function: coroxx::ThreadMutex::ThreadMutex(int)
ThreadMutex(int type = PTHREAD_MUTEX_DEFAULT)
			{
				pthread_mutexattr_t attr;
				pthread_mutexattr_init(&attr);
				pthread_mutexattr_settype(&attr, type);
				pthread_mutex_init(&m_mutex, &attr);
				pthread_mutexattr_destroy(&attr);
			}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7133(%rip), %rax      # 0x9ce8
movq %rax, (%rdi)
leaq 0xc(%rsp), %r15
movq %r15, %rdi
callq 0x2060
movq %r15, %rdi
movl %ebx, %esi
callq 0x2280
addq $0x8, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x22a0
movq %r15, %rdi
callq 0x2290
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::CoroEnv::GetCoroStack()
CoroStack* GetCoroStack()
            {
                if (share_stack_pool.size() < share_stack_count)
                {
                    CoroStack* s = new CoroStack(stack_size, true);
                    share_stack_pool.pool.push_back(s);
                    return s;
                }
                if (share_stack_pool.pool.empty())
                {
                    return new CoroStack(stack_size, false);
                }
                size_t idx = share_stack_pool.cursor;
                if (idx >= share_stack_pool.size())
                {
                    idx = 0;
                    share_stack_pool.cursor = 0;
                }
                share_stack_pool.cursor++;
                return share_stack_pool.pool[idx];
            }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x60(%rdi), %rax
movq 0x68(%rdi), %rdx
movq %rdx, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movl 0xb4(%rdi), %esi
cmpq %rsi, %rcx
jae 0x2c99
pushq $0x20
popq %rdi
callq 0x21d0
movq %rax, %r14
movl 0xb0(%rbx), %esi
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x3076
addq $0x60, %rbx
leaq 0x8(%rsp), %r15
movq %r14, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3084
movq (%r15), %r14
jmp 0x2cd7
cmpq %rdx, %rax
je 0x2cbc
movq 0x78(%rbx), %rdx
cmpq %rcx, %rdx
jb 0x2cae
andq $0x0, 0x78(%rbx)
xorl %edx, %edx
leaq 0x1(%rdx), %rcx
movq %rcx, 0x78(%rbx)
movq (%rax,%rdx,8), %r14
jmp 0x2cd7
pushq $0x20
popq %rdi
callq 0x21d0
movq %rax, %r14
movl 0xb0(%rbx), %esi
movq %rax, %rdi
xorl %edx, %edx
callq 0x3076
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2ce6
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::SwapContext::Init()
void Init()
            {
                if (inited)
                {
                    return;
                }
                coro_stack_alloc(&swap_stack, 0);
                coro_create(&swap_coro, swapCoroFunc, NULL, swap_stack.sptr, swap_stack.ssze);
                inited = true;
            }

// Assembly:
cmpb $0x0, 0x28(%rdi)
jne 0x2d30
pushq %rbx
movq %rdi, %rbx
addq $0x18, %rdi
xorl %esi, %esi
callq 0x5aa0
leaq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %r8
leaq -0x1cc(%rip), %rsi      # 0x2b58
xorl %edx, %edx
callq 0x59f1
movb $0x1, 0x28(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/./thread_local.h
// Function: coroxx::ThreadLocal<coroxx::CoroEnv>::GetValue()
T& GetValue()
			{
				T* local_thread_value = static_cast<T*>(pthread_getspecific(
				        m_key));
				if (NULL == local_thread_value)
				{
					T* newObj = InitialValue();
					pthread_setspecific(m_key, newObj);
					local_thread_value = newObj;
				}
				return *local_thread_value;
			}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x22c0
movq %rax, %r14
testq %rax, %rax
jne 0x2d73
movq %rbx, %rdi
callq 0x2d7e
movq %rax, %r14
movl (%rbx), %edi
movq %rax, %rsi
callq 0x2080
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::Run()
void Scheduler::Run()
    {
        g_current_scheduler.SetValue(this);
        InitCoroPool();
        sched_coro = new CoroType(options);
        sched_coro->ResetContext(Scheduler::RoutineFunc, this);
        sched_coro->Resume();
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x6d21(%rip), %rdi      # 0xa218
callq 0x43a0
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x3624
pushq $0x68
popq %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x1e0(%rbx), %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x2768
movq %r14, 0x1c8(%rbx)
leaq 0x8(%rsp), %rsi
andq $0x0, 0x8(%rsi)
leaq 0x3d1(%rip), %rax       # 0x390c
movq %rax, (%rsi)
leaq -0xe07(%rip), %rax      # 0x273e
movq %rax, 0x18(%rsi)
leaq -0xe0a(%rip), %rax      # 0x2746
movq %rax, 0x10(%rsi)
movq %r14, %rdi
addq $0x18, %rdi
movq %rbx, 0x38(%r14)
callq 0x43d6
leaq 0x8(%rsp), %rdi
callq 0x2716
movq 0x1c8(%rbx), %rdi
xorl %esi, %esi
callq 0x2986
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2716
jmp 0x35a1
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r14, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::Start()
int Scheduler::Start()
    {
        options.share_stack = CoroType::NewShareStack(options.share_stack_count, options.max_stack_size);
        if (options.create_thread)
        {
            pthread_attr_t attr;
            pthread_attr_init(&attr);
            if (0 != pthread_create(&tid, &attr, RunFunc, this))
            {
                return errno;
            }
        }
        else
        {
            g_current_scheduler.SetValue(this);
            InitCoroPool();
        }
        return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0x1e4(%rdi), %esi
movl 0x1f4(%rdi), %edi
callq 0x2b32
movq %rax, 0x200(%rbx)
cmpb $0x1, 0x1e0(%rbx)
jne 0x3603
movq %rsp, %r14
movq %r14, %rdi
callq 0x2230
leaq 0x70(%rbx), %rdi
leaq -0x127(%rip), %rdx      # 0x34c4
movq %r14, %rsi
movq %rbx, %rcx
callq 0x2350
testl %eax, %eax
je 0x361a
callq 0x2040
movl (%rax), %eax
jmp 0x361c
leaq 0x6c0e(%rip), %rdi      # 0xa218
callq 0x43a0
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x3624
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::GetCoroutineById(unsigned long)
CoroPtr Scheduler::GetCoroutineById(coro_id id)
    {
        CoroutineTable::iterator found = exec_table.find(id);
        if (found == exec_table.end())
        {
            return NULL;
        }
        return found->second;
    }

// Assembly:
pushq %rax
movq %rsp, %rax
movq %rsi, (%rax)
addq $0x38, %rdi
movq %rax, %rsi
callq 0x4af8
testq %rax, %rax
je 0x36d2
movq 0x10(%rax), %rax
jmp 0x36d4
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::CheckTimeQueue()
int64_t Scheduler::CheckTimeQueue()
    {
        while (!coro_time_queue.empty())
        {
            TimeCoroDiaptchDataQueue::iterator it = coro_time_queue.begin();
            CoroDiaptchDataQueue& queue = it->second;
            int64_t ts = it->first;
            int64_t now = currentMills();
            if (now < ts)
            {
                return ts - now;
            }
            //printf("###time queue size:%d\n", queue.size());
            for (size_t i = 0; i < queue.size(); i++)
            {
                CoroDiaptchData* data = queue[i];
                data->Invoke();
            }
            coro_time_queue.erase(it);
        }
        return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc8(%rdi), %r14
cmpq $0x0, 0xf0(%rbx)
je 0x3746
movq 0xe0(%rbx), %r15
movq 0x20(%r15), %r12
callq 0x375b
subq %rax, %r12
jg 0x3749
leaq 0x28(%r15), %r12
leaq 0x38(%r15), %r13
xorl %ebp, %ebp
movq %r12, %rdi
callq 0x41ea
cmpq %rax, %rbp
jae 0x3739
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4bac
movq (%rax), %rdi
callq 0x41fa
incq %rbp
jmp 0x3714
movq %r14, %rdi
movq %r15, %rsi
callq 0x4c4a
jmp 0x36eb
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::currentMills()
static int64_t currentMills()
    {
        struct timeval timeValue;
        gettimeofday(&timeValue, NULL);
        int64_t ts = ((int64_t) timeValue.tv_sec) * 1000;
        ts += ((timeValue.tv_usec) / 1000);
        return ts;
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2300
imulq $0x3e8, (%rbx), %rcx    # imm = 0x3E8
movq 0x8(%rbx), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
addq %rcx, %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::InvokeQueueSize()
uint32_t Scheduler::InvokeQueueSize()
    {
        uint32_t n = 0;
        coro_queue_mutex.Lock();
        n = coro_queue.size();
        coro_queue_mutex.Unlock();
        return n;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf8(%rdi), %r14
movq %r14, %rdi
callq 0x4264
addq $0x78, %rbx
movq %rbx, %rdi
callq 0x41ea
movq %rax, %rbx
movq %r14, %rdi
callq 0x4276
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::Routine(bool)
void Scheduler::Routine(bool wait)
    {
        CoroGC();
        while (1)
        {
            CoroDiaptchData* data = NULL;
            {
                coro_queue_mutex.Lock();
                if ((coro_queue.empty()) && wait)
                {
                    if (routine_wait_ms <= 0 || routine_wait_ms > 100)
                    {
                        routine_wait_ms = 10;
                    }
                    //printf("###before wait %d %lld\n", routine_wait_ms, nowMs());
                    coro_queue_mutex.Wait(routine_wait_ms);
                    //printf("###after wait %d %lld %d\n", routine_wait_ms, nowMs(), v);
                }
                if (!coro_queue.empty())
                {
                    data = coro_queue.front();
                    coro_queue.pop_front();
                }
                coro_queue_mutex.Unlock();
            }

            if (NULL == data)
            {
                routine_wait_ms = CheckTimeQueue();
                return;
            }
            else
            {
                data->Invoke();
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3890
leaq 0xf8(%rbx), %r14
leaq 0x78(%rbx), %r15
xorb $0x1, %bpl
pushq $0xa
popq %r13
movq %r14, %rdi
callq 0x4264
movq 0x88(%rbx), %rax
movq 0xa8(%rbx), %rcx
cmpq %rax, %rcx
setne %dl
orb %bpl, %dl
jne 0x3842
movq 0x1d0(%rbx), %rsi
leaq -0x65(%rsi), %rax
cmpq $-0x65, %rax
ja 0x382c
movq $0xa, 0x1d0(%rbx)
movq %r13, %rsi
movq %r14, %rdi
callq 0x4288
movq 0x88(%rbx), %rax
movq 0xa8(%rbx), %rcx
cmpq %rax, %rcx
je 0x3854
movq (%rax), %r12
movq %r15, %rdi
callq 0x4310
jmp 0x3857
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x4276
testq %r12, %r12
je 0x3871
movq %r12, %rdi
callq 0x41fa
jmp 0x37ec
movq %rbx, %rdi
callq 0x36d6
movq %rax, 0x1d0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::StartCoroAfter(std::function<void (void*)> const&, void*, long, bool)
int Scheduler::StartCoroAfter(const CoroutineFunction& func, void* data, int64_t wait_time, bool create_coro)
    {
        if (NULL == g_current_scheduler.GetValue())
        {
            return PushCoroTask(func, data, false, wait_time);
        }
        CoroDiaptchData* task = new CoroDiaptchData;
        task->call = func;
        task->data = data;
        task->create_coro = create_coro;
        AddTimeCoroTask(task, wait_time);
        return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x688b(%rip), %rdi      # 0xa218
callq 0x43a0
cmpq $0x0, (%rax)
je 0x39d4
pushq $0x30
popq %rdi
callq 0x21d0
movq %rax, %r13
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x19(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x43d6
movq %r14, 0x20(%r13)
movb %bpl, 0x28(%r13)
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x3922
jmp 0x39e7
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x39f8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::PushCoroTask(std::function<void (void*)> const&, void*, bool, long)
int Scheduler::PushCoroTask(const CoroutineFunction& func, void* data, bool create_coro, int64_t wait_time)
    {
        if (create_coro && IsOverload())
        {
            return -1;
        }
        CoroDiaptchData* task = new CoroDiaptchData;
        task->call = func;
        task->data = data;
        task->create_coro = create_coro;

        coro_queue_mutex.Lock();
        if (wait_time > 0)
        {
            AddTimeCoroTask(task, wait_time);
        }
        else
        {
            coro_queue.push_back(task);
            if (options.eventfd > 0)
            {
                int64_t ev = 1;
                ::write(options.eventfd, &ev, sizeof(ev));
            }
            else
            {
                coro_queue_mutex.Notify();
            }
        }
        coro_queue_mutex.Unlock();
        return 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movl %ecx, %ebx
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
pushq $0x30
popq %rdi
callq 0x21d0
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x19(%rax)
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x43d6
movq %r13, 0x20(%r12)
movb %bl, 0x28(%r12)
leaq 0xf8(%r14), %rbx
movq %rbx, %rdi
callq 0x4264
testq %r15, %r15
jle 0x3a6b
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3922
jmp 0x3aa2
leaq 0x78(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x437e
movl 0x1f8(%r14), %edi
testl %edi, %edi
jle 0x3a9a
leaq 0x10(%rsp), %rsi
movq $0x1, (%rsi)
pushq $0x8
popq %rdx
callq 0x20d0
jmp 0x3aa2
movq %rbx, %rdi
callq 0x4424
movq %rbx, %rdi
callq 0x4276
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::CreateCoroutine(std::function<void (void*)> const&, void*, bool)
CoroPtr Scheduler::CreateCoroutine(const CoroutineFunction& func, void* data, bool pool)
    {
        CoroPtr task = new CoroType(options);
        CoroutineDataContext& data_ctx = task->GetDataContext();
        CoroCallData* cdata = new CoroCallData;
        data_ctx.data = cdata;
        cdata->data = data;
        cdata->coro = task;
        cdata->func = func;
        cdata->scheduler = this;
        if (pool)
        {
            data_ctx.func = CoroutinePoolFunc;
        }
        else
        {
            data_ctx.func = CoroutineNonPoolFunc;
        }

        return task;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
pushq $0x68
popq %rdi
callq 0x21d0
movq %rax, %rbx
leaq 0x1e0(%r14), %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x2768
movq %rbx, %r13
addq $0x18, %r13
pushq $0x38
popq %rdi
callq 0x21d0
movq %rax, %rbp
leaq 0x10(%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
andq $0x0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movq %rax, 0x38(%rbx)
movq %r12, 0x8(%rax)
movq %rbx, (%rax)
movq %r15, %rsi
callq 0x43d6
movq %r14, 0x30(%rbp)
leaq 0x14b(%rip), %rax       # 0x3c7f
leaq 0x178(%rip), %rsi       # 0x3cb3
cmpb $0x0, 0x4(%rsp)
cmovneq %rax, %rsi
movq %r13, %rdi
callq 0x4472
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x68
popq %rsi
movq %rbx, %rdi
callq 0x21e0
movq %r14, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::CoroDone(coroxx::LibCoroCoroutine*, bool)
void Scheduler::CoroDone(CoroPtr coro, bool pool)
    {
        if (exec_table.erase(coro->id) > 0)
        {
            exec_coro_num--;
        }
        if (pool)
        {
            coro_pool.push_back(coro);
        }
        else
        {
            deleting_coros.push_back(coro);
        }

        /*
         * Wake join coroutine first
         */
        CoroutineTable::iterator jit = join_table.find(coro->id);
        if (jit != join_table.end())
        {
            CoroPtr waiting = jit->second;
            join_table.erase(jit);
            //printf("####Join Resume \n");
            waiting->Resume(true);
        }
        else
        {
            coro->Yield(true);
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
addq $0x38, %rdi
addq $0x10, %rsi
callq 0x52a4
testq %rax, %rax
je 0x3bb5
decq 0x1d8(%rbx)
testb %bpl, %bpl
je 0x3bcd
leaq 0x178(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3290
jmp 0x3bde
leaq 0x160(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4436
movq 0x8(%rsp), %rsi
addq $0x10, %rsi
movq %rbx, %rdi
callq 0x4af8
testq %rax, %rax
je 0x3c10
movq 0x10(%rax), %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x54ba
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x2986
jmp 0x3c1d
movq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x2922
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::GetCoroutine(std::function<void (void*)> const&, void*)
CoroPtr Scheduler::GetCoroutine(const CoroutineFunction& func, void* data)
    {
        if (coro_pool.empty())
        {
            return CreateCoroutine(func, data, false);
        }
        else
        {
            CoroPtr coro = coro_pool.front();
            coro_pool.pop_front();
            CoroutineDataContext& data_ctx = coro->GetDataContext();
            CoroCallData* cdata = (CoroCallData*) data_ctx.data;
            cdata->data = data;
            cdata->func = func;
            return coro;
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq 0x188(%rdi), %rax
cmpq %rax, 0x1a8(%rdi)
je 0x3c6d
addq $0x178, %rdi            # imm = 0x178
movq (%rax), %r15
callq 0x4454
movq 0x38(%r15), %rdi
movq %r14, 0x8(%rdi)
addq $0x10, %rdi
movq %rbx, %rsi
callq 0x43d6
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0x3abc
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::CoroutinePoolFunc(void*)
static void CoroutinePoolFunc(void* cdata)
    {
        CoroCallData* data = (CoroCallData*) cdata;
        Scheduler* scheduler = data->scheduler;
        CoroPtr coro = data->coro;
        while (1)
        {
            data->func(data->data);
            scheduler->CoroDone(coro, true);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x30(%rdi), %r15
leaq 0x10(%rdi), %r12
pushq $0x1
popq %rbp
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x31e6
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3b8a
jmp 0x3c98
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::StartCoro(std::function<void (void*)> const&, void*, bool)
coro_id Scheduler::StartCoro(const CoroutineFunction& func, void* data, bool create_coro)
    {
        //start from another thread
        if (NULL == g_current_scheduler.GetValue())
        {
            return PushCoroTask(func, data, create_coro, 0);
        }
        if (IsOverload())
        {
            return (coro_id) -1;
        }
        CoroGC();
        CoroPtr task = GetCoroutine(func, data);
        coro_id id = task->id;
        exec_table[id] = task;
        exec_coro_num++;
        Wakeup(task);
        return id;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x64ee(%rip), %rdi      # 0xa218
callq 0x43a0
cmpq $0x0, (%rax)
je 0x3d7f
movq %rbx, %rdi
callq 0x3890
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3c26
movq %rax, %r14
movq 0x10(%rax), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
leaq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x5540
movq %r14, (%rax)
incq 0x1d8(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x2986
movq (%r15), %r12
jmp 0x3d97
movzbl %bpl, %ecx
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x39f8
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::GetCoroById(unsigned long)
CoroPtr Scheduler::GetCoroById(coro_id id)
    {
        CoroutineTable::iterator found = exec_table.find(id);
        if (found != exec_table.end())
        {
            return found->second;
        }
        return NULL;
    }

// Assembly:
pushq %rax
movq %rsp, %rax
movq %rsi, (%rax)
addq $0x38, %rdi
movq %rax, %rsi
callq 0x4af8
testq %rax, %rax
je 0x3dc6
movq 0x10(%rax), %rax
jmp 0x3dc8
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::Join(unsigned long)
int Scheduler::Join(coro_id cid)
    {
        CoroutineTable::iterator it = exec_table.find(cid);
        if (it == exec_table.end())
        {
            return 0;
        }
        it = join_table.find(cid);
        if (it != join_table.end())
        {
            return -2;
        }
        CoroPtr current = CoroType::CurrentCoro();
        join_table[cid] = current;
        Wait(current);
        return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
addq $0x38, %rdi
movq %rax, %rsi
callq 0x4af8
xorl %ebx, %ebx
testq %rax, %rax
je 0x3e28
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4af8
testq %rax, %rax
je 0x3e08
pushq $-0x2
popq %rbx
jmp 0x3e28
callq 0x2b26
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x5540
movq %r15, (%rax)
movq %r15, %rdi
callq 0x2916
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::Scheduler::Join(unsigned long, unsigned long, unsigned long)
int Scheduler::Join(coro_id c1, coro_id c2, coro_id c3)
    {
        Join(c1);
        Join(c2);
        Join(c3);
        return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
callq 0x3dca
movq %r15, %rdi
movq %r14, %rsi
callq 0x3dca
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3dca
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::SchedulerManager::Singleton()
SchedulerManager& SchedulerManager::Singleton()
    {
        if (NULL == g_scheduler_manager)
        {
            CoroOptions opt;
            CreateSingleton(opt);
        }
        return *g_scheduler_manager;
    }

// Assembly:
movq 0x637b(%rip), %rax      # 0xa220
testq %rax, %rax
je 0x3eab
retq
subq $0x28, %rsp
movq %rsp, %rdi
movb $0x1, (%rdi)
movaps 0x2154(%rip), %xmm0     # 0x6010
movups %xmm0, 0x4(%rdi)
movabsq $-0xfffffff0, %rax      # imm = 0xFFFFFFFF00000010
movq %rax, 0x14(%rdi)
andq $0x0, 0x20(%rdi)
callq 0x3ee4
movq 0x6341(%rip), %rax      # 0xa220
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::SchedulerManager::CreateSingleton(coroxx::CoroOptions const&)
int SchedulerManager::CreateSingleton(const CoroOptions& opt)
    {
        if (NULL != g_scheduler_manager)
        {
            return -1;
        }
        g_scheduler_manager = new SchedulerManager(opt);
        return 0;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x6330(%rip)      # 0xa220
je 0x3ef7
pushq $-0x1
popq %rax
jmp 0x3f19
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x21d0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3f3c
movq %rbx, 0x6309(%rip)      # 0xa220
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x21e0
movq %r14, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::SchedulerManager::SchedulerManager(coroxx::CoroOptions const&)
SchedulerManager::SchedulerManager(const CoroOptions& opt)
    {
        for (uint32_t i = 0; i < opt.sheduler_num; i++)
        {
            Scheduler* s = new Scheduler(opt);
            schedulers_.push_back(s);
            schedulers_[i]->Start();
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movl 0x10(%r14), %eax
cmpq %rax, %r13
jae 0x3fa4
movl $0x208, %edi            # imm = 0x208
callq 0x21d0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x44c4
movq %r12, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x460e
movq (%rbx), %rax
movq (%rax,%r13,8), %rdi
callq 0x35aa
incq %r13
jmp 0x3f62
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x208, %esi            # imm = 0x208
movq %r12, %rdi
callq 0x21e0
jmp 0x3fc7
movq %rax, %r14
movq %rbx, %rdi
callq 0x585a
movq %r14, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::SchedulerManager::GetScheduler()
Scheduler& SchedulerManager::GetScheduler()
    {
        Scheduler* s = g_current_scheduler.GetValue();
        if (NULL != s)
        {
            return *s;
        }
        uint32_t min_coro_num = 0;
        uint32_t min_scheduler_idx = 0;
        SchedulerManager& singleton = SchedulerManager::Singleton();
        if (singleton.schedulers_.size() > 1)
        {
            for (size_t i = 0; i < singleton.schedulers_.size(); i++)
            {
                uint32_t numk = singleton.schedulers_[i]->GetCoroNum();
                if (0 == numk)
                {
                    min_scheduler_idx = i;
                    break;
                }
                if (numk < min_coro_num)
                {
                    min_coro_num = numk;
                    min_scheduler_idx = i;
                }
            }
        }
        return *(singleton.schedulers_[min_scheduler_idx]);
    }

// Assembly:
pushq %rax
leaq 0x6238(%rip), %rdi      # 0xa218
callq 0x43a0
movq (%rax), %rax
testq %rax, %rax
jne 0x4039
callq 0x3e9e
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x2, %rax
jb 0x402d
xorl %edx, %edx
cmpq %rdx, %rax
je 0x4031
movq (%rcx,%rdx,8), %rsi
movq 0x168(%rsi), %rdi
subq 0x160(%rsi), %rdi
shrq $0x3, %rdi
addl 0x50(%rsi), %edi
je 0x4033
incq %rdx
jmp 0x4008
xorl %eax, %eax
jmp 0x4035
xorl %edx, %edx
movl %edx, %eax
movq (%rcx,%rax,8), %rax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/scheduler.cpp
// Function: coroxx::CoroDiaptchData::Invoke()
void Invoke()
            {
                if (create_coro)
                {
                    StartCoro(CoroDiaptchData::InvokeFunc, this);
                }
                else
                {
                    CoroDiaptchData::InvokeFunc(this);
                }
            }

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rsi
cmpb $0x1, 0x28(%rdi)
jne 0x4243
movq %rsp, %rdi
andq $0x0, 0x8(%rdi)
leaq 0x5f7(%rip), %rax       # 0x480e
movq %rax, (%rdi)
leaq -0x1ae3(%rip), %rax     # 0x273e
movq %rax, 0x18(%rdi)
leaq -0x1ae6(%rip), %rax     # 0x2746
movq %rax, 0x10(%rdi)
callq 0x404d
movq %rsp, %rdi
callq 0x2716
addq $0x20, %rsp
popq %rbx
retq
movq %rsi, %rdi
addq $0x20, %rsp
popq %rbx
jmp 0x480e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2716
movq %rbx, %rdi
callq 0x2330
nop