LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xdd60
addl $0xffff0000, %ecx       # imm = 0xFFFF0000
movq 0x4008(%rdi), %rax
movl 0x4018(%rdi), %edx
xorl %esi, %esi
xorl %r8d, %r8d
cmpq $0x1000, %r8            # imm = 0x1000
je 0xdd2a
movl (%rdi,%r8,4), %r9d
subl %ecx, %r9d
cmovbl %esi, %r9d
movl %r9d, (%rdi,%r8,4)
incq %r8
jmp 0xdd0d
addq %rdx, %rax
movl $0x10000, 0x4000(%rdi)  # imm = 0x10000
movl 0x4018(%rdi), %ecx
cmpl $0x10001, %ecx          # imm = 0x10001
jb 0xdd54
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_O2/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 %rcx, %rax
jae 0x11215
movq (%rsi), %r8
movq (%rax), %r9
cmpq %r9, %r8
jne 0x11204
addq $0x8, %rax
addq $0x8, %rsi
jmp 0x111ea
xorq %r8, %r9
bsfq %r9, %rcx
shrl $0x3, %ecx
addq %rcx, %rax
subl %edi, %eax
popq %rbp
retq
leaq -0x3(%rdx), %rcx
cmpq %rcx, %rax
jae 0x1122c
movl (%rsi), %ecx
cmpl (%rax), %ecx
jne 0x1122c
addq $0x4, %rax
addq $0x4, %rsi
leaq -0x1(%rdx), %rcx
cmpq %rcx, %rax
jae 0x11245
movzwl (%rsi), %ecx
cmpw (%rax), %cx
jne 0x11245
addq $0x2, %rax
addq $0x2, %rsi
cmpq %rdx, %rax
jae 0x11211
movb (%rsi), %cl
xorl %edx, %edx
cmpb (%rax), %cl
sete %dl
addq %rdx, %rax
jmp 0x11211
// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
cmpl $0xb, %edi
jne 0x130c
movq %rsi, %rbx
leaq 0xdef(%rip), %r12       # 0x202c
pushq $0xb
popq %r13
leaq 0xdbc(%rip), %r14       # 0x2004
movq 0x2da1(%rip), %rbp      # 0x3ff0
movl %r13d, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1070
leal -0x6c(%rax), %ecx
cmpl $0x9, %ecx
ja 0x127d
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
jmpq *%rax
movq (%rbp), %rdi
callq 0x10b0
movl %eax, 0xc(%rsp)
jmp 0x124f
cmpl $-0x1, %eax
je 0x12c3
cmpl $0x3f, %eax
jne 0x124f
jmp 0x1318
movq (%rbp), %rdi
callq 0x10b0
movl %eax, 0x10(%rsp)
jmp 0x124f
movq (%rbp), %rdi
callq 0x10b0
movl %eax, 0x14(%rsp)
jmp 0x124f
movq (%rbp), %rax
movq %rax, 0x18(%rsp)
jmp 0x124f
movq (%rbp), %rdi
callq 0x10b0
movl %eax, %r15d
jmp 0x124f
leaq 0x20(%rsp), %rbx
movl %r15d, %edi
movl 0x14(%rsp), %ebp
movl %ebp, %esi
movl 0xc(%rsp), %edx
movl 0x10(%rsp), %ecx
movq %rbx, %r8
callq 0x1320
movq (%rbx), %rcx
movq 0x18(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x1447
movq (%rbx), %rdi
callq 0x10a0
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd24(%rip), %rdi       # 0x2037
callq 0x1040
pushq $0x1
popq %rdi
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %ebx
leaq 0x4(%rsp), %r14
andl $0x0, (%r14)
pushq $0xa
popq %rbp
pushq $0x64
popq %r15
subl $0x1, %ebp
jb 0x13f2
incl 0x4(%rsp)
movl %ebx, %edi
movq %r14, %rsi
callq 0x2004
testl %eax, %eax
jne 0x13e6
movq %r15, %rdi
callq 0x17d2
jmp 0x13c5
leaq 0x1c3b(%rip), %rdi      # 0x3028
callq 0x1070
leaq 0x1c4d(%rip), %rdi      # 0x3046
callq 0x1070
movl %ebx, %edi
callq 0x1eea
xorl %eax, %eax
callq 0x15fe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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), %r14
andl $0x0, (%r14)
leaq 0x1bd2(%rip), %r15      # 0x3004
movl %ebx, %edi
movq %r14, %rsi
callq 0x211a
testl %eax, %eax
jne 0x1450
movl 0xc(%rsp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1120
jmp 0x1432
leaq 0x1c02(%rip), %rdi      # 0x3059
callq 0x1070
leaq 0x1c14(%rip), %rdi      # 0x3077
callq 0x1070
xorl %eax, %eax
callq 0x15fe
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x4
popq %rsi
xorl %edi, %edi
callq 0x1e12
leaq 0xc(%rsp), %rbx
movl %eax, (%rbx)
leaq 0x1b80(%rip), %rdi      # 0x3016
leaq -0xf1(%rip), %rdx       # 0x13ac
movl $0x2800, %esi           # imm = 0x2800
movq %rbx, %rcx
callq 0x1759
leaq 0x1b6e(%rip), %rdi      # 0x301f
leaq -0xa1(%rip), %rdx       # 0x1417
movl $0x2800, %esi           # imm = 0x2800
movq %rbx, %rcx
callq 0x1759
xorl %eax, %eax
callq 0x1519
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %rbx
callq 0x2753
movq %rax, 0x140b8(%rbx)
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x12a0
andq $0x0, 0x140b8(%rbx)
popq %rbx
jmp 0x15fe
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movl $0x3, 0x130(%rbx)
movq %rbx, 0x140c8(%rax)
movq 0x140c0(%rax), %rdi
addq $0x48, %rdi
addq $0x48, %rbx
movq %rbx, %rsi
popq %rbx
jmp 0x2764
// File: /workspace/github_c_makefile_star2_O2/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 0x2753
callq 0x266f
movq %rax, %rbx
movq 0x140c8(%rax), %rax
movl $0x4, 0x130(%rax)
callq 0x2753
leaq 0x1a61(%rip), %rdi      # 0x308a
movq %rax, %rsi
xorl %eax, %eax
callq 0x1120
movq 0x140c0(%rbx), %rsi
movq 0x140c8(%rbx), %rdi
addq $0x48, %rdi
addq $0x48, %rsi
popq %rbx
jmp 0x2764
// File: /workspace/github_c_makefile_star2_O2/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 0x1988(%rip), %rdi      # 0x3099
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1120
callq 0x266f
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 0x2764
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0x140, %esi            # imm = 0x140
callq 0x1190
movq %rax, %rbx
leaq 0x50(%rax), %rdi
movl %ebp, %esi
callq 0x2830
leaq 0x48(%rbx), %rdi
movq 0x50(%rbx), %rcx
movq 0x58(%rbx), %r8
movq %r12, %rsi
movq %r15, %rdx
callq 0x2781
testq %r14, %r14
je 0x17b8
cmpb $0x0, (%r14)
je 0x17b8
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1260
jmp 0x17c2
movb $0x0, 0x4(%rbx)
movl $0x6f726f63, (%rbx)     # imm = 0x6F726F63
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x16c3
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %r14
callq 0x2753
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
callq 0x14e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1140
leaq 0x59(%rip), %rsi        # 0x1866
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1230
cmpq $0x0, 0x140b8(%r14)
jne 0x183e
leaq 0x1889(%rip), %rdi      # 0x30b4
leaq -0x346(%rip), %rdx      # 0x14ec
movl $0x100000, %esi         # imm = 0x100000
xorl %ecx, %ecx
callq 0x1759
callq 0x16a1
leaq 0x24(%rip), %rsi        # 0x186e
leaq 0x8(%rsp), %rdi
callq 0x1060
callq 0x16a1
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
andq $0x0, 0x30(%rbx)
cmpl $0x3, %ebp
je 0x18c5
testl %ebp, %ebp
jne 0x18d6
movl $0xf8, %edi
callq 0x11f0
movq %rax, %r15
callq 0x14e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x11d0
jmp 0x18d2
movl $0x1b8, %edi            # imm = 0x1B8
callq 0x11f0
movq %rax, %r15
movq %r15, 0x28(%rbx)
cmpq $0x0, 0x140b8(%r14)
jne 0x18fa
leaq 0x17cd(%rip), %rdi      # 0x30b4
leaq -0x402(%rip), %rdx      # 0x14ec
movl $0x100000, %esi         # imm = 0x100000
xorl %ecx, %ecx
callq 0x1759
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1931
movq 0x28(%rbx), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x11e0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x39(%rip), %rsi        # 0x198a
leaq 0x45(%rip), %rdx        # 0x199d
callq 0x10a0
movl %eax, %ecx
movq $-0xfff, %rax           # imm = 0xF001
cmpl $0xfffff001, %ecx       # imm = 0xFFFFF001
je 0x1988
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movq 0x28(%rbx), %rdi
callq 0x1280
movq 0x18(%rbx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movq (%rdi), %rax
movq (%rdx), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rdx), %rcx
movq %rcx, 0x10(%rax)
movq %rsi, 0x18(%rax)
movq (%rax), %rdi
jmp 0x164f
// File: /workspace/github_c_makefile_star2_O2/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)
andl $0x0, 0x30(%rdi)
callq 0x14e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1140
leaq 0x67(%rip), %rsi        # 0x1a5f
movq %r15, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1230
movq 0x28(%rbx), %rdi
leaq -0x86(%rip), %rsi       # 0x198a
leaq -0x7a(%rip), %rdx       # 0x199d
callq 0x10a0
movl %eax, %ecx
movq $-0xfff, %rax           # imm = 0xF001
cmpl $0xfffff001, %ecx       # imm = 0xFFFFF001
je 0x1a52
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movq 0x28(%rbx), %rdi
callq 0x1280
cmpl $0x0, 0x30(%rbx)
je 0x1a4f
movq 0x18(%rbx), %rax
jmp 0x1a52
pushq $0x6e
popq %rax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x25(%rip), %r8         # 0x1abe
pushq $0x1
popq %rcx
movq %rax, %rdx
callq 0x10c0
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movslq 0x20(%rbx), %rax
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x13(%rip), %rsi        # 0x1af1
callq 0x1060
callq 0x2753
movq %rax, (%rbx)
popq %rbx
jmp 0x16a1
// File: /workspace/github_c_makefile_star2_O2/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 0x1b4e
leaq 0x10(%rsp), %rdi
movq %rbx, (%rdi)
movq 0x28(%rbx), %rsi
leaq 0x1e(%rip), %rcx        # 0x1b54
movq %rsp, %rdx
callq 0x1160
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movl 0x20(%rbx), %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x17(%rip), %rdx        # 0x1b8b
callq 0x1250
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movl 0x20(%rbx), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x14e0
movq 0x28(%rbx), %rsi
leaq 0x34(%rip), %r9         # 0x1bfd
movq %rax, %rdi
movq %r14, %rdx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x10d0
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
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_O2/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 0x14e0
movq 0x28(%rbx), %rsi
movl 0x34(%rbx), %edx
leaq -0x3b(%rip), %rcx       # 0x1bfd
movq %rcx, (%rsp)
pushq $0x1
popq %r8
pushq $-0x1
popq %r9
movq %rax, %rdi
movq %r14, %rcx
callq 0x10b0
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
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_O2/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 0x14e0
movq 0x28(%rbx), %rsi
movl 0x34(%rbx), %edx
leaq -0xa7(%rip), %rcx       # 0x1bfd
movq %rcx, (%rsp)
pushq $0x1
popq %r8
pushq $-0x1
popq %r9
movq %rax, %rdi
movq %r14, %rcx
callq 0x1040
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movq 0x28(%rbx), %rax
movl 0x58(%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x14e0
movq 0x28(%rbx), %rsi
movl 0x34(%rbx), %edx
leaq -0xf8(%rip), %rcx       # 0x1bfd
movq %rax, %rdi
callq 0x1080
callq 0x2753
movq %rax, (%rbx)
callq 0x16a1
movq 0x28(%rbx), %rdi
callq 0x1100
movq 0x28(%rbx), %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r14
callq 0x2753
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
callq 0x14e0
leaq 0x41(%rip), %rcx        # 0x1d8c
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1170
callq 0x16a1
leaq 0x78(%rsp), %r14
movl $0xa0, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11b0
movq %r15, %rdi
callq 0x1100
movl -0x18(%r14), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2753
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
callq 0x14e0
leaq 0x20(%rip), %rcx        # 0x1dda
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11c0
callq 0x16a1
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %rcx
movl $0x2800, %esi           # imm = 0x2800
movl %ebx, %eax
cltd
idivl %esi
movslq %edx, %rax
movq 0x18(%rcx,%rax,8), %rax
testq %rax, %rax
je 0x1e0e
cmpl %ebx, 0x10(%rax)
jne 0x1e0e
pushq $0x1
popq %rax
jmp 0x1e10
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %rbx
movl 0x10(%rax), %esi
pushq $-0x1
popq %rcx
movl $0x2800, %edi           # imm = 0x2800
movl %ecx, %r9d
subl $0x1, %r9d
jb 0x1edd
movl %esi, %r8d
leal 0x1(%r8), %esi
movl 0x14(%rbx), %r15d
incl %r15d
movl %r15d, 0x14(%rbx)
movl %esi, %eax
cltd
idivl %edi
movslq %edx, %rax
movq 0x18(%rbx,%rax,8), %rax
testq %rax, %rax
je 0x1e67
cmpl 0x10(%rax), %esi
je 0x1e34
incl %r8d
movl %r8d, 0x10(%rbx)
testl %r15d, %r15d
js 0x1edd
movl %r14d, %eax
imull %ebp, %eax
movslq %eax, %rdi
addq $0x58, %rdi
callq 0x11f0
movq %rax, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
andq $0x0, 0x50(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movslq %r14d, %rax
movq %rax, (%rcx)
movslq %ebp, %rax
movq %rax, 0x8(%rcx)
movl %r15d, 0x10(%rcx)
leaq 0x20(%rcx), %rax
movq %rax, 0x20(%rcx)
movq %rax, 0x28(%rcx)
leaq 0x38(%rcx), %rax
movq %rax, 0x38(%rcx)
movq %rax, 0x40(%rcx)
movl $0x2800, %esi           # imm = 0x2800
movl %r15d, %eax
xorl %edx, %edx
divl %esi
movq %rcx, 0x18(%rbx,%rdx,8)
movl %r15d, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/whtc123[P]libuvc/uvc.c
// Function: channel_close
int channel_close(channel_t c){
	channel_pool *pool=get_chan_pool();
	channel *chan;
	uvc_ctx *ctx;
	uvc_ctx *ctx_self =uvc_self();
	chan=channel_pool_get(pool,c);
	if(chan == NULL ||chan->id !=c || chan->closeing==1){
		return -1;
	}
	chan->closeing=1;
	
	
	//唤醒所有发送队列，让发生者知道已经发送失败。
	do
    {
        if(queue_empty(&chan->writq) )break;
		ctx = channel_queue_get(&chan->writq);
		uvc_ready(ctx);
		uvc_ready(ctx_self);
		uvc_yield();
    }while(1);


	//如果chanbuf中还有数据，那么不能立即关闭管道，
	//否则发送放无法获知释放已经送达数据。
	if (chanbuf_empty(chan) && queue_empty(&chan->readq)){
		channel_pool_remove(pool, c);
		free(chan); 
	}else{
		do
	    {
	        if(queue_empty(&chan->readq) )break;
			ctx = channel_queue_get(&chan->readq);
			if (ctx!=ctx_self){
				printf("channel closeing,wakeup task[%s]\n",ctx->name);
				uvc_ready(ctx);
				uvc_ready(ctx_self);
				uvc_yield();
			}
	    }while(1);
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r12d
callq 0x266f
movq %rax, %r15
callq 0x2753
movq %rax, %rbx
movl $0x2800, %ecx           # imm = 0x2800
movl %r12d, %eax
cltd
idivl %ecx
movslq %edx, %r13
movq 0x18(%r15,%r13,8), %r14
pushq $-0x1
popq %rbp
testq %r14, %r14
je 0x1f30
cmpl %r12d, 0x10(%r14)
jne 0x1f30
cmpl $0x1, 0x50(%r14)
jne 0x1f41
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, 0x50(%r14)
leaq 0x38(%r14), %r12
cmpq (%r12), %r12
je 0x1f72
movq %r12, %rdi
callq 0x1fe1
movq %rax, %rdi
callq 0x16c3
movq %rbx, %rdi
callq 0x16c3
callq 0x16a1
jmp 0x1f4d
movl 0x14(%r14), %eax
cmpl 0x18(%r14), %eax
jne 0x1f86
leaq 0x20(%r14), %rax
cmpq 0x20(%r14), %rax
je 0x1fcc
addq $0x20, %r14
leaq 0x1131(%rip), %r15      # 0x30c2
xorl %ebp, %ebp
cmpq (%r14), %r14
je 0x1f30
movq %r14, %rdi
callq 0x1fe1
cmpq %rbx, %rax
je 0x1f93
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1120
movq %r12, %rdi
callq 0x16c3
movq %rbx, %rdi
callq 0x16c3
callq 0x16a1
jmp 0x1f93
andq $0x0, 0x18(%r15,%r13,8)
movq %r14, %rdi
callq 0x1030
xorl %ebp, %ebp
jmp 0x1f30
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %rcx
movl $0x2800, %esi           # imm = 0x2800
movl %ebp, %eax
cltd
idivl %esi
movslq %edx, %rax
movq 0x18(%rcx,%rax,8), %r15
pushq $-0x1
popq %rbx
testq %r15, %r15
je 0x210d
cmpl %ebp, 0x10(%r15)
jne 0x210d
cmpl $0x1, 0x50(%r15)
je 0x210d
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x206a
movslq 0x18(%r15), %rcx
leaq 0x1(%rcx), %rax
xorl %edx, %edx
divq %rsi
movslq 0x14(%r15), %rax
cmpq %rax, %rdx
jne 0x20b3
callq 0x2753
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), %rdi
cmpq 0x20(%r15), %rdi
je 0x20f6
callq 0x1fe1
movq %rax, %rdi
callq 0x16c3
jmp 0x20fb
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)
leaq 0x20(%r15), %rdi
cmpq 0x20(%r15), %rdi
je 0x20f2
callq 0x1fe1
movq %rax, %rdi
callq 0x16c3
xorl %ebx, %ebx
jmp 0x210d
callq 0x16a1
cmpl %ebp, 0x10(%r15)
jne 0x210d
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_O2/whtc123[P]libuvc/uvc.c
// Function: channel_read
int channel_read(channel_t c,void *buf){
	channel *chan = NULL;
	uvc_ctx *ctx=uvc_self();
	void *p=NULL;
	queue_t *node = NULL;
	channel_pool *pool = get_chan_pool();
	chan = channel_pool_get(pool,c);
	if(chan == NULL ||chan->id !=c)return -1;
	//当管道关闭的时候，buf中数据任然可读
	if (!chanbuf_empty(chan) ){
		chanbuf_pop(chan,buf);
		if(chan->closeing==1 &&chanbuf_empty(chan)){
			//管道关闭状态，且buf中数据已经读完，失败chan
			free(chan); 
			channel_pool_remove(pool,c);
			return -1;
		}
		return 0;
	}
	else if (chan->closeing == 1){
		return -1;
	}
	
	// 没有协程等待写，入队，调度
	if(queue_empty(&chan->writq) ){
		channel_queue_put(&chan->readq, ctx);
		//queue_add(&chan->readq, &ctx->i_node);
		uvc_yield();
		if(chan == NULL ||chan->id !=c || chan->closeing==1){
			return -1;
		}
		ctx = channel_queue_get(&chan->writq);
        
	}else {
		ctx = channel_queue_get(&chan->writq);
		uvc_ready(ctx);
		//uvc_ready(uvc_self());
		//uvc_yield();
		//uvc_io_ready(ctx);
		//uvc_resume(ctx);
	}
	memcpy(buf, ctx->cbuf, chan->size);
	return 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
callq 0x2753
movq %rax, %r12
callq 0x266f
movq %rax, %r15
movl $0x2800, %ecx           # imm = 0x2800
movl %ebp, %eax
cltd
idivl %ecx
movslq %edx, %r13
movq 0x18(%r15,%r13,8), %rbx
pushq $-0x1
popq %r8
testq %rbx, %rbx
je 0x216b
cmpl %ebp, 0x10(%rbx)
jne 0x216b
movl 0x14(%rbx), %ecx
movslq 0x18(%rbx), %rax
cmpl %eax, %ecx
jne 0x217d
cmpl $0x1, 0x50(%rbx)
jne 0x21e7
movl %r8d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x21c5
movslq %ecx, %rsi
incq %rax
xorl %edx, %edx
divq %rdi
cmpq %rsi, %rdx
je 0x21c5
movq (%rbx), %rdx
imulq %rdx, %rsi
addq %rbx, %rsi
addq $0x54, %rsi
movq %r14, %rdi
movl %r8d, %ebp
callq 0x11b0
movl %ebp, %r8d
movslq 0x14(%rbx), %rax
incq %rax
xorl %edx, %edx
divq 0x8(%rbx)
movq %rdx, %rcx
movl %ecx, 0x14(%rbx)
xorl %eax, %eax
cmpl $0x1, 0x50(%rbx)
jne 0x216e
cmpl 0x18(%rbx), %ecx
jne 0x216e
movq %rbx, %rdi
movl %r8d, %ebx
callq 0x1030
andq $0x0, 0x18(%r15,%r13,8)
movl %ebx, %eax
jmp 0x216e
leaq 0x38(%rbx), %r15
cmpq 0x38(%rbx), %r15
je 0x221d
movq %r15, %rdi
callq 0x1fe1
movq %rax, %r15
movq %rax, %rdi
callq 0x16c3
movq 0x138(%r15), %rsi
movq (%rbx), %rdx
movq %r14, %rdi
callq 0x11b0
xorl %eax, %eax
jmp 0x216e
movl %r8d, %r13d
leaq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq %r12, %rdx
addq $0x100, %rdx            # imm = 0x100
movq %rcx, 0x108(%r12)
movq %rdx, (%rcx)
movq %rax, 0x100(%r12)
movq %rdx, 0x28(%rbx)
callq 0x16a1
cmpl %ebp, 0x10(%rbx)
jne 0x226d
cmpl $0x1, 0x50(%rbx)
movl %r13d, %eax
je 0x216e
movq %r15, %rdi
callq 0x1fe1
movq %rax, %r15
jmp 0x2204
movl %r13d, %eax
jmp 0x216e
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %rcx
movl $0x2800, %esi           # imm = 0x2800
movl %ebx, %eax
cltd
idivl %esi
movslq %edx, %rax
movq 0x18(%rcx,%rax,8), %rcx
pushq $-0x1
popq %rax
testq %rcx, %rcx
je 0x22b9
cmpl %ebx, 0x10(%rcx)
jne 0x22b9
leaq 0x38(%rcx), %rax
cmpq 0x38(%rcx), %rax
je 0x22ae
pushq $0x1
popq %rax
jmp 0x22b9
movl 0x14(%rcx), %edx
xorl %eax, %eax
cmpl 0x18(%rcx), %edx
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x266f
movq %rax, %rcx
movl $0x2800, %esi           # imm = 0x2800
movl %ebx, %eax
cltd
idivl %esi
movslq %edx, %rax
movq 0x18(%rcx,%rax,8), %rsi
pushq $-0x1
popq %rcx
testq %rsi, %rsi
je 0x2312
cmpl %ebx, 0x10(%rsi)
jne 0x2312
leaq 0x20(%rsi), %rax
pushq $0x1
popq %rcx
cmpq 0x20(%rsi), %rax
jne 0x2312
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0x2310
movslq 0x18(%rsi), %rax
incq %rax
xorl %edx, %edx
divq %rdi
movslq 0x14(%rsi), %rax
cmpq %rax, %rdx
jne 0x2312
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2753
leaq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
cmpq %rdx, %rcx
je 0x2342
cmpq %rax, 0x10(%rcx)
jne 0x2323
movq (%rcx), %rsi
movq 0x8(%rcx), %rcx
movq %rsi, (%rcx)
movq %rcx, 0x8(%rsi)
jmp 0x2323
leaq 0x38(%rbx), %rdx
cmpq %rdx, %rcx
je 0x2365
cmpq %rax, 0x10(%rcx)
jne 0x235f
movq (%rcx), %rsi
movq 0x8(%rcx), %rcx
movq %rsi, (%rcx)
movq %rcx, 0x8(%rsi)
movq 0x40(%rbx), %rcx
jmp 0x2346
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x16b0e(%rip), %rdi     # 0x19188
leaq -0x11ad(%rip), %rsi     # 0x14d4
callq 0x11a0
leaq 0x2ae3(%rip), %rdi      # 0x5170
callq 0x1150
movq %rax, %rbx
testq %rax, %rax
jne 0x2748
pushq $0x1
popq %r14
movl $0x14100, %esi          # imm = 0x14100
movq %r14, %rdi
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 $0x140, %esi            # imm = 0x140
movq %r14, %rdi
callq 0x1190
movq %rax, %r14
leaq 0x50(%rax), %rdi
xorl %esi, %esi
callq 0x2830
leaq 0x48(%r14), %rdi
movq 0x50(%r14), %rcx
movq 0x58(%r14), %r8
xorl %esi, %esi
xorl %edx, %edx
callq 0x2781
movb $0x0, 0x4(%r14)
movl $0x544f4f52, (%r14)     # imm = 0x544F4F52
movq %r14, 0x140c0(%rbx)
movq %r14, 0x140c8(%rbx)
movl $0x3, 0x130(%r14)
leaq 0x2a30(%rip), %rdi      # 0x5170
movq %rbx, %rsi
callq 0x1090
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/whtc123[P]libuvc/coro.c
// Function: coro_stack_alloc
int
coro_stack_alloc (struct coro_stack *stack, unsigned int size)
{
  if (!size)
    size = 256 * 1024;

  stack->sptr = 0;
  stack->ssze = ((size_t)size * sizeof (void *) + PAGESIZE - 1) / PAGESIZE * PAGESIZE;

#if CORO_FIBER

  stack->sptr = (void *)stack;
  return 1;

#else

  size_t ssze = stack->ssze + CORO_GUARDPAGES * PAGESIZE;
  void *base;

  #if CORO_MMAP
    /* mmap supposedly does allocate-on-write for us */
    base = mmap (0, ssze, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

    if (base == (void *)-1)
      {
        /* some systems don't let us have executable heap */
        /* we assume they won't need executable stack in that case */
        base = mmap (0, ssze, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

        if (base == (void *)-1)
          return 0;
      }

    #if CORO_GUARDPAGES
      mprotect (base, CORO_GUARDPAGES * PAGESIZE, PROT_NONE);
    #endif

    base = (void*)((char *)base + CORO_GUARDPAGES * PAGESIZE);
  #else
    base = malloc (ssze);
    if (!base)
      return 0;
  #endif

  #if CORO_USE_VALGRIND
    stack->valgrind_id = VALGRIND_STACK_REGISTER ((char *)base, ((char *)base) + ssze - CORO_GUARDPAGES * PAGESIZE);
  #endif

  stack->sptr = base;
  return 1;

#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
movl $0x40000, %r14d         # imm = 0x40000
cmovnel %esi, %r14d
movq %rdi, %rbx
andq $0x0, (%rdi)
callq 0x28f9
leaq (%rax,%r14,8), %r15
decq %r15
callq 0x28f9
movq %rax, %rcx
xorl %r14d, %r14d
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r15
callq 0x28f9
movq %rax, %r12
imulq %r15, %r12
movq %r12, 0x8(%rbx)
callq 0x28f9
leaq (%r12,%rax,4), %r12
pushq $0x7
popq %rdx
pushq $0x22
popq %rcx
pushq $-0x1
popq %r8
xorl %edi, %edi
movq %r12, %rsi
xorl %r9d, %r9d
callq 0x1110
cmpq $-0x1, %rax
jne 0x28c0
pushq $0x3
popq %rdx
pushq $0x22
popq %rcx
pushq $-0x1
popq %r8
xorl %edi, %edi
movq %r12, %rsi
xorl %r9d, %r9d
callq 0x1110
cmpq $-0x1, %rax
je 0x28ea
movq %rax, %r15
callq 0x28f9
leaq (,%rax,4), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x1220
callq 0x28f9
leaq (%r15,%rax,4), %rax
movq %rax, (%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/whtc123[P]libuvc/coro.c
// Function: coro_pagesize
static size_t
    coro_pagesize (void)
    {
      static size_t pagesize;

      if (!pagesize)
        pagesize = sysconf (_SC_PAGESIZE);

      return pagesize;
    }

// Assembly:
movq 0x168b0(%rip), %rax     # 0x191b0
testq %rax, %rax
je 0x2906
retq
pushq %rax
pushq $0x1e
popq %rdi
callq 0x1240
movq %rax, 0x1689a(%rip)     # 0x191b0
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/whtc123[P]libuvc/coro.c
// Function: coro_stack_free
void
coro_stack_free (struct coro_stack *stack)
{
#if CORO_FIBER
  /* nop */
#else
  #if CORO_USE_VALGRIND
    VALGRIND_STACK_DEREGISTER (stack->valgrind_id);
  #endif

  #if CORO_MMAP
    if (stack->sptr)
      munmap ((void*)((char *)stack->sptr - CORO_GUARDPAGES * PAGESIZE),
              stack->ssze                 + CORO_GUARDPAGES * PAGESIZE);
  #else
    free (stack->sptr);
  #endif
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x2952
movq %rdi, %r14
callq 0x28f9
shlq $0x2, %rax
subq %rax, %rbx
movq 0x8(%r14), %r14
callq 0x28f9
leaq (%r14,%rax,4), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1210
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/almk277[P]ROSE/rasm/rasm.cpp
// Function: parse_opt(int, char**)
void parse_opt(int argc, char *argv[])
{
	int idx = cmdopt_parse(argc, argv, opts);
	if (idx)
		throw option_error(string(argv[idx]) + ": can't parse");
	if (help_opt) {
		cmdopt_print(opts);
		std::exit(0);
	}
	if (inname.empty())
		throw option_error("input file not specified");
	if (outname.empty())
		throw option_error("output file not specified");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
leaq 0x10b72(%rip), %rdx     # 0x14c50
callq 0xbfc8
testl %eax, %eax
jne 0x4119
cmpl $0x0, 0x1122a(%rip)     # 0x15318
jne 0x417f
cmpq $0x0, 0x111e4(%rip)     # 0x152e0
je 0x4192
cmpq $0x0, 0x111f6(%rip)     # 0x15300
je 0x41dd
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %ebp
pushq $0x10
popq %rdi
callq 0x3170
movq %rax, %rbx
movslq %ebp, %rax
movq (%r14,%rax,8), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x46b2
leaq 0x8ec9(%rip), %rdx      # 0xd00c
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x46ed
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x470c
xorl %ebp, %ebp
leaq 0x10b45(%rip), %rsi     # 0x14cb0
movq 0x10e2e(%rip), %rdx     # 0x14fa0
movq %rbx, %rdi
callq 0x3470
jmp 0x4226
leaq 0x10aca(%rip), %rdi     # 0x14c50
callq 0xc0f3
xorl %edi, %edi
callq 0x32d0
pushq $0x10
popq %rdi
callq 0x3170
movq %rax, %rbx
leaq 0x8e76(%rip), %rsi      # 0xd01a
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x46b2
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x470c
xorl %ebp, %ebp
leaq 0x10ae4(%rip), %rsi     # 0x14cb0
movq 0x10dcd(%rip), %rdx     # 0x14fa0
movq %rbx, %rdi
callq 0x3470
jmp 0x4226
pushq $0x10
popq %rdi
callq 0x3170
movq %rax, %rbx
leaq 0x8e44(%rip), %rsi      # 0xd033
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x46b2
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x470c
xorl %ebp, %ebp
leaq 0x10a99(%rip), %rsi     # 0x14cb0
movq 0x10d82(%rip), %rdx     # 0x14fa0
movq %rbx, %rdi
callq 0x3470
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3528
jmp 0x423b
movq %rax, %r14
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
jmp 0x424e
jmp 0x4246
jmp 0x425c
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3528
testb %bpl, %bpl
jne 0x425f
jmp 0x4267
jmp 0x425c
movq %rax, %r14
movq %rbx, %rdi
callq 0x3210
movq %r14, %rdi
callq 0x3490
// File: /workspace/github_c_makefile_star2_O2/almk277[P]ROSE/rasm/scanner.cpp
// Function: scanner::next(tok)
void scanner::next(tok expected)
{
	tok t = next();
	if (expected != t)
		throw error(tokname(t) + " encountered, but "
				+ tokname(expected) + " expected");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movl %esi, %ebp
callq 0x53b6
cmpl %ebp, %eax
jne 0x5b66
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %r14d
pushq $0x10
popq %rdi
callq 0x3170
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movl %r14d, %esi
callq 0x4d60
leaq 0x763f(%rip), %rdx      # 0xd1c7
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x46ed
movq %rsp, %rdi
movl %ebp, %esi
callq 0x4d60
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
callq 0x632e
leaq 0x7631(%rip), %rdx      # 0xd1eb
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x46ed
movb $0x1, %bpl
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
callq 0x3440
xorl %ebp, %ebp
movq 0xf400(%rip), %rsi      # 0x14fe8
movq 0xf3a9(%rip), %rdx      # 0x14f98
movq %rbx, %rdi
callq 0x3470
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x3528
jmp 0x5c0f
movq %rax, %r14
movb $0x1, %bpl
leaq 0x60(%rsp), %rdi
callq 0x3528
jmp 0x5c21
movq %rax, %r14
movb $0x1, %bpl
movq %rsp, %rdi
callq 0x3528
jmp 0x5c31
movq %rax, %r14
movb $0x1, %bpl
leaq 0x40(%rsp), %rdi
callq 0x3528
jmp 0x5c43
movq %rax, %r14
movb $0x1, %bpl
leaq 0x20(%rsp), %rdi
callq 0x3528
testb %bpl, %bpl
jne 0x5c57
jmp 0x5c5f
movq %rax, %r14
movq %rbx, %rdi
callq 0x3210
movq %r14, %rdi
callq 0x3490
nop
// File: /workspace/github_c_makefile_star2_O2/almk277[P]ROSE/rasm/scanner.cpp
// Function: scanner::string_pair[abi:cxx11]() const
std::pair<string, string> scanner::string_pair() const
{
	auto pos = s.find(STRING_DELIM);
	if (pos == string::npos)
		throw error(s + ": compound string expected");
	return { s.substr(0, pos), s.substr(pos) };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x10, %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3320
cmpq $-0x1, %rax
je 0x5db7
movq %rax, %r15
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3290
leaq 0x28(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r14, %rsi
movq %r15, %rdx
callq 0x3290
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x63ee
movq %r15, %rdi
callq 0x3528
movq %r14, %rdi
callq 0x3528
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x3170
movq %rax, %rbx
leaq 0x7411(%rip), %rdx      # 0xd1da
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x4721
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3440
xorl %ebp, %ebp
movq 0xf1f9(%rip), %rsi      # 0x14fe8
movq 0xf1a2(%rip), %rdx      # 0x14f98
movq %rbx, %rdi
callq 0x3470
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3528
testb %bpl, %bpl
jne 0x5e15
jmp 0x5e2c
movq %rax, %r14
movq %rbx, %rdi
callq 0x3210
jmp 0x5e2c
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3528
movq %r14, %rdi
callq 0x3490