LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: read_original_program
void read_original_program(){
    struct stat st;
    elf_unpatched=NULL;
    py_unpatched=NULL;
    int elfsize = 0;
    int ret = stat(ELF_PROGRAM_NAME, &st);
    if(ret<0){
        puts("elf file not exist");
        exit(0);
    }

    elfsize = st.st_size; 
    elf_unpatched_size = elfsize;
    FILE *fp = fopen(ELF_PROGRAM_NAME, "rb");
    elf_unpatched = malloc(elfsize);
    fread(elf_unpatched, 1, elfsize , fp);
    fclose(fp);
#ifdef DEBUG
    printf("%d, %s\n",elfsize, elf_unpatched);
#endif
    return; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
xorl %eax, %eax
movq %rax, 0x652b(%rip)      # 0x8148
movq %rax, 0x65dc(%rip)      # 0x8200
leaq 0x294d(%rip), %rdi      # 0x4578
leaq -0xa0(%rbp), %rsi
callq 0x1150
testl %eax, %eax
js 0x1c94
movq -0x70(%rbp), %r14
movl %r14d, 0x64fe(%rip)     # 0x8144
leaq 0x292b(%rip), %rdi      # 0x4578
leaq 0x2883(%rip), %rsi      # 0x44d7
callq 0x11a0
movq %rax, %rbx
movslq %r14d, %r14
movq %r14, %rdi
callq 0x1170
movq %rax, 0x64da(%rip)      # 0x8148
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1070
movq %rbx, %rdi
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x10a0
leaq 0x28f2(%rip), %rdi      # 0x458d
callq 0x1060
xorl %edi, %edi
callq 0x11d0
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: add_complain
int add_complain(){
    char option_buffer[16];
    char *message;
    memset(option_buffer, 0, 16);
    puts("Anything to complain about your patch?");
    puts("1. My patch is checked down but it should work.");
    puts("2. My patch seems not effective against some team.") ;
    puts("3. other complains");
    recv_until(option_buffer, 16, '\n');
    switch(option_buffer[0]){
        case '1':
            puts("We have a checker to check the function of the target program, your patch should not change those basic behaviors, also we disallow too many change over the original program.");
            break;
        case '2':
            puts("Maybe they are attacking your service with a deeper vulnerability, come on bro");
            break;
        case '3':
            message = malloc(0x200);
            read(0,message,0x200);
            puts("thanks for the complain, we will get back to you in a second");
            sleep(1);
            if(strstr(message,"flag") > 0){
                printf("%s, Your complain looks reasonable, let us give you a stack overflow as reward :n\n",message);
                free(message);
                read(0, option_buffer, 0x200);
                exit(0);
            }
            break;
        default:
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
leaq 0x2730(%rip), %rdi      # 0x45a7
callq 0x1060
leaq 0x274b(%rip), %rdi      # 0x45ce
callq 0x1060
leaq 0x276f(%rip), %rdi      # 0x45fe
callq 0x1060
leaq 0x2796(%rip), %rdi      # 0x4631
callq 0x1060
xorl %r14d, %r14d
leaq -0x11(%rbp), %rbx
movl $0x1, %edx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x1110
movb -0x11(%rbp), %al
cmpb $0xa, %al
je 0x1ecb
movb %al, -0x30(%rbp,%r14)
incq %r14
cmpq $0x10, %r14
jne 0x1ea7
movzbl -0x30(%rbp), %eax
cmpl $0x31, %eax
je 0x1f36
cmpl $0x33, %eax
je 0x1ee7
cmpl $0x32, %eax
jne 0x1f2d
leaq 0x280e(%rip), %rdi      # 0x46f3
jmp 0x1f3d
movl $0x200, %edi            # imm = 0x200
callq 0x1170
movq %rax, %rbx
movl $0x200, %edx            # imm = 0x200
xorl %edi, %edi
movq %rax, %rsi
callq 0x1110
leaq 0x2838(%rip), %rdi      # 0x4742
callq 0x1060
movl $0x1, %edi
callq 0x11f0
leaq 0x285f(%rip), %rsi      # 0x477f
movq %rbx, %rdi
callq 0x1220
testq %rax, %rax
jne 0x1f4a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2707(%rip), %rdi      # 0x4644
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1060
leaq 0x2833(%rip), %rdi      # 0x4784
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
callq 0x1030
leaq -0x30(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
xorl %edi, %edi
callq 0x1110
xorl %edi, %edi
callq 0x11d0
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: do_patch_pipeline_alloc
struct executor_queue * do_patch_pipeline_alloc(struct patch_attr* attr){
    unsigned int size, value_size; 
    unsigned long queue_size, cost;

    struct executor_queue * eq;
    size = attr->max_queue_entries + 1;
    value_size = attr->value_size;
    queue_size = sizeof(*eq) + (unsigned long) value_size * size;
    cost = queue_size + (0x1000 - (queue_size % 0x1000));
    if (cost >= 0x10000000){
        return NULL;
    }
    eq = malloc(queue_size);
    if(eq<0){
        return NULL;
    }
    eq->ops = &elf_executor_ops;
    init_executor_queue(eq, attr);
    eq->size = size;
    return eq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %r12d
movl 0x8(%rdi), %r15d
leal 0x1(%r12), %r14d
movq %r14, %rax
imulq %r15, %rax
leaq 0x38(%rax), %rdi
movl %edi, %ecx
andl $0xfff, %ecx            # imm = 0xFFF
negq %rcx
addq %rcx, %rax
addq $-0xfffefc8, %rax       # imm = 0xF0001038
cmpq $-0x10000000, %rax      # imm = 0xF0000000
jae 0x1fc0
xorl %eax, %eax
jmp 0x1ff1
callq 0x1170
leaq 0x5dec(%rip), %rcx      # 0x7db8
movq %rcx, (%rax)
movl (%rbx), %ecx
movl %ecx, 0x8(%rax)
movl %r12d, 0x10(%rax)
movl %r15d, 0x14(%rax)
movl 0x615e(%rip), %ecx      # 0x8140
movl %ecx, 0xc(%rax)
movq $0x0, 0x18(%rax)
movl %r14d, 0x20(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: add_patch_pipeline
int add_patch_pipeline(){
    struct patch_attr* attr; int res = 0;
    struct executor_queue *eq;
    puts(">");
    attr = malloc(sizeof(struct patch_attr));
    read(0, attr, sizeof(struct patch_attr));
#ifdef DEBUG
    puts("o");
#endif

    res=check_patch_attr(attr);
    if(res<0){
#ifdef DEBUG
        printf("check patach attr error code: %d\n",res);
#endif
        return res;
    }

    eq = do_patch_pipeline_alloc(attr);
    if(!eq){
#ifdef DEBUG
        printf("pipeline alloc error\n");
#endif
        return res;
    }

    list_insert(&head, &eq->list);
    total_ppl+=1;
    global_executor_idx+=1;
#ifdef DEBUG
    printf("successfully added pipeline\n");
#endif

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2a88(%rip), %rdi      # 0x4a8f
callq 0x1060
movl $0x18, %edi
callq 0x1170
movq %rax, %rbx
movl $0x18, %edx
xorl %edi, %edi
movq %rax, %rsi
callq 0x1110
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x2, (%rbx)
ja 0x20a2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x100000, 0x8(%rbx)    # imm = 0x100000
ja 0x20a2
cmpl $0x4, 0x6109(%rip)      # 0x8150
jb 0x205c
leaq 0x27b9(%rip), %rdi      # 0x4809
callq 0x1060
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x20a2
movq %rbx, %rdi
callq 0x1f7a
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x20a2
movq %rcx, %rdx
addq $0x28, %rdx
leaq 0x618c(%rip), %rsi      # 0x8208
movq 0x6185(%rip), %rdi      # 0x8208
movq %rdx, 0x617e(%rip)      # 0x8208
movq %rdi, 0x28(%rcx)
movq %rsi, 0x30(%rcx)
movq %rdx, 0x8(%rdi)
incl 0x60b4(%rip)            # 0x8150
incl 0x609e(%rip)            # 0x8140
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: remove_pipeline
int remove_pipeline(){
    struct executor_queue *eq = NULL;
    struct ppl_list_node * cur; 
    unsigned int idx;
    read(0, &idx, 4);
    cur = &head;
    for(cur=cur->fd; cur!=&head; cur=cur->fd){
        eq = (struct executor_queue *)((unsigned long)cur - (unsigned long)&((struct executor_queue*)0)->list);
#ifdef DEBUG
        printf("found executor at: %p\n", eq);
#endif
        if (eq->executor_idx == idx){
            break;
        }
        eq = NULL;
    }
    if(eq != NULL){
#ifdef DEBUG
        printf("goint to remove pipeline %d\n",idx);
#endif  
        eq->ops->executor_free(eq);
        ppl_node_unlink(&eq->list);
        total_ppl-=1;
    }
    else{
        return -1;
    }
    return 0; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0xc(%rbp), %rbx
movl $0x4, %edx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x1110
leaq 0x613f(%rip), %rax      # 0x8208
movl (%rbx), %ecx
movq %rax, %rbx
movq (%rbx), %rbx
cmpq %rax, %rbx
je 0x2100
cmpl %ecx, -0x1c(%rbx)
jne 0x20ce
addq $-0x28, %rbx
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
decl 0x6054(%rip)            # 0x8150
xorl %eax, %eax
jmp 0x2105
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: swap_a_patch
int swap_a_patch(){
    struct patch_attr attr;
    unsigned int value_size;
    struct executor_queue * eq;
    unsigned int queue_type, idx_to_swap;
    unsigned char * value, * tmp_buffer;
    struct ppl_list_node * cur;
    int found_queue = 0;
    void *dst;
    if(!total_ppl){
        return -1;
    }
    read(0, &attr, sizeof(struct patch_attr));
    queue_type = attr.queue_type;
    idx_to_swap  = attr.idx_to_swap;
#ifdef DEBUG
    printf("type:%d\t idx to swap: %d\n", queue_type, idx_to_swap);
#endif
    
    cur = &head;
    for(cur=cur->fd; cur!=&head; cur=cur->fd)
    {
        eq = (struct executor_queue *)((unsigned long)cur - (unsigned long)&((struct executor_queue*)0)->list);
#ifdef DEBUG
        printf("found executor at: %p\n", eq);
#endif
        if(eq->queue_type == queue_type && eq->head > idx_to_swap && eq->tail<=idx_to_swap){
            found_queue = 1;
            break;
        }
    }
    if (!found_queue){
#ifdef DEBUG
        printf("executor not found for type %d\n", queue_type);
        printf("head: %d, tail: %d\n", eq->head, eq->tail);
#endif
        return -1;
    }
    value_size = eq->value_size;
    value = malloc(value_size);
#ifdef DEBUG
    puts("xD");
#endif
    // read new patch to buffer just allocated
    //read(0, value, value_size);
    safe_read(0, value, value_size);

    tmp_buffer = (char*)malloc(value_size);
    dst = &eq->elements[idx_to_swap * value_size];
    memcpy(tmp_buffer, dst, value_size);
    memcpy(dst, value, value_size);

    write(1, tmp_buffer, value_size);

    free(tmp_buffer);
    free(value);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x0, 0x6027(%rip)      # 0x8150
je 0x21f1
leaq -0x48(%rbp), %rsi
movl $0x18, %edx
xorl %edi, %edi
callq 0x1110
movq 0x60c2(%rip), %rax      # 0x8208
leaq 0x60bb(%rip), %rcx      # 0x8208
cmpq %rcx, %rax
je 0x21f1
movl -0x48(%rbp), %edx
movl -0x34(%rbp), %r13d
cmpl %edx, -0x20(%rax)
jne 0x2172
leaq -0x28(%rax), %r14
cmpl %r13d, 0x18(%r14)
jbe 0x2172
cmpl %r13d, 0x1c(%r14)
jbe 0x217c
movq (%rax), %rax
cmpq %rcx, %rax
jne 0x215d
jmp 0x21f1
movl 0x14(%r14), %r15d
movq %r15, %rdi
callq 0x1170
movq %rax, -0x30(%rbp)
xorl %ebx, %ebx
xorl %edi, %edi
movq %rax, %rsi
movl %r15d, %edx
callq 0x1776
movq %r15, %rdi
callq 0x1170
movq %rax, %r12
imull %r15d, %r13d
addq %r14, %r13
addq $0x38, %r13
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1160
movq %r13, %rdi
movq -0x30(%rbp), %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x1160
movl $0x1, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1090
movq %r12, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/main.c
// Function: run_patches
int run_patches(){
    struct patch_attr attr;
    struct ppl_list_node * cur;
    unsigned int queue_type;
    int found_queue = 0;
    int cur_run;
    unsigned int value_size;
    void* value;
    int ret;
    struct executor_queue* eq;
    if(!total_ppl){
        return -1;
    }
    read(0, &attr, sizeof(struct patch_attr));
    if(attr.queue_type > BRAINFUCK_EXECUTOR){
        return -1; 
    }
    queue_type = attr.queue_type;
    // iterate over the linked list
    cur = &head;
    for(cur=cur->fd; cur!=&head; cur=cur->fd)
    {
        eq = (struct executor_queue *)((unsigned long)cur - (unsigned long)&((struct executor_queue*)0)->list);
#ifdef DEBUG
        printf("%p\n", eq);
#endif
        if(eq->queue_type == queue_type && attr.number_of_patch <= eq->head - eq->tail){
            found_queue=1;
            break;
        }
    }
    if(!found_queue){
        puts("not found");
        return -1; 
    }
    value_size = eq->value_size;
    value = malloc(eq->value_size);
    memset(value, 0, value_size);
    for(cur_run=0; cur_run<attr.number_of_patch; cur_run++){
        // get_the element 
        eq->ops->get_elem(eq, value);
        ret=eq->ops->check_patch(eq, value);
        if(ret < 0){
            printf("%s... is not a valid patch\n", (char*)value);
            return 0;
        }
        eq->ops->run_patch(eq, value);
    }
    free(value);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x0, 0x5ea7(%rip)      # 0x8150
je 0x2307
leaq -0x38(%rbp), %r14
movl $0x18, %edx
xorl %edi, %edi
movq %r14, %rsi
callq 0x1110
movl (%r14), %eax
cmpl $0x2, %eax
ja 0x2307
movq 0x5f3b(%rip), %rcx      # 0x8208
leaq 0x5f34(%rip), %rdx      # 0x8208
cmpq %rdx, %rcx
je 0x22fb
movl -0x28(%rbp), %r12d
cmpl %eax, -0x20(%rcx)
jne 0x22f3
leaq -0x28(%rcx), %r14
movl 0x18(%r14), %esi
subl 0x1c(%r14), %esi
cmpl %esi, %r12d
jbe 0x2316
movq (%rcx), %rcx
cmpq %rdx, %rcx
jne 0x22dd
leaq 0x24d5(%rip), %rdi      # 0x47d7
callq 0x1060
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x14(%r14), %esi
movl $0x1, %edi
callq 0x1130
movq %rax, %r15
testl %r12d, %r12d
je 0x2359
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
testl %eax, %eax
js 0x2365
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x28(%rax)
decl %r12d
jne 0x232c
movq %r15, %rdi
callq 0x1030
xorl %ebx, %ebx
jmp 0x2307
leaq 0x2475(%rip), %rdi      # 0x47e1
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
jmp 0x2307
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/sha3.c
// Function: rhash_sha3_update
void rhash_sha3_update(sha3_ctx *ctx, const unsigned char *msg, size_t size)
{
	size_t index = (size_t)ctx->rest;
	size_t block_size = (size_t)ctx->block_size;

	if (ctx->rest & SHA3_FINALIZED) return; /* too late for additional input */
	ctx->rest = (unsigned)((ctx->rest + size) % block_size);

	/* fill partial block */
	if (index) {
		size_t left = block_size - index;
		memcpy((char*)ctx->message + index, msg, (size < left ? size : left));
		if (size < left) return;

		/* process partial block */
		rhash_sha3_process_block(ctx->hash, ctx->message, block_size);
		msg  += left;
		size -= left;
	}
	while (size >= block_size) {
		uint64_t* aligned_message_block;
		if (IS_ALIGNED_64(msg)) {
			/* the most common case is processing of an already aligned message
			without copying it */
			aligned_message_block = (uint64_t*)msg;
		} else {
			memcpy(ctx->message, msg, block_size);
			aligned_message_block = ctx->message;
		}

		rhash_sha3_process_block(ctx->hash, aligned_message_block, block_size);
		msg  += block_size;
		size -= block_size;
	}
	if (size) {
		memcpy(ctx->message, msg, size); /* save leftovers */
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x188(%rdi), %ecx
testl %ecx, %ecx
js 0x25d5
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
movl 0x18c(%rdi), %r12d
leaq (%rcx,%rdx), %rax
xorl %edx, %edx
divq %r12
movl %edx, 0x188(%rdi)
testq %rcx, %rcx
je 0x2565
movq %r12, %r14
subq %rcx, %r14
leaq (%rcx,%r13), %rdi
addq $0xc8, %rdi
cmpq %rbx, %r14
movq %rbx, %rdx
cmovbq %r14, %rdx
movq %r15, %rsi
callq 0x1160
subq %r14, %rbx
jb 0x25d5
leaq 0xc8(%r13), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x25e4
addq %r14, %r15
cmpq %r12, %rbx
movq %r13, -0x30(%rbp)
jb 0x25ac
addq $0xc8, %r13
movq %r15, %r14
movq %r15, %rsi
testb $0x7, %r14b
je 0x2592
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1160
movq %r13, %rsi
movq -0x30(%rbp), %rdi
movq %r12, %rdx
callq 0x25e4
addq %r12, %r15
subq %r12, %rbx
addq %r12, %r14
cmpq %r12, %rbx
jae 0x2578
testq %rbx, %rbx
movq -0x30(%rbp), %rdi
je 0x25d5
addq $0xc8, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1160
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/sha3.c
// Function: rhash_sha3_final
void rhash_sha3_final(sha3_ctx *ctx, unsigned char* result)
{
	size_t digest_length = 100 - ctx->block_size / 2;
	const size_t block_size = ctx->block_size;

	if (!(ctx->rest & SHA3_FINALIZED))
	{
		/* clear the rest of the data queue */
		memset((char*)ctx->message + ctx->rest, 0, block_size - ctx->rest);
		((char*)ctx->message)[ctx->rest] |= 0x06;
		((char*)ctx->message)[block_size - 1] |= 0x80;

		/* process final block */
		rhash_sha3_process_block(ctx->hash, ctx->message, block_size);
		ctx->rest = SHA3_FINALIZED; /* mark context as finalized */
	}

	assert(block_size > digest_length);
	if (result) me64_to_le_str(result, ctx->hash, digest_length);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x18c(%rdi), %r12d
movl %r12d, %eax
shrl %eax
movl $0x64, %r15d
subl %eax, %r15d
movslq 0x188(%rdi), %rax
testq %rax, %rax
js 0x2a4a
leaq 0xc8(%rbx), %r13
leaq (%rbx,%rax), %rdi
addq $0xc8, %rdi
movq %r12, %rdx
subq %rax, %rdx
xorl %esi, %esi
callq 0x10f0
movl 0x188(%rbx), %eax
orb $0x6, 0xc8(%rbx,%rax)
orb $-0x80, 0xc7(%rbx,%r12)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x25e4
movl $0x80000000, 0x188(%rbx) # imm = 0x80000000
cmpl %r15d, %r12d
jbe 0x2a7f
testq %r14, %r14
je 0x2a70
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1160
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ed6(%rip), %rdi      # 0x495c
leaq 0x1eea(%rip), %rsi      # 0x4977
leaq 0x1eea(%rip), %rcx      # 0x497e
movl $0x145, %edx            # imm = 0x145
callq 0x10e0
nop
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_FileGetNameOfSection
const char * ELF64_FileGetNameOfSection( ELF64_FileRef file, ELF64_SectionHeaderEntryRef section )
{
    ELF64_HeaderRef             header;
    ELF64_SectionHeaderEntryRef stringTable;
    ELF64_Word                  nameOffset;
    
    if( file == NULL || section == NULL )
    {
        return NULL;
    }
    
    header = ELF64_FileGetHeader( file );
    
    if( header == NULL )
    {
        return NULL;
    }
    
    stringTable = ELF64_FileGetStringTableHeaderEntry( file );
    nameOffset  = ELF64_SectionHeaderEntryGetNameOffset( section );
    
    return ( const char * )( ELF64_FileGetDataForSection( file, stringTable ) + nameOffset );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x2bac
xorl %eax, %eax
jmp 0x2bd3
movzwl 0x3e(%rdi), %eax
cmpw %ax, 0x3c(%rdi)
jbe 0x2bcc
movq 0x28(%rdi), %rcx
addq %rdi, %rcx
movzwl 0x3a(%rdi), %edx
imulq %rax, %rdx
addq 0x18(%rdx,%rcx), %rdi
jmp 0x2bce
xorl %edi, %edi
movl (%rsi), %eax
addq %rdi, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_FileGetSymbolTableEntryForSection
ELF64_SymbolTableEntryRef ELF64_FileGetSymbolTableEntryForSection( ELF64_FileRef file, ELF64_SectionHeaderEntryRef section, unsigned int index )
{
    ELF64_XWord entrySize;
    
    if( ELF64_SectionHeaderEntryGetType( section ) != ELF64_SectionTypeLinkerSymbolTable )
    {
        return NULL;
    }
    
    if( index >= ELF64_SectionHeaderEntryGetSymbolTableEntryCount( section ) )
    {
        return NULL;
    }
    
    entrySize = ELF64_SectionHeaderEntryGetEntrySize( section );
    
    return ( ELF64_SymbolTableEntryRef )( ( void * )( ELF64_FileGetDataForSection( file, section ) + ( index * entrySize ) ) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2d1e
cmpl $0x2, %eax
jne 0x2d0e
movq %r15, %rdi
callq 0x2d1e
xorl %ecx, %ecx
testq %r15, %r15
je 0x2d10
cmpl $0x2, %eax
jne 0x2d10
movq 0x38(%r15), %rsi
testq %rsi, %rsi
je 0x2d0e
movq 0x20(%r15), %rax
xorl %ecx, %ecx
xorl %edx, %edx
divq %rsi
cmpl %r14d, %eax
jbe 0x2d10
addq 0x18(%r15), %rbx
movl %r14d, %eax
imulq %rax, %rsi
addq %rbx, %rsi
movq %rsi, %rcx
jmp 0x2d10
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_SectionHeaderEntryGetSymbolTableEntryCount
unsigned int ELF64_SectionHeaderEntryGetSymbolTableEntryCount( ELF64_SectionHeaderEntryRef section )
{
    ELF64_XWord entrySize;
    ELF64_XWord sectionSize;
    
    if( ELF64_SectionHeaderEntryGetType( section ) != ELF64_SectionTypeLinkerSymbolTable )
    {
        return 0;
    }
    
    entrySize   = ELF64_SectionHeaderEntryGetEntrySize( section );
    sectionSize = ELF64_SectionHeaderEntryGetSectionSize( section );
    
    if( entrySize == 0 )
    {
        return 0;
    }
    
    return ( unsigned int )( sectionSize / entrySize );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2d1e
movl %eax, %ecx
xorl %eax, %eax
testq %rbx, %rbx
je 0x2d6f
cmpl $0x2, %ecx
jne 0x2d6f
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
je 0x2d6f
movq 0x20(%rbx), %rax
xorl %edx, %edx
divq %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_FileGetSymbolTableEntryNameForSection
const char * ELF64_FileGetSymbolTableEntryNameForSection( ELF64_FileRef file, ELF64_SymbolTableEntryRef sym, ELF64_SectionHeaderEntryRef section )
{
    ELF64_Word                  stringTableIndex;
    ELF64_SectionHeaderEntryRef stringTable;
    ELF64_Word                  nameOffset;
    const char                * name;
    
    if( file == NULL || sym == NULL || section == NULL )
    {
        return NULL;
    }
    
    stringTableIndex = ELF64_SectionHeaderEntryGetLinkedSectionIndex( section );
    stringTable      = ELF64_FileGetSectionHeaderEntry( file, stringTableIndex );
    
    if( stringTable == NULL )
    {
        return NULL;
    }
    
    nameOffset = ELF64_SymbolTableEntryGetNameOffset( sym );
    name       = ( const char * )( ELF64_FileGetDataForSection( file, stringTable ) + nameOffset );
    
    if( strlen( name ) == 0 )
    {
        return "<unnamed-symbol>";
    }
    
    return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
orb %cl, %al
jne 0x2ddb
movl 0x28(%rdx), %eax
movzwl 0x3c(%rdi), %ecx
cmpl %ecx, %eax
jae 0x2ddb
movq 0x28(%rdi), %rcx
addq %rdi, %rcx
movzwl 0x3a(%rdi), %edx
imulq %rdx, %rax
movl (%rsi), %edx
addq 0x18(%rax,%rcx), %rdi
cmpb $0x0, (%rdx,%rdi)
leaq (%rdi,%rdx), %rcx
leaq 0x1cab(%rip), %rax      # 0x4a80
cmovneq %rcx, %rax
jmp 0x2ddd
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_FileGetSectionHeaderEntryWithName
ELF64_SectionHeaderEntryRef ELF64_FileGetSectionHeaderEntryWithName( ELF64_FileRef file, const char * name )
{
    ELF64_Half                  i;
    ELF64_HeaderRef             header;
    ELF64_SectionHeaderEntryRef section;
    const char                * sName;
    
    if( file == NULL )
    {
        return NULL;
    }
    
    header = ELF64_FileGetHeader( file );
    
    if( header == NULL )
    {
        return NULL;
    }
    
    for( i = 0; i < ELF64_HeaderGetSectionHeaderEntryCount( header ); i++ )
    {
        section = ELF64_FileGetSectionHeaderEntry( file, i );
        sName   = ELF64_FileGetNameOfSection( file, section );
        
        if( strcmp( name, sName ) == 0 )
        {
            return section;
        }
    }
    
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, -0x30(%rbp)
testq %rdi, %rdi
je 0x2e73
movq %rdi, %r15
movzwl 0x3c(%rdi), %r12d
testq %r12, %r12
je 0x2e73
movzwl 0x3a(%r15), %r13d
movq 0x28(%r15), %rbx
addq %r15, %rbx
movzwl 0x3e(%r15), %eax
imulq %r13, %rax
addq 0x18(%rax,%rbx), %r15
xorl %r14d, %r14d
movl (%rbx), %esi
addq %r15, %rsi
movq -0x30(%rbp), %rdi
callq 0x1140
testl %eax, %eax
je 0x2e75
incq %r14
addq %r13, %rbx
cmpq %r14, %r12
jne 0x2e56
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_FileGetSymbolTableEntryWithName
ELF64_SymbolTableEntryRef ELF64_FileGetSymbolTableEntryWithName( ELF64_FileRef file, const char * name )
{
    ELF64_HeaderRef             header;
    ELF64_SectionHeaderEntryRef sHeader;
    ELF64_Half                  i;
    unsigned int                symCount;
    unsigned int                j;
    ELF64_SymbolTableEntryRef   sym;
    const char                * symName;
    
    if( file == NULL )
    {
        return NULL;
    }
    
    header = ELF64_FileGetHeader( file );
    
    if( header == NULL )
    {
        return NULL;
    }
    
    for( i = 0; i < ELF64_HeaderGetSectionHeaderEntryCount( header ); i++ )
    {
        sHeader = ELF64_FileGetSectionHeaderEntry( file, i );
        
        if( ELF64_SectionHeaderEntryGetType( sHeader ) != ELF64_SectionTypeLinkerSymbolTable )
        {
            continue;
        }
        
        symCount = ELF64_SectionHeaderEntryGetSymbolTableEntryCount( sHeader );
            
        for( j = 0; j < symCount; j++ )
        {
            sym     = ELF64_FileGetSymbolTableEntryForSection( file, sHeader, j );
            symName = ELF64_FileGetSymbolTableEntryNameForSection( file, sym, sHeader );
            
            if( strcmp( name, symName ) == 0 )
            {
                return sym;
            }
        }
    }
    
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, -0x48(%rbp)
testq %rdi, %rdi
je 0x2f97
movq %rdi, %rbx
movzwl 0x3c(%rdi), %eax
testq %rax, %rax
je 0x2f97
xorl %r12d, %r12d
movq %rax, -0x38(%rbp)
cmpq %rax, %r12
jae 0x2ed6
movzwl 0x3a(%rbx), %r15d
movq 0x28(%rbx), %rax
addq %rbx, %rax
imulq %r12, %r15
addq %rax, %r15
jmp 0x2ed9
xorl %r15d, %r15d
movq %r15, %rdi
callq 0x2d1e
cmpl $0x2, %eax
jne 0x2f87
movq %r15, %rdi
callq 0x2d1e
testq %r15, %r15
je 0x2f87
cmpl $0x2, %eax
jne 0x2f87
movq 0x38(%r15), %rcx
testq %rcx, %rcx
je 0x2f87
movq 0x20(%r15), %rax
xorl %edx, %edx
divq %rcx
movq %rax, -0x40(%rbp)
testl %eax, %eax
je 0x2f87
movl 0x28(%r15), %eax
movq 0x28(%rbx), %rcx
addq %rbx, %rcx
movzwl 0x3a(%rbx), %edx
imulq %rax, %rdx
movq 0x18(%rdx,%rcx), %rax
addq %rbx, %rax
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
movq %rbx, %r14
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x2cae
movq %rax, %rbx
movl (%rax), %eax
movq -0x30(%rbp), %rcx
cmpb $0x0, (%rcx,%rax)
leaq 0x1b1b(%rip), %rsi      # 0x4a80
je 0x2f6e
addq -0x30(%rbp), %rax
movq %rax, %rsi
movq -0x48(%rbp), %rdi
callq 0x1140
testl %eax, %eax
je 0x2f99
incl %r13d
cmpl %r13d, -0x40(%rbp)
movq %r14, %rbx
jne 0x2f40
incq %r12
movq -0x38(%rbp), %rax
cmpq %rax, %r12
jne 0x2ebc
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_FileGetSymbolTableEntryWithAddress
ELF64_SymbolTableEntryRef ELF64_FileGetSymbolTableEntryWithAddress( ELF64_FileRef file, ELF64_Addr address )
{
    ELF64_HeaderRef             header;
    ELF64_SectionHeaderEntryRef sHeader;
    ELF64_Half                  i;
    unsigned int                symCount;
    unsigned int                j;
    ELF64_SymbolTableEntryRef   sym;
    ELF64_Addr                  symAddress;
    
    if( file == NULL )
    {
        return NULL;
    }
    
    header = ELF64_FileGetHeader( file );
    
    if( header == NULL )
    {
        return NULL;
    }
    
    for( i = 0; i < ELF64_HeaderGetSectionHeaderEntryCount( header ); i++ )
    {
        sHeader = ELF64_FileGetSectionHeaderEntry( file, i );
        
        if( ELF64_SectionHeaderEntryGetType( sHeader ) != ELF64_SectionTypeLinkerSymbolTable )
        {
            continue;
        }
        
        symCount = ELF64_SectionHeaderEntryGetSymbolTableEntryCount( sHeader );
            
        for( j = 0; j < symCount; j++ )
        {
            sym         = ELF64_FileGetSymbolTableEntryForSection( file, sHeader, j );
            symAddress  = ELF64_SymbolTableEntryGetSymbolValue( sym );
            
            if( address == symAddress )
            {
                return sym;
            }
        }
    }
    
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
testq %rdi, %rdi
je 0x3071
movq %rdi, %r14
movzwl 0x3c(%rdi), %eax
testq %rax, %rax
je 0x3071
xorl %ebx, %ebx
movq %rax, -0x30(%rbp)
cmpq %rax, %rbx
jae 0x2ff9
movzwl 0x3a(%r14), %r15d
movq 0x28(%r14), %rax
addq %r14, %rax
imulq %rbx, %r15
addq %rax, %r15
jmp 0x2ffc
xorl %r15d, %r15d
movq %r15, %rdi
callq 0x2d1e
cmpl $0x2, %eax
jne 0x3061
movq %r15, %rdi
callq 0x2d1e
testq %r15, %r15
je 0x3061
cmpl $0x2, %eax
jne 0x3061
movq 0x38(%r15), %rcx
testq %rcx, %rcx
je 0x3061
movq 0x20(%r15), %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r12
testl %r12d, %r12d
je 0x3061
xorl %r13d, %r13d
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x2cae
testq %rax, %rax
je 0x3051
movq 0x8(%rax), %rcx
jmp 0x3053
xorl %ecx, %ecx
cmpq -0x38(%rbp), %rcx
je 0x3073
incl %r13d
cmpl %r13d, %r12d
jne 0x3038
incq %rbx
movq -0x30(%rbp), %rax
cmpq %rax, %rbx
jne 0x2fdf
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_ProgramHeaderEntryGetAttributesString
const char * ELF64_ProgramHeaderEntryGetAttributesString( ELF64_ProgramHeaderEntryRef entry )
{
    ELF64_Word flags;
    
    flags = ELF64_ProgramHeaderEntryGetAttributes( entry );
    
    if( flags & ELF64_SegmentAttributeRead && flags & ELF64_SegmentAttributeWrite && flags & ELF64_SegmentAttributeExecute )
    {
        return "rwx";
    }
    else if( flags & ELF64_SegmentAttributeRead && flags & ELF64_SegmentAttributeWrite )
    {
        return "rw-";
    }
    else if( flags & ELF64_SegmentAttributeRead && flags & ELF64_SegmentAttributeExecute )
    {
        return "r-x";
    }
    else if( flags & ELF64_SegmentAttributeWrite && flags & ELF64_SegmentAttributeExecute )
    {
        return "-wx";
    }
    else if( flags & ELF64_SegmentAttributeRead )
    {
        return "r--";
    }
    else if( flags & ELF64_SegmentAttributeWrite )
    {
        return "-w-";
    }
    else if( flags & ELF64_SegmentAttributeExecute )
    {
        return "--x";
    }
    
    return "---";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3303
movl 0x4(%rdi), %ecx
jmp 0x3305
xorl %ecx, %ecx
movl %ecx, %edx
andl $0x6, %edx
movl %ecx, %esi
notl %esi
testb $0x7, %sil
leaq 0x1e03(%rip), %rdi      # 0x511c
leaq 0x1e00(%rip), %rax      # 0x5120
cmoveq %rdi, %rax
cmpl $0x6, %edx
je 0x3377
testb $0x5, %sil
jne 0x3338
leaq 0x1dee(%rip), %rax      # 0x5124
jmp 0x3377
testb $0x4, %cl
leaq 0x1dee(%rip), %rax      # 0x5130
leaq 0x1de3(%rip), %rdi      # 0x512c
cmoveq %rax, %rdi
testb $0x3, %sil
leaq 0x1dd0(%rip), %rsi      # 0x5128
cmovneq %rdi, %rsi
testb $0x1, %cl
leaq 0x1dd2(%rip), %rcx      # 0x5138
leaq 0x1dc7(%rip), %rax      # 0x5134
cmoveq %rcx, %rax
testl %edx, %edx
cmovneq %rsi, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ww9210[P]xnuca_final_ssp/elf.c
// Function: ELF64_Hash
unsigned long ELF64_Hash( const char * name )
{
    unsigned long h;
    unsigned long g;
    
    h = 0;
    
    while( *( name ) )
    {
        h = ( h << 4 ) + *( ( const unsigned char * )name++ );
        
        if( ( g = h & 0xF0000000 ) )
        {
            h ^= g >> 24;
        }
        
        h &= 0x0FFFFFFF;
    }
    
    return h;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x359f
pushq %rbp
movq %rsp, %rbp
incq %rdi
xorl %edx, %edx
shlq $0x4, %rdx
movzbl %cl, %eax
addq %rdx, %rax
movl %eax, %ecx
shrl $0x18, %ecx
andl $-0x10, %ecx
andl $0xfffffff, %eax        # imm = 0xFFFFFFF
xorq %rcx, %rax
movb (%rdi), %cl
incq %rdi
movq %rax, %rdx
testb %cl, %cl
jne 0x3577
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Cyan4973[P]FiniteStateEntropy/programs/commandline.c
// Function: usage
static int usage(const char* programName)
{
    DISPLAY("Usage :\n");
    DISPLAY("%s [arg] inputFilename [outputFilename]\n", programName);
    DISPLAY("Arguments :\n");
    DISPLAY("(default): fse core loop timing tests\n");
    DISPLAY(" -e : use FSE (default)\n");
    DISPLAY(" -h : use HUF\n");
    DISPLAY(" -z : use zlib's huffman\n");
    DISPLAY(" -d : decompression (default for %s extension)\n", FSE_EXTENSION);
    DISPLAY(" -b : benchmark mode\n");
    DISPLAY(" -i#: iteration loops [1-9](default : 4), benchmark mode only\n");
    DISPLAY(" -B#: block size (default : 32768), benchmark mode only\n");
    DISPLAY(" -H : display help and exit\n");
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x180c1(%rip), %r15     # 0x19ff8
movq (%r15), %rcx
leaq 0x118f8(%rip), %rdi     # 0x13839
pushq $0x8
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rdi
leaq 0x118e9(%rip), %rsi     # 0x13842
movq %r14, %rdx
xorl %eax, %eax
callq 0x1110
movq (%r15), %rcx
leaq 0x118fe(%rip), %rdi     # 0x1386b
pushq $0xc
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x118f6(%rip), %rdi     # 0x13878
pushq $0x26
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x11908(%rip), %rdi     # 0x1389f
pushq $0x18
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x1190c(%rip), %rdi     # 0x138b8
pushq $0xe
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x11906(%rip), %rdi     # 0x138c7
pushq $0x19
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rdi
leaq 0x1190b(%rip), %rsi     # 0x138e1
leaq 0x117ba(%rip), %rdx     # 0x13797
xorl %eax, %eax
callq 0x1110
movq (%r15), %rcx
leaq 0x11923(%rip), %rdi     # 0x13911
pushq $0x15
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x11924(%rip), %rdi     # 0x13927
pushq $0x3e
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x1194e(%rip), %rdi     # 0x13966
pushq $0x38
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r15), %rcx
leaq 0x11972(%rip), %rdi     # 0x1399f
pushq $0x1c
popq %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1190
// File: /workspace/github_c_makefile_star2_O3/Cyan4973[P]FiniteStateEntropy/programs/fileio.c
// Function: get_fileHandle
static void get_fileHandle(const char* input_filename, const char* output_filename, FILE** pfinput, FILE** pfoutput)
{
    if (!strcmp (input_filename, stdinmark)) {
        DISPLAYLEVEL(4,"Using stdin for input\n");
        *pfinput = stdin;
        SET_BINARY_MODE(stdin);
    } else {
        *pfinput = fopen(input_filename, "rb");
    }

    if (*pfinput == 0) EXM_THROW(12, "Pb opening %s", input_filename);

    if (!strcmp (output_filename, stdoutmark)) {
        DISPLAYLEVEL(4,"Using stdout for output\n");
        *pfoutput = stdout;
        SET_BINARY_MODE(stdout);
    } else {
        /* Check if destination file already exists */
        *pfoutput=0;
        if (strcmp(output_filename,nulmark)) *pfoutput = fopen( output_filename, "rb" );
        if (*pfoutput!=0) {
            fclose(*pfoutput);
            if (!g_overwrite) {
                char ch;
                if (g_displayLevel <= 1)   /* No interaction possible */
                    EXM_THROW(11, "Operation aborted : %s already exists", output_filename);
                DISPLAYLEVEL(2, "Warning : %s already exists\n", output_filename);
                DISPLAYLEVEL(2, "Overwrite ? (Y/N) : ");
                ch = (char)getchar();
                if ((ch!='Y') && (ch!='y')) EXM_THROW(11, "Operation aborted : %s already exists", output_filename);
        }   }
        *pfoutput = fopen( output_filename, "wb" );
    }

    if ( *pfoutput==0) EXM_THROW(13, "Pb opening %s", output_filename);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xf06d(%rip), %rsi      # 0x13ea0
callq 0x10f0
testl %eax, %eax
je 0x4e4d
leaq 0xe651(%rip), %rsi      # 0x13494
movq %r15, %rdi
callq 0x1120
jmp 0x4e64
cmpl $0x4, 0x152a0(%rip)     # 0x1a0f4
jge 0x4efe
movq 0x15177(%rip), %rax     # 0x19fd8
movq (%rax), %rax
movq %rax, (%r12)
testq %rax, %rax
je 0x4f22
leaq 0xf02e(%rip), %rsi      # 0x13ea6
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x4ed7
movq $0x0, (%r14)
leaq 0xe8fb(%rip), %rsi      # 0x1378d
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x4ec6
leaq 0xe5ef(%rip), %rsi      # 0x13494
movq %rbx, %rdi
callq 0x1120
movq %rax, (%r14)
testq %rax, %rax
je 0x4ec6
movq %rax, %rdi
callq 0x1080
cmpb $0x0, 0x15280(%rip)     # 0x1a144
je 0x4f0f
leaq 0xefd0(%rip), %rsi      # 0x13e9d
movq %rbx, %rdi
callq 0x1120
jmp 0x4eea
cmpl $0x4, 0x15216(%rip)     # 0x1a0f4
jge 0x4f08
movq 0x150e9(%rip), %rax     # 0x19fd0
movq (%rax), %rax
movq %rax, (%r14)
testq %rax, %rax
je 0x4f3d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x24a7
jmp 0x4e5a
callq 0x25d4
jmp 0x4ee0
cmpl $0x1, 0x151de(%rip)     # 0x1a0f4
jle 0x4f58
movq %rbx, %rdi
callq 0x24c3
jmp 0x4ec6
cmpl $0x0, 0x151cb(%rip)     # 0x1a0f4
jle 0x4f33
movq %r15, %rdi
callq 0x2652
movl $0xc, %edi
callq 0x1180
cmpl $0x0, 0x151b0(%rip)     # 0x1a0f4
jle 0x4f4e
movq %rbx, %rdi
callq 0x25f0
movl $0xd, %edi
callq 0x1180
jne 0x4f62
movq %rbx, %rdi
callq 0x2572
movl $0xb, %edi
callq 0x1180
// File: /workspace/github_c_makefile_star2_O3/Cyan4973[P]FiniteStateEntropy/programs/xxhash.c
// Function: XXH32
XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed)
{
#if 0
    /* Simple version, good for code maintenance, but unfortunately slow for small inputs */
    XXH32_CREATESTATE_STATIC(state);
    XXH32_reset(state, seed);
    XXH32_update(state, input, len);
    return XXH32_digest(state);
#else
    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;

    if (XXH_FORCE_ALIGN_CHECK) {
        if ((((size_t)input) & 3) == 0) {   /* Input is 4-bytes aligned, leverage the speed benefit */
            if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
                return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);
            else
                return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);
    }   }

    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
        return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);
    else
        return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);
#endif
}

// Assembly:
pushq %rbp
pushq %rbx
leaq (%rdi,%rsi), %rax
cmpq $0x10, %rsi
jb 0x5533
leaq -0x10(%rax), %r8
leal 0x24234428(%rdx), %r10d
leal -0x7a143589(%rdx), %r9d
leal 0x61c8864f(%rdx), %ecx
imull $0x85ebca77, (%rdi), %r11d # imm = 0x85EBCA77
addl %r10d, %r11d
roll $0xd, %r11d
imull $0x85ebca77, 0x4(%rdi), %ebx # imm = 0x85EBCA77
addl %r9d, %ebx
roll $0xd, %ebx
imull $0x9e3779b1, %r11d, %r10d # imm = 0x9E3779B1
imull $0x85ebca77, 0x8(%rdi), %r11d # imm = 0x85EBCA77
addl %edx, %r11d
roll $0xd, %r11d
imull $0x85ebca77, 0xc(%rdi), %ebp # imm = 0x85EBCA77
imull $0x9e3779b1, %ebx, %r9d # imm = 0x9E3779B1
addl %ecx, %ebp
roll $0xd, %ebp
imull $0x9e3779b1, %r11d, %edx # imm = 0x9E3779B1
imull $0x9e3779b1, %ebp, %ecx # imm = 0x9E3779B1
addq $0x10, %rdi
cmpq %r8, %rdi
jbe 0x54c2
roll %r10d
roll $0x7, %r9d
addl %r10d, %r9d
roll $0xc, %edx
roll $0x12, %ecx
addl %edx, %ecx
addl %r9d, %ecx
jmp 0x553b
addl $0x165667b1, %edx       # imm = 0x165667B1
movl %edx, %ecx
addl %ecx, %esi
leaq 0x4(%rdi), %rcx
cmpq %rax, %rcx
jbe 0x554b
movq %rdi, %rcx
jmp 0x5585
imull $0xc2b2ae3d, (%rdi), %ecx # imm = 0xC2B2AE3D
addl %esi, %ecx
roll $0x11, %ecx
imull $0x27d4eb2f, %ecx, %esi # imm = 0x27D4EB2F
leaq 0x4(%rdi), %rcx
addq $0x8, %rdi
cmpq %rax, %rdi
movq %rcx, %rdi
jbe 0x554b
jmp 0x5585
movzbl (%rcx), %edx
imull $0x165667b1, %edx, %edx # imm = 0x165667B1
addl %esi, %edx
roll $0xb, %edx
imull $0x9e3779b1, %edx, %esi # imm = 0x9E3779B1
incq %rcx
cmpq %rax, %rcx
jb 0x556e
movl %esi, %eax
shrl $0xf, %eax
xorl %esi, %eax
imull $0x85ebca77, %eax, %eax # imm = 0x85EBCA77
movl %eax, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
imull $0xc2b2ae3d, %ecx, %ecx # imm = 0xC2B2AE3D
movl %ecx, %eax
shrl $0x10, %eax
xorl %ecx, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cyan4973[P]FiniteStateEntropy/programs/xxhash.c
// Function: XXH32_update
XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len)
{
    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;

    if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
        return XXH32_update_endian(state_in, input, len, XXH_littleEndian);
    else
        return XXH32_update_endian(state_in, input, len, XXH_bigEndian);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
addq %rdx, (%rdi)
movq %rsi, %r15
movl 0x2c(%rdi), %eax
leaq (%rax,%rdx), %rcx
cmpq $0xf, %rcx
ja 0x58ba
leaq (%r14,%rax), %rdi
addq $0x1c, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1130
addl 0x2c(%r14), %ebx
jmp 0x59f6
addq %r15, %rbx
testq %rax, %rax
je 0x5960
leaq (%r14,%rax), %rdi
addq $0x1c, %rdi
movl $0x10, %r12d
movl $0x10, %edx
subl %eax, %edx
movq %r15, %rsi
callq 0x1130
movdqu 0xc(%r14), %xmm0
movdqu 0x1c(%r14), %xmm1
movdqa 0xe5b9(%rip), %xmm2     # 0x13eb0
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pmuludq %xmm2, %xmm1
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
pmuludq %xmm2, %xmm3
pshufd $0xe8, %xmm3, %xmm2     # xmm2 = xmm3[0,2,2,3]
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
paddd %xmm0, %xmm1
movdqa %xmm1, %xmm0
psrld $0x13, %xmm0
pslld $0xd, %xmm1
por %xmm0, %xmm1
movdqa 0xe590(%rip), %xmm0     # 0x13ec0
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
pmuludq %xmm0, %xmm1
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
pmuludq %xmm0, %xmm2
pshufd $0xe8, %xmm2, %xmm0     # xmm0 = xmm2[0,2,2,3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movdqu %xmm1, 0xc(%r14)
subl 0x2c(%r14), %r12d
addq %r12, %r15
movl $0x0, 0x2c(%r14)
leaq -0x10(%rbx), %rax
cmpq %rax, %r15
ja 0x59df
movdqu 0xc(%r14), %xmm2
movdqa 0xe539(%rip), %xmm0     # 0x13eb0
movdqa 0xe541(%rip), %xmm1     # 0x13ec0
movdqu (%r15), %xmm3
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
pmuludq %xmm0, %xmm3
pshufd $0xe8, %xmm3, %xmm3     # xmm3 = xmm3[0,2,2,3]
pmuludq %xmm0, %xmm4
pshufd $0xe8, %xmm4, %xmm4     # xmm4 = xmm4[0,2,2,3]
punpckldq %xmm4, %xmm3    # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
paddd %xmm2, %xmm3
movdqa %xmm3, %xmm2
psrld $0x13, %xmm2
pslld $0xd, %xmm3
por %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
pmuludq %xmm1, %xmm3
pshufd $0xe8, %xmm3, %xmm2     # xmm2 = xmm3[0,2,2,3]
pmuludq %xmm1, %xmm4
pshufd $0xe8, %xmm4, %xmm3     # xmm3 = xmm4[0,2,2,3]
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
addq $0x10, %r15
cmpq %rax, %r15
jbe 0x597f
movdqu %xmm2, 0xc(%r14)
cmpq %rbx, %r15
jae 0x59fa
leaq 0x1c(%r14), %rdi
subq %r15, %rbx
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1130
movl %ebx, 0x2c(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cyan4973[P]FiniteStateEntropy/programs/xxhash.c
// Function: XXH32_digest
FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian)
{
    const BYTE * p = (const BYTE*)state->mem32;
    const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize;
    U32 h32;

    if (state->total_len >= 16) {
        h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
    } else {
        h32 = state->seed + PRIME32_5;
    }

    h32 += (U32) state->total_len;

    while (p+4<=bEnd) {
        h32 += XXH_readLE32(p, endian) * PRIME32_3;
        h32  = XXH_rotl32(h32, 17) * PRIME32_4;
        p+=4;
    }

    while (p<bEnd) {
        h32 += (*p) * PRIME32_5;
        h32  = XXH_rotl32(h32, 11) * PRIME32_1;
        p++;
    }

    h32 ^= h32 >> 15;
    h32 *= PRIME32_2;
    h32 ^= h32 >> 13;
    h32 *= PRIME32_3;
    h32 ^= h32 >> 16;

    return h32;
}

// Assembly:
movl 0x2c(%rdi), %edx
movq (%rdi), %rax
cmpq $0x10, %rax
jb 0x5a6b
movdqu 0xc(%rdi), %xmm0
movdqa 0xe4af(%rip), %xmm1     # 0x13ed0
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pmuludq %xmm1, %xmm0
pshufd $0xed, %xmm0, %xmm3     # xmm3 = xmm0[1,3,2,3]
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pmuludq %xmm2, %xmm1
pshufd $0xed, %xmm1, %xmm2     # xmm2 = xmm1[1,3,2,3]
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
por %xmm3, %xmm0
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
paddd %xmm0, %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
paddd %xmm1, %xmm0
movd %xmm0, %esi
jmp 0x5a73
movl $0x165667b1, %esi       # imm = 0x165667B1
addl 0x8(%rdi), %esi
leaq (%rdi,%rdx), %rcx
addq $0x1c, %rcx
addq $0x1c, %rdi
addl %esi, %eax
cmpl $0x4, %edx
jae 0x5a8b
movq %rdi, %rdx
jmp 0x5ac5
imull $0xc2b2ae3d, (%rdi), %edx # imm = 0xC2B2AE3D
addl %eax, %edx
roll $0x11, %edx
imull $0x27d4eb2f, %edx, %eax # imm = 0x27D4EB2F
leaq 0x4(%rdi), %rdx
addq $0x8, %rdi
cmpq %rcx, %rdi
movq %rdx, %rdi
jbe 0x5a8b
jmp 0x5ac5
movzbl (%rdx), %esi
imull $0x165667b1, %esi, %esi # imm = 0x165667B1
addl %eax, %esi
roll $0xb, %esi
imull $0x9e3779b1, %esi, %eax # imm = 0x9E3779B1
incq %rdx
cmpq %rcx, %rdx
jb 0x5aae
movl %eax, %ecx
shrl $0xf, %ecx
xorl %eax, %ecx
imull $0x85ebca77, %ecx, %eax # imm = 0x85EBCA77
movl %eax, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
imull $0xc2b2ae3d, %ecx, %ecx # imm = 0xC2B2AE3D
movl %ecx, %eax
shrl $0x10, %eax
xorl %ecx, %eax
retq