LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/bench/bulk_insert/main.c
// Function: printperf
static void
printperf(struct bulkinsert_state * C)
{
	struct timeval tv_now;
	double T;
	uint64_t N;

	/* Get current time. */
	if (monoclock_get(&tv_now)) {
		warnp("Error reading clock");
		return;
	}

	/* Compute time difference. */
	T = timeval_diff(C->tv_saved, tv_now);

	/* Compute number of requests between then and now. */
	N = C->Ndone - C->Ndone_saved;

	/* Everything completed before now was before 10 s. */
	if (T > 10.0) {
		T = 10.0;
		N -= 1;
	}

	/* Avoid microsecond precision rounding resulting in divide-by-0. */
	if (T < 0.000001)
		T = 0.000001;

	/*
	 * Print requests per second.  Skip this if we handled less than 4096
	 * requests, since that could be a burst of responses from a single
	 * bundle.
	 */
	if (N >= 4096)
		printf("%zu %.0f\n", C->Ndone_saved, (double)N / T);

	/* We've printed this performance point. */
	C->Ndone_saved = 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x3a08
testl %eax, %eax
je 0x27d7
callq 0x2090
cmpl $0x0, (%rax)
je 0x2873
movq %rax, %rbx
leaq 0x690d(%rip), %rdi      # 0x90d5
xorl %eax, %eax
callq 0x4af9
andl $0x0, (%rbx)
jmp 0x2881
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq 0x30(%rbx), %rax
cvtsi2sd %rax, %xmm1
subq 0x38(%rbx), %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0x680e(%rip), %xmm0     # 0x9008
addsd %xmm1, %xmm0
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rsi
subq %rsi, %rax
xorl %ecx, %ecx
ucomisd 0x67fd(%rip), %xmm0     # 0x9010
seta %cl
subq %rcx, %rax
cmpq $0x1000, %rax           # imm = 0x1000
jb 0x286c
movsd 0x67e7(%rip), %xmm1     # 0x9010
minsd %xmm0, %xmm1
movsd 0x67d3(%rip), %xmm2     # 0x9008
maxsd %xmm1, %xmm2
movq %rax, %xmm1
punpckldq 0x67da(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x67e2(%rip), %xmm1     # 0x9030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd %xmm2, %xmm0
leaq 0x6884(%rip), %rdi      # 0x90e9
movb $0x1, %al
callq 0x2130
andq $0x0, 0x28(%rbx)
jmp 0x2881
leaq 0x685b(%rip), %rdi      # 0x90d5
xorl %eax, %eax
callq 0x4c88
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/debugger.c
// Function: read_piped_input
void read_piped_input ()
{
    int read_bytes;

    piped_input_len = 0;

    int flags = fcntl(0, F_GETFD, 0);
    fcntl(0, F_SETFL, flags | O_NONBLOCK);

    while (piped_input_len < PIPED_INPUT_SIZE) {
        read_bytes = read(0,
                          &(piped_input[piped_input_len]),
                          PIPED_INPUT_SIZE - piped_input_len);
        if (read_bytes <= 0)
            break;
        piped_input_len += read_bytes;
    }

    fclose(stdin);
    freopen("/dev/tty", "r+b", stdin);
}

// Assembly:
pushq %rbx
andq $0x0, 0x6dbb(%rip)      # 0x9190
pushq $0x1
popq %rsi
xorl %edi, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20e0
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
xorl %edi, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x20e0
movq 0x6d93(%rip), %rax      # 0x9190
leaq 0x6d9c(%rip), %rbx      # 0x91a0
cmpq $0x1fff, %rax           # imm = 0x1FFF
ja 0x2438
leaq (%rbx,%rax), %rsi
movl $0x2000, %edx           # imm = 0x2000
subq %rax, %rdx
xorl %edi, %edi
callq 0x2190
testl %eax, %eax
jle 0x2438
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq 0x6d61(%rip), %rax      # 0x9190
movq %rax, 0x6d5a(%rip)      # 0x9190
jmp 0x2404
movq 0x6b91(%rip), %rbx      # 0x8fd0
movq (%rbx), %rdi
callq 0x2100
movq (%rbx), %rdx
leaq 0x3bb3(%rip), %rdi      # 0x6004
leaq 0x3bb5(%rip), %rsi      # 0x600d
popq %rbx
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/debugger.c
// Function: debug_step
int debug_step (struct _vm * vm)
{
    int depth = 0;
    int error = 0;

    if (vm_opcode(vm) == OP_CALL)
        depth = 1;
    else
        return debug_next(vm);

    while (depth > 0) {
        error = debug_next(vm);
        if (error)
            return error;
        if (vm_opcode(vm) == OP_CALL)
            depth++;
        else if (vm_opcode(vm) == OP_RET)
            depth--;
    }

    return debug_next(vm);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x4e5f
cmpb $0x27, %al
jne 0x250f
pushq $0x1
popq %rbp
movl %ebp, %r14d
movq %rbx, %rdi
callq 0x2494
testl %r14d, %r14d
jle 0x250a
testl %eax, %eax
jne 0x250a
movq %rbx, %rdi
callq 0x4e5f
movl %ebp, %ecx
cmpb $0x27, %al
je 0x2505
movq %rbx, %rdi
callq 0x4e5f
xorl %ecx, %ecx
cmpb $0x29, %al
sete %cl
negl %ecx
addl %ecx, %r14d
jmp 0x24d5
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2494
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/debugger.c
// Function: debug_memory
int debug_memory (struct _vm * vm, const char * command)
{
    int address = vm->regs[REG_SP];
    int length  = 8;
    int matched;
    int i;

    matched = sscanf(command, "m %x %d", &address, &length);
    if (matched == -1) {
        matched = sscanf(command, "memory %x %d", &address, &length);
    }

    printf("%04x: ", address);
    for (i = 0; i < length; i++) {
        if (address + i >= 0x10000)
            break;
        printf("%02x", vm->mem[address + i]);
        if (((i + 1) % 16 == 0) && (i + 1 < length))
            printf("\n%04x: ", address + i + 1);
        else if ((i + 1) % 8 == 0)
            printf("  ");
        else if ((i + 1) % 2 == 0)
            printf(" ");
    }

    printf("\n");

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x1a(%rdi), %eax
movq %rsp, %rdx
movl %eax, (%rdx)
leaq 0x4(%rsp), %rcx
movl $0x8, (%rcx)
leaq 0x3aca(%rip), %rsi      # 0x6011
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
cmpl $-0x1, %eax
jne 0x256f
leaq 0x3abc(%rip), %rsi      # 0x6019
movq %rsp, %rdx
leaq 0x4(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
movl (%rsp), %esi
leaq 0x3ab3(%rip), %rdi      # 0x602c
xorl %eax, %eax
callq 0x2130
leaq 0x3a9f(%rip), %r14      # 0x6026
leaq 0x3a9d(%rip), %r15      # 0x602b
leaq 0x3a9e(%rip), %r12      # 0x6033
xorl %ebp, %ebp
movq %rbp, %r13
cmpl 0x4(%rsp), %r13d
jge 0x260b
movslq (%rsp), %rax
leal (%rax,%r13), %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
jg 0x260b
addq (%rbx), %rax
movzbl (%r13,%rax), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2130
leaq 0x1(%r13), %rbp
testb $0xf, %bpl
jne 0x25e9
cmpl 0x4(%rsp), %ebp
jge 0x25e9
movl (%rsp), %eax
leal (%rax,%r13), %esi
incl %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2130
jmp 0x2597
testb $0x7, %bpl
je 0x25ff
testb $0x1, %r13b
je 0x2597
pushq $0x20
popq %rdi
callq 0x2050
jmp 0x2597
movq %r12, %rdi
xorl %eax, %eax
callq 0x2130
jmp 0x2597
pushq $0xa
popq %rdi
callq 0x2050
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/debugger.c
// Function: set_breakpoint
void set_breakpoint (const char * command)
{
    int break_i;
    uint16_t addr;

    if (    (sscanf(command, "b %hx", &addr) == -1)
         && (sscanf(command, "break %hx", &addr) == -1))
        return;

    for (break_i = 0; break_i < BREAKPOINTS_SIZE; break_i++) {
        if (breakpoints[break_i] == -1) {
            breakpoints[break_i] = addr;
            printf("breakpoint set: %hx\n", addr);
            if (break_i < BREAKPOINTS_SIZE - 1)
                breakpoints[break_i + 1] = -1;
            return;
        }
    }

    printf("breakpoint not set, max breakpoints already set\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3a04(%rip), %rsi      # 0x6036
leaq 0x6(%rsp), %rdx
xorl %eax, %eax
callq 0x2210
cmpl $-0x1, %eax
jne 0x265e
leaq 0x39f2(%rip), %rsi      # 0x603c
leaq 0x6(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2210
cmpl $-0x1, %eax
je 0x26aa
xorl %ebx, %ebx
leaq 0x8b49(%rip), %r14      # 0xb1b0
cmpq $0x20, %rbx
je 0x2679
cmpl $-0x1, (%r14,%rbx,4)
je 0x2687
incq %rbx
jmp 0x2667
leaq 0x3a61(%rip), %rdi      # 0x60e1
callq 0x20b0
jmp 0x26aa
movzwl 0x6(%rsp), %esi
movl %esi, (%r14,%rbx,4)
leaq 0x39af(%rip), %rdi      # 0x6046
xorl %eax, %eax
callq 0x2130
cmpq $0x1f, %rbx
je 0x26aa
orl $-0x1, 0x4(%r14,%rbx,4)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/debugger.c
// Function: debug_continue
void debug_continue (struct _vm * vm)
{
    int break_i;
    int breakpoint_found = 0;

    if (vm->halted) {
        printf("VM Halted\n");
        return;
    }
    while ((vm->halted == 0) && (breakpoint_found == 0)) {
        vm_step(vm);
        for (break_i = 0; break_i < BREAKPOINTS_SIZE; break_i++) {
            if (breakpoints[break_i] == -1)
                break;
            if (breakpoints[break_i] == vm->regs[REG_IP]) {
                printf("breakpoint: %s\n", vm_ins_str(vm));
                breakpoint_found = 1;
                break;
            }
        }
    }
}

// Assembly:
cmpl $0x0, 0x24(%rdi)
je 0x26c4
leaq 0x3a52(%rip), %rdi      # 0x6111
jmp 0x20b0
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8adb(%rip), %r15      # 0xb1b0
leaq 0x397f(%rip), %r14      # 0x605b
pushq $0x1
popq %rbp
xorl %eax, %eax
testl %eax, %eax
jne 0x272b
movq %rbx, %rdi
callq 0x4e6a
xorl %ecx, %ecx
xorl %eax, %eax
cmpq $0x80, %rcx
je 0x2726
movl (%rcx,%r15), %edx
cmpl $-0x1, %edx
je 0x2726
movzwl 0x16(%rbx), %eax
addq $0x4, %rcx
cmpl %eax, %edx
jne 0x26ef
movq %rbx, %rdi
callq 0x4e0c
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2130
movl %ebp, %eax
orl 0x24(%rbx), %eax
jmp 0x26e1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/debugger.c
// Function: dump_core
void dump_core (struct _vm * vm)
{
    FILE * fh;

    fh = fopen("core", "wb");
    if (fh == NULL) {
        fprintf(stderr, "could not open file core\n");
        return;
    }

    fwrite (vm->mem, 1, 65536, fh);

    fclose(fh);

    printf("core written to file 'core'\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x3927(%rip), %rdi      # 0x606b
leaq 0x3925(%rip), %rsi      # 0x6070
callq 0x2280
testq %rax, %rax
je 0x2786
movq %rax, %rbx
movq (%r14), %rdi
pushq $0x1
popq %rsi
movl $0x10000, %edx          # imm = 0x10000
movq %rax, %rcx
callq 0x22a0
movq %rbx, %rdi
callq 0x2100
leaq 0x39a1(%rip), %rdi      # 0x611b
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20b0
movq 0x6863(%rip), %rax      # 0x8ff0
movq (%rax), %rcx
leaq 0x38dc(%rip), %rdi      # 0x6073
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22a0
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/token.c
// Function: token_create
struct _token * token_create (int type, const char * str, int line)
{
    struct _token * token = (struct _token *) malloc(sizeof(struct _token));
    token->type = type;
    token->next = NULL;
    token->line = line;

    if (str == NULL)
        token->str = NULL;
    else {
        token->str = (char *) malloc(strlen(str) + 1);
        strcpy(token->str, str);
        token->str[strlen(str)] = '\0';
    }

    return token;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
pushq $0x18
popq %rdi
callq 0x21f0
movq %rax, %rbx
movl %r15d, (%rax)
andq $0x0, 0x10(%rax)
movl %ebp, 0x4(%rax)
testq %r14, %r14
je 0x3dc8
movq %r14, %rdi
callq 0x2110
movq %rax, %r12
leaq 0x1(%rax), %rdi
callq 0x21f0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x20a0
movb $0x0, (%r15,%r12)
jmp 0x3dcb
xorl %r15d, %r15d
movq %r15, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/token.c
// Function: token_str
const char * token_str (struct _token * token)
{
    if (ins_reg_str(token->type) != NULL)
        return ins_reg_str(token->type);
    if (ins_opcode_str(token->type) != NULL)
        return ins_opcode_str(token->type);
    if (token->type == TOK_NEWLINE)
        return "NEWLINE";
    if (token->type == TOK_COMMA)
        return ",";
    return token->str;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzbl (%rdi), %edi
callq 0x29fc
movb (%rbx), %cl
movzbl %cl, %edi
testq %rax, %rax
je 0x3e0d
popq %rbx
jmp 0x29fc
callq 0x2a18
movl (%rbx), %ecx
testq %rax, %rax
je 0x3e22
movzbl %cl, %edi
popq %rbx
jmp 0x2a18
cmpl $0x70, %ecx
je 0x3e35
cmpl $0x71, %ecx
jne 0x3e3e
leaq 0x26f8(%rip), %rax      # 0x652b
jmp 0x3e42
leaq 0x26e7(%rip), %rax      # 0x6523
jmp 0x3e42
movq 0x8(%rbx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseAddCompletion
void linenoiseAddCompletion(linenoiseCompletions *lc, char *str) {
    size_t len = strlen(str);
    char *copy = malloc(len+1);
    memcpy(copy,str,len+1);
    lc->cvec = realloc(lc->cvec,sizeof(char*)*(lc->len+1));
    lc->cvec[lc->len++] = copy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2110
leaq 0x1(%rax), %r15
movq %r15, %rdi
callq 0x21f0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21e0
movq (%r14), %rax
movq 0x8(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x2230
movq %rax, 0x8(%r14)
movq (%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
movq %r12, (%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseHistoryAdd
int linenoiseHistoryAdd(const char *line) {
    char *linecopy;

    if (history_max_len == 0) return 0;
    if (history == NULL) {
        history = malloc(sizeof(char*)*history_max_len);
        if (history == NULL) return 0;
        memset(history,0,(sizeof(char*)*history_max_len));
    }
    linecopy = strdup(line);
    if (!linecopy) return 0;
    if (history_len == history_max_len) {
        free(history[0]);
        memmove(history,history+1,sizeof(char*)*(history_max_len-1));
        history_len--;
    }
    history[history_len] = linecopy;
    history_len++;
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x4982(%rip), %r15d     # 0x9178
movq 0x6a33(%rip), %r14      # 0xb230
testq %r14, %r14
jne 0x4821
leaq (,%r15,8), %rsi
pushq $0x1
popq %rdi
callq 0x21b0
movq %rax, %r14
movq %rax, 0x6a14(%rip)      # 0xb230
testq %rax, %rax
je 0x487c
movq %rbx, %rdi
callq 0x22b0
testq %rax, %rax
je 0x487c
movq %rax, %rbx
movl 0x6a09(%rip), %eax      # 0xb240
cmpl %r15d, %eax
jne 0x4869
movq (%r14), %rdi
callq 0x2040
movq 0x69e5(%rip), %rdi      # 0xb230
leaq 0x8(%rdi), %rsi
decl %r15d
leaq (,%r15,8), %rdx
callq 0x2240
movq 0x69ca(%rip), %r14      # 0xb230
movl %r15d, %eax
cltq
movq %rbx, (%r14,%rax,8)
incl %eax
movl %eax, 0x69c9(%rip)      # 0xb240
pushq $0x1
popq %rax
jmp 0x487e
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseHistorySetMaxLen
int linenoiseHistorySetMaxLen(int len) {
    char **new;

    if (len < 1) return 0;
    if (history) {
        int tocopy = history_len;

        new = malloc(sizeof(char*)*len);
        if (new == NULL) return 0;
        if (len < tocopy) tocopy = len;
        memcpy(new,history+(history_max_len-tocopy), sizeof(char*)*tocopy);
        free(history);
        history = new;
    }
    history_max_len = len;
    if (history_len > history_max_len)
        history_len = history_max_len;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebp, %ebp
testl %edi, %edi
jle 0x4903
movl %edi, %ebx
movq 0x6995(%rip), %r14      # 0xb230
movl 0x699e(%rip), %r12d     # 0xb240
testq %r14, %r14
je 0x48ef
movl %ebx, %edi
shlq $0x3, %rdi
callq 0x21f0
testq %rax, %rax
je 0x4903
movq %rax, %r15
cmpl %ebx, %r12d
movl %ebx, %eax
cmovll %r12d, %eax
movslq 0x48ae(%rip), %rcx      # 0x9178
movslq %eax, %rdx
subq %rdx, %rcx
leaq (%r14,%rcx,8), %rsi
shlq $0x3, %rdx
movq %r15, %rdi
callq 0x21e0
movq %r14, %rdi
callq 0x2040
movq %r15, 0x6941(%rip)      # 0xb230
movl %ebx, 0x4883(%rip)      # 0x9178
pushq $0x1
popq %rbp
cmpl %ebx, %r12d
jle 0x4903
movl %ebx, 0x693d(%rip)      # 0xb240
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseHistorySave
int linenoiseHistorySave(char *filename) {
    FILE *fp = fopen(filename,"w");
    int j;
    
    if (fp == NULL) return -1;
    for (j = 0; j < history_len; j++)
        fprintf(fp,"%s\n",history[j]);
    fclose(fp);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x1cba(%rip), %rsi      # 0x65d4
callq 0x2280
testq %rax, %rax
je 0x4966
movq %rax, %rbx
leaq 0x1739(%rip), %r14      # 0x6067
xorl %r15d, %r15d
movslq 0x6908(%rip), %rax      # 0xb240
cmpq %rax, %r15
jge 0x495a
movq 0x68ec(%rip), %rax      # 0xb230
movq (%rax,%r15,8), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
incq %r15
jmp 0x4931
movq %rbx, %rdi
callq 0x2100
xorl %eax, %eax
jmp 0x4969
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/linenoise.c
// Function: refreshLine
static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_t pos, size_t cols) {
    char seq[64];
    size_t plen = strlen(prompt);
    
    while((plen+pos) >= cols) {
        buf++;
        len--;
        pos--;
    }
    while (plen+len > cols) {
        len--;
    }

    /* Cursor to left edge */
    snprintf(seq,64,"\x1b[0G");
    if (write(fd,seq,strlen(seq)) == -1) return;
    /* Write the prompt and the current buffer content */
    if (write(fd,prompt,strlen(prompt)) == -1) return;
    if (write(fd,buf,len) == -1) return;
    /* Erase to right */
    snprintf(seq,64,"\x1b[0K");
    if (write(fd,seq,strlen(seq)) == -1) return;
    /* Move cursor to original position. */
    snprintf(seq,64,"\x1b[0G\x1b[%dC", (int)(pos+plen));
    if (write(fd,seq,strlen(seq)) == -1) return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %rbp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %r13
callq 0x2110
movq %rax, (%rsp)
leaq (%rax,%r15), %r12
leaq -0x1(%rbp), %rbx
cmpq %rbx, %r12
cmovbq %r12, %rbx
addq %rbx, %r14
subq %r15, %r14
cmpq %r14, %rbp
cmovbq %rbp, %r14
leaq 0x10(%rsp), %r15
movl $0x47305b1b, (%r15)     # imm = 0x47305B1B
movb $0x0, 0x4(%r15)
movq %r15, %rdi
callq 0x2110
xorl %edi, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4b81
movq %r13, %rdi
callq 0x2110
xorl %edi, %edi
movq %r13, %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4b81
subq %rbx, %r12
movq 0x8(%rsp), %rsi
addq %r12, %rsi
subq (%rsp), %r14
xorl %edi, %edi
movq %r14, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4b81
leaq 0x10(%rsp), %r14
movb $0x0, 0x4(%r14)
movl $0x4b305b1b, (%r14)     # imm = 0x4B305B1B
movq %r14, %rdi
callq 0x2110
xorl %edi, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4b81
leaq 0x1a99(%rip), %rdx      # 0x65f1
leaq 0x10(%rsp), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2140
movq %r14, %rdi
callq 0x2110
xorl %edi, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x20f0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/vm.c
// Function: vm_create
struct _vm * vm_create (unsigned char * mem)
{
    struct _vm * vm;
    int i;

    vm = (struct _vm *) malloc(sizeof(struct _vm));
    vm->mem = (unsigned char *) malloc(VM_MEMSIZE);
    memcpy(vm->mem, mem, VM_MEMSIZE);

    for (i = 0; i < 11; i++) vm->regs[i] = 0;
    vm->regs[REG_IP] = 0;
    vm->regs[REG_SP] = 0xfff8;
    vm->flags = 0;
    vm->halted = 0;

    return vm;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x128, %edi            # imm = 0x128
callq 0x21f0
movq %rax, %rbx
movl $0x10000, %edi          # imm = 0x10000
callq 0x21f0
movq %rax, (%rbx)
movl $0x10000, %edx          # imm = 0x10000
movq %rax, %rdi
movq %r14, %rsi
callq 0x21e0
pushq $0x4
popq %rax
cmpq $0xf, %rax
je 0x4bf0
andw $0x0, (%rbx,%rax,2)
incq %rax
jmp 0x4be0
andw $0x0, 0x16(%rbx)
movw $0xfff8, 0x1a(%rbx)     # imm = 0xFFF8
andq $0x0, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/vm.c
// Function: vm_load
struct _vm * vm_load (const char * filename)
{
    unsigned char * mem;
    FILE * fh;
    size_t filesize;
    struct _vm * vm;

    fh = fopen(filename, "rb");
    if (fh == NULL)
        return NULL;

    fseek(fh, 0, SEEK_END);
    filesize = ftell(fh);
    fseek(fh, 0, SEEK_SET);

    mem = (unsigned char *) malloc(VM_MEMSIZE);
    memset(mem, 0, VM_MEMSIZE);

    if (filesize > VM_MEMSIZE)
        filesize = VM_MEMSIZE;

    fread(mem, 1, filesize, fh);

    fclose(fh);

    vm = vm_create(mem);

    free(mem);

    return vm;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x1849(%rip), %rsi      # 0x6464
callq 0x2280
testq %rax, %rax
je 0x4c9e
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2220
movq %rbx, %rdi
callq 0x21d0
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
pushq $0x1
popq %r15
movl $0x10000, %r12d         # imm = 0x10000
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdi
callq 0x21b0
movq %rax, %r13
cmpq %r12, %r14
cmovbq %r14, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x20d0
movq %rbx, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x4bac
movq %rax, %rbx
movq %r13, %rdi
callq 0x2040
movq %rbx, %rax
jmp 0x4ca0
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/vm.c
// Function: vm_syscall
void vm_syscall (struct _vm * vm)
{
    switch (vm->regs[REG_0]) {
    case VM_SYSCALL_OPEN  : vm_syscall_open(vm);  break;
    case VM_SYSCALL_READ  : vm_syscall_read(vm);  break;
    case VM_SYSCALL_WRITE : vm_syscall_write(vm); break;
    case VM_SYSCALL_CLOSE : vm_syscall_close(vm); break;
    }
}

// Assembly:
movzwl 0x8(%rdi), %eax
cmpq $0x3, %rax
ja 0x4ced
leaq 0x192c(%rip), %rcx      # 0x65fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x4cee
jmp 0x4d43
jmp 0x4d61
jmp 0x4d25
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/vm.c
// Function: vm_registers_str
const char * vm_registers_str (struct _vm * vm)
{
    snprintf(vm->debug_str, 256,
             "r0=%04x r1=%04x r2=%04x r3=%04x r4=%04x r5=%04x\n"
             "r6=%04x r7=%04x rsp=%04x rbp=%04x\n"
             "rip=%04x flags=%d",
             vm->regs[REG_0], vm->regs[REG_1], vm->regs[REG_2],
             vm->regs[REG_3], vm->regs[REG_4], vm->regs[REG_5],
             vm->regs[REG_6], vm->regs[REG_7], vm->regs[REG_SP],
             vm->regs[REG_BP], vm->regs[REG_IP], vm->flags);
    return vm->debug_str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x28(%rdi), %rbx
movzwl 0x8(%rdi), %ecx
movzwl 0xa(%rdi), %r8d
movzwl 0xc(%rdi), %r9d
movzwl 0xe(%rdi), %eax
movq %rax, 0x10(%rsp)
movzwl 0x10(%rdi), %eax
movq %rax, 0x8(%rsp)
movzwl 0x12(%rdi), %r14d
movzwl 0x14(%rdi), %r15d
movzwl 0x1c(%rdi), %r12d
movzwl 0x1a(%rdi), %r13d
movzwl 0x18(%rdi), %ebp
movzwl 0x16(%rdi), %r10d
movl 0x20(%rdi), %r11d
subq $0x8, %rsp
leaq 0x1982(%rip), %rdx      # 0x6754
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %rbp
pushq %r13
pushq %r12
pushq %r15
pushq %r14
pushq 0x48(%rsp)
pushq 0x58(%rsp)
callq 0x2140
addq $0x50, %rsp
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/endeav0r[P]hvm/src/vm.c
// Function: vm_ins_str
const char * vm_ins_str (struct _vm * vm)
{
    char tmp[256];
    struct _instruction * ins;
    ins = (struct _instruction *) &(vm->mem[vm->regs[REG_IP]]);
    ins_str(ins, tmp, 256);
    snprintf(vm->debug_str, 256, "%04x %s", vm->regs[REG_IP], tmp);
    return vm->debug_str;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movzwl 0x16(%rdi), %edi
addq (%rbx), %rdi
movq %rsp, %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
callq 0x2b2f
movzwl 0x16(%rbx), %ecx
addq $0x28, %rbx
leaq 0x1979(%rip), %rdx      # 0x67b8
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2140
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/read2.c
// Function: testcase_prepare
void testcase_prepare(unsigned long nr_tasks)
{
	char buf[FILESIZE];
	int fd = mkstemp(tmpfile);

	memset(buf, 0, sizeof(buf));
	assert(fd >= 0);
	assert(write(fd, buf, sizeof(buf)) == sizeof(buf));
	close(fd);
}

// Assembly:
pushq %rbx
subq $0x100000, %rsp         # imm = 0x100000
leaq 0x2631(%rip), %rdi      # 0x51a0
callq 0x21f0
movl %eax, %ebx
movq %rsp, %rdi
movl $0x100000, %edx         # imm = 0x100000
xorl %esi, %esi
callq 0x2140
testl %ebx, %ebx
js 0x2baf
movq %rsp, %rsi
movl $0x100000, %edx         # imm = 0x100000
movl %ebx, %edi
callq 0x20d0
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x2bc8
movl %ebx, %edi
addq $0x100000, %rsp         # imm = 0x100000
popq %rbx
jmp 0x2150
leaq 0x6c1(%rip), %rdi       # 0x3277
leaq 0x6c2(%rip), %rsi       # 0x327f
leaq 0x6c9(%rip), %rcx       # 0x328d
pushq $0x14
jmp 0x2bdf
leaq 0x6e3(%rip), %rdi       # 0x32b2
leaq 0x6a9(%rip), %rsi       # 0x327f
leaq 0x6b0(%rip), %rcx       # 0x328d
pushq $0x15
popq %rdx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/read2.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char buf[BUFLEN];
	int fd = open(tmpfile, O_RDONLY);

	assert(fd >= 0);

	while (1) {
		int ret = read(fd, buf, BUFLEN);
		assert(ret >= 0);
		if (ret == 0)
			lseek(fd, 0, SEEK_SET);

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
leaq 0x25a6(%rip), %rdi      # 0x51a0
xorl %esi, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x2c4a
movl %eax, %ebp
movq %rsp, %r14
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x2170
testl %eax, %eax
js 0x2c31
jne 0x2c2c
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2120
incq (%rbx)
jmp 0x2c0c
leaq 0x6d8(%rip), %rdi       # 0x3310
leaq 0x640(%rip), %rsi       # 0x327f
leaq 0x697(%rip), %rcx       # 0x32dd
pushq $0x22
jmp 0x2c61
leaq 0x626(%rip), %rdi       # 0x3277
leaq 0x627(%rip), %rsi       # 0x327f
leaq 0x67e(%rip), %rcx       # 0x32dd
pushq $0x1e
popq %rdx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/albinoloverats[P]hide/src/png.c
// Function: init
extern image_type_t *init(void)
{
	static image_type_t png;
	png.type = "PNG";
	png.is_type = is_png;
	png.read = read_png;
	png.write = write_png;
	png.info = info_png;
	png.free = free_png;
	return &png;
}

// Assembly:
leaq 0xd3d(%rip), %rax       # 0x2000
movq %rax, 0x2e3e(%rip)      # 0x4108
leaq 0x2e37(%rip), %rax      # 0x4108
leaq 0x40(%rip), %rcx        # 0x1318
movq %rcx, 0x2e31(%rip)      # 0x4110
leaq 0x91(%rip), %rcx        # 0x1377
movq %rcx, 0x2e2b(%rip)      # 0x4118
leaq 0x28d(%rip), %rcx       # 0x1581
movq %rcx, 0x2e25(%rip)      # 0x4120
leaq 0x468(%rip), %rcx       # 0x176a
movq %rcx, 0x2e1f(%rip)      # 0x4128
leaq 0x474(%rip), %rcx       # 0x1784
movq %rcx, 0x2e19(%rip)      # 0x4130
retq
// File: /workspace/github_c_makefile_star2_O2/albinoloverats[P]hide/src/png.c
// Function: is_png
static bool is_png(char *file_name)
{
	FILE *fp = fopen(file_name, "rb");
	if (!fp)
		return false;

	uint8_t header[8];
	fread(header, 1, sizeof header, fp);
	fclose(fp);

	return !png_sig_cmp(header, 0, sizeof header);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xcdc(%rip), %rsi       # 0x2004
callq 0x1110
testq %rax, %rax
je 0x136b
movq %rax, %rbx
leaq 0x8(%rsp), %r14
pushq $0x1
popq %rsi
pushq $0x8
popq %r15
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
callq 0x10a0
movq %rbx, %rdi
callq 0x10b0
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1100
testl %eax, %eax
sete %al
jmp 0x136d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/albinoloverats[P]hide/src/png.c
// Function: free_png
static void free_png(image_info_t image_info)
{
	for (uint64_t y = 0; y < image_info.height; y++)
		free(image_info.buffer[y]);
	free(image_info.buffer);
	free(image_info.extra);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x30(%rsp), %r14
movq 0x28(%r14), %r15
movq 0x40(%r14), %rbx
xorl %r12d, %r12d
cmpq %r15, %r12
jae 0x17af
movq (%rbx,%r12,8), %rdi
callq 0x1040
incq %r12
jmp 0x179c
movq %rbx, %rdi
callq 0x1040
movq 0x48(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/orestesleal[P]base64/b16dec.c
// Function: main
int main(int argc, char *argv[])
{
	struct finfo *fd;
	char *dec_buf;
	int ofd;
	size_t wr;
	size_t dec; /* number of decoded bytes */
	int flags = O_CREAT | O_RDWR;
	int perms = S_IRUSR | O_TRUNC | S_IWUSR;

	if (argv[1]) {
		/* load the encoded file */
		if ((fd = get_file(argv[1])) == NULL) {
			fprintf(stderr, "get_file() failed loading %s in main memory\n", argv[1]);
			exit(EXIT_FAILURE);
		}

		if (argv[2]) {
			/* allocate buffer and decode */
			dec_buf = alloc(fd->size); 

			/*  decode the base32 string on 'dec_buf' */
			dec = b16_dec(fd->addr, dec_buf, fd->size); 

            if ((ofd = open(argv[2], flags, perms)) == -1) {
            	fprintf(stderr, "open(2) error, can't create or truncate %s\n", argv[2]);
	        	exit(EXIT_FAILURE);
			}

			/* write the contents of `dec_buf` into the file requested on argv[2] */
			if ((wr = write(ofd, dec_buf, dec)) == -1) {
				fprintf(stderr, "write(2) error, can't write to %s\n", argv[2]);
				exit(EXIT_FAILURE);
			}
			close(ofd);
			free(dec_buf);
        }
		free(fd);
	}
	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0x126e
movq %rsi, %rbx
callq 0x1ec9
testq %rax, %rax
je 0x127f
movq %rax, %r14
cmpq $0x0, 0x10(%rbx)
je 0x1266
movl 0x8(%r14), %edi
callq 0x200f
movq %rax, %r15
movq (%r14), %rdi
movl 0x8(%r14), %edx
movq %rax, %rsi
callq 0x1cde
movl %eax, %r13d
movq 0x10(%rbx), %rdi
pushq $0x42
popq %rsi
movl $0x380, %edx            # imm = 0x380
xorl %eax, %eax
callq 0x10b0
cmpl $-0x1, %eax
je 0x1296
movl %eax, %r12d
movl %r13d, %edx
movl %eax, %edi
movq %r15, %rsi
callq 0x1040
cmpq $-0x1, %rax
je 0x12ad
movl %r12d, %edi
callq 0x1060
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3d72(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x8(%rbx), %rdx
leaq 0x1d70(%rip), %rsi      # 0x3004
jmp 0x12c2
movq 0x3d5b(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x10(%rbx), %rdx
leaq 0x1d86(%rip), %rsi      # 0x3031
jmp 0x12c2
movq 0x3d44(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x10(%rbx), %rdx
leaq 0x1d9b(%rip), %rsi      # 0x305d
xorl %eax, %eax
callq 0x1080
pushq $0x1
popq %rdi
callq 0x10c0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/pileup.c
// Function: readaln
static int readaln(void *data, bam1_t *b) {
    ptest_t *g = (ptest_t*)data;
    int ret;

    while (1) {
        ret = sam_read1(g->fp, g->fp_hdr, b);
        if (ret < 0) break;
        if ( b->core.flag & (BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP) ) continue;
        break;
    }

    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rsi
movq %rbx, %rdx
callq 0x18c02
testl %eax, %eax
js 0x5ebb
movzwl 0x10(%rbx), %ecx
testw $0x704, %cx             # imm = 0x704
jne 0x5e9c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/pileup.c
// Function: print_pileup_qual
static void print_pileup_qual(const bam_pileup1_t *p, int n) {
    int i;

    for (i = 0; i < n; i++, p++) {
        uint8_t *qual = bam_get_qual(p->b);
        uint8_t q = '~';
        if (p->qpos < p->b->core.l_qseq &&
            qual[p->qpos]+33 < '~')
            q = qual[p->qpos]+33;
        putchar(q);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
testl %esi, %esi
cmovgl %esi, %ebp
pushq $0x7e
popq %r14
subl $0x1, %ebp
jb 0x60e2
movq (%rbx), %rdx
movl 0x18(%rdx), %ecx
movslq 0x8(%rbx), %rax
movl %r14d, %edi
cmpl %ecx, %eax
jge 0x60d7
movl 0x14(%rdx), %esi
shll $0x2, %esi
addq 0x38(%rdx), %rsi
movzwl 0x12(%rdx), %edx
incl %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rdx, %rcx
addq %rsi, %rcx
movzbl (%rax,%rcx), %eax
movl %r14d, %edi
cmpl $0x5c, %eax
ja 0x60d7
addl $0x21, %eax
movl %eax, %edi
callq 0x46d0
addq $0x28, %rbx
jmp 0x6095
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_2/exercise_2_06/setbits.c
// Function: setbits
unsigned int setbits(int x, int p, int n, int y)
{
  ++p; // First position is 0

  unsigned int mask1 = (~(~(~0 << n) << p) & x);
  unsigned int mask2 = (~(~0 << n) & y) << p;

  return mask1 | mask2;
}

// Assembly:
movl %ecx, %r8d
movl %edx, %ecx
pushq $-0x1
popq %rax
shll %cl, %eax
notl %eax
leal 0x1(%rsi), %ecx
movl %eax, %edx
shll %cl, %edx
andl %r8d, %eax
shll %cl, %eax
notl %edx
andl %edi, %edx
orl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_08/getopt.c
// Function: main
int main(int argc, char *argv[])
{
	int c;
	int flag = 0, error = 0;
	char *name = NULL;
	int i;

	while ((c = getopt(argc, argv, ":af:")) != -1) {
		switch(c) {
		case 'a':
			flag++;
			break;
		case 'f':
			name = optarg;
			break;
		case ':':       /* missing operand? */
			fprintf(stderr,
				"option -%c requires an operand\n",
				optopt);
			error++;
			break;
		case '?':	/* invalid option? */
			fprintf(stderr,
				"unrecognized option '-%c'\n",
				optopt);
			error++;
		}
	}
	if (error) {
		fprintf(stderr,
			"usage: %s [-a] [-f <name>] [<arg> ...]\n",
			argv[0]);
		return -1;
	}

	/* Print the parsing result */
	if (flag)
		printf("-a\n");
	if (name)
		printf("-f=%s\n", name);
	for (i = optind; i < argc; i++)
		printf("argv[%d]=%s\n", i - optind, argv[i]);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xe81(%rip), %r15       # 0x2004
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r14d, %r14d
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1060
cmpl $-0x1, %eax
je 0x1205
cmpl $0x61, %eax
je 0x11ce
cmpl $0x66, %eax
je 0x11d3
cmpl $0x3a, %eax
je 0x11df
cmpl $0x3f, %eax
jne 0x118c
movq 0x2e3f(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq 0x2e1d(%rip), %rax      # 0x3fe0
movl (%rax), %edx
leaq 0xe5d(%rip), %rsi       # 0x2029
jmp 0x11f9
incl %r13d
jmp 0x118c
movq 0x2df6(%rip), %rax      # 0x3fd0
movq (%rax), %r14
jmp 0x118c
movq 0x2e12(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq 0x2df0(%rip), %rax      # 0x3fe0
movl (%rax), %edx
leaq 0xe10(%rip), %rsi       # 0x2009
xorl %eax, %eax
callq 0x1050
incl %r12d
jmp 0x118c
testl %r12d, %r12d
jne 0x1267
testl %r13d, %r13d
je 0x121b
leaq 0xe6a(%rip), %rdi       # 0x2080
callq 0x1030
testq %r14, %r14
je 0x1231
leaq 0xe45(%rip), %rdi       # 0x206c
movq %r14, %rsi
xorl %eax, %eax
callq 0x1040
movq 0x2d90(%rip), %r15      # 0x3fc8
movslq (%r15), %r12
movslq %ebp, %r13
leaq 0xe2e(%rip), %r14       # 0x2073
xorl %ebp, %ebp
cmpq %r13, %r12
jge 0x1285
movl (%r15), %eax
movl %r12d, %esi
subl %eax, %esi
movq (%rbx,%r12,8), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
incq %r12
jmp 0x1247
movq 0x2d8a(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0xdc9(%rip), %rsi       # 0x2044
xorl %eax, %eax
callq 0x1050
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Marinouel[P]Network-Lab/serv4.c
// Function: writen
ssize_t writen(int fd, const void *vptr, size_t n)                    //function from the lessons-> writen
{
  size_t nleft;
  ssize_t nwritten;
  const char *ptr;
  ptr = vptr;
  nleft = n;
  while (nleft > 0) {
    if  ((nwritten = write(fd, ptr, nleft)) <= 0 ){ 
      if (errno == EINTR) 
        nwritten = 0;
            else 
              return -1; /* error */ 
    } 
    nleft -= nwritten;
        ptr += nwritten;
  } 
  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
pushq $-0x1
popq %r13
movq %rdx, %r12
testq %r12, %r12
je 0x1249
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1070
testq %rax, %rax
jg 0x123e
callq 0x1040
cmpl $0x4, (%rax)
jne 0x1246
xorl %eax, %eax
subq %rax, %r12
addq %rax, %r14
jmp 0x121a
movq %r13, %rbx
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_O2/Marinouel[P]Network-Lab/serv4.c
// Function: put
void put(char *key, char *value)
{
  /* Puts the <key,value> pair into the store. If the key already existed, its previous 
  * value is discarded and replaced by the new one. */

  int x;
  int flag=0;

      for (x=0;x<netlab.next ;x++) // check all the positions
      {   
          if (strcmp(netlab.keyvalue[x][0], key)== 0) //if you find the key update
          {
    
               strcpy(netlab.keyvalue[x][1], value);
               strcpy(netlab.keyvalue[x][0], key);
               flag=1;
               return;
          } 
      }

     if (flag == 0) //if the value doesn't exist, then we store it in the array
     {
          netlab.next++;   //put it in the next empty cell
          strcpy(netlab.keyvalue[netlab.next][1], value);
          strcpy(netlab.keyvalue[netlab.next][0], key);
          return;
    }       
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, -0x30(%rbp)
movslq 0x2dd0(%rip), %r15      # 0x4094
xorl %r12d, %r12d
testl %r15d, %r15d
movl $0x0, %eax
cmovgl %r15d, %eax
movq %rdi, %rbx
imulq $0x64, %rax, %r13
addq $0x64, %r13
leaq 0x2db3(%rip), %rdi      # 0x4098
addq $-0x64, %r12
movq %r13, %rax
addq %r12, %rax
je 0x1321
leaq 0x64(%rdi), %r14
movq %rbx, %rsi
callq 0x1090
movq %r14, %rdi
testl %eax, %eax
jne 0x12e5
leaq 0x2d89(%rip), %r15      # 0x4094
subq %r12, %r15
leaq -0x2e(%r15), %rdi
movq -0x30(%rbp), %rsi
callq 0x1050
addq $-0x60, %r15
jmp 0x135d
leal 0x1(%r15), %eax
movl %eax, 0x2d69(%rip)      # 0x4094
leaq 0x2d62(%rip), %r14      # 0x4094
imulq $0x64, %r15, %rax
leaq (%rax,%r14), %rdi
addq $0x9a, %rdi
movq -0x30(%rbp), %rsi
callq 0x1050
movslq 0x2d43(%rip), %rax      # 0x4094
imulq $0x64, %rax, %rax
leaq (%rax,%r14), %r15
addq $0x4, %r15
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/atlas.c
// Function: Font_atlas_add
static int Font_atlas_add(lua_State *L)
    {
    int err;
    ud_t *ud;
    nk_font_t* font;
    nk_atlas_t *atlas = checkatlas(L, 1, &ud);
    float height = luaL_checknumber(L, 2);
    const char *file_path = luaL_optstring(L, 3, NULL);
    nk_font_config_t *config = echeckfontconfig(L, 4, height, &err);
    if(err)
        { if(err == ERR_NOTPRESENT) lua_pop(L, 1); else return argerror(L, 4); }
    if(file_path)
        font = nk_font_atlas_add_from_file(atlas, file_path, height, config);
    else
        font = nk_font_atlas_add_default(atlas, height, config);
    //Not currently used:
    //nk_font_t* nk_font_atlas_add(atlas, const nk_font_config_t*);
    //nk_font_t* nk_font_atlas_add_from_memory(atlas, void*, nk_size, float, const nk_font_config_t*);
    //nk_font_t *nk_font_atlas_add_compressed(atlas, void*, nk_size, float, const nk_font_config_t*);
    //nk_font_t* nk_font_atlas_add_compressed_base85(atlas, const char*, float, const nk_font_config_t*);
    if(!font) return errorc(L, ERR_FAILED);
    pushatlasfont(L, ud, font, config);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x4ba07(%rip), %rcx     # 0x60000
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %rdx
movl %ebp, %esi
callq 0x120e0
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x12920
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x12970
movq %rax, %r12
pushq $0x4
popq %rsi
leaq 0x14(%rsp), %r13
movq %rbx, %rdi
movss 0x4(%rsp), %xmm0
movq %r13, %rdx
callq 0x13340
movq %rax, %r15
movl (%r13), %eax
testl %eax, %eax
je 0x14666
cmpl $0x1, %eax
jne 0x14681
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x12190
movq %r14, %rdi
testq %r12, %r12
je 0x1469e
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
movq %r15, %rdx
callq 0x13890
jmp 0x146ac
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x12690
pushq $0x4
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x124a0
jmp 0x146db
movss 0x4(%rsp), %xmm0
movq %r15, %rsi
callq 0x12f90
testq %rax, %rax
je 0x146c6
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %rax, %rdx
movq %r15, %rcx
callq 0x125d0
jmp 0x146dd
pushq $-0xc
popq %rdi
callq 0x13cc0
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x13bb0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/atlas.c
// Function: Font_atlas_bake
static int Font_atlas_bake(lua_State *L)
    {
    ud_t *ud;
    int width, height;
    size_t len = 0;
    nk_atlas_t *atlas = checkatlas(L, 1, &ud);
    enum nk_font_atlas_format fmt = checkfontatlasformat(L, 2);
    const void* pixels = nk_font_atlas_bake(atlas, &width, &height, fmt);
    switch(fmt)
        {
        case NK_FONT_ATLAS_ALPHA8: len = width*height; break;
        case NK_FONT_ATLAS_RGBA32: len = width*height*4; break;
        }
    lua_pushlstring(L, (char*)pixels, len);
    lua_pushinteger(L, width);
    lua_pushinteger(L, height);
    return 3;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x4b900(%rip), %rcx     # 0x60000
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %rdx
callq 0x120e0
movq %rax, %r14
pushq $0x12
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x13450
movl %eax, %ebp
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %r14, %rdi
movl %eax, %ecx
callq 0x12810
cmpl $0x1, %ebp
je 0x1474a
testl %ebp, %ebp
jne 0x1475a
movslq 0x4(%rsp), %rcx
movslq (%rsp), %rdx
imulq %rcx, %rdx
jmp 0x1475c
movl 0x4(%rsp), %ecx
imull (%rsp), %ecx
shll $0x2, %ecx
movslq %ecx, %rdx
jmp 0x1475c
xorl %edx, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x13840
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x12c20
movslq (%rsp), %rsi
movq %rbx, %rdi
callq 0x12c20
pushq $0x3
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/atlas.c
// Function: Font_atlas_end
static int Font_atlas_end(lua_State *L)
    {
    nk_handle_t tex;
    nk_draw_null_texture_t dnt;
    nk_atlas_t *atlas = checkatlas(L, 1, NULL);
    tex.id = luaL_checkinteger(L, 2);
    nk_font_atlas_end(atlas, tex, &dnt);
    lua_pushinteger(L, dnt.texture.id);
    pushvec2(L, &dnt.uv);
    return 2;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x4b860(%rip), %rcx     # 0x60000
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x120e0
movq %rax, %r14
pushq $0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13060
movl %eax, %esi
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x12e10
movslq (%r15), %rsi
movq %rbx, %rdi
callq 0x12c20
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x12730
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/atlas.c
// Function: Cursor
static int Cursor(lua_State *L)
    {
    ud_t *ud;
    nk_atlas_t *atlas = checkatlas(L, 1, &ud);
    enum nk_style_cursor what = checkstylecursor(L, 2);
    pushatlascursor(L, ud, &atlas->cursors[what]);
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4b79d(%rip), %rcx     # 0x60000
pushq $0x1
popq %rbp
movq %rsp, %r14
movl %ebp, %esi
movq %r14, %rdx
callq 0x120e0
movq %rax, %r15
pushq $0x10
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x13450
movq (%r14), %rsi
movl %eax, %eax
imulq $0x28, %rax, %rax
leaq (%r15,%rax), %rdx
addq $0x48, %rdx
movq %rbx, %rdi
callq 0x13e20
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/atlas.c
// Function: Init
static int Init(lua_State *L)
    {
    ud_t *ud;
    nk_atlas_t *atlas;
    atlas = (nk_atlas_t*)Malloc(L, sizeof(nk_atlas_t));
    nk_font_atlas_init_default(atlas);
    //void nk_font_atlas_init(nk_atlas_t*, nk_allocator_t*);
    //void nk_font_atlas_init_custom(nk_atlas_t*, nk_allocator_t*, nk_allocator_t*);
    ud = newuserdata(L, atlas, ATLAS_MT, "atlas");
    ud->parent_ud = NULL;
    ud->destructor = freefont_atlas;
    return 1;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x190, %esi            # imm = 0x190
callq 0x13c00
movq %rax, %r14
movq %rax, %rdi
callq 0x12a90
leaq 0x4b733(%rip), %rdx     # 0x60000
leaq 0x4b738(%rip), %rcx     # 0x6000c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x140d0
andq $0x0, 0x10(%rax)
leaq 0x73(%rip), %rcx        # 0x1495e
movq %rcx, 0x8(%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/atlas.c
// Function: freefont_atlas
static int freefont_atlas(lua_State *L, ud_t *ud)
    {
    nk_atlas_t *atlas = (nk_atlas_t*)ud->handle;
    freechildren(L, FONT_MT, ud);
    freechildren(L, CURSOR_MT, ud);
    if(!freeuserdata(L, ud, "atlas")) return 0;
    nk_font_atlas_clear(atlas);
    Free(L, atlas);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rbx
leaq 0x4b73e(%rip), %rsi     # 0x600b1
movq %r15, %rdx
callq 0x121f0
leaq 0x4b740(%rip), %rsi     # 0x600c2
movq %r14, %rdi
movq %r15, %rdx
callq 0x121f0
leaq 0x4b678(%rip), %rdx     # 0x6000c
movq %r14, %rdi
movq %r15, %rsi
callq 0x13f10
testl %eax, %eax
je 0x149b6
movq %rbx, %rdi
callq 0x13d00
movq %r14, %rdi
movq %rbx, %rsi
callq 0x13220
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/buffer.c
// Function: Init
static int Init(lua_State *L)
    {
    ud_t *ud;
    nk_buffer_t *buffer = checkbuffer(L, 1, &ud);
    void *ptr = checklightuserdata(L, 2);
    nk_size size = luaL_checkinteger(L, 3);
    if(size <= 0) return argerrorc(L, 3, ERR_VALUE);
    if(!IsFixed(ud))
        return luaL_argerror(L, 1, "not a fixed buffer");
    if(IsInitialized(ud))
        nk_buffer_free(buffer);
    nk_buffer_init_fixed(buffer, ptr, size);
    MarkInitialized(ud);
    return 0;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4b64e(%rip), %rcx     # 0x600d5
pushq $0x1
popq %rsi
movq %rsp, %rdx
callq 0x120e0
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x139f0
movq %rax, %r15
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x13060
testq %rax, %rax
je 0x14ad0
movq %rax, %r12
movq (%rsp), %rax
movl 0x70(%rax), %eax
testb $0x4, %al
jne 0x14ae8
leaq 0x4b62b(%rip), %rdx     # 0x600f3
pushq $0x1
popq %rsi
movq %rbx, %rdi
jmp 0x14ae1
pushq $-0x3
popq %rdi
callq 0x13cc0
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x124a0
jmp 0x14b0c
testb $0x8, %al
je 0x14af4
movq %r14, %rdi
callq 0x13f80
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x126f0
movq (%rsp), %rax
orl $0x8, 0x70(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq