// File: /workspace/github_cpp_makefile_star2_O2/yinqiwen[P]coroxx/libcoro.cpp
// Function: coroxx::LibCoroCoroutine::Resume(bool)
void LibCoroCoroutine::Resume(bool release_current)
    {
        CoroEnv& coro_env = getCoroEnv();
        CoroutineStack& coro_stack = getCoroEnv().coro_stack;
        LibCoroCoroutine* current = coro_env.current;
        coro_context* current_ctx = NULL;
        if (NULL == current)
        {
            if (NULL == coro_env.main)
            {
                CoroOptions opt;
                coro_env.main = new LibCoroCoroutine(opt, true);
            }
            current_ctx = &(coro_env.main->ctx);
        }
        else
        {
            current_ctx = &(current->ctx);
        }
        if (NULL != current && !current->waiting && !release_current)
        {
            coro_stack.push(current);
        }
        coro_env.current = this;
        waiting = false;
        if (NULL == stack && !ctx_inited)
        {
            stack = coro_env.GetCoroStack();
            //stack = new CoroStack(coro_env.stack_size, false);
        }

        LibCoroCoroutine* save_coro = NULL;
        if (NULL != stack && stack->coro && stack->coro != this)
        {
            save_coro = stack->coro;
            if (save_coro == current && release_current)
            {
                save_coro = NULL;
            }
        }
        if (NULL != stack)
        {
            stack->coro = this;
        }
//        if(NULL != save_coro)
//        {
//            //save_coro->MarkStackResumePoint();
//        }
        if (!ctx_inited)
        {
            g_create_mutex.Lock();
            coro_create(&ctx, LibCoroFunc, &data_ctx, stack->stack.sptr, stack->stack.ssze);
            g_create_mutex.Unlock();
            ctx_inited = true;
        }

        if (NULL != save_coro && current != save_coro)
        {
            save_coro->SaveStackBuffer();
        }
        if (NULL != current)
        {
            current->MarkStackResumePoint();
            if (current->stack == stack)
            {
                //printf("####WARN change current stack buffer for %d->%d\n", current->id, id);
                coro_env.swap_ctx.Init();
                coro_env.swap_ctx.from = current;
                coro_env.swap_ctx.to = this;
                coro_transfer(&(current->ctx), &(coro_env.swap_ctx.swap_coro));
                return;
            }
            ResumeStackBuffer();
        }
        coro_transfer(current_ctx, &ctx);

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x297a
movq %rax, %r14
callq 0x297a
movq (%r14), %r15
movq %r15, (%rsp)
testq %r15, %r15
je 0x29c9
movb 0x49(%r15), %cl
orb %bpl, %cl
jne 0x29ec
addq $0x10, %rax
movq %rsp, %rsi
movq %rax, %rdi
callq 0x3290
jmp 0x29ec
movq 0x8(%r14), %r15
testq %r15, %r15
jne 0x29ec
pushq $0x68
popq %rdi
callq 0x21d0
movq %rax, %r15
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x2768
movq %r15, 0x8(%r14)
movq %rbx, (%r14)
movb $0x0, 0x49(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2a2a
movq 0x10(%rax), %rcx
cmpq (%rsp), %rcx
sete %dl
andb %bpl, %dl
xorl %esi, %esi
testb $0x1, %dl
movq %rcx, %r12
cmovneq %rsi, %r12
cmpq %rbx, %rcx
cmoveq %rsi, %r12
testq %rcx, %rcx
cmoveq %rcx, %r12
movq %rbx, 0x10(%rax)
jmp 0x2a44
cmpb $0x0, 0x48(%rbx)
jne 0x2a41
movq %r14, %rdi
callq 0x2c38
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x29fc
xorl %r12d, %r12d
cmpb $0x0, 0x48(%rbx)
jne 0x2a83
leaq 0x778f(%rip), %r13      # 0xa1e0
movq %r13, %rdi
callq 0x2c04
leaq 0x18(%rbx), %rdx
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq 0xae(%rip), %rsi        # 0x2b1d
movq %rbx, %rdi
callq 0x59f1
movq %r13, %rdi
callq 0x2c16
movb $0x1, 0x48(%rbx)
testq %r12, %r12
sete %al
movq (%rsp), %rdi
cmpq %r12, %rdi
sete %cl
orb %al, %cl
jne 0x2aa3
movq %r12, %rdi
callq 0x27f8
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2ac3
callq 0x289a
movq (%rsp), %rax
movq 0x8(%rax), %rax
cmpq 0x8(%rbx), %rax
je 0x2acb
movq %rbx, %rdi
callq 0x284c
movq %r15, %rdi
movq %rbx, %rsi
jmp 0x2af3
leaq 0x80(%r14), %rdi
callq 0x2cfc
movq (%rsp), %rdi
movq %rdi, 0x80(%r14)
movq %rbx, 0x88(%r14)
addq $0x90, %r14
movq %r14, %rsi
callq 0x59d4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r15, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2330