LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_wordlist
static runt_int rproc_wordlist(runt_vm *vm, runt_ptr p)
{
    runt_int w, e;
    runt_entry *entry;
    runt_int nentry = 0;
    runt_dict *dict;
    runt_list *list;
    dict = runt_dictionary_get(vm);

    list = dict->list;
    for(w = 0; w < RUNT_DICT_SIZE; w++) {
        entry = runt_list_top(&list[w]);
        nentry = list[w].size;
        for(e = 0; e < nentry ; e++) {
            runt_print(vm, "%s\n", runt_to_string(entry->p));
            entry = entry->next;
        }
    }

    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x1eff
movq %rax, %r14
addq $0x8, %r14
leaq 0x1af1(%rip), %r15      # 0x64ac
xorl %ebp, %ebp
cmpq $0x80, %rbp
je 0x4a21
imulq $0x18, %rbp, %r13
leaq (%r14,%r13), %rdi
callq 0x1ff1
movq %rax, %r12
movl (%r14,%r13), %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
subl $0x1, %r13d
jb 0x4a1c
movq 0x20(%r12), %rax
movq %rax, 0x10(%rsp)
movups 0x10(%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x1c2d
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x18da
movq 0x40(%r12), %r12
jmp 0x49e6
incq %rbp
jmp 0x49bd
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_rand
static runt_int rproc_rand(runt_vm *vm, runt_ptr p)
{
    runt_uint max;
    runt_stacklet *s;
    runt_int rc;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    max = s->f;

    rc = runt_ppush(vm, &s);
    RUNT_ERROR_CHECK(rc);
    s->f = rand() % max;

    return RUNT_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x10(%rsp), %rsi
callq 0x1dc7
xorl %ebx, %ebx
testl %eax, %eax
je 0x4a8e
leaq 0x10(%rsp), %rsi
movq (%rsi), %rax
movss 0x20(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
callq 0x1cb0
testl %eax, %eax
je 0x4a8e
cvttss2si 0xc(%rsp), %rbx
callq 0x1170
xorl %edx, %edx
divl %ebx
cvtsi2ss %rdx, %xmm0
movq 0x10(%rsp), %rax
movss %xmm0, 0x20(%rax)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_psize
static runt_int rproc_psize(runt_vm *vm, runt_ptr p)
{
    runt_uint id;
    runt_stacklet *s;
    runt_int rc;
    runt_cell *cell;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    id = s->f;

    rc = runt_cell_pool_get_cell(vm, id, &cell);
    RUNT_ERROR_CHECK(rc);

    rc = runt_ppush(vm, &s);
    RUNT_ERROR_CHECK(rc);

    s->f = cell->psize;

    return RUNT_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
callq 0x1dc7
xorl %ebx, %ebx
testl %eax, %eax
je 0x4b29
movq 0x8(%rsp), %rax
cvttss2si 0x20(%rax), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x2183
testl %eax, %eax
je 0x4b29
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1cb0
testl %eax, %eax
je 0x4b29
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
cvtsi2ss %rax, %xmm0
movq 0x8(%rsp), %rax
movss %xmm0, 0x20(%rax)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_restore
static runt_int rproc_restore(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    runt_stacklet *s;
    runt_uint mem;
    runt_uint cell;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    mem = s->f;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    cell = s->f;

    vm->cell_pool.used = cell;
    vm->memory_pool.used = mem;

    runt_cell_undo(vm);
    runt_mark_set(vm);
    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
callq 0x1dc7
xorl %ebp, %ebp
testl %eax, %eax
je 0x4b9c
leaq 0x10(%rsp), %rsi
movq (%rsi), %rax
movss 0x20(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
callq 0x1dc7
testl %eax, %eax
je 0x4b9c
movq 0x10(%rsp), %rax
cvttss2si 0x20(%rax), %rax
cvttss2si 0xc(%rsp), %rcx
movl %eax, 0x51c(%rbx)
movl %ecx, 0x534(%rbx)
movq %rbx, %rdi
callq 0x2bea
movq %rbx, %rdi
callq 0x2c4c
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_block_begin
static runt_int rproc_block_begin(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    runt_stacklet *s;
    runt_block *blk;
    blk = (runt_block *)runt_to_cptr(p);
    vm->pos = blk->end;
    rc = runt_ppush(vm, &s);
    RUNT_ERROR_CHECK(rc);
    s->f = blk->start;
    return RUNT_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x2cf6
movq %rax, %rbx
movl 0x4(%rax), %eax
movl %eax, 0x11bc(%r14)
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x1cb0
testl %eax, %eax
je 0x4bfb
movl (%rbx), %eax
cvtsi2ss %rax, %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x20(%rax)
pushq $0x1
popq %rax
jmp 0x4bfd
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rcopy_block_begin
static runt_int rcopy_block_begin(runt_vm *vm, runt_cell *src, runt_cell *dst)
{
    runt_block *blk;
    runt_malloc(vm, sizeof(runt_block), (void **)&blk);
    blk->start = dst->id;
    blk->end = dst->id;
    dst->p = runt_mk_cptr(vm, blk);
    dst->fun = src->fun;
    return runt_proc_begin(vm, dst);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x8
popq %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
callq 0x19ad
movl 0x24(%rbx), %eax
movq (%r12), %rdx
movl %eax, (%rdx)
movl %eax, 0x4(%rdx)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2b3e
movq 0x10(%r12), %rax
movq %rax, 0x18(%rbx)
movups (%r12), %xmm0
movups %xmm0, 0x8(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1a01
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rcopy_block_end
static runt_int rcopy_block_end(runt_vm *vm, runt_cell *src, runt_cell *dst)
{
    runt_int rc;
    runt_stacklet *s;
    runt_cell *cell;
    runt_block *blk;
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    cell = runt_to_cell(s->p);
    blk = (runt_block *) runt_to_cptr(cell->p);
    blk->end = dst->id - 1;
    runt_cell_undo(vm);
    cell->psize--;
    return RUNT_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %rsi
callq 0x1dc7
testl %eax, %eax
je 0x4ce0
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups 0x8(%rax), %xmm0
movups %xmm0, (%rsp)
callq 0x197a
movq %rax, %r15
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movups 0x8(%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x2cf6
movl 0x24(%r14), %ecx
decl %ecx
movl %ecx, 0x4(%rax)
movq %rbx, %rdi
callq 0x2bea
decl 0x20(%r15)
pushq $0x1
popq %rax
jmp 0x4ce2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_argv
static runt_int rproc_argv(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    runt_stacklet *s;
    runt_int pos;
    const char *str;
    runt_uint len;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    pos = s->f;

    if(pos <= 0 || pos >= vm->argc) {
        runt_print(vm, "argv: invalid position %d\n", pos);
        return RUNT_NOT_OK;
    }

    rc = runt_ppush(vm, &s);
    str = vm->argv[pos];
    len = strlen(str);
    s->p = runt_mk_string(vm, str, len);

    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
callq 0x1dc7
testl %eax, %eax
je 0x4d8c
movq (%rsp), %rax
cvttss2si 0x20(%rax), %ebp
testl %ebp, %ebp
jle 0x4d74
cmpl %ebp, 0x11e8(%rbx)
jle 0x4d74
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1cb0
movq 0x11e0(%rbx), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %r15
movq %r15, %rdi
callq 0x1070
movq (%r14), %r12
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %eax, %ecx
callq 0x1c3d
movq 0x10(%r14), %rax
movq %rax, 0x18(%r12)
movups (%r14), %xmm0
movups %xmm0, 0x8(%r12)
pushq $0x1
popq %r14
jmp 0x4d8f
leaq 0x17a9(%rip), %rsi      # 0x6524
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x18da
jmp 0x4d8f
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_dnew
static runt_int rproc_dnew(runt_vm *vm, runt_ptr p)
{
    runt_uint ptr;
    runt_int rc;
    runt_stacklet *s;
    runt_dict *dict;

    ptr = runt_dictionary_new(vm, &dict);
    if(ptr == 0) return RUNT_NOT_OK;


    /* load minimal set */
    runt_dictionary_set(vm, dict);
    runt_load_minimal(vm);
    /* load dictionary routines to swap out */
    runt_keyword_define(vm, "basic", 5, rproc_basic, NULL);
    runt_keyword_define(vm, "dnew", 4, rproc_dnew, NULL);
    runt_keyword_define(vm, "dset", 4, rproc_dset, NULL);
    runt_keyword_define(vm, "dswap", 5, rproc_dswap, NULL);
    load_control(vm);
    runt_dictionary_swap(vm);

    /* preserve memory */
    runt_mark_set(vm);

    rc = runt_ppush(vm, &s);
    RUNT_ERROR_CHECK(rc);

    s->f = ptr;

    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq %rsp, %rsi
callq 0x2edd
testl %eax, %eax
je 0x4ec1
movl %eax, %ebx
movq (%rsp), %rsi
movq %r14, %rdi
callq 0x20fe
movq %r14, %rdi
callq 0x152e
leaq 0x172f(%rip), %rsi      # 0x653f
leaq 0x5a6(%rip), %rcx       # 0x53bd
xorl %r15d, %r15d
pushq $0x5
popq %rbp
movq %r14, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x15cd(%rip), %rsi      # 0x63fe
leaq -0x64(%rip), %rcx       # 0x4dd4
pushq $0x4
popq %r12
movq %r14, %rdi
movl %r12d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x15b2(%rip), %rsi      # 0x6403
leaq 0x7c(%rip), %rcx        # 0x4ed4
movq %r14, %rdi
movl %r12d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x159b(%rip), %rsi      # 0x6408
leaq 0xbf(%rip), %rcx        # 0x4f33
movq %r14, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
movq %r14, %rdi
callq 0x43a3
movq %r14, %rdi
callq 0x2ec0
movq %r14, %rdi
callq 0x2c4c
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1cb0
testl %eax, %eax
je 0x4ec4
movl %ebx, %eax
cvtsi2ss %rax, %xmm0
movq 0x8(%rsp), %rax
movss %xmm0, 0x20(%rax)
pushq $0x1
popq %r15
jmp 0x4ec4
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_dset
static runt_int rproc_dset(runt_vm *vm, runt_ptr p)
{
    runt_uint ptr;
    runt_int rc;
    runt_stacklet *s;
    runt_dict *dict;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    ptr = s->f;

    if(ptr == 0) {
        dict = &vm->idict;
    } else {
        runt_memory_pool_get(vm, ptr, (void **)&dict);
    }

    runt_dictionary_set(vm, dict);

    return RUNT_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
callq 0x1dc7
testl %eax, %eax
je 0x4f10
movq 0x10(%rsp), %rax
cvttss2si 0x20(%rax), %rsi
testl %esi, %esi
je 0x4f14
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1beb
movq (%r14), %rsi
jmp 0x4f20
xorl %eax, %eax
jmp 0x4f2b
leaq 0x548(%rbx), %rsi
movq %rsi, 0x8(%rsp)
movq %rbx, %rdi
callq 0x20fe
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_dtor
static int rproc_dtor(runt_vm *vm, runt_ptr p)
{
    runt_stacklet *s;
    runt_int rc;
    runt_uint pos;
    runt_cell *cell;


    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    pos = s->f;

    if(pos > 0) {
        runt_cell_pool_get_cell(vm, pos, &cell);
    } else {
        cell = runt_to_cptr(s->p);
    }

    runt_cell_destructor(vm, cell);
    runt_mark_set(vm);
    return RUNT_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
callq 0x1dc7
testl %eax, %eax
je 0x4f7a
movq 0x20(%rsp), %rax
cvttss2si 0x20(%rax), %rsi
testl %esi, %esi
je 0x4f7e
leaq 0x18(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2183
movq (%r14), %rsi
jmp 0x4f9c
xorl %eax, %eax
jmp 0x4faf
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups 0x8(%rax), %xmm0
movups %xmm0, (%rsp)
callq 0x2cf6
movq %rax, %rsi
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x3040
movq %rbx, %rdi
callq 0x2c4c
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_regset
static int rproc_regset(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    runt_stacklet *s;
    runt_int r;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    r = s->f;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    rc = runt_register_set(vm, r, s);
    RUNT_ERROR_CHECK(rc);

    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
callq 0x1dc7
xorl %ebp, %ebp
testl %eax, %eax
je 0x5024
leaq 0x10(%rsp), %rsi
movq (%rsi), %rax
movss 0x20(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
callq 0x1dc7
testl %eax, %eax
je 0x5024
cvttss2si 0xc(%rsp), %esi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x339b
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_regget
static int rproc_regget(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    runt_stacklet *s;
    runt_stacklet *out;
    runt_int r;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    r = s->f;

    rc = runt_register_get(vm, r, &s);
    RUNT_ERROR_CHECK(rc);

    rc = runt_ppush(vm, &out);
    RUNT_ERROR_CHECK(rc);

    *out = *s;

    return RUNT_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
callq 0x1dc7
xorl %ebx, %ebx
testl %eax, %eax
je 0x5094
leaq 0x8(%rsp), %rdx
movq (%rdx), %rax
cvttss2si 0x20(%rax), %esi
movq %r14, %rdi
callq 0x337e
testl %eax, %eax
je 0x5094
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x1cb0
testl %eax, %eax
je 0x5094
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rdx
movq %rdx, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_anon
static int rproc_anon(runt_vm *vm, runt_ptr p)
{
    runt_int rc;
    runt_stacklet *s;

    rc = RUNT_OK;
    if(vm->anon == NULL) rc = RUNT_NOT_OK;
    else if(vm->anon->cell->id > runt_cell_pool_used(vm)) rc = RUNT_NOT_OK;

    if(rc != RUNT_OK) {
        runt_print(vm, "The anonymous function position is undefined\n");
        return RUNT_NOT_OK;
    }

    rc = runt_ppush(vm, &s);
    RUNT_ERROR_CHECK(rc);

    s->f = vm->anon->cell->id;
    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x14a8(%rdi), %rax
testq %rax, %rax
je 0x50c2
movq (%rax), %rax
movl 0x24(%rax), %ebp
movq %rbx, %rdi
callq 0x2174
cmpl %eax, %ebp
jbe 0x50d7
leaq 0x147c(%rip), %rsi      # 0x6545
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x18da
jmp 0x5108
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1cb0
testl %eax, %eax
je 0x5106
movq 0x14a8(%rbx), %rax
movq (%rax), %rax
movl 0x24(%rax), %eax
cvtsi2ss %rax, %xmm0
movq (%rsp), %rax
movss %xmm0, 0x20(%rax)
pushq $0x1
popq %rbp
jmp 0x5108
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: loader
static int loader(
    runt_vm *vm,
    runt_int pstate,
    const char *fname,
    runt_stacklet *s,
    int (*fn)(runt_vm *, const char*))
{
    runt_int rc;
    vm->memory_pool.used = s->p.pos;
    runt_set_state(vm, RUNT_MODE_INTERACTIVE, RUNT_OFF);
    rc = fn(vm, fname);
    runt_set_state(vm, RUNT_MODE_INTERACTIVE, pstate);
    RUNT_ERROR_CHECK(rc);
    runt_mark_set(vm);
    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movl 0x18(%rcx), %eax
movl %eax, 0x534(%rdi)
pushq $0x2
popq %r12
pushq $0x4
popq %rdx
movl %r12d, %esi
callq 0x13d3
movq %rbx, %rdi
movq %r15, %rsi
callq *%r14
movl %eax, %r14d
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x13d3
testl %r14d, %r14d
je 0x5167
movq %rbx, %rdi
callq 0x2c4c
pushq $0x1
popq %rax
jmp 0x5169
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: load_dictionary
static runt_int load_dictionary(runt_vm *vm, const char *filename)
{
    FILE *fp;
    char *line = NULL;
    size_t len = 0;
    ssize_t read;

    fp = fopen(filename, "r");

    if(fp == NULL) {
        runt_print(vm, "Could not open file %s\n", filename);
        return RUNT_NOT_OK;
    }

    while((read = runt_getline(&line, &len, fp)) != -1) {
        parse(vm, line, read);
    }

    fclose(fp);
    free(line);
    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
andq $0x0, (%rsp)
movq %rdi, %rbx
andq $0x0, 0x8(%rsp)
leaq 0x123a(%rip), %rsi      # 0x63d0
movq %r15, %rdi
callq 0x1120
testq %rax, %rax
je 0x51e6
movq %rax, %r14
movq %rsp, %r15
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2f03
cmpq $-0x1, %rax
je 0x51d0
movq (%rsp), %rsi
movq %rbx, %rdi
callq 0x24c2
jmp 0x51ae
movq %r14, %rdi
callq 0x1060
movq (%rsp), %rdi
callq 0x1040
pushq $0x1
popq %rbp
jmp 0x51fc
leaq 0x12ab(%rip), %rsi      # 0x6498
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x18da
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_call
static int rproc_call(runt_vm *vm, runt_ptr p)
{
    runt_stacklet *s;
    runt_int rc;
    runt_uint level;
    runt_uint ppos;
    runt_int pstate;
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    pstate = runt_get_state(vm, RUNT_MODE_END);
    runt_set_state(vm, RUNT_MODE_END, RUNT_OFF);
    ppos = vm->pos;
    vm->pos = s->f;

    vm->level++;
    level = vm->level;
    while(runt_get_state(vm, RUNT_MODE_END) == RUNT_OFF &&
            vm->level == level) {
        rc = runt_cell_call(vm, &vm->cell_pool.cells[vm->pos - 1]);
        RUNT_ERROR_CHECK(rc);
        vm->pos++;
    }
    vm->level--;
    vm->pos = ppos;
    runt_set_state(vm, RUNT_MODE_END, pstate);

    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rsi
callq 0x1dc7
xorl %ebp, %ebp
testl %eax, %eax
je 0x52e6
pushq $0x40
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x18cb
movl %eax, %r14d
pushq $0x4
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13d3
movl 0x11b8(%rbx), %r13d
movq (%rsp), %rax
cvttss2si 0x20(%rax), %rax
movl 0x11bc(%rbx), %r12d
movl %eax, 0x11bc(%rbx)
incl %r13d
movl %r13d, 0x11b8(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x18cb
movl 0x11b8(%rbx), %ecx
cmpl $0x4, %eax
jne 0x52c6
cmpl %r13d, %ecx
jne 0x52c6
movl 0x11bc(%rbx), %eax
decl %eax
imulq $0x28, %rax, %rsi
addq 0x510(%rbx), %rsi
movq %rbx, %rdi
callq 0x19de
testl %eax, %eax
je 0x52e6
incl 0x11bc(%rbx)
jmp 0x5284
decl %ecx
movl %ecx, 0x11b8(%rbx)
movl %r12d, 0x11bc(%rbx)
pushq $0x40
popq %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x13d3
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/MuvikLabs[P]runt/basic.c
// Function: rproc_goto
static int rproc_goto(runt_vm *vm, runt_ptr p)
{
    runt_stacklet *s;
    runt_uint pos;
    runt_uint jump;
    runt_int rc;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    pos = s->f;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    jump = s->f;

    if(jump && pos < vm->cell_pool.size + 1) {
        vm->pos = pos;
    }

    return RUNT_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
callq 0x1dc7
xorl %ebx, %ebx
testl %eax, %eax
je 0x5354
leaq 0x8(%rsp), %rsi
movq (%rsi), %rax
cvttss2si 0x20(%rax), %r15
movq %r14, %rdi
callq 0x1dc7
testl %eax, %eax
je 0x5354
movq 0x8(%rsp), %rax
cvttss2si 0x20(%rax), %rax
pushq $0x1
popq %rbx
testl %eax, %eax
je 0x5354
movl 0x518(%r14), %eax
incl %eax
cmpl %r15d, %eax
jbe 0x5354
movl %r15d, 0x11bc(%r14)
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: rproc_ex
static int rproc_ex(runt_vm *vm, runt_ptr p)
{
    runt_stacklet *s;
    runt_int rc;
    runt_uint pos;
    runt_cell *cell;
    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    pos = s->f;

    if(pos > 0) {
        runt_cell_id_exec(vm, pos);
    } else {
        cell = runt_to_cptr(s->p);
        runt_cell_exec(vm, cell);
    }

    return RUNT_OK;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rsi
callq 0x1dc7
testl %eax, %eax
je 0x538f
movq 0x18(%rsp), %rax
cvttss2si 0x20(%rax), %rsi
testl %esi, %esi
je 0x5393
movq %rbx, %rdi
callq 0x1b49
jmp 0x53b4
xorl %eax, %eax
jmp 0x53b7
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups 0x8(%rax), %xmm0
movups %xmm0, (%rsp)
callq 0x2cf6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1a99
pushq $0x1
popq %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/irunt.c
// Function: runt_parse_file
runt_int runt_parse_file(runt_vm *vm, const char *filename)
{
    FILE *fp;
    runt_int rc;

    fp = fopen(filename, "r");

    if(fp == NULL) {
        runt_print(vm, "Could not open file %s\n", filename);
        return RUNT_NOT_OK;
    }

    rc = runt_parse_filehandle(vm, fp);
    fclose(fp);
    return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xfea(%rip), %rsi       # 0x63d0
movq %r14, %rdi
callq 0x1120
testq %rax, %rax
je 0x540f
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x542b
movl %eax, %ebx
movq %r15, %rdi
callq 0x1060
movl %ebx, %eax
jmp 0x5425
leaq 0x1082(%rip), %rsi      # 0x6498
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x18da
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/irunt.c
// Function: runt_parse_filehandle
runt_int runt_parse_filehandle(runt_vm *vm, FILE *fp)
{
    char *line = NULL;
    size_t len = 0;
    ssize_t read;
    runt_int rc = RUNT_OK;

    if(fp == NULL) return RUNT_NOT_OK;

    while((read = runt_getline(&line, &len, fp)) != -1) {
        rc = parse(vm, line, read);
        if(rc == RUNT_NOT_OK) break;
    }

    free(line);
    return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
andq $0x0, (%rsp)
andq $0x0, 0x8(%rsp)
testq %rsi, %rsi
je 0x548c
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rbx
movq %rsp, %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2f03
cmpq $-0x1, %rax
je 0x5481
movq (%rsp), %rsi
movq %r15, %rdi
callq 0x549e
movl %eax, %ebx
testl %eax, %eax
jne 0x5459
xorl %ebx, %ebx
movq (%rsp), %rdi
callq 0x1040
jmp 0x548e
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/irunt.c
// Function: parse
static runt_int parse(runt_vm *vm, char *str, size_t read)
{
    const char *code = str;
    runt_int rc;
    runt_pmark_set(vm);
    rc = runt_compile(vm, code);
    runt_pmark_free(vm);
    return rc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2c81
movq %r14, %rdi
movq %rbx, %rsi
callq 0x24c2
movl %eax, %ebx
movq %r14, %rdi
callq 0x2cb7
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/irunt.c
// Function: load_dictionary_handle
static runt_int load_dictionary_handle(runt_vm *vm, FILE *fp)
{
    char *line = NULL;
    size_t len = 0;
    ssize_t read;
    runt_int rc = RUNT_OK;

    while((read = runt_getline(&line, &len, fp)) != -1) {
        rc = parse(vm, line, read);
        if(rc == RUNT_NOT_OK) {
            runt_print(vm, "Bad return value. Dipping out.\n");
            break;
        }
    }

    free(line);
    return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
leaq 0x10(%rsp), %r12
andq $0x0, (%r12)
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2f03
cmpq $-0x1, %rax
je 0x581c
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x549e
testl %eax, %eax
jne 0x57e6
leaq 0xd82(%rip), %rsi       # 0x6594
movq %rbx, %rdi
xorl %eax, %eax
callq 0x18da
movq 0x8(%rsp), %rdi
callq 0x1040
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/irunt.c
// Function: runt_vm_alloc
int runt_vm_alloc(runt_vm *vm, runt_uint ncells, runt_uint memsize)
{
    unsigned char *mem;
    runt_cell *cells;

    mem = malloc(memsize);
    cells = malloc(sizeof(runt_cell) * ncells);
    runt_init(vm);
    runt_cell_pool_set(vm, cells, ncells);
    runt_cell_pool_init(vm);
    runt_memory_pool_set(vm, mem, memsize);
    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %edx, %edi
callq 0x10d0
movq %rax, %r15
movl %ebp, %eax
imulq $0x28, %rax, %rdi
callq 0x10d0
movq %rax, %r12
movq %r14, %rdi
callq 0x1294
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x14a2
movq %r14, %rdi
callq 0x14ba
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x1507
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/irunt.c
// Function: runt_vm_free
int runt_vm_free(runt_vm *vm)
{
    runt_close_plugins(vm);
    free(vm->cell_pool.cells);
    free(vm->memory_pool.data);
    return RUNT_OK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2dfd
movq 0x510(%rbx), %rdi
callq 0x1040
movq 0x528(%rbx), %rdi
callq 0x1040
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: hexchar_to_uint16
int hexchar_to_uint16(uint16_t *output_uint16_ptr, const char input_char)
{
    if (input_char >= '0' && input_char <= '9')
    {
        *output_uint16_ptr = input_char - '0';
        return 0;
    }
    if (input_char >= 'A' && input_char <= 'F')
    {
        *output_uint16_ptr = input_char - 'A' + 10;
        return 0;
    }
    if (input_char >= 'a' && input_char <= 'f')
    {
        *output_uint16_ptr = input_char - 'a' + 10;
        return 0;
    }
    if (input_char == '*')
    {
        *output_uint16_ptr = 0x100;
        return 0;
    }
    if (input_char == '?')
    {
        *output_uint16_ptr = 0x101;
        return 0;
    }

    return -1;
}

// Assembly:
leal -0x30(%rsi), %eax
cmpb $0x9, %al
ja 0x33ba
movzbl %sil, %eax
addl $-0x30, %eax
jmp 0x33f2
leal -0x41(%rsi), %eax
cmpb $0x5, %al
ja 0x33ca
movzbl %sil, %eax
addl $-0x37, %eax
jmp 0x33f2
leal -0x61(%rsi), %eax
cmpb $0x5, %al
ja 0x33da
movzbl %sil, %eax
addl $-0x57, %eax
jmp 0x33f2
movsbl %sil, %eax
cmpl $0x2a, %eax
je 0x33ee
cmpl $0x3f, %eax
jne 0x33f8
movw $0x101, %ax             # imm = 0x101
jmp 0x33f2
movw $0x100, %ax             # imm = 0x100
movw %ax, (%rdi)
xorl %eax, %eax
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: hex_string_to_uint16_arrary
int hex_string_to_uint16_arrary(uint16_t *uint16_array, const char *hex_string)
{
    int size = 0;
    while(hex_string[0] && hex_string[1])
    {
        // Arbitrary symbols must be in pairs
        if (hex_string[0] == '?' || hex_string[1] == '?' || hex_string[0] == '*' || hex_string[1] == '*')
            if (hex_string[0] != hex_string[1]) return -1;

        uint16_t output[2];
        if (hexchar_to_uint16(&output[0], hex_string[0])==0 && hexchar_to_uint16(&output[1], hex_string[1])==0)
        {
            uint16_array[size++] = output[0] * 16 + output[1];
        }
        else return -1;
        hex_string += 2;
    }
    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6(%rsp), %r12
xorl %ebp, %ebp
pushq $-0x1
popq %rbx
leaq 0x4(%rsp), %r13
movb (%r14,%rbp,2), %al
testb %al, %al
je 0x348d
movb 0x1(%r14,%rbp,2), %dl
testb %dl, %dl
je 0x348d
cmpb $0x3f, %al
setne %cl
cmpb $0x3f, %dl
setne %dil
cmpb $0x2a, %al
setne %r8b
cmpb $0x2a, %dl
setne %sil
cmpb %dl, %al
je 0x3455
andb %dil, %cl
andb %r8b, %sil
andb %cl, %sil
je 0x348f
movsbl %al, %esi
movq %r13, %rdi
callq 0x33aa
testl %eax, %eax
jne 0x348f
movsbl 0x1(%r14,%rbp,2), %esi
movq %r12, %rdi
callq 0x33aa
testl %eax, %eax
jne 0x348f
movzwl 0x4(%rsp), %eax
shll $0x4, %eax
addw 0x6(%rsp), %ax
movw %ax, (%r15,%rbp,2)
incq %rbp
jmp 0x341c
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: update_raw_byte_buffer
void update_raw_byte_buffer(cache_linked_list_t *instr_buffer, 
                            char const *cur_insn_rawbytes, 
                            const uint32_t instr_size,
                            const size_t target_length)
{
    // Remove instr from head if buffer is full
    if (instr_buffer->length > target_length)
    {
        assert(instr_buffer->head != NULL);
        assert(instr_buffer->head != instr_buffer->tail);
        insn_rawbyte_node_t *new_head = instr_buffer->head->succ;
        assert(new_head != NULL);
        free_insn_rawbyte_node(instr_buffer->head);
        instr_buffer->head = new_head;
        instr_buffer->length -= 1;
    }

    // New instr
    insn_rawbyte_node_t *new_node = malloc(sizeof(insn_rawbyte_node_t));
    if (!new_node) PEEKABOO_DIE("Failed to malloc!");
    new_node->is_arbitrary = false;
    new_node->prec = instr_buffer->tail;
    new_node->succ = NULL;
    new_node->size = instr_size;
    new_node->bytes = malloc(sizeof(uint16_t) * instr_size);
    uint32_t idx;
    for (idx=0; idx<instr_size; idx++)
    {
        new_node->bytes[idx] = cur_insn_rawbytes[idx] & 0xFF;
    }

    // Update buffer
    if (instr_buffer->head == NULL) 
    {
        instr_buffer->head = new_node;
    }
    if (instr_buffer->tail != NULL) 
    {
        instr_buffer->tail->succ = new_node;
    }
    instr_buffer->tail = new_node;
    instr_buffer->length += 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %r12
cmpq %rcx, %r12
jbe 0x350e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x35a9
cmpq 0x8(%rbx), %rdi
je 0x35c8
movq 0x20(%rdi), %r15
testq %r15, %r15
je 0x35e7
callq 0x34a0
movq %r15, (%rbx)
movq 0x10(%rbx), %r12
decq %r12
movq %r12, 0x10(%rbx)
pushq $0x28
popq %rdi
callq 0x31b0
testq %rax, %rax
je 0x3585
movq %rax, %r15
movb $0x0, (%rax)
movq 0x8(%rbx), %r13
movq %r13, 0x18(%rax)
andq $0x0, 0x20(%rax)
movl %ebp, 0x10(%rax)
movl %ebp, %ebp
leaq (,%rbp,2), %rdi
callq 0x31b0
movq %rax, 0x8(%r15)
xorl %ecx, %ecx
cmpq %rcx, %rbp
je 0x3559
movzbl (%r14,%rcx), %edx
movw %dx, (%rax,%rcx,2)
incq %rcx
jmp 0x3546
cmpq $0x0, (%rbx)
jne 0x3562
movq %r15, (%rbx)
testq %r13, %r13
je 0x356b
movq %r15, 0x20(%r13)
movq %r15, 0x8(%rbx)
incq %r12
movq %r12, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7a6c(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x2b97(%rip), %rdi      # 0x612d
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x3230
pushq $0x1
popq %rdi
callq 0x3220
leaq 0x2abc(%rip), %rdi      # 0x606c
leaq 0x2ad0(%rip), %rsi      # 0x6087
leaq 0x2ad6(%rip), %rcx      # 0x6094
movl $0xfd, %edx
callq 0x3110
leaq 0x2b24(%rip), %rdi      # 0x60f3
leaq 0x2ab1(%rip), %rsi      # 0x6087
leaq 0x2ab7(%rip), %rcx      # 0x6094
movl $0xfe, %edx
callq 0x3110
leaq 0x2b2e(%rip), %rdi      # 0x611c
leaq 0x2a92(%rip), %rsi      # 0x6087
leaq 0x2a98(%rip), %rcx      # 0x6094
movl $0x100, %edx            # imm = 0x100
callq 0x3110
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: is_buffer_matched
uint32_t is_buffer_matched(cache_linked_list_t const *raw_bytes_buffer, 
                       cache_linked_list_t const *pattern)
{
    insn_rawbyte_node_t *target_node = raw_bytes_buffer->tail;
    insn_rawbyte_node_t *pattern_node = pattern->tail;
    uint32_t matched_bytes_num = 0;

    if (raw_bytes_buffer->length < pattern->length) return 0;

    uint32_t idx = pattern->length;
    for (; idx>0; idx--, pattern_node = pattern_node->prec, target_node = target_node->prec)
    {
        matched_bytes_num += target_node->size;
        if (pattern_node->is_arbitrary) continue;
        if (pattern_node->size != target_node->size) return 0;
        uint32_t byte_offset = 0;
        for (; byte_offset < pattern_node->size; byte_offset++)
        {
            if (pattern_node->bytes[byte_offset] == 0x101*16+0x101) continue; // Matched "??"
            if (pattern_node->bytes[byte_offset] != target_node->bytes[byte_offset]) return 0;
        }
    }
    return matched_bytes_num;
}

// Assembly:
movq 0x10(%rsi), %rcx
xorl %eax, %eax
cmpq %rcx, 0x10(%rdi)
jb 0x366d
addq $0x8, %rsi
addq $0x8, %rdi
xorl %eax, %eax
subl $0x1, %ecx
jb 0x366d
movq (%rsi), %rsi
movq (%rdi), %rdi
movl 0x10(%rdi), %edx
cmpb $0x0, (%rsi)
je 0x363d
addl %eax, %edx
addq $0x18, %rsi
addq $0x18, %rdi
movl %edx, %eax
jmp 0x361c
cmpl %edx, 0x10(%rsi)
jne 0x366b
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x362f
movq 0x8(%rsi), %r9
movzwl (%r9,%r8,2), %r9d
cmpw $0x1111, %r9w           # imm = 0x1111
je 0x3666
movq 0x8(%rdi), %r10
cmpw (%r10,%r8,2), %r9w
jne 0x366b
incq %r8
jmp 0x3645
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: print_back
uint64_t print_back(const int64_t unprinted_size,
                peekaboo_trace_t *peekaboo_trace_ptr, 
                const size_t insn_idx)
{
    if (unprinted_size <= 0 || insn_idx < 1)
    {
        for (size_t prev_idx = ((int64_t)insn_idx - 5 > 0) ? (insn_idx - 5) : 1; prev_idx <= insn_idx; prev_idx++)
        {
            peekaboo_insn_t *prev_insn = get_peekaboo_insn(prev_idx, peekaboo_trace_ptr);
            print_peekaboo_insn(prev_insn, peekaboo_trace_ptr, prev_idx, false, false);
            free_peekaboo_insn(prev_insn);
        }
        return (insn_idx+1);
    }
    peekaboo_insn_t *insn = get_peekaboo_insn(insn_idx, peekaboo_trace_ptr);
    uint64_t rvalue = print_back(unprinted_size - insn->size, peekaboo_trace_ptr, insn_idx - 1);
    print_peekaboo_insn(insn, peekaboo_trace_ptr, insn_idx, true, false);
    free_peekaboo_insn(insn);
    return rvalue;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
testq %rdi, %rdi
setg %al
testq %rdx, %rdx
setne %cl
testb %cl, %al
jne 0x39a6
leaq -0x5(%rbx), %rax
cmpq $0x2, %rax
pushq $0x1
popq %r15
cmovgeq %rax, %r15
cmpq %rbx, %r15
ja 0x39ee
movq %r15, %rdi
movq %r14, %rsi
callq 0x5074
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x366e
movq %r12, %rdi
callq 0x52ab
incq %r15
jmp 0x3973
movq %rdi, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5074
movq %rax, %r12
subq 0x8(%rax), %r15
leaq -0x1(%rbx), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3945
movq %rax, %r15
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x366e
movq %r12, %rdi
callq 0x52ab
movq %r15, %rax
jmp 0x39f4
incq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: append2pattern_list
int append2pattern_list(cache_linked_list_t *pattern_ptr, const uint8_t *buffer, const unsigned int buffer_size)
{
    // Empty buffer, directly return
    if (buffer_size == 0) return 0;

    insn_rawbyte_node_t *new_node = malloc(sizeof(insn_rawbyte_node_t));
    if (!new_node) PEEKABOO_DIE("Failed to malloc.");
    new_node->succ = NULL;
    
    if (pattern_ptr->head == NULL)
    {
        pattern_ptr->head = new_node;
    }

    // Update tail and length
    insn_rawbyte_node_t *curr_tail_node = pattern_ptr->tail;
    if (curr_tail_node != NULL)
    {
        curr_tail_node->succ = new_node;
    }
    new_node->prec = curr_tail_node;
    pattern_ptr->tail = new_node;
    pattern_ptr->length += 1;

    new_node->bytes = malloc((buffer_size/2+1)*sizeof(uint16_t));
    if(!new_node->bytes) PEEKABOO_DIE("Failed to malloc.");
    new_node->size = hex_string_to_uint16_arrary(new_node->bytes, buffer);
    if (new_node->size <= 0) return -1; 

    // Find if abitrary
    size_t idx;
    new_node->is_arbitrary = false;
    for (idx=0; idx<new_node->size; idx++)
    {
        if (new_node->bytes[idx] == 0x100*16+0x100) // Matched "**"
        {
            new_node->is_arbitrary = true;
            new_node->size = 0;
            free(new_node->bytes);
            new_node->bytes = NULL;
            break;
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %edx, %edx
je 0x3ab9
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %r12
pushq $0x28
popq %rdi
callq 0x31b0
testq %rax, %rax
je 0x3acb
movq %rax, %rbx
andq $0x0, 0x20(%rax)
cmpq $0x0, (%r12)
jne 0x3a3d
movq %rbx, (%r12)
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x3a4b
movq %rbx, 0x20(%rax)
movq %rax, 0x18(%rbx)
movq %rbx, 0x8(%r12)
incq 0x10(%r12)
andl $-0x2, %r15d
addq $0x2, %r15
movq %r15, %rdi
callq 0x31b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x3acb
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x33fc
movl %eax, 0x10(%rbx)
testl %eax, %eax
jle 0x3abd
movb $0x0, (%rbx)
movl %eax, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rbp
cmpq %rcx, %rax
je 0x3ac0
cmpw $0x1100, (%r15,%rcx,2)  # imm = 0x1100
leaq 0x1(%rcx), %rcx
jne 0x3a91
movb $0x1, (%rbx)
andl $0x0, 0x10(%rbx)
movq %r15, %rdi
callq 0x3030
andq $0x0, 0x8(%rbx)
jmp 0x3ac0
xorl %ebp, %ebp
jmp 0x3ac0
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7526(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x2712(%rip), %rdi      # 0x61ee
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x3230
pushq $0x1
popq %rdi
callq 0x3220
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: free_dulinked_list
void free_dulinked_list(cache_linked_list_t* pattern)
{
    if (pattern == NULL) return;
    uint32_t idx;
    insn_rawbyte_node_t *this_node = pattern->head;
    for (idx=0; idx<pattern->length; idx++)
    {
        insn_rawbyte_node_t *next_node = this_node->succ;
        free_insn_rawbyte_node(this_node);
        this_node = next_node;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x3c65
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
xorl %ebp, %ebp
movl %ebp, %eax
cmpq %rax, 0x10(%rbx)
jbe 0x3c61
movq 0x20(%rdi), %r14
callq 0x34a0
incl %ebp
movq %r14, %rdi
jmp 0x3c49
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: print_usage
void print_usage(const char* program_name)
{
    fprintf(stderr, "Usage: %s [Options] path_to_trace_dir\n", program_name);
    fprintf(stderr, "Options:\n");
    fprintf(stderr, "  -r               \tPrint register values.\n");
    fprintf(stderr, "  -m               \tPrint memory values.\n");
    fprintf(stderr, "  -y               \tPrint syscalls. Not compatible with -p.\n");
    fprintf(stderr, "  -s <instr id>    \tPrint trace starting from the given id. Below zero for reversed order.\n");
    fprintf(stderr, "  -e <instr id>    \tPrint trace till the given id.\n");
    fprintf(stderr, "  -a <addr>[,size] \tSearch for all accesses to given memory address, for accesses to buffer when size is given.\n");
    fprintf(stderr, "  -p <pattern file>\tSearch for instruction patterns in trace. See pattern.txt for samples. Not compatible with -c.\n");
    fprintf(stderr, "  -h               \tPrint this help.\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rdx
movq 0x72a0(%rip), %r14      # 0xaff8
movq (%r14), %rdi
leaq 0x2597(%rip), %rsi      # 0x62f9
xorl %eax, %eax
callq 0x3160
movq (%r14), %rcx
leaq 0x25ad(%rip), %rdi      # 0x6320
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x259f(%rip), %rdi      # 0x632a
pushq $0x2b
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x25b6(%rip), %rdi      # 0x6356
pushq $0x29
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x25cb(%rip), %rdi      # 0x6380
pushq $0x3c
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x25f3(%rip), %rdi      # 0x63bd
pushq $0x5b
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x263a(%rip), %rdi      # 0x6419
pushq $0x33
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x2659(%rip), %rdi      # 0x644d
pushq $0x70
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x26b5(%rip), %rdi      # 0x64be
pushq $0x73
popq %rsi
movq %rbx, %rdx
callq 0x3230
movq (%r14), %rcx
leaq 0x2714(%rip), %rdi      # 0x6532
pushq $0x25
popq %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3230
// File: /workspace/github_c_makefile_star2_O2/melynx[P]peekaboo/read_trace.c
// Function: append2macthed_list
void append2macthed_list(matched_list_node_t **list_header, const uint64_t addr)
{

    if (*list_header == NULL)
    {
        *list_header = malloc(sizeof(matched_list_node_t));
        if (!*list_header) PEEKABOO_DIE("Malloc failed.");
        (*list_header)->addr = addr;
        (*list_header)->cnt = 1;
        (*list_header)->succ = NULL;
    }
    else
    {
        matched_list_node_t *prev_node, *node = *list_header;
        while (node)
        {
            if (node->addr == addr)
            {
                node->cnt++;
                break;
            }
            prev_node = node;
            node = prev_node->succ;
        }
        if (node == NULL)
        {
            node = malloc(sizeof(matched_list_node_t));
            if (!node) PEEKABOO_DIE("Malloc failed.");
            node->addr = addr;
            node->cnt = 1;
            node->succ = NULL;
            prev_node->succ = node;
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x3e52
testq %rax, %rax
je 0x3e77
cmpq %rbx, 0x8(%rax)
je 0x3e99
movq %rax, %r14
movq (%rax), %rax
jmp 0x3e3f
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x31b0
movq %rax, (%r14)
testq %rax, %rax
je 0x3ea5
movq %rbx, 0x8(%rax)
movq $0x1, 0x10(%rax)
andq $0x0, (%rax)
jmp 0x3e9d
pushq $0x18
popq %rdi
callq 0x31b0
testq %rax, %rax
je 0x3ea5
movq %rbx, 0x8(%rax)
movq $0x1, 0x10(%rax)
andq $0x0, (%rax)
movq %rax, (%r14)
jmp 0x3e9d
incq 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x714c(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x26a2(%rip), %rdi      # 0x6558
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0x3230
pushq $0x1
popq %rdi
callq 0x3220
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/x264.c
// Function: fillByte(unsigned char*, int, int)
void fillByte(BYTE *src, int dx, int dy)
{
    int j;
    int i;
    for (j = 0; j < dy; j++)
    {
        for ( i = 0; i < dx; i++)
        {
            src[j * dx + i]= 0;
        }

    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
testl %esi, %esi
movl $0x0, %ecx
cmovgl %esi, %ecx
movslq %esi, %rsi
testl %edx, %edx
cmovlel %eax, %edx
cmpq %rdx, %rax
je 0x2323
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x231b
movb $0x0, (%rdi,%r8)
incq %r8
jmp 0x230c
incq %rax
addq %rsi, %rdi
jmp 0x2304
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/core/cabac.c
// Function: x264_cabac_context_init(x264_cabac_t*, int, int, int)
void x264_cabac_context_init( x264_cabac_t *cb, int i_slice_type, int i_qp, int i_model )
{
    const int (*cabac_context_init)[399][2];
    int i;

    if( i_slice_type == SLICE_TYPE_I )
    {
        cabac_context_init = &x264_cabac_context_init_I;
    }
    else
    {
        cabac_context_init = &x264_cabac_context_init_PB[i_model];
    }

    for( i = 0; i < 399; i++ )
    {
        int i_pre_state;

        i_pre_state = x264_clip3( (((*cabac_context_init)[i][0] * i_qp) >> 4) + (*cabac_context_init)[i][1], 1, 126 );
        if( i_pre_state <= 63 )
        {
            cb->ctxstate[i].i_state = 63 - i_pre_state;
            cb->ctxstate[i].i_mps = 0;
        }
        else
        {
            cb->ctxstate[i].i_state = i_pre_state - 64;
            cb->ctxstate[i].i_mps = 1;
        }
        cb->ctxstate[i].i_count = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movslq %ecx, %rax
imulq $0xc78, %rax, %rax      # imm = 0xC78
leaq 0x1552c(%rip), %rcx     # 0x181c0
addq %rax, %rcx
cmpl $0x2, %esi
leaq 0x1489f(%rip), %rax     # 0x17540
cmovneq %rcx, %rax
addq $0x20, %rdi
xorl %ecx, %ecx
movl $0x7e, %esi
movl $0x1, %r8d
movl $0x3f, %r9d
cmpq $0x18f, %rcx            # imm = 0x18F
je 0x2d18
movl (%rax,%rcx,8), %r10d
imull %edx, %r10d
sarl $0x4, %r10d
addl 0x4(%rax,%rcx,8), %r10d
movl %r10d, %r11d
cmpl $0x7e, %r10d
jl 0x2ce2
movl %esi, %r11d
cmpl $0x2, %r11d
jge 0x2ceb
movl %r8d, %r11d
movl %r9d, %ebx
subl %r11d, %ebx
addl $-0x40, %r11d
xorl %r14d, %r14d
cmpl $0x40, %r10d
setge %r14b
cmovll %ebx, %r11d
movl %r11d, -0x8(%rdi)
movl %r14d, -0x4(%rdi)
andl $0x0, (%rdi)
incq %rcx
addq $0xc, %rdi
jmp 0x2cbc
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/core/cabac.c
// Function: x264_cabac_decode_decision(x264_cabac_t*, int)
int  x264_cabac_decode_decision( x264_cabac_t *cb, int i_ctx )
{
    int i_state = cb->ctxstate[i_ctx].i_state;
    int i_mps   = cb->ctxstate[i_ctx].i_mps;

    int i_range_lps = x264_cabac_range_lps[i_state][(cb->i_range>>6)&0x03];

    int val;

    cb->i_range -= i_range_lps;

    if( cb->i_low >= cb->i_range )
    {
        val = 1 - i_mps;

        cb->i_low -= cb->i_range;
        cb->i_range= i_range_lps;

        if( i_state == 0 )
        {
            cb->ctxstate[i_ctx].i_mps = 1 - i_mps;
        }
        cb->ctxstate[i_ctx].i_state = x264_transition_lps[i_state];
    }
    else
    {
        val = i_mps;

        cb->ctxstate[i_ctx].i_state = x264_transition_mps[i_state];
    }

    x264_cabac_decode_renorm( cb );

    return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movslq %esi, %rax
imulq $0xc, %rax, %rax
addq %rdi, %rax
addq $0x18, %rax
movslq (%rax), %rcx
movl 0x4(%rax), %ebx
movl 0x12cc(%rdi), %edx
movl 0x12d0(%rdi), %esi
movq %rcx, %r8
shlq $0x4, %r8
leaq 0x1793c(%rip), %r9      # 0x1a730
addq %r8, %r9
movl %esi, %r8d
shrl $0x4, %r8d
andl $0xc, %r8d
movl (%r8,%r9), %r8d
subl %r8d, %esi
movl %esi, 0x12d0(%rdi)
subl %esi, %edx
jge 0x2e1c
leaq 0x17e16(%rip), %rdx     # 0x1ac30
jmp 0x2e3e
pushq $0x1
popq %rsi
subl %ebx, %esi
movl %edx, 0x12cc(%rdi)
movl %r8d, 0x12d0(%rdi)
leaq 0x17cfb(%rip), %rdx     # 0x1ab30
testl %ecx, %ecx
jne 0x2e3c
movl %esi, 0x4(%rax)
movl %esi, %ebx
movl (%rdx,%rcx,4), %ecx
movl %ecx, (%rax)
callq 0x2e51
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq