LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_cut
static BTreeNode *bt_node_cut(BTreeNode *node, uint64_t *split_key)
{
    BTree        *tree;
    uint64_t      type;
    BTreeNode    *new;
    uint64_t      min_keys, max_keys;

    tree = node->tree;
    min_keys = bt_get_min_keys(tree);
    max_keys = bt_get_max_keys(tree);

    assert(bt_node_get_key_count(node) == max_keys + 1);

    if(bt_node_get_type(node) & BT_NODE_TYPE_LEAF)
    {
        type = BT_NODE_TYPE_LEAF;
    }
    else
    {
        type = BT_NODE_TYPE_INTERNAL;
    }

    new = bt_node_new_empty(tree, type);
    *split_key = bt_node_get_key(node, min_keys);
    // not link internal node in same layer?
    //if(bt_node_get_type(node) & BT_NODE_TYPE_LEAF)
    //{
        bt_node_link_sibling(new, bt_node_get_right_sibling(node));
        bt_node_link_sibling(node, new);
    //}
    bt_node_move_half_content(new, node, min_keys);
 

    bt_node_set_type(node, type);
    return new;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2e20
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x29a0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1c10
movq -0x38(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x2b1d
jmp 0x2b3c
leaq 0x1a1b(%rip), %rdi      # 0x453f
leaq 0x14fa(%rip), %rsi      # 0x4025
movl $0x2f3, %edx            # imm = 0x2F3
leaq 0x1a34(%rip), %rcx      # 0x456b
callq 0x1090
movq -0x8(%rbp), %rdi
callq 0x12f0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2b57
movq $0x4, -0x20(%rbp)
jmp 0x2b5f
movq $0x2, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2e40
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2530
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1cd0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x2ee0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2ee0
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x2f40
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x1330
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_new_root_with_one_key
static BTreeNode *bt_node_new_root_with_one_key(BTree *bt, uint64_t split_key, BTreeNode *left, BTreeNode *right)
{
    BTreeNode    *new_root;

    new_root = bt_node_new_empty(bt, BT_NODE_TYPE_ROOT);

    bt_node_set_key_and_link(new_root, 0, split_key, left, right);
    bt_node_set_key_count(new_root , 1);

    bt->root = new_root;
    bt_set_root_blkid(bt, new_root->blkid);

    return new_root;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x2e40
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
xorl %eax, %eax
movl %eax, %esi
callq 0x3430
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x3330
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x3490
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_none_leaf_insert
static void bt_node_none_leaf_insert(BTree * bt, BTreeNode *parent, BTreeNode *left, BTreeNode *new, uint64_t key)
{
    uint64_t index;

    assert(parent);
    assert(!(bt_node_get_type(parent) & BT_NODE_TYPE_LEAF));
    assert(bt_node_get_key_count(parent) <= bt_get_max_keys(bt) + 1);

    index = bt_node_get_child_index(parent, left);
    bt_node_none_leaf_make_space(parent, index);
    bt_node_set_key_and_link(parent, index, key, left, new);
    bt_node_set_key_count(parent, bt_node_get_key_count(parent) + 1);
    if (bt_node_get_key_count(parent) > bt_get_max_keys(bt))
        bt_node_none_leaf_split(bt, parent);

    bt_node_marked_dirty(left);
    bt_node_marked_dirty(new);
    bt_node_marked_dirty(parent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2c85
jmp 0x2ca4
leaq 0x19d1(%rip), %rdi      # 0x465d
leaq 0x1392(%rip), %rsi      # 0x4025
movl $0x32f, %edx            # imm = 0x32F
leaq 0x19c5(%rip), %rcx      # 0x4664
callq 0x1090
movq -0x10(%rbp), %rdi
callq 0x12f0
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x2cb7
jmp 0x2cd6
leaq 0x19fe(%rip), %rdi      # 0x46bc
leaq 0x1360(%rip), %rsi      # 0x4025
movl $0x330, %edx            # imm = 0x330
leaq 0x1993(%rip), %rcx      # 0x4664
callq 0x1090
movq -0x10(%rbp), %rdi
callq 0x1c10
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x29a0
movq %rax, %rcx
movq -0x38(%rbp), %rax
addq $0x1, %rcx
cmpq %rcx, %rax
ja 0x2cfe
jmp 0x2d1d
leaq 0x19e7(%rip), %rdi      # 0x46ec
leaq 0x1319(%rip), %rsi      # 0x4025
movl $0x331, %edx            # imm = 0x331
leaq 0x194c(%rip), %rcx      # 0x4664
callq 0x1090
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3560
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3620
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x3430
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1c10
movq -0x48(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x3330
movq -0x10(%rbp), %rdi
callq 0x1c10
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x29a0
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jbe 0x2da4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3650
movq -0x18(%rbp), %rdi
callq 0x1380
movq -0x20(%rbp), %rdi
callq 0x1380
movq -0x10(%rbp), %rdi
callq 0x1380
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_get_parent
static BTreeNode *bt_node_get_parent(BTreeNode *node)
{
    uint64_t blkid;

    blkid = bt_node_blk_get_parent_blkid(node->blk);
    if (blkid == 0)
        return NULL;
        
    return bt_get_node(node->tree, blkid);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3750
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2dfe
movq $0x0, -0x8(%rbp)
jmp 0x2e12
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3770
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_new_empty
static BTreeNode *bt_node_new_empty(BTree *tree, uint64_t type)
{
    BTreeNode    *node;
    BTreeNodeBlk *blk;

    blk = bt_node_blk_new_empty(bt_get_blksize(tree), type);
    node = (BTreeNode *)malloc(sizeof(BTreeNode));
    node->blkid = bt_next_blkid(tree);
    node->blk = blk;
    node->tree = tree;
    node->state = NULL;
    bt_node_marked_new(node); // init state and chain

    bt_set_node(tree, node->blkid, node);
    
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2810
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x3030
movq %rax, -0x20(%rbp)
movl $0x30, %edi
callq 0x10d0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x30b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rdi
callq 0x30d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x3140
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_link_sibling
static void bt_node_link_sibling(BTreeNode *left, BTreeNode *right)
{
    if (!left || !right)
        return;

    bt_node_blk_link_sibling(left->blk, right->blk, left->blkid, right->blkid);

    bt_node_marked_dirty(left);
    bt_node_marked_dirty(right);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2efe
cmpq $0x0, -0x10(%rbp)
jne 0x2f00
jmp 0x2f37
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
callq 0x3220
movq -0x8(%rbp), %rdi
callq 0x1380
movq -0x10(%rbp), %rdi
callq 0x1380
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_move_half_content
static void bt_node_move_half_content(BTreeNode* new, BTreeNode *node, uint64_t min_keys)
{
    uint64_t      i;
    uint64_t      start;

    start = min_keys + 1;

    // copy pairs
    bt_node_blk_copy_half_pairs(new->blk, node->blk, start, min_keys);
    
    // if the node is not LEAF, link parent - child
    if(!(bt_node_get_type(node) & BT_NODE_TYPE_LEAF))
    {
        // copy one more.
        for( i = 0; i <= min_keys ; i ++ )
        {
            bt_node_link_parent_child(new,bt_node_get_child(node, i+start), i);
        }
    }

    // set key counts
    bt_node_set_key_count(new, min_keys);
    if(bt_node_get_type(node) & BT_NODE_TYPE_LEAF)
    {
        bt_node_set_key_count(node, min_keys + 1);   
    }
    else
    {
        bt_node_set_key_count(node, min_keys);   
    }

    bt_node_marked_dirty(node);
    bt_node_marked_dirty(new);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x3250
movq -0x10(%rbp), %rdi
callq 0x12f0
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x2fd9
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x2fd7
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq -0x28(%rbp), %rsi
callq 0x24c0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x32d0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x2f96
jmp 0x2fd9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3330
movq -0x10(%rbp), %rdi
callq 0x12f0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x300a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x3330
jmp 0x3017
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3330
movq -0x10(%rbp), %rdi
callq 0x1380
movq -0x8(%rbp), %rdi
callq 0x1380
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_blk_new_empty
static BTreeNodeBlk *bt_node_blk_new_empty(uint64_t blk_size, uint64_t type)
{
    BTreeNodeBlk *blk;
    uint64_t      mem_size;
    mem_size = blk_size + sizeof(uint64_t) * 2;
    blk =  (BTreeNodeBlk *)malloc(mem_size);
    // prevent valgrind complain Syscall param write(buf) points to uninitialised byte(s)
    memset(blk, 0, blk_size);
    blk->type = type;
    blk->parent_blkid = 0;
    blk->left_sibling_blkid = 0;
    blk->right_sibling_blkid = 0;
    blk->key_counts = 0;

    return blk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rdx
xorl %esi, %esi
callq 0x10a0
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_set_node
static void bt_set_node(BTree *bt, uint64_t blkid, BTreeNode *node)
{

    uint64_t max_blkid;
    max_blkid = bt_get_max_blkid(bt);

    assert(blkid <= max_blkid);


    // TODO....  only realloc if really needed
    if(blkid == max_blkid)
        bt->blkid_to_node = (BTreeNode **)realloc(bt->blkid_to_node, sizeof(BTreeNode *) * (max_blkid + 1));
    bt->blkid_to_node[blkid] = node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21c0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
ja 0x316d
jmp 0x318c
leaq 0x1460(%rip), %rdi      # 0x45d4
leaq 0xeaa(%rip), %rsi       # 0x4025
movl $0x403, %edx            # imm = 0x403
leaq 0x1460(%rip), %rcx      # 0x45e7
callq 0x1090
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x31ba
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x10e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_blk_copy_half_pairs
static void bt_node_blk_copy_half_pairs(BTreeNodeBlk *dst, BTreeNodeBlk *src, uint64_t start, uint64_t n)
{
    uint64_t content_offset;

    //assert(start + n <= max_keys);
    content_offset = sizeof(BTreeNodeBlk);
    n = n * 2 * sizeof(uint64_t);
    if (!(dst->type & BT_NODE_TYPE_LEAF))
        n += sizeof(uint64_t);
    memcpy((char*) dst + content_offset , (char *)src + content_offset + sizeof(int64_t) * (start * 2), n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x28, -0x28(%rbp)
movq -0x20(%rbp), %rax
shlq %rax
shlq $0x3, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0x329c
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x10c0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_get_child_index
static uint64_t bt_node_get_child_index(BTreeNode *node, BTreeNode *child)
{
    uint64_t index;

    assert(!(bt_node_get_type(node) & BT_NODE_TYPE_LEAF));
    for (index = 0; index <= bt_node_get_key_count(node); index++)
    {
        if (bt_node_get_child(node, index) == child)
            return index;
    }
    assert(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x12f0
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x3583
jmp 0x35a2
leaq 0x119b(%rip), %rdi      # 0x4725
leaq 0xa94(%rip), %rsi       # 0x4025
movl $0x2ad, %edx            # imm = 0x2AD
leaq 0x11b6(%rip), %rcx      # 0x4753
callq 0x1090
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1c10
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
ja 0x35f4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x24c0
cmpq -0x10(%rbp), %rax
jne 0x35e4
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
jmp 0x35e6
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x35aa
leaq 0x1193(%rip), %rdi      # 0x478e
leaq 0xa23(%rip), %rsi       # 0x4025
movl $0x2b3, %edx            # imm = 0x2B3
leaq 0x1145(%rip), %rcx      # 0x4753
callq 0x1090
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_none_leaf_split
static void bt_node_none_leaf_split(BTree *bt, BTreeNode *node)
{
    uint64_t      split_key;
    uint64_t      type;
    BTreeNode    *new;

    assert(!(bt_node_get_type(node) & BT_NODE_TYPE_LEAF));
    assert(bt_node_get_key_count(node) == bt_get_max_keys(bt) + 1);

    type = bt_node_get_type(node);
    new = bt_node_cut(node, &split_key);

    if (type & BT_NODE_TYPE_ROOT)
    {
        // Root(none leaft) split
        bt_node_new_root_with_one_key(bt, split_key, node, new);
    }
    else
    {   
        bt_node_none_leaf_insert(bt, bt_node_get_parent(node), node, new, split_key);
        //bt_node_none_leaf_insert(bt, bt_node_get_parent(node), node, new, split_key);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12f0
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x3673
jmp 0x3692
leaq 0x10ab(%rip), %rdi      # 0x4725
leaq 0x9a4(%rip), %rsi       # 0x4025
movl $0x314, %edx            # imm = 0x314
leaq 0x1103(%rip), %rcx      # 0x4790
callq 0x1090
movq -0x10(%rbp), %rdi
callq 0x1c10
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x29a0
movq %rax, %rcx
movq -0x30(%rbp), %rax
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x36ba
jmp 0x36d9
leaq 0x1102(%rip), %rdi      # 0x47c3
leaq 0x95d(%rip), %rsi       # 0x4025
movl $0x315, %edx            # imm = 0x315
leaq 0x10bc(%rip), %rcx      # 0x4790
callq 0x1090
movq -0x10(%rbp), %rdi
callq 0x12f0
cltq
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2ad0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x371e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x2be0
jmp 0x3747
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2dd0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %r8
callq 0x2c60
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_get_node
static BTreeNode *bt_get_node(BTree *bt, uint64_t blkid)
{
    uint64_t max_blkid;
    max_blkid = bt_get_max_blkid(bt);

    assert(blkid <= max_blkid);

    // TODO....  only realloc if really needed
    if (bt->blkid_to_node[blkid] == NULL)
        bt_node_new_from_file(bt, blkid);

    return bt->blkid_to_node[blkid];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x3799
jmp 0x37b8
leaq 0xe34(%rip), %rdi       # 0x45d4
leaq 0x87e(%rip), %rsi       # 0x4025
movl $0x411, %edx            # imm = 0x411
leaq 0x1047(%rip), %rcx      # 0x47fa
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x37d8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x37f0
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_new_from_file
static BTreeNode *bt_node_new_from_file(BTree *bt, uint64_t blkid)
{
    BTreeNode    *node;
    BTreeNodeBlk *blk;
    blk =  bt_node_blk_new_from_file(bt, blkid);
    node = (BTreeNode *)malloc(sizeof(BTreeNode));
    node->blk = blk;
    node->blkid = blkid;
    node->tree = bt;
    node->state = NULL;     // clean node.

    bt_set_node(bt, blkid, node);

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3870
movq %rax, -0x20(%rbp)
movl $0x30, %edi
callq 0x10d0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3140
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_blk_new_from_file
static BTreeNodeBlk *bt_node_blk_new_from_file(BTree *bt, uint64_t blkid)
{
    BTreeNodeBlk *blk;
    uint64_t      blksize;

    blksize = bt_get_blksize(bt);
    blk =  (BTreeNodeBlk *)malloc(blksize + sizeof(uint64_t) * 2);
    memset(blk, 0, blksize);
    bt_load_blk(bt, blk, blkid);
    return blk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2810
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x10d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %esi, %esi
callq 0x10a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x38d0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_load_blk
static void bt_load_blk(BTree *bt, void *dst, uint64_t blkid)
{
    ssize_t   rtv;
    uint64_t  blksize;

    // when load Meta block, blksize is unknown
    if (blkid == 0)
        blksize = sizeof(BTreeMetaBlk);
    else
        blksize = bt_get_blksize(bt);
    
    bt_open_file(bt);
    rtv = lseek(bt->file_fd, blkid * blksize, SEEK_SET);
    assert(rtv == blkid * blksize);
    rtv = read(bt->file_fd, dst, blksize);
    assert(rtv == blksize);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x38f5
movq $0x30, -0x28(%rbp)
jmp 0x3902
movq -0x8(%rbp), %rdi
callq 0x2810
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2830
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x18(%rbp), %rsi
imulq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x1080
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
imulq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jne 0x393a
jmp 0x3959
leaq 0xab6(%rip), %rdi       # 0x43f7
leaq 0x6dd(%rip), %rsi       # 0x4025
movl $0x430, %edx            # imm = 0x430
leaq 0xed0(%rip), %rcx       # 0x4824
callq 0x1090
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x10b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x397d
jmp 0x399c
leaq 0xaaf(%rip), %rdi       # 0x4433
leaq 0x69a(%rip), %rsi       # 0x4025
movl $0x432, %edx            # imm = 0x432
leaq 0xe8d(%rip), %rcx       # 0x4824
callq 0x1090
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_values_new
static BTreeValues *bt_values_new()
{
    BTreeValues *values;
    values = (BTreeValues *)malloc(sizeof(BTreeValues));

    values->counts = 0;
    values->values = NULL;

    return values;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x10, %edi
callq 0x10d0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_meta_new_from_file
static BTreeMeta *bt_meta_new_from_file(BTree *bt)
{
    BTreeMeta      *meta;
    BTreeMetaBlk   *blk;

    blk = bt_meta_blk_new_from_file(bt);
    meta = (BTreeMeta *)malloc(sizeof(BTreeMeta));
    meta->dirty = 0;
    meta->blk = blk;

    return meta;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3ad0
movq %rax, -0x18(%rbp)
movl $0x10, %edi
callq 0x10d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_meta_blk_new_from_file
static BTreeMetaBlk *bt_meta_blk_new_from_file(BTree *bt)
{
    BTreeMetaBlk   *blk;

    blk = (BTreeMetaBlk *)malloc(sizeof(BTreeMetaBlk));
    bt_load_blk(bt, blk, 0);    // metablk has blkid 0
    assert(blk->magic == BTREE_FILE_MAGIC);   // bad tree file
    blk = (BTreeMetaBlk *)realloc(blk, blk->blk_size);

    memset((char *)blk + sizeof(BTreeMetaBlk), 0, blk->blk_size - sizeof(BTreeMetaBlk));

    return blk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x30, %edi
callq 0x10d0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x38d0
movq -0x10(%rbp), %rax
movl $0xbbbbbbbb, %ecx       # imm = 0xBBBBBBBB
cmpq %rcx, (%rax)
jne 0x3b0b
jmp 0x3b2a
leaq 0xd3e(%rip), %rdi       # 0x4850
leaq 0x50c(%rip), %rsi       # 0x4025
movl $0xc3, %edx
leaq 0xd4a(%rip), %rcx       # 0x486f
callq 0x1090
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
subq $0x30, %rdx
xorl %esi, %esi
callq 0x10a0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_meta_new_empty
static BTreeMeta *bt_meta_new_empty(uint64_t order, uint64_t blksize)
{
    BTreeMeta    *meta;
    BTreeMetaBlk *blk;

    blk = bt_meta_blk_new_empty(order, blksize);
    meta = (BTreeMeta *)malloc(sizeof(BTreeMeta));
    meta->dirty = 1;
    meta->blk = blk;

    return meta;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3c00
movq %rax, -0x20(%rbp)
movl $0x10, %edi
callq 0x10d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_meta_blk_new_empty
static BTreeMetaBlk *bt_meta_blk_new_empty(uint64_t order, uint64_t blksize)
{
    BTreeMetaBlk * blk;
    
    blk = (BTreeMetaBlk *)malloc(blksize);
    // prevent valgrind complain Syscall param write(buf) points to uninitialised byte(s)
    memset(blk, 0, blksize);    
    blk->magic = BTREE_FILE_MAGIC;
    blk->order = order;
    blk->blk_size = blksize;
    blk->blk_counts = 1;
    blk->max_blkid = 0;
    blk->root_blkid = 1;
    return blk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
xorl %esi, %esi
callq 0x10a0
movq -0x18(%rbp), %rax
movl $0xbbbbbbbb, %ecx       # imm = 0xBBBBBBBB
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x1, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x1, 0x18(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree.c
// Function: bt_node_blk_get_child_blkid
static uint64_t bt_node_blk_get_child_blkid(BTreeNodeBlk *blk, uint64_t index)
{
    assert(!(blk->type & BT_NODE_TYPE_LEAF));
    assert(index <= blk->key_counts);
    return *(uint64_t *)
            ((char *)blk + sizeof(BTreeNodeBlk) + sizeof(uint64_t) * (index * 2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0x3d03
jmp 0x3d22
leaq 0x2fa(%rip), %rdi       # 0x4004
leaq 0x314(%rip), %rsi       # 0x4025
movl $0x16f, %edx            # imm = 0x16F
leaq 0xc03(%rip), %rcx       # 0x4920
callq 0x1090
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
ja 0x3d32
jmp 0x3d51
leaq 0xc26(%rip), %rdi       # 0x495f
leaq 0x2e5(%rip), %rsi       # 0x4025
movl $0x170, %edx            # imm = 0x170
leaq 0xbd4(%rip), %rcx       # 0x4920
callq 0x1090
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
movq 0x28(%rax,%rcx), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/btree_test1.c
// Function: main
int main()
{
    uint64_t       k, n;
    BTree         *bt;
    BTreeOpenFlag  flag;

    flag.create_if_missing = 1;
    flag.error_if_exist = 0;
    flag.file = "./test.bt";
    flag.order = 3;

    bt = bt_open(flag);
    
//    printf("Tree order: %lu\n", flag.order);
//    printf("Empty tree:\n");
//    bt_print(bt);

    printf("插入10 个随机的 key/value pair...\n");
    for(k=0;k<10;k++)
    {
        n = rand() % 100;
        bt_insert(bt, n, n);
        printf("\tinsert (%ld, %ld)\n", n, n);
    }
    printf("Insert done.\n");
   
    printf("Tree:");
    bt_print(bt);

    printf("Search done.\n");
    bt_close(bt);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl $0x1, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
leaq 0xbc4(%rip), %rax       # 0x4978
movq %rax, -0x38(%rbp)
movq $0x3, -0x30(%rbp)
leaq -0x38(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1d50
movq %rax, -0x20(%rbp)
leaq 0xb95(%rip), %rdi       # 0x4982
movb $0x0, %al
callq 0x1070
movq $0x0, -0x10(%rbp)
cmpq $0xa, -0x10(%rbp)
jae 0x3e4c
callq 0x1120
movl $0x64, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1a50
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0xb74(%rip), %rdi       # 0x49ab
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3dfc
leaq 0xb6c(%rip), %rdi       # 0x49bf
movb $0x0, %al
callq 0x1070
leaq 0xb6c(%rip), %rdi       # 0x49cd
movb $0x0, %al
callq 0x1070
movq -0x20(%rbp), %rdi
callq 0x2590
leaq 0xb5b(%rip), %rdi       # 0x49d3
movb $0x0, %al
callq 0x1070
movq -0x20(%rbp), %rdi
callq 0x2110
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/main.c
// Function: quit
void quit()
{
	clrtoeol();
	refresh();
	getch();
	endwin();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x14c75(%rip), %rax     # 0x1cff0
movq (%rax), %rdi
callq 0x2150
movq 0x14c66(%rip), %rax     # 0x1cff0
movq (%rax), %rdi
callq 0x2100
movq 0x14c57(%rip), %rax     # 0x1cff0
movq (%rax), %rdi
callq 0x21f0
callq 0x2140
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/ennemy.c
// Function: testEnnemyOnPos
int testEnnemyOnPos(Ennemy ennemies[], int x, int y, int nbrEnnemies)
{
	int ret = -1;
	int i = 0;

	for(i = 0; i < nbrEnnemies; i++)
	{
		if(ennemies[i].x == x && ennemies[i].y == y && ennemies[i].life > 0)
		{
			ret = i;
			break;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x8a95
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x8a88
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x10(%rbp), %eax
jne 0x8a88
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jle 0x8a88
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x8a95
jmp 0x8a8a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8a36
movl -0x18(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/ennemy.c
// Function: repair
void repair(Ennemy ennemies[], int indice, int *colorPrint, char messagePrint[])
{
	*colorPrint = 197; // RED LIKE BLOOOOOOOD
	char *body[] = {"HEAD","CORE","ARMS","LEGS"};
	int heal = rand()%3+1+ennemies[indice].agility/3;
	snprintf(messagePrint,100,"%s IS REPARING HIS %s (+%d LP)",ennemies[indice].name,body[rand()%4],heal);
	ennemies[indice].life += heal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl $0xc5, (%rax)
movq 0x119a8(%rip), %rax     # 0x1cbb0
movq %rax, -0x40(%rbp)
movq 0x119a5(%rip), %rax     # 0x1cbb8
movq %rax, -0x38(%rbp)
movq 0x119a2(%rip), %rax     # 0x1cbc0
movq %rax, -0x30(%rbp)
movq 0x1199f(%rip), %rax     # 0x1cbc8
movq %rax, -0x28(%rbp)
callq 0x21e0
movl $0x3, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x5c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x21e0
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rcx
movl $0x4, %esi
cltd
idivl %esi
movslq %edx, %rax
movq -0x40(%rbp,%rax,8), %r8
movl -0x44(%rbp), %r9d
movl $0x64, %esi
leaq 0xdc93(%rip), %rdx      # 0x18f43
movb $0x0, %al
callq 0x2050
movl -0x44(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/interface.c
// Function: printBar
void printBar(WINDOW *win, char name[15],int attribute, int x, int y, int colorpair)
{
	unsigned int i = 0;
	mvwprintw(win,x,y,"%s: ",name);

	if(attribute > 0)
	{
		wattron(win,COLOR_PAIR(colorpair));
		for(i = 14+strlen(name); i >= strlen(name)+4; i--)
		{
			// 1 case = 10 pv
			if((i-(strlen(name)+4))*10 <= attribute)
			{
				mvwprintw(win,x,i," ");
			}
		}
		wattroff(win,COLOR_PAIR(colorpair));

		wattron(win,A_BOLD);
		mvwprintw(win,x,strlen(name)+16,"(%d)  ",attribute);
		wattroff(win,A_BOLD);
	}
	else
	{
		wattron(win,A_BOLD);
		mvwprintw(win,x,strlen(name)+16,"(0)  ");
		wattroff(win,A_BOLD);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %r8
leaq 0xcd4c(%rip), %rcx      # 0x19066
movb $0x0, %al
callq 0x2070
cmpl $0x0, -0x14(%rbp)
jle 0xc439
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x10(%rbp), %rdi
callq 0x20f0
addq $0xe, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
addq $0x4, %rcx
cmpq %rcx, %rax
jb 0xc3c4
movl -0x24(%rbp), %eax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20f0
movq %rax, %rcx
movq -0x38(%rbp), %rax
addq $0x4, %rcx
subq %rcx, %rax
imulq $0xa, %rax, %rax
movslq -0x14(%rbp), %rcx
cmpq %rcx, %rax
ja 0xc3b7
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x24(%rbp), %edx
leaq 0xbd36(%rip), %rcx      # 0x180e6
movb $0x0, %al
callq 0x2070
jmp 0xc3b9
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc354
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movq -0x8(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20f0
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %esi
addq $0x10, %rax
movl %eax, %edx
movl -0x14(%rbp), %r8d
leaq 0xcc4d(%rip), %rcx      # 0x1906b
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
jmp 0xc48f
movq -0x8(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20f0
movq -0x58(%rbp), %rdi
movl -0x4c(%rbp), %esi
addq $0x10, %rax
movl %eax, %edx
leaq 0xcbfc(%rip), %rcx      # 0x19072
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/interface.c
// Function: printEnnemy
void printEnnemy(WINDOW *win, Ennemy ennemies[], int nbrEnnemyFloor)
{
	box(win,0,0);
	char *classeEnnemy[] = {"???","DROID","SENTRY","GUARDIAN","GUARDIAN"};
	int i = 0;
	int c = 1;
	mvwprintw(win,1,1,"ENEMIES :");
	for(i = 0; i < nbrEnnemyFloor; i++)
	{
		if(ennemies[i].type > 0 && ennemies[i].seen == 1 && ennemies[i].life > 0)
		{
			wattron(win,A_UNDERLINE);
			mvwprintw(win,c+2,5,"%s (%s)",ennemies[i].name,classeEnnemy[ennemies[i].type]);
			wattroff(win,A_UNDERLINE);
			printBar(win,"LIFE",ennemies[i].life,c+4,2,249);
			c+=3;
		}
		/*else
		{
			break;
		}*/
	}

	wrefresh(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x2120
leaq -0x40(%rbp), %rdi
leaq 0x10703(%rip), %rsi     # 0x1cbf0
movl $0x28, %edx
callq 0x2200
movl $0x0, -0x44(%rbp)
movl $0x1, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %edx
leaq 0xcb63(%rip), %rcx      # 0x19078
movl %edx, %esi
movb $0x0, %al
callq 0x2070
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xc635
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
jle 0xc625
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, 0xc(%rax)
jne 0xc625
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jle 0xc625
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %esi
addl $0x2, %esi
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movslq 0x20(%rax), %rax
movq -0x40(%rbp,%rax,8), %r9
movl $0x5, %edx
leaq 0xcab3(%rip), %rcx      # 0x19082
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movl -0x48(%rbp), %ecx
addl $0x4, %ecx
leaq 0xc9ec(%rip), %rsi      # 0x18ff7
movl $0x2, %r8d
movl $0xf9, %r9d
callq 0xc2e0
movl -0x48(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x48(%rbp)
jmp 0xc627
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xc525
movq -0x8(%rbp), %rdi
callq 0x2100
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/interface.c
// Function: printWeapon
void printWeapon(WINDOW *win, Weapons weaponHold)
{
	wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
	mvwprintw(win,1,1,"WEAPON :");
	wattron(win,A_UNDERLINE);
	mvwprintw(win,2,(30-strlen(weaponHold.name))/2,"%s",weaponHold.name);
	wattroff(win,A_UNDERLINE);

	if(weaponHold.type > 0)
	{
		printBar(win,"AMMO",weaponHold.state,4,2,247);
		mvwprintw(win,5,2,"RANGE: %d",weaponHold.range);
	}
	else if(weaponHold.indice != 3)
	{
		printBar(win,"STATE",weaponHold.state,4,2,247);
	}

	mvwprintw(win,6,2,"DAMAGES: %d",weaponHold.degat);

	wrefresh(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x7c, %edx
movl $0x2d, %r8d
movl $0x2b, %r9d
movl %edx, %esi
movl %r8d, %ecx
movl $0x2b, (%rsp)
movl $0x2b, 0x8(%rsp)
movl $0x2b, 0x10(%rsp)
callq 0x2120
movq -0x8(%rbp), %rdi
movl $0x1, %edx
leaq 0xc9e0(%rip), %rcx      # 0x1908a
movl %edx, %esi
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq (%rax), %rdi
callq 0x20f0
movq -0x18(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl $0x1e, %ecx
subq %rdx, %rcx
shrq %rcx
movl %ecx, %edx
movq (%rax), %r8
movl $0x2, %esi
leaq 0xca6d(%rip), %rcx      # 0x1916d
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movq -0x10(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jle 0xc771
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movl 0x1c(%rax), %edx
leaq 0xc95e(%rip), %rsi      # 0x19093
movl $0x4, %ecx
movl $0x2, %r8d
movl $0xf7, %r9d
callq 0xc2e0
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movl 0x20(%rax), %r8d
movl $0x5, %esi
movl $0x2, %edx
leaq 0xc930(%rip), %rcx      # 0x19098
movb $0x0, %al
callq 0x2070
jmp 0xc7a5
movq -0x10(%rbp), %rax
cmpl $0x3, 0x2c(%rax)
je 0xc7a3
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movl 0x1c(%rax), %edx
leaq 0xc915(%rip), %rsi      # 0x190a2
movl $0x4, %ecx
movl $0x2, %r8d
movl $0xf7, %r9d
callq 0xc2e0
jmp 0xc7a5
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movl 0x10(%rax), %r8d
movl $0x6, %esi
movl $0x2, %edx
leaq 0xc8e6(%rip), %rcx      # 0x190a8
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
callq 0x2100
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/interface.c
// Function: setMessage
void setMessage(WINDOW *win, char message[], int colorPair)
{
	wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
	wattron(win,A_UNDERLINE);
	mvwprintw(win,1,1,"MESSAGES:");
	wattroff(win,A_UNDERLINE);

	if(colorPair != 0)
	{
		wattron(win,COLOR_PAIR(colorPair));
		mvwprintw(win,2,1,message);
		wattroff(win,COLOR_PAIR(colorPair));	
	}
	else
	{
		mvwprintw(win,2,1,message);
	}

	wrefresh(win);	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0x7c, %edx
movl $0x2d, %r8d
movl $0x2b, %r9d
movl %edx, %esi
movl %r8d, %ecx
movl $0x2b, (%rsp)
movl $0x2b, 0x8(%rsp)
movl $0x2b, 0x10(%rsp)
callq 0x2120
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x8(%rbp), %rdi
movl $0x1, %edx
leaq 0xc0ef(%rip), %rcx      # 0x191ea
movl %edx, %esi
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
cmpl $0x0, -0x14(%rbp)
je 0xd169
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x2, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
jmp 0xd182
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x2, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
callq 0x2100
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/interface.c
// Function: printArmor
void printArmor(WINDOW *win, Armor armor)
{
	wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
	mvwprintw(win,1,1,"ARMOR :");
	wattron(win,A_UNDERLINE);
	mvwprintw(win,2,(30-strlen(armor.name))/2,"%s",armor.name);
	wattroff(win,A_UNDERLINE);

	if(armor.indice != 10)
		printBar(win,"STATE",armor.state,4,2,247);
	
	mvwprintw(win,6,2,"RESISTANCE: %d",armor.resistance);

	wrefresh(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x7c, %edx
movl $0x2d, %r8d
movl $0x2b, %r9d
movl %edx, %esi
movl %r8d, %ecx
movl $0x2b, (%rsp)
movl $0x2b, 0x8(%rsp)
movl $0x2b, 0x10(%rsp)
callq 0x2120
movq -0x8(%rbp), %rdi
movl $0x1, %edx
leaq 0xbffa(%rip), %rcx      # 0x191f4
movl %edx, %esi
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq (%rax), %rdi
callq 0x20f0
movq -0x18(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl $0x1e, %ecx
subq %rdx, %rcx
shrq %rcx
movl %ecx, %edx
movq (%rax), %r8
movl $0x2, %esi
leaq 0xbf1d(%rip), %rcx      # 0x1916d
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movq -0x10(%rbp), %rax
cmpl $0xa, 0x20(%rax)
je 0xd29b
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movl 0x18(%rax), %edx
leaq 0xbe1d(%rip), %rsi      # 0x190a2
movl $0x4, %ecx
movl $0x2, %r8d
movl $0xf7, %r9d
callq 0xc2e0
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movl 0x14(%rax), %r8d
movl $0x6, %esi
movl $0x2, %edx
leaq 0xbf44(%rip), %rcx      # 0x191fc
movb $0x0, %al
callq 0x2070
movq -0x8(%rbp), %rdi
callq 0x2100
addq $0x30, %rsp
popq %rbp
retq
nop