LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderPushScope
const char *fstReaderPushScope(void *ctx, const char *nam, void *user_info)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
if(xc)
        {
        struct fstCurrHier *ch = (struct fstCurrHier *)malloc(sizeof(struct fstCurrHier));
        int chl = xc->curr_hier ? xc->curr_hier->len : 0;
        int len = chl + 1 + strlen(nam);
        if(len >= xc->flat_hier_alloc_len)
                {
                xc->curr_flat_hier_nam = xc->curr_flat_hier_nam ? (char *)realloc(xc->curr_flat_hier_nam, len+1) : (char *)malloc(len+1);
                }

        if(chl)
                {
                xc->curr_flat_hier_nam[chl] = '.';
                strcpy(xc->curr_flat_hier_nam + chl + 1, nam);
                }
                else
                {
                strcpy(xc->curr_flat_hier_nam, nam);
                len--;
                }

        ch->len = len;
        ch->prev = xc->curr_hier;
        ch->user_info = user_info;
        xc->curr_hier = ch;
        return(xc->curr_flat_hier_nam);
        }

return(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r13d, %r13d
testq %rdi, %rdi
je 0x7824
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, -0x38(%rbp)
movl $0x18, %edi
callq 0x2270
movq %rax, %r12
movq 0x278(%rbx), %rax
testq %rax, %rax
je 0x7786
movl 0x10(%rax), %r13d
movq %r14, -0x30(%rbp)
movq %r14, %rdi
callq 0x2130
movq %rax, %r15
leal (%rax,%r13), %r14d
incl %r14d
cmpl 0x290(%rbx), %r14d
jl 0x77ce
movq 0x288(%rbx), %rdi
leal 0x1(%r14), %eax
movslq %eax, %rsi
testq %rdi, %rdi
je 0x77bf
callq 0x22c0
jmp 0x77c7
movq %rsi, %rdi
callq 0x2270
movq %rax, 0x288(%rbx)
movq 0x288(%rbx), %rdi
testl %r13d, %r13d
je 0x77f1
movslq %r13d, %rax
movb $0x2e, (%rdi,%rax)
movq 0x288(%rbx), %rcx
leaq (%rcx,%rax), %rdi
incq %rdi
jmp 0x77f4
movl %r15d, %r14d
movq -0x30(%rbp), %rsi
callq 0x20a0
movl %r14d, 0x10(%r12)
movq 0x278(%rbx), %rax
movq %rax, (%r12)
movq -0x38(%rbp), %rax
movq %rax, 0x8(%r12)
movq %r12, 0x278(%rbx)
movq 0x288(%rbx), %r13
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderGetFacProcessMask
int fstReaderGetFacProcessMask(void *ctx, fstHandle facidx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;

if(xc)
        {
        facidx--;
        if(facidx<xc->maxhandle)
                {
                int process_idx = facidx/8;
                int process_bit = facidx&7;

                return( (xc->process_mask[process_idx]&(1<<process_bit)) != 0 );
                }
        }
return(0);
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x7896
decl %esi
cmpl 0x38(%rdi), %esi
jae 0x7896
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
shrl $0x3, %eax
movq 0x60(%rdi), %rcx
movzbl (%rcx,%rax), %ecx
andl $0x7, %esi
xorl %eax, %eax
btl %esi, %ecx
setb %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderSetFacProcessMask
void fstReaderSetFacProcessMask(void *ctx, fstHandle facidx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;

if(xc)
        {
        facidx--;
        if(facidx<xc->maxhandle)
                {
                int idx = facidx/8;
                int bitpos = facidx&7;

                xc->process_mask[idx] |= (1<<bitpos);
                }
        }
}

// Assembly:
testq %rdi, %rdi
je 0x78c1
decl %esi
cmpl 0x38(%rdi), %esi
jae 0x78c1
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
shrl $0x3, %eax
andb $0x7, %sil
movl $0x1, %edx
movl %esi, %ecx
shll %cl, %edx
movq 0x60(%rdi), %rcx
orb %dl, (%rcx,%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderIterateHierRewind
int fstReaderIterateHierRewind(void *ctx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
int pass_status = 0;

if(xc)
        {
        pass_status = 1;
        if(!xc->fh)
                {
                pass_status = fstReaderRecreateHierFile(xc);
                }

        xc->do_rewind = 1;
        }

return(pass_status);
}

// Assembly:
testq %rdi, %rdi
je 0x7b40
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %eax
cmpq $0x0, 0x8(%rdi)
jne 0x7b32
movq %rbx, %rdi
callq 0x7b43
orb $0x1, 0x294(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderVarint64
static uint64_t fstReaderVarint64(FILE *f)
{
unsigned char buf[16];
unsigned char *mem = buf;
uint64_t rc = 0;
int ch;

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

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

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x21a0
movb %al, -0x20(%rbp,%r14)
incq %r14
testb %al, %al
js 0x8396
xorl %eax, %eax
movq %rax, %rcx
shlq $0x7, %rcx
movzbl -0x21(%rbp,%r14), %eax
andl $0x7f, %eax
orq %rcx, %rax
decq %r14
jne 0x83ac
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderVarint32
static uint32_t fstReaderVarint32(FILE *f)
{
unsigned char buf[5];
unsigned char *mem = buf;
uint32_t rc = 0;
int ch;

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

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

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x21a0
movb %al, -0x15(%rbp,%r14)
incq %r14
testb %al, %al
js 0x83de
xorl %eax, %eax
movl %eax, %ecx
shll $0x7, %ecx
movzbl -0x16(%rbp,%r14), %eax
andl $0x7f, %eax
orl %ecx, %eax
decq %r14
jne 0x83f4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderUint64
static uint64_t fstReaderUint64(FILE *f)
{
uint64_t val = 0;
unsigned char buf[sizeof(uint64_t)];
unsigned int i;

fstFread(buf, sizeof(uint64_t), 1, f);
for(i=0;i<sizeof(uint64_t);i++)
        {
        val <<= 8;
        val |= buf[i];
        }

return(val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, %rcx
leaq -0x8(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x20c0
xorl %ecx, %ecx
xorl %eax, %eax
movq %rax, %rdx
shlq $0x8, %rdx
movzbl -0x8(%rbp,%rcx), %eax
orq %rdx, %rax
incq %rcx
cmpq $0x8, %rcx
jne 0x94af
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderOpen
void *fstReaderOpen(const char *nam)
{
struct fstReaderContext *xc = (struct fstReaderContext *)calloc(1, sizeof(struct fstReaderContext));

if((!nam)||(!(xc->f=fopen(nam, "rb"))))
        {
        free(xc);
        xc=NULL;
        }
        else
        {
        int flen = strlen(nam);
        char *hf = (char *)calloc(1, flen + 6);
        int rc;

#if defined(__MINGW32__) || defined(FST_MACOSX)
        setvbuf(xc->f, (char *)NULL, _IONBF, 0);   /* keeps gzip from acting weird in tandem with fopen */
#endif

        memcpy(hf, nam, flen);
        strcpy(hf + flen, ".hier");
        xc->fh = fopen(hf, "rb");

        free(hf);
        xc->filename = strdup(nam);
        rc = fstReaderInit(xc);

        if((rc) && (xc->vc_section_count) && (xc->maxhandle) && ((xc->fh)||(xc->contains_hier_section||(xc->contains_hier_section_lz4))))
                {
                /* more init */
                xc->do_rewind = 1;
                }
                else
                {
                fstReaderClose(xc);
                xc = NULL;
                }
        }

return(xc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x106b0, %esi          # imm = 0x106B0
callq 0x21e0
movq %rax, %rbx
testq %r14, %r14
je 0x95bd
leaq 0xc0f6(%rip), %rsi      # 0x15607
movq %r14, %rdi
callq 0x2330
movq %rax, (%rbx)
testq %rax, %rax
je 0x95bd
movq %r14, %rdi
callq 0x2130
movq %rax, %r15
addl $0x6, %eax
movslq %eax, %rsi
movl $0x1, %edi
callq 0x21e0
movq %rax, %r12
movslq %r15d, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2240
movl $0x6569682e, (%r12,%r15) # imm = 0x6569682E
movw $0x72, 0x4(%r12,%r15)
leaq 0xc09c(%rip), %rsi      # 0x15607
movq %r12, %rdi
callq 0x2330
movq %rax, 0x8(%rbx)
movq %r12, %rdi
callq 0x2050
movq %r14, %rdi
callq 0x23a0
movq %rax, 0x180(%rbx)
movq %rbx, %rdi
callq 0x8be1
testl %eax, %eax
je 0x95c7
cmpq $0x0, 0x48(%rbx)
je 0x95c7
cmpl $0x0, 0x38(%rbx)
je 0x95c7
cmpq $0x0, 0x8(%rbx)
jne 0x95b4
testb $0x50, 0x7a(%rbx)
je 0x95c7
orb $0x1, 0x294(%rbx)
jmp 0x95d1
movq %rbx, %rdi
callq 0x2050
jmp 0x95cf
movq %rbx, %rdi
callq 0x95dd
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderClose
void fstReaderClose(void *ctx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;

if(xc)
        {
        fstReaderDeallocateScopeData(xc);
        fstReaderDeallocateRvatData(xc);
        free(xc->rvat_sig_offs); xc->rvat_sig_offs = NULL;

        free(xc->process_mask); xc->process_mask = NULL;
        free(xc->blackout_times); xc->blackout_times = NULL;
        free(xc->blackout_activity); xc->blackout_activity = NULL;
        free(xc->temp_signal_value_buf); xc->temp_signal_value_buf = NULL;
        free(xc->signal_typs); xc->signal_typs = NULL;
        free(xc->signal_lens); xc->signal_lens = NULL;
        free(xc->filename); xc->filename = NULL;

        if(xc->fh)
                {
                tmpfile_close(&xc->fh, &xc->fh_nam);
                }

        if(xc->f)
                {
                tmpfile_close(&xc->f, &xc->f_nam);
                if(xc->filename_unpacked)
                        {
                        unlink(xc->filename_unpacked);
                        free(xc->filename_unpacked);
                        }
                }

        free(xc);
        }
}

// Assembly:
testq %rdi, %rdi
je 0x9709
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x288(%rdi), %rdi
callq 0x2050
movq $0x0, 0x288(%rbx)
movq 0x278(%rbx), %rdi
testq %rdi, %rdi
je 0x962a
movq (%rdi), %r14
callq 0x2050
movq %r14, 0x278(%rbx)
movq %r14, %rdi
testq %r14, %r14
jne 0x9613
movq %rbx, %rdi
callq 0x970a
movq 0x210(%rbx), %rdi
callq 0x2050
xorl %r14d, %r14d
movq %r14, 0x210(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2050
movq %r14, 0x60(%rbx)
movq 0x1a0(%rbx), %rdi
callq 0x2050
movq %r14, 0x1a0(%rbx)
movq 0x1a8(%rbx), %rdi
callq 0x2050
movq %r14, 0x1a8(%rbx)
movq 0x70(%rbx), %rdi
callq 0x2050
movq %r14, 0x70(%rbx)
movq 0x58(%rbx), %rdi
callq 0x2050
movq %r14, 0x58(%rbx)
movq 0x50(%rbx), %rdi
callq 0x2050
movq %r14, 0x50(%rbx)
movq 0x180(%rbx), %rdi
callq 0x2050
movq %r14, 0x180(%rbx)
cmpq %r14, 0x8(%rbx)
je 0x96cb
leaq 0x8(%rbx), %rdi
leaq 0x106a8(%rbx), %rsi
callq 0x3ee0
cmpq $0x0, (%rbx)
je 0x96fd
leaq 0x106a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x3ee0
movq 0x188(%rbx), %rdi
testq %rdi, %rdi
je 0x96fd
callq 0x2080
movq 0x188(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderDeallocateRvatData
static void fstReaderDeallocateRvatData(void *ctx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
if(xc)
        {
        free(xc->rvat_chain_mem); xc->rvat_chain_mem = NULL;
        free(xc->rvat_frame_data); xc->rvat_frame_data = NULL;
        free(xc->rvat_time_table); xc->rvat_time_table = NULL;
        free(xc->rvat_chain_table); xc->rvat_chain_table = NULL;
        free(xc->rvat_chain_table_lengths); xc->rvat_chain_table_lengths = NULL;

        xc->rvat_data_valid = 0;
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x220(%rdi), %rdi
callq 0x2050
xorl %r14d, %r14d
movq %r14, 0x220(%rbx)
movq 0x1e0(%rbx), %rdi
callq 0x2050
movq %r14, 0x1e0(%rbx)
movq 0x1c8(%rbx), %rdi
callq 0x2050
movq %r14, 0x1c8(%rbx)
movq 0x1f0(%rbx), %rdi
callq 0x2050
movq %r14, 0x1f0(%rbx)
movq 0x1f8(%rbx), %rdi
callq 0x2050
movq %r14, 0x1f8(%rbx)
andb $-0x2, 0x1c0(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb6c5
movl %edx, %r14d
movq %rsi, %r15
movslq 0x698(%rbx), %rdx
cmpl $0xffff, %r14d          # imm = 0xFFFF
jg 0xb6f8
movl %edx, %eax
addl %r14d, %eax
cmpl $0x10000, %eax          # imm = 0x10000
jl 0xb69f
movl 0x69c(%rbx), %edi
leaq 0x6a0(%rbx), %rsi
callq 0x20e0
movl $0x0, 0x698(%rbx)
movslq 0x698(%rbx), %rax
leaq (%rbx,%rax), %rdi
addq $0x6a0, %rdi            # imm = 0x6A0
movslq %r14d, %rdx
movq %r15, %rsi
callq 0x2240
addl %r14d, 0x698(%rbx)
jmp 0xb6ed
movslq 0x698(%rbx), %rdx
testq %rdx, %rdx
je 0xb6ed
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 %edx, %edx
je 0xb718
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_O1/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 0xb746
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 0xb75f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc5db
movq %rdx, %rbx
movq %rdi, %r14
movq 0x50(%rdi), %rax
movl (%rax,%r15,4), %edx
cmpq $0x1, %rdx
jne 0xc5eb
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 0xc5dd
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 0xc62a
movq 0x210(%r14), %rax
movl (%rax,%r15,4), %eax
addq 0x1e0(%r14), %rax
testb $0x2, 0x7a(%r14)
jne 0xc652
movl $0x8, %ecx
leaq -0x20(%rbp), %rdx
movb -0x1(%rax,%rcx), %sil
movb %sil, (%rdx)
incq %rdx
decq %rcx
jne 0xc618
jmp 0xc659
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 0xc5dd
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
leaq 0x90eb(%rip), %rsi      # 0x15750
movq %rbx, %rdi
movb $0x1, %al
callq 0x2370
jmp 0xc5dd
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstUtilityFreeEnumTable
void fstUtilityFreeEnumTable(struct fstETab *etab)
{
if(etab)
	{
	free(etab->literal_arr);
	free(etab->val_arr);
	free(etab->name);
	free(etab);
	}
}

// Assembly:
testq %rdi, %rdi
je 0xcc64
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
callq 0x2050
movq (%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %rax
movq %rdi, %rcx
leaq -0xf(%rbp), %rdx
xorl %esi, %esi
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq %rax, %r8
sarq $0x7, %r8
cmpq $0x40, %rax
jb 0xccaa
cmpq $-0x1, %r8
setne %r9b
testb $0x40, %al
sete %r10b
orb %r9b, %r10b
je 0xccaa
orb $-0x80, %al
xorl %r9d, %r9d
jmp 0xccaf
andb $0x7f, %al
movb $0x1, %r9b
movb %al, (%rdx)
incq %rdx
addq %rdi, %rsi
movq %r8, %rax
testb %r9b, %r9b
je 0xcc86
sarq $0x20, %rsi
leaq -0xf(%rbp), %rdi
movl $0x1, %edx
callq 0x2390
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xeb6b
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 0xeb93
cmpl $0x1000a, %ecx          # imm = 0x1000A
jg 0xeba3
movq %r15, %rcx
movl %ebx, %r8d
movl $0x2, %r9d
jmp 0xebaf
movl %ebx, %r8d
movl $0x1, %r9d
callq 0xcd13
jmp 0xebb4
movq %r15, %rcx
movl %ebx, %r8d
movl $0x1, %r9d
callq 0x1445d
addq $0x4028, %rsp           # imm = 0x4028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x4004(%rdi)
jne 0xec1e
cmpl $0x40000001, 0x4000(%rbx) # imm = 0x40000001
jb 0xec2d
movl $0x4020, %edx           # imm = 0x4020
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2190
cmpl $0x7, %r15d
jg 0xec4c
movq $0x0, 0x4008(%rbx)
movl $0x0, 0x4018(%rbx)
xorl %eax, %eax
jmp 0xecc5
movslq %r15d, %rcx
addq %r14, %rcx
leaq -0x10000(%rcx), %rdx
cmpl $0x10001, %r15d         # imm = 0x10001
cmovlq %r14, %rdx
movl 0x4000(%rbx), %esi
movq %rdx, 0x4008(%rbx)
movl %ecx, %eax
subl %edx, %eax
movl %eax, 0x4018(%rbx)
leal (%rsi,%rax), %edi
addl $0x10000, %edi          # imm = 0x10000
movl %edi, 0x4000(%rbx)
addq $-0x8, %rcx
cmpq %rcx, %rdx
ja 0xecc5
addl $0x10000, %esi          # imm = 0x10000
movabsq $0xcf1bbcdcbb, %rdi     # imm = 0xCF1BBCDCBB
movq (%rdx), %r8
imulq %rdi, %r8
shrq $0x1c, %r8
andl $0xfff, %r8d            # imm = 0xFFF
movl %esi, (%rbx,%r8,4)
addq $0x3, %rdx
addl $0x3, %esi
cmpq %rcx, %rdx
jbe 0xeca3
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10519
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 0x104cb
addq %rdx, %rax
movl $0x10000, 0x4000(%rdi)  # imm = 0x10000
cmpl $0x10001, 0x4018(%rdi)  # imm = 0x10001
jb 0x10509
movl $0x10000, 0x4018(%rdi)  # imm = 0x10000
movl 0x4018(%rdi), %ecx
subq %rcx, %rax
movq %rax, 0x4008(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/lz4.c
// Function: LZ4_saveDict
int LZ4_saveDict (LZ4_stream_t* LZ4_dict, char* safeBuffer, int dictSize)
{
    LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict;
    const BYTE* previousDictEnd = dict->dictionary + dict->dictSize;

    if ((U32)dictSize > 64 KB) dictSize = 64 KB;   /* useless to define a dictionary > 64 KB */
    if ((U32)dictSize > dict->dictSize) dictSize = dict->dictSize;

    memmove(safeBuffer, previousDictEnd - dictSize, dictSize);

    dict->dictionary = (const BYTE*)safeBuffer;
    dict->dictSize = (U32)dictSize;

    return dictSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4018(%rdi), %eax
cmpl %eax, %edx
cmovael %eax, %edx
movl $0x10000, %r14d         # imm = 0x10000
cmpl %r14d, %edx
cmovbl %edx, %r14d
movq %rsi, %r15
addq 0x4008(%rdi), %rax
subq %r14, %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x22f0
movq %r15, 0x4008(%rbx)
movl %r14d, 0x4018(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/lz4.c
// Function: LZ4_setStreamDecode
int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize)
{
    LZ4_streamDecode_t_internal* lz4sd = (LZ4_streamDecode_t_internal*) LZ4_streamDecode;
    lz4sd->prefixSize = (size_t) dictSize;
    lz4sd->prefixEnd = (const BYTE*) dictionary + dictSize;
    lz4sd->externalDict = NULL;
    lz4sd->extDictSize  = 0;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edx, %rax
movq %rax, 0x18(%rdi)
addq %rax, %rsi
movq %rsi, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
leaq -0x7(%rdx), %r8
movq %rdi, %rcx
cmpq %r8, %rcx
jae 0x14416
movq (%rsi), %r9
movq (%rcx), %r10
movq %r10, %r11
xorq %r9, %r11
bsfq %r11, %r11
shrl $0x3, %r11d
addq %rcx, %r11
movl %r11d, %ebx
subl %edi, %ebx
addq $0x8, %rcx
addq $0x8, %rsi
cmpq %r10, %r9
cmovneq %r11, %rcx
cmovnel %ebx, %eax
je 0x143de
popq %rbx
popq %rbp
retq
leaq -0x3(%rdx), %rax
cmpq %rax, %rcx
jae 0x1442d
movl (%rsi), %eax
cmpl (%rcx), %eax
jne 0x1442d
addq $0x4, %rcx
addq $0x4, %rsi
leaq -0x1(%rdx), %rax
cmpq %rax, %rcx
jae 0x14446
movzwl (%rsi), %eax
cmpw (%rcx), %ax
jne 0x14446
addq $0x2, %rcx
addq $0x2, %rsi
cmpq %rdx, %rcx
jae 0x14457
movb (%rsi), %al
xorl %edx, %edx
cmpb (%rcx), %al
sete %dl
addq %rdx, %rcx
subl %edi, %ecx
movl %ecx, %eax
jmp 0x14413
// File: /workspace/github_c_makefile_star2_O1/baileywjohnson[P]mpi-matrix-mult/make-matrix.c
// Function: main
int main(int argc, char *argv[]){

	double *A;
	char *in;

	int rows, columns, lower, upper;
	
	if(argc != 11){
		printf("USAGE: make-matrix -m <number of rows> -n <number of columns> -l <lower bound> -u <upper bound> -o <output file>\n");
		exit(1);
	}

	int c;
	while((c = getopt(argc, argv, "m:n:l:u:o:")) != -1){
		switch(c){
			case 'm':
				rows = atoi(optarg);
				break;
			case 'n':
				columns = atoi(optarg);
				break;
			case 'l':
				lower = atoi(optarg);
				break;
			case 'u':
				upper = atoi(optarg);
				break;
			case 'o':
				in = optarg;
				break;
			case '?':
				exit(1);
				break;
			default:
				break;
		}
	}	

	make_matrix(rows, columns, lower, upper, &A);
	write_matrix(in, rows, columns, A);
	free(A);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0xb, %edi
jne 0x12fe
movq %rsi, %rbx
leaq 0xdef(%rip), %r12       # 0x202c
leaq 0xdc0(%rip), %r13       # 0x2004
movq 0x2da5(%rip), %r14      # 0x3ff0
movl $0xb, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1070
leal -0x6c(%rax), %ecx
cmpl $0x9, %ecx
ja 0x127a
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
movq (%r14), %rdi
callq 0x10b0
movl %eax, (%rsp)
jmp 0x124b
cmpl $-0x1, %eax
je 0x12ba
cmpl $0x3f, %eax
jne 0x124b
jmp 0x130a
movq (%r14), %rdi
callq 0x10b0
movl %eax, 0x4(%rsp)
jmp 0x124b
movq (%r14), %rdi
callq 0x10b0
movl %eax, %ebp
jmp 0x124b
movq (%r14), %rax
movq %rax, 0x8(%rsp)
jmp 0x124b
movq (%r14), %rdi
callq 0x10b0
movl %eax, %r15d
jmp 0x124b
leaq 0x10(%rsp), %rbx
movl %r15d, %edi
movl %ebp, %esi
movl (%rsp), %edx
movl 0x4(%rsp), %ecx
movq %rbx, %r8
callq 0x1314
movq (%rbx), %rcx
movq 0x8(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x1436
movq (%rbx), %rdi
callq 0x10a0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd32(%rip), %rdi       # 0x2037
callq 0x1040
movl $0x1, %edi
callq 0x1050
// File: /workspace/github_c_makefile_star2_O1/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 0x274e
testl %eax, %eax
jne 0x13e9
movl $0x64, %edi
callq 0x1869
decl %ebp
jne 0x13c7
jmp 0x13f5
leaq 0x2c38(%rip), %rdi      # 0x4028
callq 0x1070
leaq 0x2c4a(%rip), %rdi      # 0x4046
callq 0x1070
movl %ebx, %edi
callq 0x24d8
xorl %eax, %eax
callq 0x1652
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x294a
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 0x294a
testl %eax, %eax
je 0x1445
leaq 0x2bf1(%rip), %rdi      # 0x4059
callq 0x1070
leaq 0x2c03(%rip), %rdi      # 0x4077
callq 0x1070
xorl %eax, %eax
callq 0x1652
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x23dc
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 0x17b1
leaq 0x2b5b(%rip), %rdi      # 0x401f
leaq -0xb3(%rip), %rdx       # 0x1418
movl $0x2800, %esi           # imm = 0x2800
movq %rbx, %rcx
callq 0x17b1
xorl %eax, %eax
callq 0x1537
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x3031
movq %rax, %rbx
callq 0x3031
movq 0x140c8(%rax), %rax
movq %rax, 0x140b8(%rbx)
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x12a0
movq $0x0, 0x140b8(%rbx)
popq %rbx
jmp 0x1652
// File: /workspace/github_c_makefile_star2_O1/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 0x3031
movq %rax, %rbx
movq %rax, %r15
addq $0x140d0, %r15          # imm = 0x140D0
movl $0x3, %ebp
movq (%r15), %r14
cmpq %r14, %r15
je 0x1577
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq (%r14), %rax
movq %rcx, 0x8(%rax)
addq $-0x118, %r14           # imm = 0xFEE8
jmp 0x1583
movq 0x140b8(%rbx), %r14
testq %r14, %r14
je 0x15e5
movq %r14, 0x140c8(%rbx)
movl %ebp, 0x130(%r14)
callq 0x3031
movl %ebp, 0x130(%r14)
movq %r14, 0x140c8(%rax)
movq 0x140c0(%rax), %rdi
addq $0x48, %rdi
leaq 0x48(%r14), %rsi
callq 0x312c
cmpl $0x4, 0x130(%r14)
jne 0x15d5
leaq 0x50(%r14), %rdi
callq 0x332c
movq %r14, %rdi
callq 0x1030
jmp 0x1555
movl $0x1, 0x130(%r14)
jmp 0x1555
leaq 0x2b36(%rip), %rdi      # 0x4122
callq 0x1070
xorl %edi, %edi
callq 0x1270
// File: /workspace/github_c_makefile_star2_O1/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 0x3031
movl $0x3, 0x130(%rbx)
movq %rbx, 0x140c8(%rax)
movq 0x140c0(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rbx
movq %rbx, %rsi
popq %rbx
jmp 0x312c
// File: /workspace/github_c_makefile_star2_O1/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 0x3031
callq 0x3031
movq %rax, %rbx
movq 0x140c8(%rax), %rax
movl $0x4, 0x130(%rax)
callq 0x3031
movq 0x140c8(%rax), %rsi
leaq 0x2a06(%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 0x312c
// File: /workspace/github_c_makefile_star2_O1/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 0x2930(%rip), %rdi      # 0x4099
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1120
callq 0x3031
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 0x312c
// File: /workspace/github_c_makefile_star2_O1/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 $0x140, %edi            # imm = 0x140
callq 0x11f0
movq %rax, %rbx
movl $0x140, %edx            # imm = 0x140
movq %rax, %rdi
xorl %esi, %esi
callq 0x1170
leaq 0x50(%rbx), %rdi
movl %ebp, %esi
callq 0x31f8
leaq 0x48(%rbx), %rdi
movq 0x50(%rbx), %rcx
movq 0x58(%rbx), %r8
movq %r12, %rsi
movq %r15, %rdx
callq 0x3149
testq %r14, %r14
je 0x181c
cmpb $0x0, (%r14)
je 0x181c
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1260
jmp 0x1826
movb $0x0, 0x4(%rbx)
movl $0x6f726f63, (%rbx)     # imm = 0x6F726F63
testq %rbx, %rbx
je 0x1860
callq 0x3031
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_O1/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 0x3031
movq %rax, %r14
callq 0x3031
movq 0x140c8(%rax), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
callq 0x3031
movq (%rax), %rdi
movq %r15, %rsi
callq 0x1140
leaq 0x8f(%rip), %rsi        # 0x193a
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1230
cmpq $0x0, 0x140b8(%r14)
jne 0x18dc
leaq 0x27eb(%rip), %rdi      # 0x40b4
leaq -0x3d0(%rip), %rdx      # 0x1500
movl $0x100000, %esi         # imm = 0x100000
xorl %ecx, %ecx
callq 0x17b1
callq 0x3031
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x312c
leaq 0x89(%rip), %rsi        # 0x198c
leaq 0x8(%rsp), %rdi
callq 0x1060
callq 0x3031
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x312c
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3031
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 0x1a30
testl %ebp, %ebp
jne 0x1a41
movl $0xf8, %edi
callq 0x11f0
movq %rax, %r15
callq 0x3031
movq (%rax), %rdi
movq %r15, %rsi
callq 0x11d0
jmp 0x1a3d
movl $0x1b8, %edi            # imm = 0x1B8
callq 0x11f0
movq %rax, %r15
movq %r15, 0x28(%rbx)
cmpq $0x0, 0x140b8(%r14)
jne 0x1a65
leaq 0x2662(%rip), %rdi      # 0x40b4
leaq -0x559(%rip), %rdx      # 0x1500
movl $0x100000, %esi         # imm = 0x100000
xorl %ecx, %ecx
callq 0x17b1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1a9c
movq 0x28(%rbx), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x11e0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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        # 0x1b17
leaq 0x67(%rip), %rdx        # 0x1b2a
callq 0x10a0
movl %eax, %ecx
movq $-0xfff, %rax           # imm = 0xF001
cmpl $0xfffff001, %ecx       # imm = 0xFFFFF001
je 0x1b15
callq 0x3031
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x3031
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x312c
movq 0x28(%rbx), %rdi
callq 0x1280
movq 0x18(%rbx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/whtc123[P]libuvc/uvc.c
// Function: uvc_read_cb
static void uvc_read_cb(uv_stream_t* stream,ssize_t nread,const uv_buf_t* buf)
{
	uvc_io *io= (uvc_io *)stream->data;
	io->buf.base=buf->base;
	io->buf.len=buf->len;
	io->nread=nread;
	uvc_io_ready(io->cur);
}

// Assembly:
pushq %rbx
movq (%rdi), %rax
movq (%rdx), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rdx), %rcx
movq %rcx, 0x10(%rax)
movq %rsi, 0x18(%rax)
movq (%rax), %rbx
callq 0x3031
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 0x312c
// File: /workspace/github_c_makefile_star2_O1/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 0x3031
movq (%rax), %rdi
movq %r15, %rsi
callq 0x1140
leaq 0x8b(%rip), %rsi        # 0x1c5d
movq %r15, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1230
movq 0x28(%rbx), %rdi
leaq -0xd3(%rip), %rsi       # 0x1b17
leaq -0xc7(%rip), %rdx       # 0x1b2a
callq 0x10a0
movl %eax, %ecx
movq $-0xfff, %rax           # imm = 0xF001
cmpl $0xfffff001, %ecx       # imm = 0xFFFFF001
je 0x1c50
callq 0x3031
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x3031
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x312c
movq 0x28(%rbx), %rdi
callq 0x1280
cmpl $0x0, 0x30(%rbx)
je 0x1c4b
movq 0x18(%rbx), %rax
jmp 0x1c50
movl $0x6e, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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         # 0x1d2a
movq %rax, %rdx
movl $0x1, %ecx
callq 0x10c0
callq 0x3031
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x3031
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
callq 0x312c
movslq 0x20(%rbx), %rax
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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        # 0x1dc9
callq 0x1060
callq 0x3031
movq 0x140c8(%rax), %rax
movq %rax, (%rbx)
callq 0x3031
movq 0x140c0(%rax), %rsi
movq 0x140c8(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
popq %rbx
jmp 0x312c
// File: /workspace/github_c_makefile_star2_O1/whtc123[P]libuvc/uvc.c
// Function: uvc_close_cb
static void uvc_close_cb(uv_handle_t* handle)
{
	//uvc_io *io=uvc_container_of(handle,uvc_io,handle);
	uvc_io *io=(uvc_io *)handle->data;
	free(io->handle);
	uvc_io_ready(io->cur);
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
movq 0x28(%rbx), %rdi
callq 0x1030
movq (%rbx), %rbx
callq 0x3031
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 0x312c