LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWritex
static void fstWritex(struct fstReaderContext *xc, void *v, int len)
{
unsigned char *s = (unsigned char *)v;

if(len)
        {
        if(len < FST_WRITEX_MAX)
                {
                if(xc->writex_pos + len >= FST_WRITEX_MAX)
                        {
                        fstWritex(xc, NULL, 0);
                        }

                memcpy(xc->writex_buf + xc->writex_pos, s, len);
                xc->writex_pos += len;
                }
                else
                {
                fstWritex(xc, NULL, 0);
                if (write(xc->writex_fd, s, len)) { };
                }
        }
        else
        {
        if(xc->writex_pos)
                {
                if(write(xc->writex_fd, xc->writex_buf, xc->writex_pos)) { };
                xc->writex_pos = 0;
                }
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %edx, %edx
je 0xcf89
movl %edx, %r14d
movq %rsi, %r15
movl 0x698(%rbx), %eax
movslq %eax, %rdx
cmpl $0xffff, %r14d          # imm = 0xFFFF
jg 0xcfbc
leal (%rax,%r14), %ecx
cmpl $0x10000, %ecx          # imm = 0x10000
jl 0xcf68
movl 0x69c(%rbx), %edi
leaq 0x6a0(%rbx), %rsi
callq 0x20e0
movl $0x0, 0x698(%rbx)
xorl %eax, %eax
cltq
leaq (%rbx,%rax), %rdi
addq $0x6a0, %rdi            # imm = 0x6A0
movslq %r14d, %rdx
movq %r15, %rsi
callq 0x2240
addl %r14d, 0x698(%rbx)
jmp 0xcfb1
movslq 0x698(%rbx), %rdx
testq %rdx, %rdx
je 0xcfb1
movl 0x69c(%rbx), %edi
leaq 0x6a0(%rbx), %rsi
callq 0x20e0
movl $0x0, 0x698(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
je 0xcfdc
movl 0x69c(%rbx), %edi
leaq 0x6a0(%rbx), %rsi
callq 0x20e0
movl $0x0, 0x698(%rbx)
movl 0x69c(%rbx), %edi
movl %r14d, %edx
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderVarint32WithSkip
static uint32_t fstReaderVarint32WithSkip(FILE *f, uint32_t *skiplen)
{
unsigned char buf[5];
unsigned char *mem = buf;
uint32_t rc = 0;
int ch;

do
        {
        ch = fgetc(f);
        *(mem++) = ch;
        } while(ch & 0x80);
*skiplen = mem - buf;
mem--;

for(;;)
        {
        rc <<= 7;
        rc |= (uint32_t)(*mem & 0x7f);
        if(mem == buf)
                {
                break;
                }
        mem--;
        }

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x21a0
movb %al, -0x1d(%rbp,%r15)
incq %r15
testb %al, %al
js 0xd00a
movl %r15d, (%rbx)
xorl %eax, %eax
movl %eax, %ecx
shll $0x7, %ecx
movzbl -0x1e(%rbp,%r15), %eax
andl $0x7f, %eax
orl %ecx, %eax
decq %r15
jne 0xd023
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstExtractRvatDataFromFrame
static char *fstExtractRvatDataFromFrame(struct fstReaderContext *xc, fstHandle facidx, char *buf)
{
if(facidx >= xc->rvat_frame_maxhandle)
        {
        return(NULL);
        }

if(xc->signal_lens[facidx] == 1)
        {
        buf[0] = (char)xc->rvat_frame_data[xc->rvat_sig_offs[facidx]];
        buf[1] = 0;
        }
        else
        {
        if(xc->signal_typs[facidx] != FST_VT_VCD_REAL)
                {
                memcpy(buf, xc->rvat_frame_data + xc->rvat_sig_offs[facidx], xc->signal_lens[facidx]);
                buf[xc->signal_lens[facidx]] = 0;
                }
                else
                {
                double d;
                unsigned char *clone_d = (unsigned char *)&d;
                unsigned char *srcdata = xc->rvat_frame_data + xc->rvat_sig_offs[facidx];

                if(xc->double_endian_match)
                        {
                        memcpy(clone_d, srcdata, 8);
                        }
                        else
                        {
                        int j;

                        for(j=0;j<8;j++)
                                {
                                clone_d[j] = srcdata[7-j];
                                }
                        }

                sprintf((char *)buf, "%.16g", d);
                }
        }

return(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
cmpq %r15, 0x1e8(%rdi)
jbe 0xde65
movq %rdx, %rbx
movq %rdi, %r14
movq 0x50(%rdi), %rax
movl (%rax,%r15,4), %edx
cmpq $0x1, %rdx
jne 0xde75
movq 0x1e0(%r14), %rax
movq 0x210(%r14), %rcx
movl (%rcx,%r15,4), %ecx
movb (%rax,%rcx), %al
movb %al, (%rbx)
movb $0x0, 0x1(%rbx)
jmp 0xde67
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x58(%r14), %rax
cmpb $0x3, (%rax,%r15)
jne 0xdebc
movq 0x1e0(%r14), %rax
movq 0x210(%r14), %rcx
movl (%rcx,%r15,4), %ecx
testb $0x2, 0x7a(%r14)
jne 0xdee4
addq %rax, %rcx
addq $0x7, %rcx
xorl %edx, %edx
leaq -0x20(%rbp), %rax
movb (%rcx), %sil
movb %sil, -0x20(%rbp,%rdx)
incq %rdx
decq %rcx
cmpq $0x8, %rdx
jne 0xdea6
jmp 0xdee7
movq 0x210(%r14), %rax
movl (%rax,%r15,4), %esi
addq 0x1e0(%r14), %rsi
movq %rbx, %rdi
callq 0x2240
movq 0x50(%r14), %rax
movl (%rax,%r15,4), %eax
movb $0x0, (%rbx,%rax)
jmp 0xde67
addq %rcx, %rax
movsd (%rax), %xmm0
leaq 0x685e(%rip), %rsi      # 0x14750
movq %rbx, %rdi
movb $0x1, %al
callq 0x2370
jmp 0xde67
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSVarint
static int fstWriterSVarint(FILE *handle, int64_t v)
{
unsigned char buf[15]; /* ceil(64/7) = 10 + sign byte padded way up */
unsigned char byt;
unsigned char *pnt = buf;
int more = 1;
int len;

do      {
        byt = v | 0x80;
        v >>= 7;

        if (((!v) && (!(byt & 0x40))) || ((v == -1) && (byt & 0x40)))
                {
                more = 0;
                byt &= 0x7f;
                }

        *(pnt++) = byt;
        } while(more);

len = pnt-buf;
fstFwrite(buf, len, 1, handle);
return(len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, %rcx
leaq -0xf(%rbp), %rax
cmpq $0x40, %rsi
jb 0xe575
movl %esi, %edx
movq %rsi, %rdi
sarq $0x7, %rsi
cmpq $-0x1, %rsi
sete %r8b
andl $0x40, %edi
shrl $0x6, %edi
testb %dil, %r8b
jne 0xe573
orb $-0x80, %dl
movb %dl, (%rax)
incq %rax
movl %esi, %edx
cmpq $0x3f, %rsi
ja 0xe547
jmp 0xe575
movl %edx, %esi
andb $0x7f, %sil
movb %sil, (%rax)
leaq -0xf(%rbp), %rdi
subl %edi, %eax
incl %eax
movslq %eax, %rsi
movl $0x1, %edx
callq 0x2390
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/lz4.c
// Function: LZ4_compress_destSize
int LZ4_compress_destSize(const char* src, char* dst, int* srcSizePtr, int targetDstSize)
{
#if (HEAPMODE)
    void* ctx = ALLOCATOR(1, sizeof(LZ4_stream_t));   /* malloc-calloc always properly aligned */
#else
    LZ4_stream_t ctxBody;
    void* ctx = &ctxBody;
#endif

    int result = LZ4_compress_destSize_extState(ctx, src, dst, srcSizePtr, targetDstSize);

#if (HEAPMODE)
    FREEMEM(ctx);
#endif
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4028, %rsp           # imm = 0x4028
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq -0x4048(%rbp), %rdi
xorl %r13d, %r13d
movl $0x4020, %edx           # imm = 0x4020
xorl %esi, %esi
callq 0x2190
movl (%r15), %ecx
cmpl $0x7e000000, %ecx       # imm = 0x7E000000
ja 0xe63b
movl %ecx, %eax
movl $0x80808081, %edx       # imm = 0x80808081
imulq %rax, %rdx
shrq $0x27, %rdx
leal (%rcx,%rdx), %r13d
addl $0x10, %r13d
leaq -0x4048(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rdx
cmpl %ebx, %r13d
jle 0xe686
cmpl $0x1000a, %ecx          # imm = 0x1000A
jg 0xe663
movq %r15, %rcx
movl %ebx, %r8d
movl $0x2, %r9d
jmp 0xe66f
movq %r15, %rcx
movl %ebx, %r8d
movl $0x1, %r9d
callq 0x1362b
addq $0x4028, %rsp           # imm = 0x4028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %r8d
movl $0x1, %r9d
callq 0x2b9b
jmp 0xe674
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/lz4.c
// Function: LZ4_loadDict
int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize)
{
    LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict;
    const BYTE* p = (const BYTE*)dictionary;
    const BYTE* const dictEnd = p + dictSize;
    const BYTE* base;

    if ((dict->initCheck) || (dict->currentOffset > 1 GB))  /* Uninitialized structure, or reuse overflow */
        LZ4_resetStream(LZ4_dict);

    if (dictSize < (int)HASH_UNIT)
    {
        dict->dictionary = NULL;
        dict->dictSize = 0;
        return 0;
    }

    if ((dictEnd - p) > 64 KB) p = dictEnd - 64 KB;
    dict->currentOffset += 64 KB;
    base = p - dict->currentOffset;
    dict->dictionary = p;
    dict->dictSize = (U32)(dictEnd - p);
    dict->currentOffset += dict->dictSize;

    while (p <= dictEnd-HASH_UNIT)
    {
        LZ4_putPosition(p, dict->hashTable, byU32, base);
        p+=3;
    }

    return dict->dictSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x4004(%rdi)
jne 0xe6e4
movl 0x4000(%rbx), %r12d
cmpl $0x40000001, %r12d      # imm = 0x40000001
jb 0xe6f6
xorl %r12d, %r12d
movl $0x4020, %edx           # imm = 0x4020
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2190
cmpl $0x7, %r15d
jg 0xe715
movq $0x0, 0x4008(%rbx)
movl $0x0, 0x4018(%rbx)
xorl %eax, %eax
jmp 0xe78a
movslq %r15d, %rcx
addq %r14, %rcx
leaq -0x10000(%rcx), %rdx
cmpl $0x10001, %r15d         # imm = 0x10001
cmovbq %r14, %rdx
movq %rdx, 0x4008(%rbx)
movl %ecx, %eax
subl %edx, %eax
movl %eax, 0x4018(%rbx)
leal (%r12,%rax), %esi
addl $0x10000, %esi          # imm = 0x10000
movl %esi, 0x4000(%rbx)
addq $-0x8, %rcx
cmpq %rcx, %rdx
ja 0xe78a
addl $0x10000, %r12d         # imm = 0x10000
movabsq $0xcf1bbcdcbb, %rsi     # imm = 0xCF1BBCDCBB
movq (%rdx), %rdi
imulq %rsi, %rdi
shrq $0x1c, %rdi
andl $0xfff, %edi            # imm = 0xFFF
movl %r12d, (%rbx,%rdi,4)
addq $0x3, %rdx
addl $0x3, %r12d
cmpq %rcx, %rdx
jbe 0xe768
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/lz4.c
// Function: LZ4_renormDictT
static void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, const BYTE* src)
{
    if ((LZ4_dict->currentOffset > 0x80000000) ||
        ((size_t)LZ4_dict->currentOffset > (size_t)src))   /* address space overflow */
    {
        /* rescale hash table */
        U32 delta = LZ4_dict->currentOffset - 64 KB;
        const BYTE* dictEnd = LZ4_dict->dictionary + LZ4_dict->dictSize;
        int i;
        for (i=0; i<HASH_SIZE_U32; i++)
        {
            if (LZ4_dict->hashTable[i] < delta) LZ4_dict->hashTable[i]=0;
            else LZ4_dict->hashTable[i] -= delta;
        }
        LZ4_dict->currentOffset = 64 KB;
        if (LZ4_dict->dictSize > 64 KB) LZ4_dict->dictSize = 64 KB;
        LZ4_dict->dictionary = dictEnd - LZ4_dict->dictSize;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4000(%rdi), %ecx
movl $0x80000001, %eax       # imm = 0x80000001
cmpq %rax, %rcx
setb %al
cmpq %rsi, %rcx
setbe %dl
testb %dl, %al
jne 0xff36
addl $0xffff0000, %ecx       # imm = 0xFFFF0000
movq 0x4008(%rdi), %rax
movl 0x4018(%rdi), %edx
xorl %esi, %esi
xorl %r8d, %r8d
movl (%rdi,%r8,4), %r9d
subl %ecx, %r9d
cmovbl %esi, %r9d
movl %r9d, (%rdi,%r8,4)
incq %r8
cmpq $0x1000, %r8            # imm = 0x1000
jne 0xfee5
addq %rdx, %rax
movl $0x10000, 0x4000(%rdi)  # imm = 0x10000
movl 0x4018(%rdi), %ecx
cmpl $0x10001, %ecx          # imm = 0x10001
jb 0xff2a
movl $0x10000, 0x4018(%rdi)  # imm = 0x10000
movl $0x10000, %ecx          # imm = 0x10000
movl %ecx, %ecx
subq %rcx, %rax
movq %rax, 0x4008(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/lz4.c
// Function: LZ4_count
static unsigned LZ4_count(const BYTE* pIn, const BYTE* pMatch, const BYTE* pInLimit)
{
    const BYTE* const pStart = pIn;

    while (likely(pIn<pInLimit-(STEPSIZE-1)))
    {
        size_t diff = LZ4_read_ARCH(pMatch) ^ LZ4_read_ARCH(pIn);
        if (!diff) { pIn+=STEPSIZE; pMatch+=STEPSIZE; continue; }
        pIn += LZ4_NbCommonBytes(diff);
        return (unsigned)(pIn - pStart);
    }

    if (LZ4_64bits()) if ((pIn<(pInLimit-3)) && (LZ4_read32(pMatch) == LZ4_read32(pIn))) { pIn+=4; pMatch+=4; }
    if ((pIn<(pInLimit-1)) && (LZ4_read16(pMatch) == LZ4_read16(pIn))) { pIn+=2; pMatch+=2; }
    if ((pIn<pInLimit) && (*pMatch == *pIn)) pIn++;
    return (unsigned)(pIn - pStart);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq -0x7(%rdx), %rcx
movq %rdi, %rax
cmpq %rdi, %rcx
jbe 0x135d7
movq (%rsi), %r8
movq (%rax), %r9
cmpq %r9, %r8
jne 0x1361a
addq $0x8, %rax
addq $0x8, %rsi
cmpq %rcx, %rax
jb 0x135bf
leaq -0x3(%rdx), %rcx
cmpq %rcx, %rax
jae 0x135ee
movl (%rsi), %ecx
cmpl (%rax), %ecx
jne 0x135ee
addq $0x4, %rax
addq $0x4, %rsi
leaq -0x1(%rdx), %rcx
cmpq %rcx, %rax
jae 0x13607
movzwl (%rsi), %ecx
cmpw (%rax), %cx
jne 0x13607
addq $0x2, %rax
addq $0x2, %rsi
cmpq %rdx, %rax
jae 0x13627
movb (%rsi), %cl
xorl %edx, %edx
cmpb (%rax), %cl
sete %dl
addq %rdx, %rax
jmp 0x13627
xorq %r8, %r9
bsfq %r9, %rcx
shrl $0x3, %ecx
addq %rcx, %rax
subl %edi, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/chan.c
// Function: Producer
void Producer(void *ptr){
    channel_t ch = *(int *)ptr;
    int o = 0;
    int i = 0;
    for (i = 0; i<10; i++){
        o++;
        if (channel_write(ch, (void *)&o) != 0){
            printf("channel brokern,Producer exit\n");
            break;
        }
        uvc_sleep(100);
    }
    printf("Producer send over\n");
    channel_close(ch);
    uvc_return();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl (%rdi), %ebx
leaq 0xc(%rsp), %r14
movl $0x0, (%r14)
movl $0xa, %ebp
incl 0xc(%rsp)
movl %ebx, %edi
movq %r14, %rsi
callq 0x2727
testl %eax, %eax
jne 0x13e9
movl $0x64, %edi
callq 0x1857
decl %ebp
jne 0x13c7
jmp 0x13f5
leaq 0x2c38(%rip), %rdi      # 0x4028
callq 0x1070
leaq 0x2c4a(%rip), %rdi      # 0x4046
callq 0x1070
movl %ebx, %edi
callq 0x24bb
xorl %eax, %eax
callq 0x164f
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/chan.c
// Function: Consumer
void Consumer(void *ptr){
    
    channel_t ch = *(int *)ptr;
    int o = 0;
    while(1){
        if (channel_read(ch, (void *)&o) != 0){
            printf("channel brokern,Consumer exit\n");
            break;
        }
        printf("Consumer read %d\n",o);
    }
    printf("Consumer recv over\n");
    uvc_return();

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl (%rdi), %ebx
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
movl %ebx, %edi
callq 0x290e
testl %eax, %eax
jne 0x1461
leaq 0x2bc4(%rip), %r14      # 0x4004
leaq 0xc(%rsp), %r15
movl 0xc(%rsp), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1120
movl %ebx, %edi
movq %r15, %rsi
callq 0x290e
testl %eax, %eax
je 0x1445
leaq 0x2bf1(%rip), %rdi      # 0x4059
callq 0x1070
leaq 0x2c03(%rip), %rdi      # 0x4077
callq 0x1070
xorl %eax, %eax
callq 0x164f
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/chan.c
// Function: main
int main(){
    channel_t ch;
    ch = channel_create(0, sizeof(int));
    uvc_create("Producer",10 * 1024, Producer, (void *)&ch);
    uvc_create("Consumer",10 * 1024, Consumer, (void *)&ch);
    uvc_schedule();
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %edi, %edi
movl $0x4, %esi
callq 0x23be
leaq 0xc(%rsp), %rbx
movl %eax, (%rbx)
leaq 0x2b6d(%rip), %rdi      # 0x4016
leaq -0x104(%rip), %rdx      # 0x13ac
movl $0x2800, %esi           # imm = 0x2800
movq %rbx, %rcx
callq 0x17ae
leaq 0x2b5b(%rip), %rdi      # 0x401f
leaq -0xb3(%rip), %rdx       # 0x1418
movl $0x2800, %esi           # imm = 0x2800
movq %rbx, %rcx
callq 0x17ae
xorl %eax, %eax
callq 0x1537
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_task_uv
void uvc_task_uv(void *ptr){
	uvc_thread_env *env = uvc_get_env();
	env->uv_task = uvc_self();
	uv_run(env->loop, UV_RUN_DEFAULT);
	env->uv_task = NULL;
	uvc_return();
}

// Assembly:
pushq %rbx
callq 0x2fcb
movq %rax, %rbx
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, 0x140b8(%rbx)
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x12a0
movq $0x0, 0x140b8(%rbx)
popq %rbx
jmp 0x164f
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_schedule
void uvc_schedule(){
	uvc_ctx *ctx;
	queue_t *node;
	uvc_thread_env *env;
	env = uvc_get_env();
	for (;;){
		if (!queue_empty(&env->ready_queue) ){
			node = queue_last(&env->ready_queue);
			queue_remove( node);
			ctx = queue_data(node, uvc_ctx, task_node);
		}
		else{
			//只有当没有ready任务时才运行uvloop
			if (env->uv_task){
				ctx = env->uv_task;
			}
			else{
				printf("no task need run ,exit\n");
				exit(0);
			}
		}
		
		if (ctx != NULL){
			env->runing_task = ctx;
			ctx->status = UVC_STATUS_RUNING;
			//printf("task[%s] runing\n",ctx->name);
			uvc_resume(ctx);
			//printf("task[%s] stoping\n",ctx->name);
		}
		if (ctx->status == UVC_STATUS_DIE){
			coro_stack_free(&ctx->stack);
			free(ctx);
		}else{
			ctx->status = UVC_STATUS_PENDING;
		}
		

	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x2fcb
movq %rax, %rbx
movq %rax, %r15
addq $0x140d0, %r15          # imm = 0x140D0
movl $0x3, %ebp
movq (%r15), %r14
cmpq %r14, %r15
je 0x1574
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
addq $-0x118, %r14           # imm = 0xFEE8
jmp 0x1580
movq 0x140b8(%rbx), %r14
testq %r14, %r14
je 0x15e2
movq %r14, 0x140c8(%rbx)
movl %ebp, 0x130(%r14)
callq 0x2fcb
movl %ebp, 0x130(%r14)
movq %r14, 0x140c8(%rax)
movq 0x140c0(%rax), %rdi
addq $0x48, %rdi
leaq 0x48(%r14), %rsi
callq 0x30b0
cmpl $0x4, 0x130(%r14)
jne 0x15d2
leaq 0x50(%r14), %rdi
callq 0x32ad
movq %r14, %rdi
callq 0x1030
jmp 0x1555
movl $0x1, 0x130(%r14)
jmp 0x1555
leaq 0x2b39(%rip), %rdi      # 0x4122
callq 0x1070
xorl %edi, %edi
callq 0x1270
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_resume
void uvc_resume(uvc_ctx *ctx){
	uvc_thread_env *env=uvc_get_env();
	ctx->status = UVC_STATUS_RUNING;
	env->runing_task = ctx;
	RESUME(env, ctx);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2fcb
movl $0x3, 0x130(%rbx)
movq %rbx, 0x140c8(%rax)
movq 0x140c0(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rbx
movq %rbx, %rsi
popq %rbx
jmp 0x30b0
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_return
void uvc_return(){
	uvc_ctx *ctx=uvc_self();
	uvc_thread_env *env = uvc_get_env();
	env->runing_task->status= UVC_STATUS_DIE;
	printf("task[%s] exit\n",uvc_ctx_get_name());
	YIELD(env);
	//TODO 当前协程先出栈，然后resume到专门释放协程的协程。
}

// Assembly:
pushq %rbx
callq 0x2fcb
callq 0x2fcb
movq %rax, %rbx
movq 0x140c8(%rax), %rax
movl $0x4, 0x130(%rax)
callq 0x2fcb
movq 0x140c8(%rax), %rsi
leaq 0x2a09(%rip), %rdi      # 0x408a
xorl %eax, %eax
callq 0x1120
movq 0x140c0(%rbx), %rsi
movq 0x140c8(%rbx), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
popq %rbx
jmp 0x30b0
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_switch
void uvc_switch(uvc_ctx *prev, uvc_ctx *next){
	printf("[switch]  %s  ->  %s\n", prev->name, next->name);
	uvc_thread_env *env = uvc_get_env();
	next->status = UVC_STATUS_RUNING;
	prev->status = UVC_STATUS_READY;
	env->runing_task = next;
	coro_transfer(&prev->cur, &next->cur);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2933(%rip), %rdi      # 0x4099
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1120
callq 0x2fcb
movl $0x3, 0x130(%rbx)
movl $0x2, 0x130(%r14)
movq %rbx, 0x140c8(%rax)
addq $0x48, %r14
addq $0x48, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x30b0
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_create
void uvc_create(char *name, unsigned int size, coro_func func, void *arg){
	uvc_ctx *ctx = (uvc_ctx *)malloc(sizeof(uvc_ctx));
	memset(ctx, 0, sizeof(uvc_ctx));
	//ctx->data=arg;
	coro_stack_alloc(&ctx->stack, size);
	coro_create(&ctx->cur, func, arg, ctx->stack.sptr, ctx->stack.ssze);
	if (name == NULL || strlen(name) == 0){
		sprintf(ctx->name, "coro");
	}
	else{
		sprintf(ctx->name, name);
	}
	uvc_ready(ctx);
	//uvc_resume(ctx);

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x140, %esi            # imm = 0x140
callq 0x1190
movq %rax, %rbx
leaq 0x50(%rax), %rdi
movl %ebp, %esi
callq 0x317c
leaq 0x48(%rbx), %rdi
movq 0x50(%rbx), %rcx
movq 0x58(%rbx), %r8
movq %r12, %rsi
movq %r15, %rdx
callq 0x30cd
testq %r14, %r14
je 0x180f
cmpb $0x0, (%r14)
je 0x180f
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1260
jmp 0x1819
movb $0x0, 0x4(%rbx)
movl $0x6f726f63, (%rbx)     # imm = 0x6F726F63
callq 0x2fcb
leaq 0x140d0(%rax), %rcx
movq 0x140d8(%rax), %rdx
movq %rbx, %rsi
addq $0x118, %rsi            # imm = 0x118
movq %rdx, 0x120(%rbx)
movq %rsi, (%rdx)
movq %rcx, 0x118(%rbx)
movq %rsi, 0x140d8(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_sleep
void uvc_sleep(uint64_t msec){
	uvc_thread_env *env = uvc_get_env();
	uv_timer_t timer;
	timer.data = uvc_self();
	uv_timer_init(uvc_loop_default(), &timer);
	uv_timer_start(&timer, uvc_timer_cb, msec, 0);

	if (env->uv_task == NULL){
		uvc_create("UV_LOOP", UV_TASK_STACK_SIZE, uvc_task_uv, NULL);
	}

	uvc_yield();
	uv_close((uv_handle_t *)&timer, uvc_timer_close_cb);
	uvc_yield();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
callq 0x2fcb
movq %rax, %r14
callq 0x2fcb
movq 0x140c8(%rax), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
callq 0x2fcb
movq (%rax), %rdi
movq %r15, %rsi
callq 0x1140
leaq 0x8f(%rip), %rsi        # 0x1928
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1230
cmpq $0x0, 0x140b8(%r14)
jne 0x18ca
leaq 0x27fd(%rip), %rdi      # 0x40b4
leaq -0x3be(%rip), %rdx      # 0x1500
movl $0x100000, %esi         # imm = 0x100000
xorl %ecx, %ecx
callq 0x17ae
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
leaq 0x89(%rip), %rsi        # 0x197a
leaq 0x8(%rsp), %rdi
callq 0x1060
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_io_create
int uvc_io_create(uvc_io *io, uvc_io_type_t type)
{
	uv_handle_t *h;
	uvc_thread_env *env = uvc_get_env();
	
	memset(io,0,sizeof(uvc_io));
	switch(type){
	case UVC_IO_TCP:
		h = (uv_handle_t *)malloc(sizeof(uv_tcp_t));
		uv_tcp_init(uvc_loop_default(),(uv_tcp_t *)h);
		//io->cur=ctx;
		io->handle=h;
		break;
	case UVC_IO_FS:
		 h = (uv_handle_t *)malloc(sizeof(uv_fs_t));
		io->handle=h;
		break;

	default:
		assert("unknown handle type");
	}
	if (env->uv_task == NULL){
		uvc_create("UV_LOOP", UV_TASK_STACK_SIZE, uvc_task_uv, NULL);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2fcb
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movq $0x0, 0x30(%rbx)
cmpl $0x3, %ebp
je 0x1a1e
testl %ebp, %ebp
jne 0x1a2f
movl $0xf8, %edi
callq 0x11f0
movq %rax, %r15
callq 0x2fcb
movq (%rax), %rdi
movq %r15, %rsi
callq 0x11d0
jmp 0x1a2b
movl $0x1b8, %edi            # imm = 0x1B8
callq 0x11f0
movq %rax, %r15
movq %r15, 0x28(%rbx)
cmpq $0x0, 0x140b8(%r14)
jne 0x1a53
leaq 0x2674(%rip), %rdi      # 0x40b4
leaq -0x547(%rip), %rdx      # 0x1500
movl $0x100000, %esi         # imm = 0x100000
xorl %ecx, %ecx
callq 0x17ae
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_tcp_bind
int uvc_tcp_bind(uvc_io *io,char *ip,short port){
	int status;
	struct sockaddr_in addr;
	status = uv_ip4_addr(ip,port,&addr);
	if (status){
		return status;
	}
#if OLD_LIBUV
    return uv_tcp_bind((uv_tcp_t*)io->handle,(const struct sockaddr *)&addr);
#else
    return uv_tcp_bind((uv_tcp_t*)io->handle,(const struct sockaddr *)&addr,0);
#endif
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x10f0
testl %eax, %eax
jne 0x1a8a
movq 0x28(%rbx), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x11e0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_read
ssize_t uvc_read(uvc_io *io,void *data,size_t len){
	ssize_t nread=0;
	io->buf.base=(char *)data;
	io->buf.len=len;
	io->handle->data=io;
	nread=uv_read_start((uv_stream_t *)io->handle,uvc_alloc_cb,uvc_read_cb);
	if(nread ==UV_EOF){
		return nread;
	}
	io->cur =uvc_self();
	uvc_yield();
	uv_read_stop((uv_stream_t *)io->handle);
	return io->nread;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq 0x28(%rdi), %rdi
movq %rbx, (%rdi)
leaq 0x5b(%rip), %rsi        # 0x1b05
leaq 0x67(%rip), %rdx        # 0x1b18
callq 0x10a0
movl %eax, %ecx
movq $-0xfff, %rax           # imm = 0xF001
cmpl $0xfffff001, %ecx       # imm = 0xFFFFF001
je 0x1b03
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movq 0x28(%rbx), %rdi
callq 0x1280
movq 0x18(%rbx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_read2
ssize_t uvc_read2(uvc_io *io,void *data,size_t len,uint64_t timeout){
	ssize_t nread=0;
	io->buf.base=(char *)data;
	io->buf.len=len;

	uv_timer_t timer;
	timer.data=io;
	io->timeout=0;
	uv_timer_init(uvc_loop_default(),&timer);
	uv_timer_start(&timer,uvc_iotimer_cb,timeout,0);

	nread=uv_read_start((uv_stream_t *)io->handle,uvc_alloc_cb,uvc_read_cb);
	if(nread ==UV_EOF){
		return nread;
	}
	io->cur =uvc_self();
	uvc_yield( );
	uv_read_stop((uv_stream_t *)io->handle);
	if(io->timeout == 0){
		return ETIMEDOUT;
	}
	return io->nread;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rcx, %r14
movq %rdi, %rbx
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
leaq 0x8(%rsp), %r15
movq %rdi, (%r15)
movl $0x0, 0x30(%rdi)
callq 0x2fcb
movq (%rax), %rdi
movq %r15, %rsi
callq 0x1140
leaq 0x8b(%rip), %rsi        # 0x1c4b
movq %r15, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1230
movq 0x28(%rbx), %rdi
leaq -0xd3(%rip), %rsi       # 0x1b05
leaq -0xc7(%rip), %rdx       # 0x1b18
callq 0x10a0
movl %eax, %ecx
movq $-0xfff, %rax           # imm = 0xF001
cmpl $0xfffff001, %ecx       # imm = 0xFFFFF001
je 0x1c3e
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movq 0x28(%rbx), %rdi
callq 0x1280
cmpl $0x0, 0x30(%rbx)
je 0x1c39
movq 0x18(%rbx), %rax
jmp 0x1c3e
movl $0x6e, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_write
ssize_t uvc_write(uvc_io *io,void *data,size_t len){
	uv_buf_t buf;
	uv_write_t req;
	ssize_t nwrite=0;
	buf.base=(char *)data;
	buf.len=len;
	req.data=io;
	uv_write(&req,(uv_stream_t *)io->handle,&buf,1,uvc_write_cb);
	io->cur =uvc_self();
	uvc_yield( );
	return (ssize_t)io->return_status;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
leaq 0x10(%rsp), %rdi
movq %rbx, (%rdi)
movq 0x28(%rbx), %rsi
leaq 0x49(%rip), %r8         # 0x1d18
movq %rax, %rdx
movl $0x1, %ecx
callq 0x10c0
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movslq 0x20(%rbx), %rax
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_close
void uvc_close(uvc_io *io){
	io->handle->data=io;
	uv_close(io->handle,uvc_close_cb);
	io->cur =uvc_self();
	uvc_yield( );
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movq %rbx, (%rdi)
leaq 0x35(%rip), %rsi        # 0x1db7
callq 0x1060
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
popq %rbx
jmp 0x30b0
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_tcp_connect
int uvc_tcp_connect(uvc_io *io,char *ip,short port){
	int status;
	uv_connect_t req;
	struct sockaddr_in addr;
	status = uv_ip4_addr(ip,port,&addr);
	if (status){
		return status;
	}

	req.data = io;
	uv_tcp_connect(&req, (uv_tcp_t *)io->handle, (const struct sockaddr*)&addr, uvc_connect_cb);
	io->cur =uvc_self();
	uvc_yield( );
	return io->return_status;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x10f0
testl %eax, %eax
jne 0x1e7e
leaq 0x10(%rsp), %rdi
movq %rbx, (%rdi)
movq 0x28(%rbx), %rsi
leaq 0x40(%rip), %rcx        # 0x1e84
movq %rsp, %rdx
callq 0x1160
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movl 0x20(%rbx), %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_listen
int uvc_listen(uvc_io *io,int backlog){
	io->handle->data=io;
	uv_listen((uv_stream_t *)io->handle,backlog,uvc_connection_cb);
	io->cur =uvc_self();
	uvc_yield( );
	return io->return_status;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movq %rbx, (%rdi)
leaq 0x39(%rip), %rdx        # 0x1f27
callq 0x1250
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movl 0x20(%rbx), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_connection_cb
static void uvc_connection_cb(uv_stream_t* server, int status)
{

	uvc_io *io=(uvc_io *)server->data;
	//uvc_io *io=((uvc_io*)(((char*)(server)) - offsetof(uvc_io, handle)));
	io->return_status=status;
	uvc_io_ready(io->cur);
}

// Assembly:
pushq %rbx
movq (%rdi), %rax
movl %esi, 0x20(%rax)
movq (%rax), %rbx
callq 0x2fcb
leaq 0x140d0(%rax), %rcx
movq 0x140d8(%rax), %rdx
leaq 0x118(%rbx), %rsi
movq %rdx, 0x120(%rbx)
movq %rsi, (%rdx)
movq %rcx, 0x118(%rbx)
movq %rsi, 0x140d8(%rax)
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
popq %rbx
jmp 0x30b0
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_fs_open
uv_file uvc_fs_open(uvc_io *io,char *path,int flasgs){
	io->handle->data=io;
	uv_fs_open(uvc_loop_default(),(uv_fs_t *)io->handle,path,flasgs,0,uvc_fs_cb);
	io->cur =uvc_self();
	uvc_yield( );
	io->file = ((uv_fs_t *)(io->handle))->result;
	uv_fs_req_cleanup((uv_fs_t *)io->handle);
	return io->file;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq %rdi, (%rax)
callq 0x2fcb
movq (%rax), %rdi
movq 0x28(%rbx), %rsi
leaq 0x53(%rip), %r9         # 0x2005
movq %r14, %rdx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x10d0
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movq 0x28(%rbx), %rdi
movl 0x58(%rdi), %eax
movl %eax, 0x34(%rbx)
callq 0x1100
movl 0x34(%rbx), %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_fs_read
int uvc_fs_read(uvc_io *io,void *data,ssize_t size){
	io->handle->data=io;
	uv_buf_t buf;
	buf.len=size;
	buf.base=data;
	uv_fs_read(uvc_loop_default(),(uv_fs_t *)io->handle,io->file,&buf,1,-1,uvc_fs_cb);
	io->cur =uvc_self();
	uvc_yield( );
	uv_fs_req_cleanup((uv_fs_t *)io->handle);
	return ((uv_fs_t *)(io->handle))->result;;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq %rdi, (%rax)
leaq 0x8(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rsi, (%r14)
callq 0x2fcb
movq (%rax), %rdi
movq 0x28(%rbx), %rsi
movl 0x34(%rbx), %edx
leaq -0x88(%rip), %rax       # 0x2005
movq %rax, (%rsp)
movq %r14, %rcx
movl $0x1, %r8d
movq $-0x1, %r9
callq 0x10b0
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movq 0x28(%rbx), %rdi
callq 0x1100
movq 0x28(%rbx), %rax
movl 0x58(%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_fs_write
int uvc_fs_write(uvc_io *io,void *data,ssize_t size){
    uv_buf_t buf;
	io->handle->data=io;
    buf.len=size;
    buf.base=data;
	uv_fs_write(uvc_loop_default() ,(uv_fs_t *)io->handle,io->file,&buf,1,-1,uvc_fs_cb);
	io->cur =uvc_self();
	uvc_yield( );
	return ((uv_fs_t *)(io->handle))->result;;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq %rdi, (%rax)
leaq 0x8(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rsi, (%r14)
callq 0x2fcb
movq (%rax), %rdi
movq 0x28(%rbx), %rsi
movl 0x34(%rbx), %edx
leaq -0x11b(%rip), %rax      # 0x2005
movq %rax, (%rsp)
movq %r14, %rcx
movl $0x1, %r8d
movq $-0x1, %r9
callq 0x1040
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movq 0x28(%rbx), %rax
movl 0x58(%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_fs_close
int uvc_fs_close(uvc_io *io){
	io->handle->data=io;
	uv_fs_close(uvc_loop_default(),(uv_fs_t *)io->handle,io->file,uvc_fs_cb);
	io->cur =uvc_self();
	uvc_yield();
	uv_fs_req_cleanup((uv_fs_t *)io->handle);
	free(io->handle);
	return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq %rdi, (%rax)
callq 0x2fcb
movq (%rax), %rdi
movq 0x28(%rbx), %rsi
movl 0x34(%rbx), %edx
leaq -0x193(%rip), %rcx      # 0x2005
callq 0x1080
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
movq 0x28(%rbx), %rdi
callq 0x1100
movq 0x28(%rbx), %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_fs_stat
int uvc_fs_stat( char *path,uv_stat_t *statbuf){
	uv_fs_t req;
	req.data=uvc_self();
	uv_fs_stat(uvc_loop_default(),&req,path,uvc_fs_cb2);

	uvc_yield();
	memcpy(statbuf,&req.statbuf,sizeof(uv_stat_t));
	uv_fs_req_cleanup(&req);
	return req.result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2fcb
movq 0x140c8(%rax), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
callq 0x2fcb
movq (%rax), %rdi
leaq 0x59(%rip), %rcx        # 0x2270
movq %r14, %rsi
movq %r15, %rdx
callq 0x1170
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
leaq 0x78(%rsp), %r15
movl $0xa0, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x11b0
movq %r14, %rdi
callq 0x1100
movl -0x18(%r15), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_queue_work
int uvc_queue_work( uv_work_cb cb){
	uv_work_t req;
	req.data=uvc_self();
	uv_queue_work(uvc_loop_default(),&req,cb,uvc_after_work_cb);
	uvc_yield();
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
callq 0x2fcb
movq 0x140c8(%rax), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
callq 0x2fcb
movq (%rax), %rdi
leaq 0x38(%rip), %rcx        # 0x232a
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11c0
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: channel_is_closed
int channel_is_closed(channel_t c){
	channel *chan = channel_pool_get(get_chan_pool(),c);
	if(chan!=NULL && chan->id == c){
		return 1;
	} 
	return 0;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x2fcb
movslq %ebx, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x2c, %rdx
addl %esi, %edx
shll $0xb, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
movslq %ecx, %rcx
movq 0x18(%rax,%rcx,8), %rcx
testq %rcx, %rcx
je 0x23ba
movl $0x1, %eax
cmpl %ebx, 0x10(%rcx)
je 0x23bc
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: channel_create
channel_t channel_create(int cnt,int elem_size){

	channel *c=NULL;
	int idx=0;
	channel_pool *pool=get_chan_pool();
	idx=find_empty_slot(pool);
	if(idx<0){
		return -1;
	}
	c=malloc(sizeof(channel) +(elem_size*cnt));
	memset(c,0,sizeof(channel));
	c->size=elem_size;
	c->cnt=cnt;
	c->id = idx;
	queue_init(&c->readq);
	queue_init(&c->writq);
	
	channel_pool_put(pool,idx,c);
	return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %ebp
callq 0x2fcb
movq %rax, %rbx
movl 0x10(%rax), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl $0x1, %edx
jb 0x24b0
movl %esi, %ecx
leal 0x1(%rcx), %esi
movl 0x14(%rbx), %r15d
incl %r15d
movl %r15d, 0x14(%rbx)
movslq %esi, %rdi
imulq $0x66666667, %rdi, %r8  # imm = 0x66666667
movq %r8, %r9
shrq $0x3f, %r9
sarq $0x2c, %r8
addl %r9d, %r8d
shll $0xb, %r8d
leal (%r8,%r8,4), %r8d
subl %r8d, %edi
movslq %edi, %rdi
movq 0x18(%rbx,%rdi,8), %rdi
testq %rdi, %rdi
je 0x242d
cmpl 0x10(%rdi), %esi
je 0x23df
incl %ecx
movl %ecx, 0x10(%rbx)
testl %r15d, %r15d
js 0x24b0
movl %r14d, %eax
imull %ebp, %eax
movslq %eax, %rdi
addq $0x58, %rdi
callq 0x11f0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movq $0x0, 0x50(%rax)
movslq %r14d, %rcx
movq %rcx, (%rax)
movslq %ebp, %rcx
movq %rcx, 0x8(%rax)
movl %r15d, 0x10(%rax)
leaq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq %rcx, 0x28(%rax)
leaq 0x38(%rax), %rcx
movq %rcx, 0x38(%rax)
movq %rcx, 0x40(%rax)
movl %r15d, %ecx
movl $0xcccccccd, %edx       # imm = 0xCCCCCCCD
imulq %rcx, %rdx
shrq $0x2d, %rdx
shll $0xb, %edx
leal (%rdx,%rdx,4), %ecx
movl %r15d, %edx
subl %ecx, %edx
movq %rax, 0x18(%rbx,%rdx,8)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: channel_write
int channel_write(channel_t c,void *buf){
	channel *chan = NULL;
	uvc_ctx *ctx;
	void *p=NULL;
	chan = channel_pool_get(get_chan_pool(), c);
	if(chan == NULL ||chan->id !=c || chan->closeing==1){
		return -1;
	}

	if(!chanbuf_full(chan)){
		//buffered channel,and buffer not full
		chanbuf_push(chan, buf);
		if(!queue_empty(&chan->readq)){
			ctx = channel_queue_get(&chan->readq);
			uvc_ready(ctx);
		}
		//写入buffer的数据不管
		return 0;
	}else{
		ctx = uvc_self();
		ctx->cbuf = buf;
		channel_queue_put(&chan->writq, ctx);
		//当readq不为空的时候，writeq一定为空
		if(queue_empty(&chan->readq)){
			uvc_yield();
		}else{
			ctx = channel_queue_get(&chan->readq);
			uvc_ready(ctx);
		}
	}
	//检查管道释放
	if(chan == NULL ||chan->id !=c || chan->closeing==1){
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
callq 0x2fcb
movslq %ebp, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x2c, %rdx
addl %esi, %edx
shll $0xb, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
movslq %ecx, %rcx
movq 0x18(%rax,%rcx,8), %r15
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x2901
cmpl %ebp, 0x10(%r15)
jne 0x2901
cmpl $0x1, 0x50(%r15)
je 0x2901
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x27a5
movslq 0x18(%r15), %rcx
leaq 0x1(%rcx), %rax
xorl %edx, %edx
divq %rsi
movslq 0x14(%r15), %rax
cmpq %rax, %rdx
jne 0x2844
callq 0x2fcb
movq 0x140c8(%rax), %rax
movq %r14, 0x138(%rax)
leaq 0x38(%r15), %rcx
movq 0x40(%r15), %rdx
leaq 0x100(%rax), %rsi
movq %rdx, 0x108(%rax)
movq %rsi, (%rdx)
movq %rcx, 0x100(%rax)
movq %rsi, 0x40(%r15)
leaq 0x20(%r15), %rax
movq 0x20(%r15), %r14
cmpq %r14, %rax
je 0x28cf
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq 0x10(%r14), %rax
addq $-0x100, %r14
testq %rax, %rax
cmovneq %rax, %r14
callq 0x2fcb
leaq 0x140d0(%rax), %rcx
movq 0x140d8(%rax), %rdx
leaq 0x118(%r14), %rsi
movq %rdx, 0x120(%r14)
movq %rsi, (%rdx)
movq %rcx, 0x118(%r14)
movq %rsi, 0x140d8(%rax)
jmp 0x28ef
movq (%r15), %rdx
imulq %rdx, %rcx
leaq (%r15,%rcx), %rdi
addq $0x54, %rdi
movq %r14, %rsi
callq 0x11b0
movslq 0x18(%r15), %rax
incq %rax
xorl %edx, %edx
divq 0x8(%r15)
movl %edx, 0x18(%r15)
movq 0x20(%r15), %rbx
addq $0x20, %r15
cmpq %rbx, %r15
je 0x28cb
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq 0x10(%rbx), %rax
addq $-0x100, %rbx
testq %rax, %rax
cmovneq %rax, %rbx
callq 0x2fcb
leaq 0x140d0(%rax), %rcx
movq 0x140d8(%rax), %rdx
leaq 0x118(%rbx), %rsi
movq %rdx, 0x120(%rbx)
movq %rsi, (%rdx)
movq %rcx, 0x118(%rbx)
movq %rsi, 0x140d8(%rax)
xorl %ebx, %ebx
jmp 0x2901
callq 0x2fcb
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x30b0
cmpl %ebp, 0x10(%r15)
jne 0x2901
xorl %ebx, %ebx
cmpl $0x1, 0x50(%r15)
sete %bl
negl %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: channel_readable
int channel_readable(channel_t c){
	channel *chan = NULL;
	chan=channel_pool_get(get_chan_pool(),c);
	if(chan == NULL||chan->id !=c)return -1;
	if (!queue_empty(&chan->writq) || !chanbuf_empty(chan)){
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x2fcb
movslq %ebx, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x2c, %rdx
addl %esi, %edx
shll $0xb, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
movslq %ecx, %rcx
movq 0x18(%rax,%rcx,8), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
je 0x2b58
cmpl %ebx, 0x10(%rcx)
jne 0x2b58
leaq 0x38(%rcx), %rdx
movl $0x1, %eax
cmpq 0x38(%rcx), %rdx
jne 0x2b58
movl 0x14(%rcx), %edx
xorl %eax, %eax
cmpl 0x18(%rcx), %edx
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: channel_writeable
int channel_writeable(channel_t c){
	channel *chan = NULL;
	chan = channel_pool_get(get_chan_pool(), c);
	if(chan == NULL||chan->id !=c)return -1;
	if (!queue_empty(&chan->readq) || !chanbuf_full(chan)){
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x2fcb
movslq %ebx, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x2c, %rdx
addl %esi, %edx
shll $0xb, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
movslq %ecx, %rcx
movq 0x18(%rax,%rcx,8), %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x2bc7
cmpl %ebx, 0x10(%rsi)
jne 0x2bc7
leaq 0x20(%rsi), %rax
movl $0x1, %ecx
cmpq 0x20(%rsi), %rax
jne 0x2bc7
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0x2bc5
movslq 0x18(%rsi), %rax
incq %rax
xorl %edx, %edx
divq %rdi
movslq 0x14(%rsi), %rax
cmpq %rax, %rdx
jne 0x2bc7
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: channel_select_remove
int channel_select_remove(channel *chan){
	uvc_ctx *ctx=uvc_self();
	//queue_t *node;
	queue_t *q = queue_head(&chan->readq);  
   for (; q != queue_sentinel(&chan->readq); q = queue_next(&chan->readq))  {
   		if(q->ext == ctx){
   			queue_remove(q);
   		}
   }

   for (; q != queue_sentinel(&chan->writq); q = queue_next(&chan->writq))  {
   		if(q->ext == ctx){
   			queue_remove(q);
   		}
   }
   return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2fcb
movq 0x140c8(%rax), %rax
leaq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
cmpq %rdx, %rcx
je 0x2bfe
cmpq %rax, 0x10(%rcx)
jne 0x2be3
movq (%rcx), %rsi
movq 0x8(%rcx), %rcx
movq %rsi, (%rcx)
movq %rcx, 0x8(%rsi)
jmp 0x2bdf
leaq 0x38(%rbx), %rdx
cmpq %rdx, %rcx
je 0x2c21
cmpq %rax, 0x10(%rcx)
jne 0x2c1b
movq (%rcx), %rsi
movq 0x8(%rcx), %rcx
movq %rsi, (%rcx)
movq %rcx, 0x8(%rsi)
movq 0x40(%rbx), %rcx
jmp 0x2c02
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/whtc123[P]libuvc/uvc.c
// Function: uvc_get_env
static uvc_thread_env *uvc_get_env(){
	uvc_ctx *ctx = NULL;
	uv_once(&once,uvc_init);
	uvc_thread_env *env=(uvc_thread_env *)uv_key_get(&uvc_key);
	if(env==NULL){
		env=(uvc_thread_env *)malloc(sizeof(uvc_thread_env));
		memset(env,0,sizeof(uvc_thread_env));
		env->loop = uv_loop_new();
		queue_init(&env->pending_queue);
		queue_init(&env->ready_queue);
		
		ctx = (uvc_ctx *)malloc(sizeof(uvc_ctx));
		memset(ctx, 0, sizeof(uvc_ctx));
		coro_stack_alloc(&ctx->stack, 0);
		coro_create(&ctx->cur, NULL, NULL, ctx->stack.sptr, ctx->stack.ssze);
		sprintf(ctx->name, "ROOT");
		env->schedule_task = ctx;
		env->runing_task = ctx;
		ctx->status = UVC_STATUS_RUNING;
		uv_key_set(&uvc_key,env);
	}
	return env;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x171b2(%rip), %rdi     # 0x1a188
leaq -0x1af5(%rip), %rsi     # 0x14e8
callq 0x11a0
leaq 0x3187(%rip), %rdi      # 0x6170
callq 0x1150
movq %rax, %rbx
testq %rax, %rax
jne 0x30a4
movl $0x1, %edi
movl $0x14100, %esi          # imm = 0x14100
callq 0x1190
movq %rax, %rbx
callq 0x1200
movq %rax, (%rbx)
leaq 0x140e8(%rbx), %rax
movq %rax, 0x140e8(%rbx)
movq %rax, 0x140f0(%rbx)
leaq 0x140d0(%rbx), %rax
movq %rax, 0x140d0(%rbx)
movq %rax, 0x140d8(%rbx)
movl $0x1, %edi
movl $0x140, %esi            # imm = 0x140
callq 0x1190
movq %rax, %r14
leaq 0x50(%rax), %rdi
xorl %esi, %esi
callq 0x317c
leaq 0x48(%r14), %rdi
movq 0x50(%r14), %rcx
movq 0x58(%r14), %r8
xorl %esi, %esi
xorl %edx, %edx
callq 0x30cd
movb $0x0, 0x4(%r14)
movl $0x544f4f52, (%r14)     # imm = 0x544F4F52
movq %r14, 0x140c0(%rbx)
movq %r14, 0x140c8(%rbx)
movl $0x3, 0x130(%r14)
leaq 0x30d4(%rip), %rdi      # 0x6170
movq %rbx, %rsi
callq 0x1090
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop