LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/URLManager/./../Queue/Queue.h
// Function: Queue<URL>::pushTail(URL*)
int Queue<T>::pushTail( T *node )
{
    Node<T> *temp = NULL;
    if ( node  == NULL)
    {
        return -1;
    }
    pthread_mutex_lock(&lock);
    temp = new Node<T>;
    temp->node = node;
    temp->next = NULL;
    if ( tail == NULL && head == NULL )
    {
        tail = temp;
        head = temp;
    }
    else if ( tail != NULL )
    {
        tail->next = temp;
        tail = temp;
    }
    length++;
    pthread_mutex_unlock(&lock);
}

// Assembly:
testq %rsi, %rsi
jne 0x9921
pushq $-0x1
popq %rax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x8450
pushq $0x10
popq %rdi
callq 0x8300
movq %r15, (%rax)
andq $0x0, 0x8(%rax)
leaq 0x8(%rbx), %rcx
movq 0x8(%rbx), %rdx
movq (%rbx), %rsi
orq %rdx, %rsi
jne 0x9965
movq %rcx, %rdx
movq %rbx, %rcx
jmp 0x996e
testq %rdx, %rdx
je 0x9974
addq $0x8, %rdx
movq %rax, (%rdx)
movq %rax, (%rcx)
incl 0x14(%rbx)
movq %r14, %rdi
callq 0x8200
nop
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/URLManager/./../Queue/Queue.h
// Function: Queue<URL>::pushHead(URL*)
int Queue<T>::pushHead( T *node )
{
    Node<T> *temp = NULL;
    if ( node == NULL)
    {
        return -1;
    }

    pthread_mutex_lock( &lock );
    temp = new Node<T>;
    temp->node = node;
    temp->next = head;
    head = temp;
    if ( tail == NULL)
    {
	temp->next = NULL;
        tail = head;
    }
    length++;
    pthread_mutex_unlock(&lock);
}

