LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: bloom_init
bloom_t *bloom_init (char * key, UINT64_RC n, double e)
{

    UINT64_RC m = 0;
    int k = 0;
    double tmp_e = 1;
    
    size_t bytes = calculate(n, e, &m, &k, &tmp_e);

    if (!bytes) {
        DEBUG("Error, bad arg n:%llu e:%lf\r\n", n, e);
        return NULL;
    }
    if(bytes > blooms->max_bytes - blooms->bytes){
        DEBUG("Error, bloom over max size(bytes:%lu, x:%llu m:%llu, e:%e)\r\n", (unsigned long)bytes, m/n, m, e);
        return NULL;
    }

    bloom_t *bloom = (bloom_t *)malloc(bytes); 
    if(!bloom) {
        DEBUG("Error, bloom init failed (malloc)\r\n");
        return NULL;
    }
    
    memset(bloom, 0, bytes);  
    bloom->m = m;
    bloom->e = e;
    bloom->e2 = tmp_e;
    bloom->k = k;
    bloom->n = n;
    bloom->bytes = bytes;
    strcpy(bloom->key, key);
    
    return bloom;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
leaq 0x20(%rsp), %rsi
andq $0x0, (%rsi)
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
movq %rdi, %rbx
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq %r14, %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x2558
testq %rax, %rax
je 0x270c
movq %rax, %r12
movq 0x5b8e(%rip), %rax      # 0x8238
movq 0x18(%rax), %rcx
subq 0x10(%rax), %rcx
cmpq %rcx, %r12
ja 0x270c
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0x21f0
testq %rax, %rax
je 0x270c
movq %rax, %r15
movq 0x20(%rsp), %rax
movq %rax, 0x48(%r15)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x68(%r15)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x70(%r15)
movl 0xc(%rsp), %eax
movl %eax, 0x78(%r15)
movq %r14, 0x40(%r15)
movq %r12, 0x18(%r15)
movq %r15, %rdi
addq $0x20, %rdi
movq %rbx, %rsi
callq 0x2080
jmp 0x270f
xorl %r15d, %r15d
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: bloom_set
int bloom_set (bloom_t *bloom, char *key) 
{
    UINT64_RC checksum[2];

    MurmurHash3_x64_128(key, strlen(key), SALT_CONSTANT, checksum);
    UINT64_RC h1 = checksum[0];
    UINT64_RC h2 = checksum[1];

    int i;
    for (i = 0; i < bloom->k; i++) {
        UINT64_RC hashes = (h1 + i * h2) % bloom->m;
        bitmap_set(bloom->map, hashes);
    }
    bloom->set_count++;
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2110
movq %rsp, %r15
movq %r14, %rdi
movl %eax, %esi
movl $0x97c29b3a, %edx       # imm = 0x97C29B3A
movq %r15, %rcx
callq 0x4b10
movq (%r15), %rsi
movq 0x8(%r15), %rdi
movl 0x78(%rbx), %r8d
xorl %eax, %eax
testl %r8d, %r8d
cmovlel %eax, %r8d
pushq $0x1
popq %r9
subq $0x1, %r8
jb 0x2786
movq %rsi, %rax
xorl %edx, %edx
divq 0x48(%rbx)
movq %rdx, %rcx
movl %r9d, %eax
shll %cl, %eax
shrq $0x5, %rcx
orl %eax, 0x7c(%rbx,%rcx,4)
addq %rdi, %rsi
jmp 0x2762
incq 0x58(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: bloom_get
int bloom_get (bloom_t *bloom, char *key) 
{
    UINT64_RC checksum[2];

    MurmurHash3_x64_128(key, strlen(key), SALT_CONSTANT, checksum);
    UINT64_RC h1 = checksum[0];
    UINT64_RC h2 = checksum[1];

    int i;
    for (i = 0; i < bloom->k; i++) {
        UINT64_RC hashes = (h1 + i * h2) % bloom->m;
        if(!bitmap_check(bloom->map, hashes)){
            bloom->get_miss_count++;
            blooms->get_miss_count++;
            return 0;
        }
    }
    bloom->get_count++;
    blooms->get_count++;
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2110
movq %rsp, %r15
movq %r14, %rdi
movl %eax, %esi
movl $0x97c29b3a, %edx       # imm = 0x97C29B3A
movq %r15, %rcx
callq 0x4b10
movq (%r15), %rax
movq 0x8(%r15), %r8
movl 0x78(%rbx), %ecx
xorl %r9d, %r9d
testl %ecx, %ecx
cmovgl %ecx, %r9d
incq %r9
pushq $0x1
popq %rcx
pushq $0x28
popq %rsi
pushq $0x50
popq %rdi
pushq $0x38
popq %r10
pushq $0x60
popq %r11
decq %r9
je 0x2813
leaq (%rax,%r8), %r14
xorl %edx, %edx
divq 0x48(%rbx)
movq %rdx, %rax
shrq $0x5, %rax
movl 0x7c(%rbx,%rax,4), %eax
btl %edx, %eax
movq %r14, %rax
jb 0x27e9
movq %r11, %rdi
movq %r10, %rsi
xorl %ecx, %ecx
incq (%rbx,%rdi)
movq 0x5a1a(%rip), %rax      # 0x8238
incq (%rax,%rsi)
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: blooms_search
bloom_t *blooms_search(char *key)
{
    unsigned int hv = dictGenHashFunction((unsigned char *)key, strlen(key)) & hashmask(blooms->power);

    bloom_t *bloom = blooms->hashtable[hv];

    while (bloom) {
        if (!strcmp(bloom->key, key)) {
            return bloom;
        }
        bloom = bloom->hash_next;
    }

    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2110
movq %rbx, %rdi
movl %eax, %esi
callq 0x253c
movq 0x59ed(%rip), %rdx      # 0x8238
movb 0x24(%rdx), %cl
pushq $-0x1
popq %rsi
shll %cl, %esi
notl %esi
andl %eax, %esi
leaq (%rdx,%rsi,8), %r14
addq $0x40, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x287d
leaq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x2200
testl %eax, %eax
je 0x287d
addq $0x10, %r14
jmp 0x285f
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: blooms_add
int blooms_add (char *key, UINT64_RC n, double e)
{    
    unsigned int hv = dictGenHashFunction((unsigned char *)key, strlen(key)) & hashmask(blooms->power);
    bloom_t *bloom = blooms->hashtable[hv];

    while (bloom) {
        if (!strcmp(bloom->key, key)) {
            return 1;
        }
        bloom = bloom->hash_next;
    }

    bloom = bloom_init(key, n, e);
    if(!bloom) {
        DEBUG("Error, bloom init failed\r\n");
        return 2;
    }
    
    bloom->hash_next = blooms->hashtable[hv];
    blooms->hashtable[hv] = bloom;

    list_add_tail(&bloom->list, &blooms->list);
    
    blooms->count++;
    blooms->bytes += bloom->bytes;
    
    DEBUG("%s add\r\n", key);
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2110
movq %r14, %rdi
movl %eax, %esi
callq 0x253c
movq 0x5982(%rip), %rdx      # 0x8238
movb 0x24(%rdx), %cl
pushq $-0x1
popq %r15
shll %cl, %r15d
notl %r15d
andl %eax, %r15d
leaq (%rdx,%r15,8), %r12
addq $0x40, %r12
pushq $0x1
popq %rbp
movq (%r12), %r12
testq %r12, %r12
je 0x28f1
leaq 0x20(%r12), %rdi
movq %r14, %rsi
callq 0x2200
addq $0x10, %r12
testl %eax, %eax
jne 0x28d1
jmp 0x294e
movq %r14, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x2659
testq %rax, %rax
je 0x294b
movq 0x592a(%rip), %rcx      # 0x8238
movq 0x40(%rcx,%r15,8), %rdx
movq %rdx, 0x10(%rax)
movq %rax, 0x40(%rcx,%r15,8)
movq 0x5915(%rip), %rcx      # 0x8238
movq 0x8(%rcx), %rdx
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq 0x58fc(%rip), %rcx      # 0x8238
incl 0x20(%rcx)
movq 0x18(%rax), %rax
addq %rax, 0x10(%rcx)
xorl %ebp, %ebp
jmp 0x294e
pushq $0x2
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: blooms_set
int blooms_set (char *key, char *subkey)
{
    bloom_t *bloom = blooms_search(key);
    if(!bloom) {
        DEBUG("Error, %s not exited\r\n", key);
        return 1;
    }

    bloom_set(bloom, subkey);
    blooms->set_count++;
    
    DEBUG("%s:\t%s\tOK\r\n", key, subkey);

    return 0;    
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x282e
testq %rax, %rax
je 0x2985
movq %rax, %rdi
movq %rbx, %rsi
callq 0x271e
movq 0x58bb(%rip), %rax      # 0x8238
incq 0x30(%rax)
xorl %eax, %eax
jmp 0x2988
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: bloom_status
int bloom_status (char * key)
{
    bloom_t * bloom = blooms_search(key);
    if(!bloom) {
        DEBUG("Error, %s not exited\r\n", key);
        return -1;
    }

    printf("-----------------------------\r\n");
    printf("bloom filter name: %s\r\n", bloom->key);
    printf("expected max amount of elements: %llu\r\n", bloom->n);
    printf("expected false positive rate: %e\r\n", bloom->e);
    printf("theoretical false positive rate: %e\r\n", bloom->e2);
    printf("hash functions: %d\r\n", bloom->k);
    printf("table size (bits): %llu\r\n", bloom->m);
    printf("bloom size (bytes): %zu\r\n", bloom->bytes);
    printf("bloom set count: %llu\r\n", bloom->set_count);   
    printf("bloom get count: %llu\r\n", bloom->get_count);     
    printf("bloom get miss count: %llu\r\n", bloom->get_miss_count);    
    printf("-----------------------------\r\n\r\n");

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x282e
testq %rax, %rax
je 0x2a95
movq %rax, %r14
leaq 0x281e(%rip), %rdi      # 0x51e3
callq 0x2090
movq %r14, %rsi
addq $0x20, %rsi
leaq 0x2668(%rip), %rdi      # 0x5040
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2170
movq 0x40(%r14), %rsi
leaq 0x266c(%rip), %rdi      # 0x5058
xorl %eax, %eax
callq 0x2170
movsd 0x68(%r14), %xmm0
leaq 0x2680(%rip), %rdi      # 0x5080
movb $0x1, %al
callq 0x2170
movsd 0x70(%r14), %xmm0
leaq 0x268f(%rip), %rdi      # 0x50a3
movb $0x1, %al
callq 0x2170
movl 0x78(%r14), %esi
leaq 0x26a3(%rip), %rdi      # 0x50c9
xorl %eax, %eax
callq 0x2170
movq 0x48(%r14), %rsi
leaq 0x26a6(%rip), %rdi      # 0x50de
xorl %eax, %eax
callq 0x2170
movq 0x18(%r14), %rsi
leaq 0x26ae(%rip), %rdi      # 0x50f8
xorl %eax, %eax
callq 0x2170
movq 0x58(%r14), %rsi
leaq 0x26b6(%rip), %rdi      # 0x5112
xorl %eax, %eax
callq 0x2170
movq 0x50(%r14), %rsi
leaq 0x26bc(%rip), %rdi      # 0x512a
xorl %eax, %eax
callq 0x2170
movq 0x60(%r14), %rsi
leaq 0x26c2(%rip), %rdi      # 0x5142
xorl %eax, %eax
callq 0x2170
leaq 0x2782(%rip), %rdi      # 0x5210
callq 0x2090
jmp 0x2a98
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: blooms_status
void blooms_status ()
{
 
    printf("-----------------------------\r\n");
    if(!list_empty(&blooms->list)){
        printf("blooms list:\r\n");
        bloom_t * i;
        list_for_each_entry(i, &blooms->list, list){
            printf("\t\t%s\r\n", i->key);
        }
    }
    printf("blooms count: %d\r\n", blooms->count);    
    printf("blooms total bytes: %zu\r\n", blooms->bytes);
    printf("blooms set count: %llu\r\n", blooms->set_count);   
    printf("blooms get count: %llu\r\n", blooms->get_count);     
    printf("blooms get miss count: %llu\r\n", blooms->get_miss_count);     

    printf("-----------------------------\r\n\r\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2736(%rip), %rdi      # 0x51e3
callq 0x2090
movq 0x577f(%rip), %rax      # 0x8238
cmpq %rax, (%rax)
je 0x2afa
leaq 0x273d(%rip), %rdi      # 0x5202
callq 0x2090
movq 0x5767(%rip), %rax      # 0x8238
leaq 0x2687(%rip), %rbx      # 0x515f
movq %rax, %r14
movq (%r14), %r14
cmpq %rax, %r14
je 0x2afa
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x5740(%rip), %rax      # 0x8238
jmp 0x2adb
movl 0x20(%rax), %esi
leaq 0x2662(%rip), %rdi      # 0x5166
xorl %eax, %eax
callq 0x2170
movq 0x5726(%rip), %rax      # 0x8238
movq 0x10(%rax), %rsi
leaq 0x265c(%rip), %rdi      # 0x5179
xorl %eax, %eax
callq 0x2170
movq 0x570d(%rip), %rax      # 0x8238
movq 0x30(%rax), %rsi
leaq 0x265d(%rip), %rdi      # 0x5193
xorl %eax, %eax
callq 0x2170
movq 0x56f4(%rip), %rax      # 0x8238
movq 0x28(%rax), %rsi
leaq 0x265d(%rip), %rdi      # 0x51ac
xorl %eax, %eax
callq 0x2170
movq 0x56db(%rip), %rax      # 0x8238
movq 0x38(%rax), %rsi
leaq 0x265d(%rip), %rdi      # 0x51c5
xorl %eax, %eax
callq 0x2170
leaq 0x269a(%rip), %rdi      # 0x5210
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: blooms_delete
int blooms_delete (char *key)
{
    unsigned int hv = dictGenHashFunction((unsigned char *)key, strlen(key)) & hashmask(blooms->power);

    bloom_t *bloom = blooms->hashtable[hv];

    if(!bloom) {
        DEBUG("Error, %s not exist\r\n", key);
        return 1;
    }
    if (!strcmp(bloom->key, key)) {
        blooms->hashtable[hv] = bloom->hash_next;
        bloom_delete(bloom);
        DEBUG("%s deleted\r\n", key);
        return 0;
    } 

    bloom_t *next = bloom->hash_next;
    while (next) {

        if (!strcmp(next->key, key)) {
            bloom->hash_next = next->hash_next;
            bloom_delete(next);
            DEBUG("%s deleted\r\n", key);
            return 0;
        }

        bloom = bloom->hash_next;
        next = bloom->hash_next;
    }

    DEBUG("Error, %s not exist\r\n", key);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x2110
movq %rbx, %rdi
movl %eax, %esi
callq 0x253c
movq 0x5695(%rip), %r15      # 0x8238
movb 0x24(%r15), %cl
pushq $-0x1
popq %r12
shll %cl, %r12d
notl %r12d
andl %eax, %r12d
movq 0x40(%r15,%r12,8), %r14
pushq $0x1
popq %rbp
testq %r14, %r14
je 0x2c0c
leaq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x2200
testl %eax, %eax
je 0x2bf3
movq %r14, %r15
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x2c0c
leaq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x2200
testl %eax, %eax
jne 0x2bd1
addq $0x10, %r15
jmp 0x2bfb
leaq (%r15,%r12,8), %r15
addq $0x40, %r15
movq 0x10(%r14), %rax
movq %rax, (%r15)
movq %r14, %rdi
callq 0x2c17
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: bloom_delete
static void bloom_delete (bloom_t *bloom)
{
    list_del(&bloom->list);
    blooms->bytes -= bloom->bytes;
    free(bloom);
    blooms->count--;
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq $0x100100, (%rdi)       # imm = 0x100100
movq $0x200200, 0x8(%rdi)    # imm = 0x200200
movq 0x18(%rdi), %rax
movq 0x55f8(%rip), %rcx      # 0x8238
subq %rax, 0x10(%rcx)
callq 0x2030
movq 0x55e8(%rip), %rax      # 0x8238
decl 0x20(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/bloom_filter.c
// Function: blooms_init
int blooms_init (size_t max)
{
    size_t blooms_size = hashsize(HASH_POWER) * sizeof(blooms_t *) + sizeof(blooms_t);
    blooms = (blooms_t *)malloc(blooms_size);
    if(!blooms) {
        DEBUG("Error, blooms malloc failed\r\n");
        return 1;
    }
    memset(blooms, 0, blooms_size);  //fail?
    
    blooms->power = HASH_POWER;
    blooms->count = 0;
    blooms->bytes = 0;
    blooms->max_bytes = max;
    INIT_LIST_HEAD(&blooms->list);
    
    blooms->get_count = blooms->set_count = blooms->get_miss_count = 0;
    
    return 0;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdi
movl $0x800040, %esi         # imm = 0x800040
callq 0x21f0
movq %rax, 0x55cb(%rip)      # 0x8238
testq %rax, %rax
je 0x2c88
movl $0x14, 0x24(%rax)
movq %rbx, 0x18(%rax)
movq %rax, (%rax)
movq %rax, 0x8(%rax)
xorl %eax, %eax
jmp 0x2c8b
pushq $0x1
popq %rax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/daemon.c
// Function: daemon
int
daemon(nochdir, noclose)
	int nochdir, noclose;
{
	int fd;

	switch (fork()) {
	case -1:
		return (-1);
	case 0:
		break;
	default:
		_exit(0);
	}

	if (setsid() == -1)
		return (-1);

	if (!nochdir) {
		if (chdir("/")) {
                         ;;
                }
        }

	if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
		(void)dup2(fd, STDIN_FILENO);
		(void)dup2(fd, STDOUT_FILENO);
		(void)dup2(fd, STDERR_FILENO);
		if (fd > STDERR_FILENO)
			(void)close(fd);
	}
	return (0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
callq 0x2410
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x2d16
testl %ebx, %ebx
jne 0x2d1d
callq 0x21c0
cmpl $-0x1, %eax
je 0x2d13
testl %r14d, %r14d
jne 0x2cc4
leaq 0x2572(%rip), %rdi      # 0x5231
callq 0x2120
xorl %ebx, %ebx
testl %ebp, %ebp
jne 0x2d16
leaq 0x2562(%rip), %rdi      # 0x5233
xorl %ebx, %ebx
pushq $0x2
popq %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2330
cmpl $-0x1, %eax
je 0x2d16
movl %eax, %ebp
xorl %ebx, %ebx
movl %eax, %edi
xorl %esi, %esi
callq 0x2150
pushq $0x1
popq %rsi
movl %ebp, %edi
callq 0x2150
pushq $0x2
popq %rsi
movl %ebp, %edi
callq 0x2150
cmpl $0x3, %ebp
jl 0x2d16
movl %ebp, %edi
callq 0x21b0
jmp 0x2d16
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %edi, %edi
callq 0x2070
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: stats_init
void stats_init(void) {
    stats.curr_conns = stats.total_conns = stats.conn_structs = 0;
    stats.bytes_read = stats.bytes_written =  0;
    stats.add_count = stats.set_count = stats.get_count = 0;
    stats.started = time(0);
}

// Assembly:
pushq %rax
andl $0x0, 0x5524(%rip)      # 0x8250
andq $0x0, 0x5514(%rip)      # 0x8248
xorps %xmm0, %xmm0
movups %xmm0, 0x551a(%rip)     # 0x8258
andq $0x0, 0x5522(%rip)      # 0x8268
movups %xmm0, 0x552b(%rip)     # 0x8278
xorl %edi, %edi
callq 0x2270
movq %rax, 0x5515(%rip)      # 0x8270
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: set_cork
void set_cork (conn *c, int val) {
    if (c->is_corked == val) return;
    c->is_corked = val;
#ifdef TCP_NOPUSH
    setsockopt(c->sfd, IPPROTO_TCP, TCP_NOPUSH, &val, sizeof(val));
#endif
}

// Assembly:
pushq %rax
movl %esi, 0x4(%rsp)
movsbl 0xcc(%rdi), %eax
cmpl %esi, %eax
je 0x2ddd
movb %sil, 0xcc(%rdi)
movl (%rdi), %edi
pushq $0x6
popq %rsi
pushq $0x3
popq %rdx
leaq 0x4(%rsp), %rcx
pushq $0x4
popq %r8
callq 0x20b0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: conn_init
void conn_init(void) {
    freetotal = 200;
    freecurr = 0;
    freeconns = (conn **)malloc(sizeof (conn *)*freetotal);
    return;
}

// Assembly:
pushq %rax
movl $0xc8, 0x54de(%rip)     # 0x82c8
andl $0x0, 0x54db(%rip)      # 0x82cc
movl $0x640, %edi            # imm = 0x640
callq 0x2280
movq %rax, 0x54ce(%rip)      # 0x82d0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: event_handler
void event_handler(int fd, short which, void *arg) {
    conn *c;

    c = (conn *)arg;
    c->which = which;

    /* sanity */
    if (fd != c->sfd) {
        if (my_srv.verbose > 0)
            fprintf(stderr, "Catastrophic: event fd doesn't match conn fd!\n");
        conn_close(c);
        return;
    }

    /* do as much I/O as possible until we block */
    drive_machine(c);

    /* wait for next event */
    return;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movw %si, 0x8a(%rdx)
cmpl %edi, (%rdx)
jne 0x2ff9
movq %rbx, %rdi
popq %rbx
jmp 0x406b
cmpl $0x0, 0x529c(%rip)      # 0x829c
jg 0x300b
movq %rbx, %rdi
popq %rbx
jmp 0x3029
movq 0x4fe6(%rip), %rax      # 0x7ff8
movq (%rax), %rcx
leaq 0x28c9(%rip), %rdi      # 0x58e5
pushq $0x2e
popq %rsi
pushq $0x1
popq %rdx
callq 0x23c0
jmp 0x3002
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: conn_close
void conn_close(conn *c) {
    /* delete the event, the socket and the conn */
    event_del(&c->event);

    if (my_srv.verbose > 1)
        fprintf(stderr, "<%d connection closed.\n", c->sfd);

    close(c->sfd);
    /* if we have enough space in the free connections array, put the structure there */
    if (freecurr < freetotal) {
        freeconns[freecurr++] = c;
    } else {
        /* try to enlarge free connections array */
        conn **new_freeconns = realloc(freeconns, sizeof(conn *)*freetotal*2);
        if (new_freeconns) {
            freetotal *= 2;
            freeconns = new_freeconns;
            freeconns[freecurr++] = c;
        } else {
            free(c->rbuf);
            free(c->wbuf);
            free(c);
        }
    }

    stats.curr_conns--;

    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x2180
cmpl $0x2, 0x525f(%rip)      # 0x829c
jge 0x30cb
movl (%rbx), %edi
callq 0x21b0
movslq 0x527b(%rip), %rax      # 0x82cc
movslq 0x5270(%rip), %rsi      # 0x82c8
movq 0x5271(%rip), %rdi      # 0x82d0
cmpl %esi, %eax
jge 0x3072
leal 0x1(%rax), %ecx
movl %ecx, 0x5260(%rip)      # 0x82cc
movq %rbx, (%rdi,%rax,8)
jmp 0x30c3
shlq $0x4, %rsi
callq 0x22c0
testq %rax, %rax
je 0x30a3
shll 0x5242(%rip)            # 0x82c8
movq %rax, 0x5243(%rip)      # 0x82d0
movslq 0x5238(%rip), %rcx      # 0x82cc
leal 0x1(%rcx), %edx
movl %edx, 0x522f(%rip)      # 0x82cc
movq %rbx, (%rax,%rcx,8)
jmp 0x30c3
movq 0x90(%rbx), %rdi
callq 0x2030
movq 0xb0(%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
decl 0x517f(%rip)            # 0x8248
popq %rbx
retq
movq 0x4f26(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movl (%rbx), %edx
leaq 0x2220(%rip), %rsi      # 0x52fe
xorl %eax, %eax
callq 0x2230
jmp 0x3043
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: out_string
void out_string(conn *c, char *str) {
    int len;

    if (my_srv.verbose > 1)
        fprintf(stderr, ">%d %s\n", c->sfd, str);

    len = strlen(str);
    if (len + 2 > c->wsize) {
        /* ought to be always enough. just fail for simplicity */
        str = "SERVER_ERROR output line too long";
        len = strlen(str);
    }

    strcpy(c->wbuf, str);
    strcat(c->wbuf, "\r\n");
    c->wbytes = len + 2;
    c->wcurr = c->wbuf;

    c->state = conn_write;
    c->write_and_go = conn_read;
    return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x2, 0x51a1(%rip)      # 0x829c
jge 0x3171
movq %r14, %rdi
callq 0x2110
addl $0x2, %eax
cmpl 0xc0(%rbx), %eax
leaq 0x2209(%rip), %rsi      # 0x531e
cmovleq %r14, %rsi
movq 0xb0(%rbx), %rdi
pushq $0x23
popq %rbp
cmovlel %eax, %ebp
callq 0x2080
movq 0xb0(%rbx), %r14
movq %r14, %rdi
callq 0x2110
movb $0x0, 0x2(%r14,%rax)
movw $0xa0d, (%r14,%rax)     # imm = 0xA0D
movl %ebp, 0xc4(%rbx)
movq 0xb0(%rbx), %rax
movq %rax, 0xb8(%rbx)
movl $0x2, 0x4(%rbx)
movl $0x1, 0xc8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq 0x4e80(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movl (%rbx), %edx
leaq 0x2192(%rip), %rsi      # 0x5316
movq %r14, %rcx
xorl %eax, %eax
callq 0x2230
jmp 0x30fd
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: process_setmem
void process_setmem(conn *c,char *command){
    unsigned long msize;
    if(1 != sscanf(command + 6,"%lu",&msize) || msize > ((size_t)(-1)) >> 20){
        out_string(c, "CLIENT_ERROR bad command line like this,'setmem 1000' means max limit 1000m");    
        return ;
    }
    blooms->max_bytes = msize << 20;
    my_srv.maxbytes = blooms->max_bytes;
    out_string(c,"STORED");
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6(%rsi), %rdi
leaq 0x219b(%rip), %rsi      # 0x5340
movq %rsp, %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2290
cmpl $0x1, %eax
setne %cl
movq (%r14), %rax
movq %rax, %rdx
shrq $0x2c, %rdx
setne %dl
orb %cl, %dl
je 0x31d2
leaq 0x2174(%rip), %rsi      # 0x5344
jmp 0x31f2
shlq $0x14, %rax
leaq 0x505b(%rip), %rcx      # 0x8238
movq (%rcx), %rcx
movq %rax, 0x18(%rcx)
movq %rax, 0x50bd(%rip)      # 0x82a8
leaq 0x258b(%rip), %rsi      # 0x577d
movq %rbx, %rdi
callq 0x30ea
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: process_try
void process_try(conn *c,char *command){
    unsigned long long n,m;
    int k;
    double tmp_e;
    
    char tmp[1024];
    char *pos = tmp;
    double e;
       if (2 != sscanf(command + 3,"%llu|%lf",&n,&e)) {
        out_string(c, "CLIENT_ERROR bad command line format,command like this 'try 100000|0.001'");    
        return;
    }
    size_t bytes = calculate(n,e,&m,&k,&tmp_e);
    if(bytes > 0 ){
        pos += sprintf(pos, "need_memory %lu(Bytes) ",(unsigned long)bytes);
        float bytes_m = (float)bytes/(1024*1024);
        if(bytes_m >= 1){
            pos += sprintf(pos, "%.3f(M) ",bytes_m);
        }
        float bytes_g = bytes_m/1024;
        
        if(bytes_g >= 1){
            pos += sprintf(pos, "%.3f(G) ",bytes_g);
        }
        pos += sprintf(pos, "\r\nuse_function_num %d \r\n",k);
        pos += sprintf(pos, "false_positive_rate  %lf\r\n",tmp_e);
        pos += sprintf(pos, "END");
        out_string(c,tmp);
    }else{
        out_string(c, "CALCULATE ERROR");
    }
    return;
    
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rdi, %rbx
leaq 0x3(%rsi), %rdi
leaq 0x2172(%rip), %rsi      # 0x5390
leaq 0x20(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x2290
cmpl $0x2, %eax
jne 0x3282
movq 0x20(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
leaq 0x28(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0x2558
testq %rax, %rax
je 0x328e
movq %rax, %r15
leaq 0x2181(%rip), %rsi      # 0x53e3
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x23a0
cltq
testq %r15, %r15
js 0x329a
cvtsi2ss %r15, %xmm0
jmp 0x32b0
leaq 0x2110(%rip), %r14      # 0x5399
jmp 0x3358
leaq 0x21ac(%rip), %r14      # 0x5441
jmp 0x3358
movq %r15, %rcx
shrq %rcx
andl $0x1, %r15d
orq %rcx, %r15
cvtsi2ss %r15, %xmm0
addss %xmm0, %xmm0
mulss 0x1f98(%rip), %xmm0     # 0x5250
leaq (%rsp,%rax), %r15
addq $0x30, %r15
ucomiss 0x1f8d(%rip), %xmm0     # 0x5254
jb 0x32f1
movss %xmm0, 0x8(%rsp)
cvtss2sd 0x8(%rsp), %xmm0
leaq 0x211f(%rip), %rsi      # 0x53fb
movq %r15, %rdi
movb $0x1, %al
callq 0x23a0
movss 0x8(%rsp), %xmm0
cltq
addq %rax, %r15
mulss 0x1f5f(%rip), %xmm0     # 0x5258
ucomiss 0x1f54(%rip), %xmm0     # 0x5254
jb 0x331c
cvtss2sd %xmm0, %xmm0
leaq 0x20f7(%rip), %rsi      # 0x5404
movq %r15, %rdi
movb $0x1, %al
callq 0x23a0
cltq
addq %rax, %r15
movl 0xc(%rsp), %edx
leaq 0x20e6(%rip), %rsi      # 0x540d
movq %r15, %rdi
xorl %eax, %eax
callq 0x23a0
movslq %eax, %r12
addq %r15, %r12
movsd 0x18(%rsp), %xmm0
leaq 0x20e2(%rip), %rsi      # 0x5426
movq %r12, %rdi
movb $0x1, %al
callq 0x23a0
cltq
movl $0x444e45, (%rax,%r12)  # imm = 0x444E45
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30ea
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: complete_nread
void complete_nread(conn *c) {
    char *msg;
    int len;

    len = c->rlbytes - 2;
    msg = c->rcurr;

    if (strncmp(msg + len, "\r\n", 2) != 0) {
        out_string(c, "CLIENT_ERROR bad data chunk");
    } else {
        msg[len] = 0;
        if (c->item_comm == NREAD_SET){
            //set a bloom filter with key
            if (len && (len <= MAX_SUBKEY_LEN) && !strchr(msg,' ') && blooms_set(c->key,msg) == 0 ){
                out_string(c, "STORED");
            } else {
                out_string(c, "NOT_STORED");
            }
        }else if(c->item_comm == NREAD_ADD){
            unsigned long long n;
            double e;
            if ((2 != sscanf(msg,"%llu|%lf",&n,&e)) || !n || e<=0 || e>=1) {
                out_string(c, "NOT_STORED");
                return;
            }

            if(!strchr(c->key,'|') && blooms_add(c->key,n,e) == 0){    
                out_string(c, "STORED");
            } else {
                out_string(c, "NOT_STORED");
            }

        }else{
            out_string(c, "CLIENT_ERROR unsuport type");
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq 0xa8(%rdi), %rax
movq 0x98(%rdi), %r14
cmpb $0xd, -0x2(%r14,%rax)
jne 0x3978
leaq -0x2(%rax), %rcx
cmpb $0xa, 0x1(%r14,%rcx)
jne 0x3978
movb $0x0, (%r14,%rcx)
movzbl 0xcd(%rbx), %edx
cmpl $0x1, %edx
je 0x3992
cmpl $0x2, %edx
jne 0x3a2b
testl %ecx, %ecx
sete %cl
cmpl $0xdc, %eax
setge %al
orb %cl, %al
jne 0x396f
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x2160
testq %rax, %rax
jne 0x396f
leaq 0xd0(%rbx), %rdi
movq %r14, %rsi
callq 0x295d
testl %eax, %eax
je 0x3a37
leaq 0x1e03(%rip), %rsi      # 0x5779
jmp 0x397f
leaq 0x1dde(%rip), %rsi      # 0x575d
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x30ea
leaq 0x19f7(%rip), %rsi      # 0x5390
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2290
leaq 0x1dc5(%rip), %r14      # 0x5779
cmpl $0x2, %eax
jne 0x3a14
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x3a14
movsd 0x8(%rsp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x3a14
ucomisd 0x162d(%rip), %xmm1     # 0x5008
jae 0x3a14
movsd %xmm1, (%rsp)
leaq 0xd0(%rbx), %r12
pushq $0x7c
popq %rsi
movq %r12, %rdi
callq 0x2160
testq %rax, %rax
jne 0x3a14
movq %r12, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x2888
testl %eax, %eax
jne 0x3a14
leaq 0x1d69(%rip), %r14      # 0x577d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30ea
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1d52(%rip), %rsi      # 0x5784
jmp 0x397f
leaq 0x1d3f(%rip), %rsi      # 0x577d
jmp 0x397f
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: try_read_command
int try_read_command(conn *c) {
    char *el, *cont;

    if (!c->rbytes)
        return 0;
    el = memchr(c->rcurr, '\n', c->rbytes);
    if (!el)
        return 0;
    cont = el + 1;
    if (el - c->rcurr > 1 && *(el - 1) == '\r') {
        el--;
    }
    *el = '\0';

    process_command(c, c->rcurr);

    c->rbytes -= (cont - c->rcurr);
    c->rcurr = cont;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq 0xa4(%rdi), %rdx
xorl %ebp, %ebp
testq %rdx, %rdx
je 0x3ec2
movq %rdi, %rbx
movq 0x98(%rdi), %r14
pushq $0xa
popq %rsi
movq %r14, %rdi
callq 0x21d0
testq %rax, %rax
je 0x3ec2
leaq 0x1(%rax), %r15
movq %rax, %rcx
subq %r14, %rcx
cmpq $0x2, %rcx
jl 0x3e97
leaq -0x1(%rax), %rcx
cmpb $0xd, -0x1(%rax)
cmoveq %rcx, %rax
movb $0x0, (%rax)
movq 0x98(%rbx), %rsi
movq %rbx, %rdi
callq 0x3a43
movl 0x98(%rbx), %eax
subl %r15d, %eax
addl %eax, 0xa4(%rbx)
movq %r15, 0x98(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: try_read_network
int try_read_network(conn *c) {
    int gotdata = 0;
    int res;

    if (c->rcurr != c->rbuf) {
        if (c->rbytes != 0) /* otherwise there's nothing to copy */
            memmove(c->rbuf, c->rcurr, c->rbytes);
        c->rcurr = c->rbuf;
    }

    while (1) {
        if (c->rbytes >= c->rsize) {
            char *new_rbuf = realloc(c->rbuf, c->rsize*2);
            if (!new_rbuf) {
                if (my_srv.verbose > 0)
                    fprintf(stderr, "Couldn't realloc input buffer\n");
                c->rbytes = 0; /* ignore what we read */
                out_string(c, "SERVER_ERROR out of memory");
                c->write_and_go = conn_closing;
                return 1;
            }
            c->rcurr  = c->rbuf = new_rbuf;
            c->rsize *= 2;
        }
        res = read(c->sfd, c->rbuf + c->rbytes, c->rsize - c->rbytes);
        if (res > 0) {
            stats.bytes_read += res;
            gotdata = 1;
            c->rbytes += res;
            continue;
        }
        if (res == 0) {
            /* connection closed */
            c->state = conn_closing;
            return 1;
        }
        if (res == -1) {
            if (errno == EAGAIN || errno == EWOULDBLOCK) break;
            else return 0;
        }
    }
    return gotdata;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
movq 0x98(%rbx), %rsi
cmpq %rdi, %rsi
je 0x3f08
movslq 0xa4(%rbx), %rdx
testq %rdx, %rdx
je 0x3f01
callq 0x22f0
movq 0x90(%rbx), %rdi
movq %rdi, 0x98(%rbx)
xorl %ebp, %ebp
pushq $0x1
popq %r14
movl 0xa4(%rbx), %edx
movl 0xa0(%rbx), %ecx
movq 0x90(%rbx), %rax
cmpl %ecx, %edx
jl 0x3f5a
movslq %ecx, %rsi
addq %rsi, %rsi
movq %rax, %rdi
callq 0x22c0
testq %rax, %rax
je 0x3fb6
movq %rax, 0x90(%rbx)
movq %rax, 0x98(%rbx)
movl 0xa0(%rbx), %ecx
movl 0xa4(%rbx), %edx
addl %ecx, %ecx
movl %ecx, 0xa0(%rbx)
movl (%rbx), %edi
movslq %edx, %rdx
addq %rdx, %rax
subl %edx, %ecx
movslq %ecx, %rdx
movq %rax, %rsi
callq 0x21e0
testl %eax, %eax
jg 0x3f7e
cmpl $-0x1, %eax
je 0x3f9b
testl %eax, %eax
jne 0x3f0e
jmp 0x3fad
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, 0x42eb(%rip)      # 0x8278
addl %eax, 0xa4(%rbx)
movl %r14d, %ebp
jmp 0x3f0e
callq 0x2040
movq %rax, %rcx
xorl %eax, %eax
cmpl $0xb, (%rcx)
cmovel %ebp, %eax
jmp 0x3fe2
movl $0x5, 0x4(%rbx)
jmp 0x3fdf
cmpl $0x0, 0x42df(%rip)      # 0x829c
jg 0x3fe7
andl $0x0, 0xa4(%rbx)
leaq 0x161b(%rip), %rsi      # 0x55e8
movq %rbx, %rdi
callq 0x30ea
movl $0x5, 0xc8(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x400a(%rip), %rax      # 0x7ff8
movq (%rax), %rcx
leaq 0x15d1(%rip), %rdi      # 0x55c9
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x23c0
jmp 0x3fbf
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: update_event
int update_event(conn *c, int new_flags) {
    if (c->ev_flags == new_flags)
        return 1;
    if (event_del(&c->event) == -1) return 0;
    event_set(&c->event, c->sfd, new_flags, event_handler, (void *)c);
    c->ev_flags = new_flags;
    if (event_add(&c->event, 0) == -1) return 0;
    return 1;
}

// Assembly:
movswl 0x88(%rdi), %eax
cmpl %esi, %eax
jne 0x4014
pushq $0x1
popq %rax
retq
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2180
cmpl $-0x1, %eax
je 0x4064
movl (%rbx), %esi
movswl %bp, %ebp
leaq -0x1059(%rip), %rcx     # 0x2fe1
movq %r14, %rdi
movl %ebp, %edx
movq %rbx, %r8
callq 0x2310
movw %bp, 0x88(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x2210
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
setne %al
jmp 0x4066
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: new_socket
int new_socket(void) {
    int sfd;
    int flags;

    if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
        perror("socket()");
        return -1;
    }

    if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 ||
            fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) {
        perror("setting O_NONBLOCK");
        close(sfd);
        return -1;
    }
    return sfd;
}

// Assembly:
pushq %rbx
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2430
cmpl $-0x1, %eax
je 0x43db
movl %eax, %ebx
pushq $0x3
popq %rsi
movl %eax, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20c0
testl %eax, %eax
js 0x43c6
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebx, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x20c0
testl %eax, %eax
js 0x43c6
movl %ebx, %eax
popq %rbx
retq
leaq 0x147b(%rip), %rdi      # 0x5848
callq 0x2360
movl %ebx, %edi
callq 0x21b0
jmp 0x43e7
leaq 0x1532(%rip), %rdi      # 0x5914
callq 0x2360
pushq $-0x1
popq %rbx
jmp 0x43c2
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: server_socket
int server_socket(int port) {
    int sfd;
    struct linger ling = {0, 0};
    struct sockaddr_in addr;
    int flags =1;

    if ((sfd = new_socket()) == -1) {
        return -1;
    }

    setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
    setsockopt(sfd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags));
    setsockopt(sfd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
#if !defined(TCP_NOPUSH)
    setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &flags, sizeof(flags));
#endif

    /* 
     * the memset call clears nonstandard fields in some impementations
     * that otherwise mess things up.
     */
    memset(&addr, 0, sizeof(addr));

    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    addr.sin_addr = my_srv.interface;
    if (bind(sfd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
        perror("bind()");
        close(sfd);
        return -1;
    }
    if (listen(sfd, 1024) == -1) {
        perror("listen()");
        close(sfd);
        return -1;
    }
    return sfd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %r14d
andq $0x0, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
callq 0x4384
pushq $-0x1
popq %rbx
cmpl $-0x1, %eax
je 0x44ab
movl %eax, %ebp
pushq $0x1
popq %r15
pushq $0x2
popq %rdx
leaq 0xc(%rsp), %r12
pushq $0x4
popq %r13
movl %eax, %edi
movl %r15d, %esi
movq %r12, %rcx
movl %r13d, %r8d
callq 0x20b0
pushq $0x9
popq %rdx
movl %ebp, %edi
movl %r15d, %esi
movq %r12, %rcx
movl %r13d, %r8d
callq 0x20b0
pushq $0xd
popq %rdx
leaq 0x10(%rsp), %rcx
pushq $0x8
popq %r8
movl %ebp, %edi
movl %r15d, %esi
callq 0x20b0
leaq 0x18(%rsp), %rsi
andq $0x0, 0x8(%rsi)
rolw $0x8, %r14w
movw $0x2, (%rsi)
movw %r14w, 0x2(%rsi)
movl 0x3e3a(%rip), %eax      # 0x82c0
movl %eax, 0x4(%rsi)
pushq $0x10
popq %rdx
movl %ebp, %edi
callq 0x22e0
cmpl $-0x1, %eax
je 0x44bc
movl %ebp, %edi
movl $0x400, %esi            # imm = 0x400
callq 0x22a0
cmpl $-0x1, %eax
je 0x44c5
movl %ebp, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x145a(%rip), %rdi      # 0x591d
jmp 0x44cc
leaq 0x1458(%rip), %rdi      # 0x5924
callq 0x2360
movl %ebp, %edi
callq 0x21b0
jmp 0x44ab
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: pre_gdb
void pre_gdb () {
    int i = 0;
    if(l_socket) close(l_socket);
    for (i=3; i<=500; i++) close(i); /* so lame */
    kill(getpid(), SIGABRT);
}

// Assembly:
pushq %rbx
movl 0x3df7(%rip), %edi      # 0x82d8
testl %edi, %edi
je 0x44ea
callq 0x21b0
pushq $0x3
popq %rbx
cmpl $0x1f5, %ebx            # imm = 0x1F5
je 0x4500
movl %ebx, %edi
callq 0x21b0
incl %ebx
jmp 0x44ed
callq 0x20e0
pushq $0x6
popq %rsi
movl %eax, %edi
popq %rbx
jmp 0x2260
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: save_pid
void save_pid(pid_t pid,char *pid_file) {
    FILE *fp;
    if (!pid_file)
        return;

    if (!(fp = fopen(pid_file,"w"))) {
        fprintf(stderr,"Could not open the pid file %s for writing\n",pid_file);
        return;
    }

    fprintf(fp,"%ld\n",(long) pid);
    if (fclose(fp) == -1) {
        fprintf(stderr,"Could not close the pid file %s.\n",pid_file);
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x4556
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x1408(%rip), %rsi      # 0x592d
movq %rbx, %rdi
callq 0x2340
testq %rax, %rax
je 0x455b
movq %rax, %r14
movslq %ebp, %rdx
leaq 0x141c(%rip), %rsi      # 0x595b
movq %rax, %rdi
xorl %eax, %eax
callq 0x2230
movq %r14, %rdi
callq 0x2100
cmpl $-0x1, %eax
je 0x4564
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x13cd(%rip), %rsi      # 0x592f
jmp 0x456b
leaq 0x13f5(%rip), %rsi      # 0x5960
movq 0x3a86(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: remove_pidfile
void remove_pidfile(char *pid_file) {
    if (!pid_file)
        return;

    if (unlink(pid_file)) {
        fprintf(stderr,"Could not remove the pid file %s.\n",pid_file);
    }

}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x4595
movq %rdi, %rbx
callq 0x2050
testl %eax, %eax
jne 0x4597
popq %rbx
retq
movq 0x3a5a(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x13da(%rip), %rsi      # 0x5982
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: usage
void usage(){
    printf("PACKAGE %s VERSION %s \n",PACKAGE_NAME,PACKAGE_VERSION);
    printf("-p <num>      port number to listen on,default is 12345\n");
    printf("-l <ip_addr>  interface to listen on, default is INDRR_ANY\n");
    printf("-d            run as a daemon\n");
    //printf("-r            maximize core file limit\n");
    printf("-u <username> assume identity of <username> (only when run as root)\n");
    //printf("-m <num>      max memory to use for items in megabytes, default is 64 MB\n");
    printf("-c <num>      max simultaneous connections, default is 1024\n");
    printf("-v            verbose (print errors/warnings while in event loop)\n");
    printf("-vv           very verbose (also print client commands/reponses)\n");
    printf("-h            print this help and exit\n");
    printf("-i            print memcached and libevent license\n");
    printf("-P <file>     save PID in <file>, only used with -d option\n");
    return;
}

// Assembly:
pushq %rax
leaq 0x13ea(%rip), %rdi      # 0x59a5
leaq 0x13fb(%rip), %rsi      # 0x59bd
leaq 0x1404(%rip), %rdx      # 0x59cd
xorl %eax, %eax
callq 0x2170
leaq 0x1638(%rip), %rdi      # 0x5c0f
callq 0x2090
leaq 0x1664(%rip), %rdi      # 0x5c47
callq 0x2090
leaq 0x1693(%rip), %rdi      # 0x5c82
callq 0x2090
leaq 0x16a5(%rip), %rdi      # 0x5ca0
callq 0x2090
leaq 0x16dd(%rip), %rdi      # 0x5ce4
callq 0x2090
leaq 0x170d(%rip), %rdi      # 0x5d20
callq 0x2090
leaq 0x1743(%rip), %rdi      # 0x5d62
callq 0x2090
leaq 0x1778(%rip), %rdi      # 0x5da3
callq 0x2090
leaq 0x1793(%rip), %rdi      # 0x5dca
callq 0x2090
leaq 0x17ba(%rip), %rdi      # 0x5dfd
popq %rax
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/murmur.c
// Function: fmix64
FORCE_INLINE uint64_t fmix64(uint64_t k)
{
	k ^= k >> 33;
	k *= BIG_CONSTANT(0xff51afd7ed558ccd);
	k ^= k >> 33;
	k *= BIG_CONSTANT(0xc4ceb9fe1a85ec53);
	k ^= k >> 33;

	return k;
}

// Assembly:
movq %rdi, %rax
shrq $0x21, %rax
xorq %rdi, %rax
movabsq $-0xae502812aa7333, %rcx # imm = 0xFF51AFD7ED558CCD
imulq %rax, %rcx
movq %rcx, %rax
shrq $0x21, %rax
xorq %rcx, %rax
movabsq $-0x3b314601e57a13ad, %rcx # imm = 0xC4CEB9FE1A85EC53
imulq %rax, %rcx
movq %rcx, %rax
shrq $0x21, %rax
xorq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/snej[P]zdelta/zdu.c
// Function: main_single
int main_single(int argc, char *argv[]){
  FILE *fp_ref;

  zd_mem_buffer ref_buf;
  zd_mem_buffer delta;
  Bytef *tar_buf = NULL;
  uLong t_size = 0;

  /* open and check the input files */
  if( !(fp_ref = fopen(argv[1],"rb")) )
  {
    perror(argv[1]);
    exit(0);
  }

  if(argc>2 && (!freopen(argv[2],"rb",stdin)))
  {
    perror(argv[2]); 
    exit(0);
  }

  /* copy input data to memory */
  if(dread_file(fp_ref,&ref_buf) < 0) {perror(argv[1]); exit(0);}
  if(dread_file(stdin,&delta) < 0) {perror(argv[2]); exit(0);}

  /* decompress the data */
  if(zd_uncompress1((const Bytef*)ref_buf.buffer, ref_buf.pos - ref_buf.buffer,
		    &tar_buf, &t_size,
		    (const Bytef*) delta.buffer, 
		    delta.pos - delta.buffer) == ZD_OK){
    
    /* successfull compression write the delta to a file */
    if(argc>3 && (!freopen(argv[3],"wb",stdout))){
      perror(argv[3]);
      exit(0);
    }
    if(t_size !=  fwrite(tar_buf, sizeof(char),t_size ,stdout))
      perror("ouput");
  }
  
  /* release memory */
  free(tar_buf);
  zd_free(&delta);
  zd_free(&ref_buf);
  
  /* close files */
  fclose(fp_ref);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movl %edi, %ebp
andq $0x0, (%rsp)
andq $0x0, 0x8(%rsp)
movq 0x8(%rsi), %rdi
leaq 0x7d85(%rip), %rsi      # 0x9004
callq 0x1120
testq %rax, %rax
je 0x1399
movq %rax, %rbx
cmpl $0x3, %ebp
jl 0x12b8
movq 0x10(%r14), %rdi
movq 0xcd30(%rip), %rax      # 0xdfd0
movq (%rax), %rdx
leaq 0x7d5a(%rip), %rsi      # 0x9004
callq 0x10a0
testq %rax, %rax
je 0x139f
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x1519
testl %eax, %eax
js 0x1399
movq 0xccfc(%rip), %rax      # 0xdfd0
movq (%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1519
testl %eax, %eax
js 0x139f
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r9
subq %r8, %r9
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
callq 0x18f3
testl %eax, %eax
jne 0x135b
cmpl $0x4, %ebp
jl 0x1338
movq 0x18(%r14), %rdi
movq 0xcca4(%rip), %rax      # 0xdfc8
movq (%rax), %rdx
leaq 0x7cd9(%rip), %rsi      # 0x9007
callq 0x10a0
testq %rax, %rax
je 0x13af
movq 0x8(%rsp), %r14
movq (%rsp), %rdi
movq 0xcc80(%rip), %rax      # 0xdfc8
movq (%rax), %rcx
pushq $0x1
popq %rsi
movq %r14, %rdx
callq 0x1150
cmpq %rax, %r14
jne 0x138b
movq (%rsp), %rdi
callq 0x1030
leaq 0x10(%rsp), %rdi
callq 0x149f
leaq 0x28(%rsp), %rdi
callq 0x149f
movq %rbx, %rdi
callq 0x1060
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7c78(%rip), %rdi      # 0x900a
callq 0x1130
jmp 0x135b
movq 0x8(%r14), %rdi
jmp 0x13a3
movq 0x10(%r14), %rdi
callq 0x1130
xorl %edi, %edi
callq 0x1140
movq 0x18(%r14), %rdi
jmp 0x13a3
// File: /workspace/github_c_makefile_star2_O2/snej[P]zdelta/zd_mem.c
// Function: zd_alloc
size_t zd_alloc(zd_mem_buffer *m, size_t n){

  if(n>0){
    if((m->buffer= (Bytef *) malloc(n * sizeof(Byte))) == NULL){
      perror("zd_alloc: could not allocate");
      return 0;
    }

    m->pos= m->buffer;
    m->size= n;
    return n;
  }

  m->size = 0;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
testq %rsi, %rsi
je 0x1419
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x1100
movq %rax, (%r14)
testq %rax, %rax
je 0x142b
movq %rax, 0x8(%r14)
movq %rbx, 0x10(%r14)
jmp 0x1420
andq $0x0, 0x10(%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7c04(%rip), %rdi      # 0x9036
callq 0x1130
jmp 0x141e
// File: /workspace/github_c_makefile_star2_O2/snej[P]zdelta/zd_mem.c
// Function: zd_realloc
size_t zd_realloc(zd_mem_buffer *m, size_t n){

  Bytef *p;
  int tmp_pos= (m->pos - m->buffer);

  if(n >0){
    p= (Bytef *) realloc(m->buffer, (m->size+n));
    if(p == NULL){
      perror("zd_realloc: could not realloc");
      return 0;
    }
    /* reset newly allocated memory*/
    if (m->buffer != p)
    {
       m->pos = p + tmp_pos;
       m->buffer= p;
    }

    m->size += n;
    return n;
  }
  
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x148e
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
movq 0x8(%rdi), %r12
movq 0x10(%rdi), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x1110
testq %rax, %rax
je 0x1482
cmpq %rax, (%r14)
je 0x147c
subq %r15, %r12
movslq %r12d, %rcx
addq %rax, %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%r14)
addq %rbx, 0x10(%r14)
jmp 0x1490
leaq 0x7bca(%rip), %rdi      # 0x9053
callq 0x1130
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/snej[P]zdelta/zd_mem.c
// Function: zd_free
size_t zd_free(zd_mem_buffer *m){

  int n=0;
  
  if(m->size >0){
    free(m->buffer);
    m->pos= NULL;
    n= m->size; m->size=0;
    /*m->buffer= NULL;*/
  }
  
  return n;
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x14bf
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x1030
xorps %xmm0, %xmm0
movslq 0x10(%rbx), %rax
movups %xmm0, 0x8(%rbx)
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/snej[P]zdelta/zd_mem.c
// Function: zd_memcpy
size_t zd_memcpy(zd_mem_buffer *m, void *data, size_t n){

  size_t avail=0;
  avail = (m->size - (m->pos - m->buffer));
  if(avail < n)
    if(zd_realloc(m, (n-avail)+1)== 0)
      return 0;
  
  memcpy(m->pos, data, n);
  m->pos += n;
  return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %rdi
subq %rdi, %rax
addq 0x10(%r14), %rax
cmpq %rdx, %rax
jae 0x14fd
movq %rbx, %rsi
subq %rax, %rsi
incq %rsi
movq %r14, %rdi
callq 0x1439
testq %rax, %rax
je 0x1515
movq 0x8(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x10f0
addq %rbx, 0x8(%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
xorl %ebx, %ebx
jmp 0x150c