// Assembly:
testq %rsi, %rsi
jne 0x9989
pushq $-0x1
popq %rax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x8450
pushq $0x10
popq %rdi
callq 0x8300
movq %r15, (%rax)
movq (%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rbx)
cmpq $0x0, 0x8(%rbx)
jne 0x99ca
andq $0x0, 0x8(%rax)
movq %rax, 0x8(%rbx)
incl 0x14(%rbx)
movq %r14, %rdi
callq 0x8200
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/./URLParser.cpp
// Function: URLParser::getHost(char*)
char *URLParser::getHost( char *url )
{
	char *temp = NULL;
	pthread_mutex_lock( &lock );
	temp = gethost(url);	
	pthread_mutex_unlock( &lock );
	return temp;
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x7c677(%rip), %r14     # 0x86060
movq %r14, %rdi
callq 0x8450
movq %rbx, %rdi
callq 0xa57e
movq %rax, %rbx
movq %r14, %rdi
callq 0x8200
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/./URLParser.cpp
// Function: URLParser::getPort(char*)
char *URLParser::getPort( char *url )
{
	char *temp = NULL;
        pthread_mutex_lock( &lock );
        temp = getport(url);
        pthread_mutex_unlock( &lock );
        return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x7c643(%rip), %r14     # 0x86060
movq %r14, %rdi
callq 0x8450
movq %rbx, %rdi
callq 0xa61b
movq %rax, %rbx
movq %r14, %rdi
callq 0x8200
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/./URLParser.cpp
// Function: URLParser::getRes(char*)
char *URLParser::getRes( char *url )
{
	char *temp = NULL;
        pthread_mutex_lock( &lock );
        temp = getres(url);
        pthread_mutex_unlock( &lock );
        return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x7c60f(%rip), %r14     # 0x86060
movq %r14, %rdi
callq 0x8450
movq %rbx, %rdi
callq 0xa718
movq %rax, %rbx
movq %r14, %rdi
callq 0x8200
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/bloom/bloom.c
// Function: add
void add( char *str )
{
	int i = 0;
	unsigned h = 0;
	for( i = 0; i< 8; i++)
	{
		h = hash( str , seeds[i]);
		bloom[h/sizeof(int)] |= 1<<(h%sizeof(int));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x5e771(%rip), %r15     # 0x68230
pushq $0x1
popq %r12
leaq 0x7c5e6(%rip), %r13     # 0x860b0
cmpq $0x20, %r14
je 0x9af3
movl (%r14,%r15), %esi
movq %rbx, %rdi
callq 0x9b02
movl %eax, %ecx
andb $0x3, %cl
movl %r12d, %edx
shll %cl, %edx
andl $-0x4, %eax
orl %edx, (%rax,%r13)
addq $0x4, %r14
jmp 0x9aca
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/bloom/bloom.c
// Function: hash
static unsigned int hash( char *str , int seed)
{
	char *temp = str;
	unsigned int ret = 0;
	while( temp != NULL && *temp !='\0')
	{
		ret = ret*seed + *temp;
		temp++;
	}
	return ret % BLOOM_BIT_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
testq %rdi, %rdi
je 0x9b1e
movsbl (%rdi), %ecx
testl %ecx, %ecx
je 0x9b1e
imull %esi, %eax
addl %ecx, %eax
incq %rdi
jmp 0x9b08
movl $0x9c40, %ecx           # imm = 0x9C40
xorl %edx, %edx
divl %ecx
movl %edx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/ConfigParser/configparser.cpp
// Function: ConfigParser::~ConfigParser()
ConfigParser::~ConfigParser()
{
    for( int  i = 0; i < MODESIZE ; i++ )
    {
        if (this->modes[i] != NULL)
        {
            delete this->modes[i];
        }
    }
    delete ConfigParser::config;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x3
popq %r12
pushq $0x10
popq %r14
cmpq $0x17, %r12
je 0x9c81
movq (%rbx,%r12,8), %r15
testq %r15, %r15
je 0x9c7c
movq %r15, %rdi
callq 0xa38a
movq %r15, %rdi
movq %r14, %rsi
callq 0x8310
incq %r12
jmp 0x9c5a
movq 0x86070(%rip), %rbx     # 0x8fcf8
testq %rbx, %rbx
je 0x9c95
movq %rbx, %rdi
callq 0x9c44
movl $0xb8, %esi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8310
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/dns/dns.c
// Function: dns
struct sockaddr_in *dns( char *hostname ,char *port)
{
	struct addrinfo *ai=NULL;
	struct addrinfo i;
	struct sockaddr_in *p = NULL;
	int ret;
	if (hostname == NULL|| port == NULL)
	{
		return NULL;
	}
	memset(&i,0 ,sizeof(struct addrinfo));
	i.ai_family = AF_INET;
//	i.ai_flags = AI_PASSIVE;
	i.ai_socktype = SOCK_STREAM;
	ret = getaddrinfo(hostname,port,&i,&ai);
	if (ret != 0 && ai == NULL)
	{
		puts(gai_strerror(ret));
		return NULL;
	}
	p = (struct sockaddr_in*)malloc(sizeof(struct sockaddr_in));
	if (p==NULL)
	{
		freeaddrinfo(ai);
		return NULL;
	}
	memset(p, 0 , sizeof(struct sockaddr_in));
	memcpy(p,ai->ai_addr,sizeof(struct sockaddr_in));
/*	p->sin_family = AF_INET;
	p->sin_port = htons(atoi(port));
	memcpy( &(p->sin_addr) ,&(ai->ai_addr->sin_addr) , sizeof(struct in_addr) );
*/	
	freeaddrinfo(ai);
	return p;
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
andq $0x0, -0x18(%rbp)
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xa082
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%rdx)
leaq -0x18(%rbp), %rbx
movq %rbx, %rcx
callq 0x83b0
testl %eax, %eax
setne %cl
movq (%rbx), %r14
testq %r14, %r14
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xa056
movl %eax, %edi
callq 0x8400
movq %rax, %rdi
callq 0x84b0
jmp 0xa082
pushq $0x10
popq %rdi
callq 0x83f0
testq %rax, %rax
je 0xa07a
movq %rax, %rbx
movq 0x18(%r14), %rax
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movq %r14, %rdi
callq 0x83e0
jmp 0xa084
movq %r14, %rdi
callq 0x83e0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/HashList/hash.c
// Function: hash
unsigned int hash( const char *str , int len)
{

	unsigned int ret = 0;
	unsigned int seed = 131;
	
	int i;
	for ( i = 0 ; i < len ; i++)
	{
		ret = ret * seed + str[i];
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
xorl %eax, %eax
cmpq %rcx, %rsi
je 0xa0b3
imull $0x83, %eax, %edx
movsbl (%rdi,%rcx), %eax
addl %edx, %eax
incq %rcx
jmp 0xa09d
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/HashList/hashlist.c
// Function: destroyHashList
int   destroyHashList( HashList *list)
{
    int i = 0;
    HashNode *temp;
    if ( list == NULL )
    {
        return -1;
    }

    for( i = 0; i < LISTLENGTH ; i++ )
    {
        while( list->list[i].next != NULL )
        {
            temp = list->list[i].next;
            list->list[i].next = list->list[i].next->next;
            if (temp != NULL )
                free(temp);
        }
    }
    list->length = 0;
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0xa135
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
cmpq $0xa, %r14
je 0xa121
imulq $0x18, %r14, %rax
leaq (%rbx,%rax), %r15
addq $0x10, %r15
movq (%r15), %rdi
testq %rdi, %rdi
je 0xa11c
movq 0x10(%rdi), %rax
movq %rax, (%r15)
callq 0x8360
jmp 0xa106
incq %r14
jmp 0xa0f4
andl $0x0, 0xf0(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/HashList/hashlist.c
// Function: addElement
int   addElement( HashList *list, const char *key , void *value )
{
    int pos = 0;
    HashNode *temp = NULL;
    void *data = NULL;
    char *tkey = NULL;

    if ( list == NULL || key == NULL || value == NULL )
    {
        return -1;
    }

    data = getElement( list , key );
    if (data != NULL )
    {
        return -1;
    }

    pos = hash( key ,strlen(key)) % LISTLENGTH;

    temp = (HashNode*)malloc( sizeof( HashNode ) + strlen( key )+ 1 );

    if ( temp == NULL )
    {
        return -1;
    }
    tkey = (char *)(temp + 1);
    sprintf(tkey , "%s", key);
    temp->node = value;
    temp->key = tkey;
    temp->next = list->list[pos].next;
    list->list[pos].next = temp;
    list->length++;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
orb %cl, %al
pushq $-0x1
popq %r14
jne 0xa1f4
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0xa206
testq %rax, %rax
jne 0xa1f4
movq %r12, %rdi
callq 0x8120
movq %r12, %rdi
movl %eax, %esi
callq 0xa090
movl %eax, -0x30(%rbp)
movq %r12, %rdi
callq 0x8120
leaq 0x19(%rax), %rdi
callq 0x83f0
testq %rax, %rax
je 0xa1f4
movq %rax, %r13
xorl %r14d, %r14d
pushq $0xa
popq %rcx
movl -0x30(%rbp), %eax
xorl %edx, %edx
divl %ecx
movq %rdx, -0x30(%rbp)
movq %r13, %rdi
addq $0x18, %rdi
movq %rdi, -0x38(%rbp)
movq %r12, %rsi
callq 0x82b0
movq %r15, (%r13)
movq -0x38(%rbp), %rax
movq %rax, 0x8(%r13)
imulq $0x18, -0x30(%rbp), %rax
movq 0x10(%rbx,%rax), %rcx
movq %rcx, 0x10(%r13)
movq %r13, 0x10(%rbx,%rax)
incl 0xf0(%rbx)
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/HashList/hashlist.c
// Function: getElement
void* getElement( HashList *list, const char *key)
{
    int pos = 0;
    HashNode *temp = NULL;

    if ( list == NULL || key == NULL )
    {
        return NULL;
    }

    pos = hash( key , strlen( key )) % LISTLENGTH;
    temp = list->list[pos].next;
    while( temp != NULL )
    {
        if ( !strcmp ( temp->key , key ))
        {
            return temp->node;
        }
        temp = temp->next;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0xa225
xorl %r14d, %r14d
jmp 0xa273
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x8120
movq %rbx, %rdi
movl %eax, %esi
callq 0xa090
xorl %r14d, %r14d
pushq $0xa
popq %rcx
xorl %edx, %edx
divl %ecx
imulq $0x18, %rdx, %rax
addq %rax, %r15
addq $0x10, %r15
movq (%r15), %r15
testq %r15, %r15
je 0xa273
movq 0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x8420
testl %eax, %eax
je 0xa270
addq $0x10, %r15
jmp 0xa252
movq (%r15), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/HashList/hashlist.c
// Function: delElement
void* delElement( HashList *list, const char *key)
{
    int pos = 0;
    HashNode *temp = NULL;
    HashNode *pre = NULL;
    HashNode *del = NULL;
    void *data = NULL;
    if ( list == NULL || key == NULL )
    {
        return NULL;
    }

    pos = hash( key , strlen( key )) % LISTLENGTH;
    pre = &(list->list[pos]);
    temp = list->list[pos].next;
    while( temp != NULL )
    {
        if ( !strcmp ( temp->key , key ))
        {
            del = temp;
            data = temp->node;
            pre->next = del->next;
            free( del );
            list->length--;
            return data;
        }
        pre = temp;
        temp = temp->next;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0xa2a4
xorl %r15d, %r15d
jmp 0xa306
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x8120
movq %r14, %rdi
movl %eax, %esi
callq 0xa090
xorl %r15d, %r15d
pushq $0xa
popq %rcx
xorl %edx, %edx
divl %ecx
imulq $0x18, %rdx, %r12
addq %rbx, %r12
movq %r12, %r13
movq 0x10(%r12), %r12
testq %r12, %r12
je 0xa306
movq 0x8(%r12), %rdi
movq %r14, %rsi
callq 0x8420
testl %eax, %eax
jne 0xa2cd
movq (%r12), %r15
movq 0x10(%r12), %rax
movq %rax, 0x10(%r13)
movq %r12, %rdi
callq 0x8360
decl 0xf0(%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/ConfigParser/modepair.cpp
// Function: ModePair::ModePair(char*, int)
ModePair::ModePair(char *mode, int type)
{
    if (mode == NULL)   return;

    int len = strlen(mode);
    this->mode = new char[len+1];
    sprintf(this->mode,"%s",mode);
    this->type = type;

}

// Assembly:
testq %rsi, %rsi
je 0xa375
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x8120
incl %eax
movslq %eax, %rdi
callq 0x8040
movq %rax, (%r14)
movq %rax, %rdi
movq %r15, %rsi
callq 0x82b0
movl %ebx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/log/mylog.c
// Function: writelog
int writelog( int fd , int filter,int level, const char *str)
{
	char buf[512] = { 0 };
	struct tm *ti;
	char a[][11]={	"[DEBUG]   ",
			"[WARNING] ",
			"[ERROR]   "};
	if ( level > ERROR || filter > ERROR || level < DEBUG || filter < DEBUG)
		return-1;
	if ( level < filter)
		return 0;
	time_t t;
	time(&t);
	ti = localtime(&t);
	
	sprintf(buf,"%s %4d/%02d/%02d %02d:%02d:%02d :%s\n", a[level],
					ti->tm_year+1900,
					ti->tm_mon+1 ,
					ti->tm_mday,
					ti->tm_hour,
					ti->tm_min,
					ti->tm_sec,
					str);
	write(fd , buf ,strlen(buf));
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rcx, %r14
movl %edx, %r12d
movl %esi, %r13d
movl %edi, %ebx
leaq -0x260(%rbp), %rdi
xorl %r15d, %r15d
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x8160
movaps 0x5df6c(%rip), %xmm0    # 0x68340
movaps %xmm0, -0x50(%rbp)
movaps 0x5df51(%rip), %xmm0    # 0x68330
movaps %xmm0, -0x60(%rbp)
movb $0x0, -0x40(%rbp)
cmpl $0x3, %r12d
setae %al
cmpl $0x3, %r13d
setae %cl
orb %al, %cl
je 0xa402
pushq $-0x1
popq %r15
jmp 0xa484
cmpl %r13d, %r12d
jb 0xa484
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x82a0
movq %r15, %rdi
callq 0x81d0
movl %r12d, %ecx
imulq $0xb, %rcx, %rcx
leaq (%rcx,%rbp), %rdx
addq $-0x60, %rdx
movl $0x76c, %ecx            # imm = 0x76C
addl 0x14(%rax), %ecx
movl 0x10(%rax), %r8d
incl %r8d
movl 0xc(%rax), %r9d
movl 0x8(%rax), %r10d
movl (%rax), %r11d
movl 0x4(%rax), %r13d
leaq 0x5df02(%rip), %rsi     # 0x68351
xorl %r15d, %r15d
leaq -0x260(%rbp), %r12
movq %r12, %rdi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r13
pushq %r10
callq 0x8080
addq $0x20, %rsp
movq %r12, %rdi
callq 0x8120
movl %ebx, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x80f0
movl %r15d, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/log/mylog.c
// Function: mylog
void mylog( int level , const char *str)
{
	int fd = open( "spider.log" , O_CREAT|O_RDWR|O_APPEND,0666);
	if ( fd != -1)
	{
		writelog(fd , ERROR , level , str);
		close( fd );	
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x5dec6(%rip), %rdi     # 0x68376
movl $0x442, %esi            # imm = 0x442
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x81c0
cmpl $-0x1, %eax
je 0xa4eb
movl %eax, %r15d
pushq $0x2
popq %rsi
movl %eax, %edi
movl %r14d, %edx
movq %rbx, %rcx
callq 0xa398
movl %r15d, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8560
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/parserurl.c
// Function: removehttp
char *removehttp(char *url)
{
	char *u = url;
	char *ru;
	int len = 0;

	if (url == NULL)
		return NULL;


	if ( (u = strstr(url , "//")) != NULL)
	{
		ru = (char*)malloc(strlen(u+1));
		if ( ru== NULL)
			return NULL;
		memset( ru , 0 , strlen(u+1));
		memcpy( ru , u+2 , strlen(u+2));
	}
	else
	{
		ru = (char*)malloc(strlen(url)+1);
		memset( ru , 0 ,strlen(url)+1);
		memcpy( ru , url, strlen(url));
	}
	return ru;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xa54e
movq %rdi, %r14
leaq 0x5dc02(%rip), %rsi     # 0x68110
callq 0x8090
testq %rax, %rax
je 0xa555
movq %rax, %rbx
leaq 0x1(%rax), %rdi
callq 0x8120
pushq $0x1
popq %rdi
movq %rax, %rsi
callq 0x8190
testq %rax, %rax
je 0xa54e
movq %rax, %r14
addq $0x2, %rbx
movq %rbx, %rdi
callq 0x8120
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
jmp 0xa575
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
callq 0x8120
movq %rax, %rbx
leaq 0x1(%rax), %rsi
pushq $0x1
popq %rdi
callq 0x8190
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x8230
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/parserurl.c
// Function: gethost
char *gethost( char *url)
{
	char *hosts,*hoste;
	char *rhttp ;
	if( url == NULL)
		return NULL;

	if ((hosts = strstr(url,"//")) == NULL)
	{
		return NULL;
	}
	hosts+=2;
	if ((hoste = strstr( hosts,":")) == NULL)
	{
		if((hoste = strstr(hosts,"/")) == NULL)
		{
			rhttp = (char*)malloc(strlen(hosts)+1);
			if ( rhttp == NULL)
				return NULL;
			memset(rhttp, 0 , strlen(hosts)+1);
			memcpy(rhttp, hosts,strlen(hosts));
			return rhttp;
		}
	}
	int len = hoste - hosts;
	rhttp = (char *)malloc(len + 1);
	memset( rhttp, 0 , len+1);
	memcpy( rhttp, hosts, len);
	return rhttp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xa614
leaq 0x5db7b(%rip), %rsi     # 0x68110
callq 0x8090
testq %rax, %rax
je 0xa614
movq %rax, %rbx
addq $0x2, %rbx
pushq $0x3a
popq %rsi
movq %rbx, %rdi
callq 0x8100
testq %rax, %rax
jne 0xa5c6
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x8100
testq %rax, %rax
je 0xa5ed
movq %rax, %r14
subq %rbx, %r14
leal 0x1(%r14), %eax
movslq %eax, %rsi
pushq $0x1
popq %rdi
callq 0x8190
movslq %r14d, %rdx
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x8230
movq %rbx, %rdi
callq 0x8120
movq %rax, %r14
leaq 0x1(%rax), %rsi
pushq $0x1
popq %rdi
callq 0x8190
testq %rax, %rax
je 0xa614
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
jmp 0xa5e4
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/parserurl.c
// Function: getport
char *getport( char *url)
{
	char *c,*p;
	char *port;
	char *rh;
	if (url == NULL)
		return NULL;
	rh = removehttp(url);

	if ((c = strchr(rh,':'))== NULL)
	{
		free(rh);
		if ( strncmp(url, "https",5) == 0 )
		{
			port = (char *)malloc(4);
			if (port == NULL)
				return NULL;
			sprintf( port , "443");
		}
		else if ((strncmp(url,"http",4) == 0) ||(strncmp(url, "//",2)==0) )
		{
			port = (char *)malloc(3);
			if (port == NULL)
				return NULL;
			sprintf(port, "80");
		}
		else 
		{
			return NULL;
		}
	}
	else
	{
		c++;
		if ( (p = strchr(c,'/')) == NULL)
		{
			port = (char*)malloc(strlen(c)+1);	
			if (port == NULL)	
				return NULL;
			memset(port , 0 , strlen(c)+1);
			memcpy(port , c , strlen(c));
		}
		else
		{
			port = (char*)malloc(p-c+1);
			if ( port == NULL)
				return NULL;
			memset( port , 0 , p-c+1);
			memcpy( port , c , p-c);
		}
	}
	return port;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa70b
movq %rdi, %rbx
callq 0xa4f8
movq %rax, %r15
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x8100
testq %rax, %rax
je 0xa66b
movq %rax, %r14
incq %r14
pushq $0x2f
popq %rsi
movq %r14, %rdi
callq 0x8100
testq %rax, %rax
je 0xa6c2
movq %rax, %rbx
subq %r14, %rbx
leaq 0x1(%rbx), %rsi
jmp 0xa6d1
movq %r15, %rdi
callq 0x8360
leaq 0x5dd07(%rip), %rsi     # 0x68381
pushq $0x5
popq %rdx
movq %rbx, %rdi
callq 0x8150
testl %eax, %eax
je 0xa6f6
leaq 0x5dcf7(%rip), %rsi     # 0x68387
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x8150
testl %eax, %eax
je 0xa6aa
cmpb $0x2f, (%rbx)
jne 0xa70b
cmpb $0x2f, 0x1(%rbx)
jne 0xa70b
pushq $0x3
popq %rdi
callq 0x83f0
testq %rax, %rax
je 0xa70b
movb $0x0, 0x2(%rax)
movw $0x3038, (%rax)         # imm = 0x3038
jmp 0xa70d
movq %r14, %rdi
callq 0x8120
movq %rax, %rbx
leaq 0x1(%rax), %rsi
pushq $0x1
popq %rdi
callq 0x8190
testq %rax, %rax
je 0xa70b
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8230
pushq $0x4
popq %rdi
callq 0x83f0
testq %rax, %rax
je 0xa70b
movl $0x333434, (%rax)       # imm = 0x333434
jmp 0xa70d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/parserurl.c
// Function: getres
char *getres( char *url )
{
	char *u;
	char *find;
	char *ret;
	int len;

	if (url == NULL)
		return NULL;

	u = removehttp(url);
	if ( (find = strchr(u,'/')) == NULL)
	{
		free(u);
		ret = (char *)malloc(2);
		if (ret == NULL )
			return NULL;
		sprintf( ret , "/");
		return ret;
	}
	len = strlen(find);
	ret = (char *)malloc(len+1);
	if ( ret == NULL )
	{
		free(u);
		return NULL;
	}
	sprintf(ret , "%s", find);
	free(u);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa798
callq 0xa4f8
movq %rax, %rbx
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x8100
testq %rax, %rax
je 0xa771
movq %rax, %r15
movq %rax, %rdi
callq 0x8120
incl %eax
movslq %eax, %rdi
callq 0x83f0
testq %rax, %rax
je 0xa790
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x82b0
movq %rbx, %rdi
callq 0x8360
jmp 0xa79b
movq %rbx, %rdi
callq 0x8360
pushq $0x2
popq %rdi
callq 0x83f0
testq %rax, %rax
je 0xa798
movq %rax, %r14
movw $0x2f, (%rax)
jmp 0xa79b
movq %rbx, %rdi
callq 0x8360
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/parserurl/parserurl.c
// Function: parserURL
PURL *parserURL( PURL *u , char *url)
{
	PURL *ret;
	char *host;
	char *port;
	char *res;

	if (url == NULL)
		return NULL;
	host = gethost(url);
	port = getport(url);
	res =  getres(url);

	if (host == NULL )
	{
		if ( u == NULL || u->host == NULL)
			return NULL;
		host = (char *)malloc(strlen(u->host)+1);
		sprintf(host , "%s", u->host);
	}
	if (port == NULL )
	{
		if ( u == NULL || u->port == NULL)
			return NULL;
		port = (char *)malloc(strlen(u->port)+1);
		sprintf( port , "%s" , u->port);
	}
	ret = (PURL*)malloc(sizeof(PURL));
	if (ret == NULL )
	{
		if ( host == NULL)
			free(host);
		if ( port == NULL)
			free(port);
		if ( res == NULL )
			free(res);
		return NULL;
	}
	ret->host = host;
	ret->port = port;
	ret->res  = res;
	return ret;
}

// Assembly:
testq %rsi, %rsi
je 0xa807
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r12
movq %rsi, %rdi
callq 0xa57e
movq %rax, %r14
movq %rbx, %rdi
callq 0xa61b
movq %rax, %r15
movq %rbx, %rdi
callq 0xa718
movq %rax, %rbx
testq %r14, %r14
je 0xa80a
testq %r15, %r15
je 0xa839
pushq $0x20
popq %rdi
callq 0x83f0
testq %rax, %rax
je 0xa869
movq %r14, (%rax)
movq %r15, 0x8(%rax)
movq %rbx, 0x10(%rax)
jmp 0xa86b
xorl %eax, %eax
retq
testq %r12, %r12
je 0xa869
movq (%r12), %r13
testq %r13, %r13
je 0xa869
movq %r13, %rdi
callq 0x8120
leaq 0x1(%rax), %rdi
callq 0x83f0
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x82b0
jmp 0xa7e8
testq %r12, %r12
je 0xa869
movq 0x8(%r12), %r12
testq %r12, %r12
je 0xa869
movq %r12, %rdi
callq 0x8120
leaq 0x1(%rax), %rdi
callq 0x83f0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x82b0
jmp 0xa7ed
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: setnonblock
int setnonblock( int fd)
{
	int flags = fcntl( fd , F_GETFL); 
	if (flags < 0 )
		return -1;
	flags|=O_NONBLOCK;
	if ( fcntl( fd, F_SETFL , flags) < 0)
		return -1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0x8170
testl %eax, %eax
js 0xa8c6
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebx, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x8170
sarl $0x1f, %eax
jmp 0xa8c9
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: setblock
int setblock( int fd )
{
	int flags = fcntl( fd , F_GETFL); 
	if (flags < 0 )
		return -1;
	flags&=~O_NONBLOCK;
	if ( fcntl( fd, F_SETFL , flags) < 0)
		return -1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0x8170
testl %eax, %eax
js 0xa8fe
andl $0x7ffff7ff, %eax       # imm = 0x7FFFF7FF
pushq $0x4
popq %rsi
movl %ebx, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x8170
sarl $0x1f, %eax
jmp 0xa901
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: read_timeout
int read_timeout( int fd , int sec)
{
	fd_set fds;
	struct timeval t;
	int ret;
	
	if ( sec <= 0)
		return 0;

	FD_ZERO(&fds);
	FD_SET(fd,&fds);
	
	t.tv_sec = sec;
	t.tv_usec = 0;
	do
	{
		ret = select( fd+1 , &fds, NULL, NULL ,&t);
	}while(ret < 0 && errno == EINTR);

	if ( ret < 0 )
	{
		return -1;
	}else if (ret == 0)
	{
		errno = ETIMEDOUT;
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
testl %esi, %esi
jle 0xa994
movl %edi, %ebx
xorl %eax, %eax
cmpq $0x10, %rax
je 0xa936
andq $0x0, -0xb0(%rbp,%rax,8)
incq %rax
jmp 0xa922
pushq $0x40
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xb0(%rbp,%rdx,8)
movl %esi, %eax
leaq -0x30(%rbp), %r15
movq %rax, (%r15)
andq $0x0, 0x8(%r15)
incl %ebx
leaq -0xb0(%rbp), %r12
pushq $-0x1
popq %r14
movl %ebx, %edi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x82e0
testl %eax, %eax
jns 0xa992
callq 0x8050
cmpl $0x4, (%rax)
je 0xa971
jmp 0xa997
je 0xa9aa
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x8050
movl $0x6e, (%rax)
jmp 0xa997
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: write_timeout
int write_timeout( int fd, int sec )
{
	fd_set fds;
	int ret;
	struct timeval t;	
	
	if ( sec <= 0)
		return 0;

	FD_ZERO(&fds);
	FD_SET( fd , &fds);
	
	t.tv_sec = sec;
	t.tv_usec = 0;
	
	do
	{
		ret = select( fd+1, NULL , &fds, NULL , &t);
	}while(ret < 0 && errno == EINTR);
		
	if (ret < 0)
	{
		return -1;
	}
	else if ( ret == 0)
	{
		errno = ETIMEDOUT;
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
testl %esi, %esi
jle 0xaa43
movl %edi, %ebx
xorl %eax, %eax
cmpq $0x10, %rax
je 0xa9e5
andq $0x0, -0xb0(%rbp,%rax,8)
incq %rax
jmp 0xa9d1
pushq $0x40
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xb0(%rbp,%rdx,8)
movl %esi, %eax
leaq -0x30(%rbp), %r15
movq %rax, (%r15)
andq $0x0, 0x8(%r15)
incl %ebx
leaq -0xb0(%rbp), %r12
pushq $-0x1
popq %r14
movl %ebx, %edi
xorl %esi, %esi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x82e0
testl %eax, %eax
jns 0xaa41
callq 0x8050
cmpl $0x4, (%rax)
je 0xaa20
jmp 0xaa46
je 0xaa59
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x8050
movl $0x6e, (%rax)
jmp 0xaa46
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: accept_timeout
int accept_timeout( int fd , struct sockaddr_in *addr , int sec)
{
	fd_set fds;
	struct timeval t;
	int ret;
	socklen_t len = sizeof( struct sockaddr_in);
	
	if ( sec <= 0 )
		return 0;

	FD_ZERO(&fds);
	FD_SET(fd,&fds);
	
	t.tv_sec = sec;
	t.tv_usec = 0;

	do
	{
		ret = select( fd +1, &fds, NULL , NULL ,&t);
	}while( ret < 0 && errno == EINTR);

	if ( ret < 0)
	{
		return -1;
	}
	else if ( ret == 0)
	{
		errno = ETIMEDOUT;
		return -1;
	}
		
	memset( addr , 0 , sizeof( struct sockaddr_in));
	if ( (ret = accept( fd , (struct sockaddr*) addr,&len)) < 0 )
		return -1;
	 
	return ret;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl $0x10, -0x2c(%rbp)
testl %edx, %edx
jle 0xab0d
movl %edx, %r8d
movl %edi, %r14d
xorl %eax, %eax
cmpq $0x10, %rax
je 0xaaa5
andq $0x0, -0xc8(%rbp,%rax,8)
incq %rax
jmp 0xaa91
movq %rsi, -0x38(%rbp)
pushq $0x40
popq %rcx
movl %r14d, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %r14d, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xc8(%rbp,%rdx,8)
movl %r8d, %eax
leaq -0x48(%rbp), %r12
movq %rax, (%r12)
andq $0x0, 0x8(%r12)
leal 0x1(%r14), %r13d
leaq -0xc8(%rbp), %rbx
pushq $-0x1
popq %r15
movl %r13d, %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x82e0
testl %eax, %eax
jns 0xab12
callq 0x8050
cmpl $0x4, (%rax)
je 0xaaeb
jmp 0xab41
xorl %r15d, %r15d
jmp 0xab41
je 0xab36
xorps %xmm0, %xmm0
movq -0x38(%rbp), %rsi
movups %xmm0, (%rsi)
leaq -0x2c(%rbp), %rdx
movl %r14d, %edi
callq 0x80c0
testl %eax, %eax
pushq $-0x1
popq %r15
cmovnsl %eax, %r15d
jmp 0xab41
callq 0x8050
movl $0x6e, (%rax)
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: connect_timeout
int connect_timeout( int fd , struct sockaddr_in *addr, int sec)
{
	fd_set fds;
	int ret;
	struct timeval t;
	
	if ( sec <= 0)
		return 0;	
	
	setnonblock(fd);

	ret = connect( fd , (struct sockaddr*) addr , sizeof( struct sockaddr_in));
	if ( ret < 0  && errno == EINPROGRESS)
	{
		FD_ZERO(&fds);
		FD_SET(fd,&fds);
		
		t.tv_sec = sec;
		t.tv_usec = 0;
		
		do
		{
			ret = select( fd+1 , NULL , &fds, NULL , &t);
		}while(ret < 0 && errno == EINTR );	
		
		if ( ret > 0)
		{
			int err;
			int len;
			if ( getsockopt( fd , SOL_SOCKET, SO_ERROR ,(void *)&err , &len) == 0 )
				ret = 0;
			else
				ret =  -1;
		}
		else if ( ret == 0)
		{
			errno = ETIMEDOUT;
			ret = -1;
		}
		else
		{
			ret = -1;
		}
		
	}

	setblock(fd);	

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
testl %edx, %edx
jle 0xabbc
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %r13d
callq 0xa898
pushq $0x10
popq %rdx
movl %r13d, %edi
movq %rbx, %rsi
callq 0x8240
movl %eax, %r12d
testl %eax, %eax
jns 0xac56
callq 0x8050
cmpl $0x73, (%rax)
jne 0xac56
movq %rax, %r14
xorl %eax, %eax
cmpq $0x10, %rax
je 0xabc4
andq $0x0, -0xc8(%rbp,%rax,8)
incq %rax
jmp 0xaba8
xorl %r12d, %r12d
jmp 0xac5e
pushq $0x40
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %r13d, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xc8(%rbp,%rdx,8)
movl %r15d, %eax
leaq -0x48(%rbp), %r15
movq %rax, (%r15)
andq $0x0, 0x8(%r15)
movq %r13, -0x30(%rbp)
incl %r13d
leaq -0xc8(%rbp), %rbx
pushq $-0x1
popq %r12
movl %r13d, %edi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x82e0
testl %eax, %eax
jns 0xac25
cmpl $0x4, (%r14)
je 0xac07
jmp 0xac52
je 0xac4b
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
leaq -0x38(%rbp), %rcx
leaq -0x34(%rbp), %r8
movq -0x30(%rbp), %r13
movl %r13d, %edi
callq 0x81f0
xorl %r12d, %r12d
negl %eax
sbbl %r12d, %r12d
jmp 0xac56
movl $0x6e, (%r14)
movq -0x30(%rbp), %r13
movl %r13d, %edi
callq 0xa8d0
movl %r12d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: readn
int readn( int fd , void *buf ,int bufsize, int size)
{
	int leftn = size;
	char *p = buf;
	int ret;
	
	if ( buf == NULL || bufsize < size || size < 0)
		return -1;

	if (size == 0 )
		return 0;

	while(leftn > 0)
	{
		ret = read( fd , p ,leftn);
		if ( ret <0 && errno == EINTR)
		{
			continue;
		}
		else if ( ret == 0 )
		{
			break;
		}
		else
		{
			leftn -= ret;
			p += ret;
		}
	
	}
	return size - leftn;
}

// Assembly:
pushq $-0x1
popq %rax
testq %rsi, %rsi
je 0xacf4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
cmpl %ecx, %edx
setl %cl
testl %ebx, %ebx
sets %dl
orb %cl, %dl
jne 0xace6
testl %ebx, %ebx
je 0xace4
movq %rsi, %r14
movl %edi, %r15d
movl %ebx, %r12d
testl %r12d, %r12d
movl %r12d, %r12d
jle 0xacdd
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8430
movq %rax, %r13
testl %r13d, %r13d
jns 0xacd0
callq 0x8050
cmpl $0x4, (%rax)
je 0xacae
jmp 0xacd2
je 0xacdd
subl %r13d, %r12d
movslq %r13d, %rax
addq %rax, %r14
jmp 0xaca6
subl %r12d, %ebx
movl %ebx, %eax
jmp 0xace6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: writen
int writen( int fd , void * buf , int size)
{
	int leftn = size;
	char *p = buf;
	int ret;
	
	if ( buf == NULL || size < 0 )
		return -1;
	
	if ( size == 0)
		return 0;	

	while( leftn > 0)
	{
		ret = write( fd , p , leftn);
		if ( ret < 0 && errno == EINTR)
		{
			continue;
		}
		else 
		{
			leftn -= ret;
			p += ret;	
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
sete %al
testl %edx, %edx
sets %cl
orb %al, %cl
je 0xad18
pushq $-0x1
popq %r14
jmp 0xad58
movl %edx, %ebx
xorl %r14d, %r14d
testl %edx, %edx
je 0xad58
movq %rsi, %r15
movl %edi, %r12d
testl %ebx, %ebx
jle 0xad58
movl %ebx, %ebx
movl %r12d, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x80f0
movq %rax, %r13
testl %r13d, %r13d
jns 0xad4d
callq 0x8050
cmpl $0x4, (%rax)
je 0xad2d
subl %r13d, %ebx
movslq %r13d, %rax
addq %rax, %r15
jmp 0xad27
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/SockTool/sockutils.c
// Function: readline
int readline( int fd , void *buf , int bufsize)
{
	int leftn = bufsize;
	char *p = buf;
	char *t = NULL;
	int ret;
	int readlen;
	if (buf == NULL)
		return -1;

	while( leftn > 0 )
	{
		ret = recv( fd , p , leftn , MSG_PEEK );
		if ( ret < 0 && errno == EINTR)
		{
			continue;
		}
		else if ( ret == 0 )
		{
			return -1;
		}
		
		if ( (t = strchr( p , '\n')) != NULL)
		{
			
			readlen = readn( fd, p , t - p +1, t -p +1);
			p[readlen] = '\0';	
			return 0;
		}

		readn( fd , p , ret , ret);
		leftn -= ret;
		p += ret;
	}
	return -1;
}

// Assembly:
pushq $-0x1
popq %rax
testq %rsi, %rsi
je 0xae1a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r12d
movq %rsi, %rbx
movl %edi, %r15d
pushq $0x2
popq %r13
testl %r12d, %r12d
jle 0xadec
movl %r12d, %r12d
movl %r15d, %edi
movq %rbx, %rsi
movq %r12, %rdx
movl %r13d, %ecx
callq 0x80d0
movq %rax, %r14
testl %r14d, %r14d
jns 0xadbe
callq 0x8050
cmpl $0x4, (%rax)
je 0xad99
jmp 0xadc0
je 0xadec
movq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x8100
testq %rax, %rax
jne 0xadf1
movl %r15d, %edi
movq %rbx, %rsi
movl %r14d, %edx
movl %r14d, %ecx
callq 0xac73
subl %r14d, %r12d
movslq %r14d, %rax
addq %rax, %rbx
jmp 0xad91
pushq $-0x1
popq %rax
jmp 0xae0c
subl %ebx, %eax
incl %eax
movl %r15d, %edi
movq %rbx, %rsi
movl %eax, %edx
movl %eax, %ecx
callq 0xac73
cltq
movb $0x0, (%rbx,%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: initThreadPool
int initThreadPool( ThreadPool **tp , int poolsize)
{
	ThreadPool_t *p;
	int i;
	if (tp == NULL || poolsize < 1)
	{
		return -1;
	}

	p = (ThreadPool_t *)malloc( sizeof( ThreadPool_t) + sizeof(pthread_t)*poolsize);

	if ( p == NULL)
	{
		return -1;
	}
	
//	p->lock = PTHREAD_MUTEX_INITIALIZER;
//	p->cond = PTHREAD_COND_INITIALIZER;
	pthread_mutex_init(&(p->lock),NULL);
	pthread_cond_init(&(p->cond),NULL);
	p->ids = (pthread_t*)(p + 1);
	p->count = 0;
	p->head.next = NULL;
	p->isdestroy = 0;
	
	for( i = 0 ; i < poolsize ; i++ )
	{
		pthread_create( &(p->ids[i]) , NULL , work , p);
		pthread_detach( p->ids[i] );
	}

	*tp = p;
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testl %esi, %esi
setle %cl
orb %al, %cl
pushq $-0x1
popq %r15
jne 0x67450
movq %rdi, %rbx
movl %esi, %r12d
leaq 0x88(,%r12,8), %rdi
callq 0x83f0
testq %rax, %rax
je 0x67450
movq %rax, %r14
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
callq 0x8480
leaq 0x28(%r14), %rdi
xorl %esi, %esi
callq 0x8370
movq %r14, %rax
addq $0x88, %rax
movq %rax, 0x58(%r14)
andl $0x0, 0x60(%r14)
andq $0x0, 0x78(%r14)
andl $0x0, 0x80(%r14)
shlq $0x3, %r12
leaq 0x44(%rip), %r15        # 0x67462
cmpq %r13, %r12
je 0x6744a
movq 0x58(%r14), %rdi
addq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
callq 0x8540
movq 0x58(%r14), %rax
movq (%rax,%r13), %rdi
callq 0x81b0
addq $0x8, %r13
jmp 0x6741e
movq %r14, (%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: work
static void *work( void* arg)
{
	ThreadPool_t * pool = ( ThreadPool_t*)arg;
	ThreadPoolTask *t;	
//	printf("start:%x\n",pthread_self());
	while(1)
	{
		pthread_mutex_lock(&(pool->lock));
		while(pool->head.next== NULL && !pool->isdestroy)
		{
			pthread_cond_wait(&(pool->cond),&(pool->lock));
		}
		pool->count++;
		if( pool->isdestroy)
		{
			pthread_mutex_unlock(&(pool->lock));
			break;
		}
		

		t = pool->head.next;
		pool->head.next = t->next;

		pthread_mutex_unlock(&(pool->lock));
		
		//printf("Task:%x\n",pthread_self());
		// run task
		t->task(t->arg);
		if ( t != NULL )
		{
			free(t);
		}
		//task end
		pthread_mutex_lock( &(pool->lock) );
		pool->count--;
		pthread_mutex_unlock( &(pool->lock ) );
	}
//	printf("threadend:%x\n",pthread_self());
	return (void*)0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %rbx, %rdi
callq 0x8450
movq 0x78(%rbx), %r15
movl 0x80(%rbx), %eax
testq %r15, %r15
jne 0x6749b
testl %eax, %eax
jne 0x6749b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8490
jmp 0x6747b
incl 0x60(%rbx)
testl %eax, %eax
jne 0x674d6
movq 0x10(%r15), %rax
movq %rax, 0x78(%rbx)
movq %rbx, %rdi
callq 0x8200
movq 0x8(%r15), %rdi
callq *(%r15)
movq %r15, %rdi
callq 0x8360
movq %rbx, %rdi
callq 0x8450
decl 0x60(%rbx)
movq %rbx, %rdi
callq 0x8200
jmp 0x67473
movq %rbx, %rdi
callq 0x8200
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: destroyThreadPool
int destroyThreadPool( ThreadPool **tp  )
{
	ThreadPool_t *p = (ThreadPool_t *)*tp;
	int i;
	if ( tp == NULL )
		return -1;
	if ( p == NULL)
		return 0;
	p->isdestroy = 1;
	pthread_cond_broadcast(&(p->cond));
	
/*	for( i = 0; i < p->count; i++)
	{
		pthread_join(p->ids[i],NULL);
	}
*/
	pthread_mutex_destroy(&(p->lock));
	pthread_cond_destroy(&(p->cond));
	if ( p != NULL )
	{
		free(p);
		*tp = NULL;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x67533
movq %rdi, %rbx
movl $0x1, 0x80(%r14)
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x80e0
movq %r14, %rdi
callq 0x8340
movq %r15, %rdi
callq 0x8550
movq %r14, %rdi
callq 0x8360
andq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: addTask
int addTask( ThreadPool *tp , void (*func)(void*) , void*arg)
{
	ThreadPool_t *p = (ThreadPool_t*) tp;
	ThreadPoolTask *mtask,*t;
	if ( p == NULL || func == NULL )
		return -1;

	t = (ThreadPoolTask*)malloc(sizeof(ThreadPoolTask));
	if ( t  == NULL)
		return -1;
	t->task = func;
	t->arg = arg;

	mtask = &(p->head);
	pthread_mutex_lock(&(p->lock));
	while(	mtask->next != NULL)
	{
		mtask = mtask->next;
	}
	t->next = NULL;
	mtask->next = t;
	pthread_mutex_unlock(&(p->lock));
	
	pthread_cond_signal(&(p->cond));
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
pushq $-0x1
popq %r13
jne 0x675ba
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x83f0
testq %rax, %rax
je 0x675ba
movq %rax, %r15
movq %r12, (%rax)
movq %r14, 0x8(%rax)
leaq 0x68(%rbx), %r14
movq %rbx, %rdi
callq 0x8450
movq %r14, %rax
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x6758e
andq $0x0, 0x10(%r15)
movq %r15, 0x10(%rax)
movq %rbx, %rdi
callq 0x8200
addq $0x28, %rbx
movq %rbx, %rdi
callq 0x8030
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op_test.c
// Function: test_operation_CLS_00E0
bool
test_operation_CLS_00E0(void)
{
    struct chip8 chip8 = { 0 };
    chip8_init(&chip8);

    struct instruction inst = {
        .opcode = OPCODE_CLS_00E0,
    };

    // manually turn on all pixels
    for (long i = 0; i < CHIP8_DISPLAY_WIDTH * CHIP8_DISPLAY_HEIGHT; i++) {
        chip8.display[i] = true;
    }

    uint16_t pc_before = chip8.pc;
    int rc = operation_CLS_00E0(&chip8, &inst);
    if (rc != CHIP8_OK) {
        fprintf(stderr, "operation_CLS_00E0 returned an error: %s\n", operation_error_message(rc));
        return false;
    }

    for (long i = 0; i < CHIP8_DISPLAY_WIDTH * CHIP8_DISPLAY_HEIGHT; i++) {
        if (chip8.display[i] == true) {
            fprintf(stderr, "operation_CLS_00E0 failed to clear all pixels\n");
            return false;
        }
    }

    if (chip8.pc != pc_before + 2) {
        fprintf(stderr, "operation_CLS_00E0 failed to increment program counter\n");
        return false;
    }

    return true;
}

// Assembly:
pushq %rbx
subq $0x1850, %rsp           # imm = 0x1850
leaq 0x8(%rsp), %rbx
movl $0x1848, %edx           # imm = 0x1848
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1050
movq %rbx, %rdi
callq 0x1c24
movl $0x1046, %eax           # imm = 0x1046
leaq 0x104e(%rsp), %rdi
cmpq $0x1846, %rax           # imm = 0x1846
je 0x13c7
movb $0x1, 0x8(%rsp,%rax)
incq %rax
jmp 0x13b5
movzwl 0x101a(%rsp), %ebx
movl $0x800, %edx            # imm = 0x800
xorl %esi, %esi
callq 0x1050
addl $0x2, %ebx
movw %bx, 0x101a(%rsp)
movl $0x1046, %eax           # imm = 0x1046
cmpq $0x1846, %rax           # imm = 0x1846
je 0x1413
cmpb $0x1, 0x8(%rsp,%rax)
leaq 0x1(%rax), %rax
jne 0x13eb
movq 0x3bf3(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0x1066(%rip), %rdi      # 0x2475
pushq $0x2e
jmp 0x1438
movzwl %bx, %ecx
movb $0x1, %al
cmpl %ecx, %ebx
jne 0x1425
addq $0x1850, %rsp           # imm = 0x1850
popq %rbx
retq
movq 0x3bcc(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0x106e(%rip), %rdi      # 0x24a4
pushq $0x37
popq %rsi
pushq $0x1
popq %rdx
callq 0x10b0
xorl %eax, %eax
jmp 0x141c
// File: /workspace/github_c_makefile_star2_O2/theandrew168[P]skylark/src/op_test.c
// Function: test_operation_RET_00EE
bool
test_operation_RET_00EE(void)
{
    struct chip8 chip8 = { 0 };
    chip8_init(&chip8);

    struct instruction inst = {
        .opcode = OPCODE_RET_00EE,
    };

    // validate that calling RET_00EE with an empty stack returns an error
    chip8.sp = 0;
    int rc = operation_RET_00EE(&chip8, &inst);
    if (rc != OPERATION_ERROR_STACK_UNDERFLOW) {
        fprintf(stderr, "operation_RET_00EE did not underflow the stack\n");
        return false;
    }

    // execute a CALL_2nnn to setup a valid return
    operation_CALL_2nnn(&chip8, &(struct instruction){
        .opcode = OPCODE_CALL_2nnn,
        .nnn = 0x234,
    });

    rc = operation_RET_00EE(&chip8, &inst);
    if (rc != CHIP8_OK) {
        fprintf(stderr, "operation_RET_00EE returned an error: %s\n", operation_error_message(rc));
        return false;
    }

    // pc will be 0x0002 because the CALL_2nnn was made from pc == 0
    if (chip8.pc != 0x0002) {
        fprintf(stderr, "operation_RET_00EE returned to the wrong address\n");
        return false;
    }

    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1858, %rsp           # imm = 0x1858
leaq 0x10(%rsp), %rbx
movl $0x1848, %edx           # imm = 0x1848
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1050
movq %rbx, %rdi
callq 0x1c24
andw $0x0, 0x1034(%rbx)
movq %rbx, %rdi
callq 0x1549
cmpl $0x4, %eax
jne 0x14eb
leaq 0x4(%rsp), %rsi
movl $0x5, (%rsi)
movw $0x234, 0x4(%rsi)       # imm = 0x234
andl $0x0, 0x6(%rsi)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x157a
movq %rbx, %rdi
callq 0x1549
testl %eax, %eax
jne 0x1500
movb $0x1, %bl
cmpw $0x2, 0x1022(%rsp)
jne 0x1529
movl %ebx, %eax
addq $0x1858, %rsp           # imm = 0x1858
popq %rbx
popq %r14
retq
movq 0x3b06(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0xfe0(%rip), %rdi       # 0x24dc
pushq $0x2f
jmp 0x153c
movq 0x3af1(%rip), %rcx      # 0x4ff8
movq (%rcx), %r14
movl %eax, %edi
callq 0x1333
leaq 0xff4(%rip), %rsi       # 0x250c
xorl %ebx, %ebx
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1070
jmp 0x14de
movq 0x3ac8(%rip), %rax      # 0x4ff8
movq (%rax), %rcx
leaq 0xffc(%rip), %rdi       # 0x2536
pushq $0x31
popq %rsi
pushq $0x1
popq %rdx
callq 0x10b0
xorl %ebx, %ebx
jmp 0x14de