LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/keithnoguchi[P]pearls-in-action/0x8/main_test.c
// Function: main
int main(void)
{
	int fail = 0;
	int i = 0;

	printf("===============================\n");
	printf("Programming Pearls, Chapter 0x8\n");
	printf("===============================\n");

	if (test_max_subtree_n(&i))
		fail++;
	if (test_max_subtree_logn(&i))
		fail++;

	return fail;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x4(%rsp), %rbx
andl $0x0, (%rbx)
leaq 0xd18(%rip), %r14       # 0x209f
movq %r14, %rdi
callq 0x1030
leaq 0xce9(%rip), %rdi       # 0x207f
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1178
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
movq %rbx, %rdi
callq 0x12c8
leal 0x1(%r14), %ecx
testl %eax, %eax
cmovel %r14d, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch3/stack_list/stack.c
// Function: createStack
Stack createStack(int size)
{
    Stack s;
    s=(Stack)malloc(sizeof(StackNode));
    if(s==NULL)
    {
        fatal("stack malloc failed.");
    }
    s->next=NULL;
    return s;

}

// Assembly:
pushq %rax
pushq $0x10
popq %rdi
callq 0x1080
testq %rax, %rax
je 0x11c1
andq $0x0, 0x8(%rax)
popq %rcx
retq
leaq 0xe3c(%rip), %rdi       # 0x2004
callq 0x11cd
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch3/stack_list/stack.c
// Function: popStack
void popStack(Stack s)
{
    assert(s!=NULL);
    PStackNode node=s->next;
    s->next=s->next->next;
    free(node);
}

// Assembly:
testq %rdi, %rdi
je 0x1255
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdi)
movq %rax, %rdi
jmp 0x1030
pushq %rax
leaq 0xdbc(%rip), %rdi       # 0x2019
leaq 0xdbd(%rip), %rsi       # 0x2021
leaq 0xdee(%rip), %rcx       # 0x2059
pushq $0x41
popq %rdx
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch3/stack_list/stack.c
// Function: pushStack
void pushStack(int value, Stack s)
{
	PStackNode newNode;
    newNode=(PStackNode)malloc(sizeof(StackNode));
    if(newNode==NULL)
    {
        fatal("new node malloc failed");
    }
    newNode->value=value;
    newNode->next=s->next;
    s->next=newNode;

}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x10
popq %rdi
callq 0x1080
testq %rax, %rax
je 0x129d
movl %ebp, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xd9e(%rip), %rdi       # 0x2042
callq 0x11cd
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch3/stack_list/stack.c
// Function: printStack
void printStack(Stack s){
    assert(s!=NULL);
    if(isEmptyStack(s)){
        printf("stack is empty.\n");
        return;
    }
    
    printf("stack: ");
    PStackNode node=s->next;
    while(node!=NULL){
        printf("%d ", node->value);
        node=node->next;
    }
    printf("\n");
    
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1323
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x1310
leaq 0xdb5(%rip), %rdi       # 0x2091
xorl %eax, %eax
callq 0x1060
leaq 0xdaf(%rip), %r14       # 0x2099
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x1301
movl (%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
jmp 0x12ea
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
leaq 0xd96(%rip), %rdi       # 0x20ad
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1050
leaq 0xcef(%rip), %rdi       # 0x2019
leaq 0xcf0(%rip), %rsi       # 0x2021
leaq 0xd42(%rip), %rcx       # 0x207a
pushq $0x53
popq %rdx
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/mcxiaoke[P]dsaac/ch3/stack_list/main.c
// Function: main
int main(int argc, char** argv)
{
    
    Stack s;
    s=createStack(0);
    int i;
    for(i=0;i<10;i++){
        pushStack(rand()%100,s);
    }
    
    printStack(s);
    printf("Top: %d\n",topStack(s));
    popStack(s);
    popStack(s);
    printStack(s);
    printf("Top: %d\n",topStack(s));
    clearStack(s);
    printStack(s);
    exit(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %edi, %edi
callq 0x11ac
movq %rax, %rbx
pushq $0xa
popq %rbp
pushq $0x64
popq %r14
subl $0x1, %ebp
jb 0x136f
callq 0x10a0
cltd
idivl %r14d
movl %edx, %edi
movq %rbx, %rsi
callq 0x1273
jmp 0x1355
movq %rbx, %rdi
callq 0x12c2
movq %rbx, %rdi
callq 0x12a9
leaq 0xd37(%rip), %r14       # 0x20bd
movq %r14, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x123c
movq %rbx, %rdi
callq 0x123c
movq %rbx, %rdi
callq 0x12c2
movq %rbx, %rdi
callq 0x12a9
movq %r14, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x121a
movq %rbx, %rdi
callq 0x12c2
xorl %edi, %edi
callq 0x1090
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/ggets.c
// Function: fggets
int fggets(char* *ln, FILE *f)
{
   int     cursize, ch, ix;
   char   *buffer, *temp;

   *ln = NULL; /* default */
   if (NULL == (buffer = malloc(INITSIZE))) return NOMEM;
   cursize = INITSIZE;

   ix = 0;
   while ((EOF != (ch = getc(f))) && ('\n' != ch)) {
      if (ix >= (cursize - 1)) { /* extend buffer */
         cursize += DELTASIZE;
         if (NULL == (temp = realloc(buffer, (size_t)cursize))) {
            /* ran out of memory, return partial line */
            buffer[ix] = '\0';
            *ln = buffer;
            return NOMEM;
         }
         buffer = temp;
      }
      buffer[ix++] = ch;
   }
   if ((EOF == ch) && (0 == ix)) {
      free(buffer);
      return EOF;
   }

   buffer[ix] = '\0';
   if (NULL == (temp = realloc(buffer, (size_t)ix + 1))) {
      *ln = buffer;  /* without reducing it */
   }
   else *ln = temp;
   return OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
andq $0x0, (%rdi)
pushq $0x70
popq %rdi
callq 0x1130
pushq $0x1
popq %rbp
testq %rax, %rax
je 0x137b
movq %rax, %r14
movq %rbx, (%rsp)
pushq $0x70
popq %rbx
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x11a0
movl %eax, %r12d
cmpl $-0x1, %eax
je 0x1326
cmpl $0xa, %r12d
je 0x1326
leal -0x1(%rbx), %eax
cltq
cmpq %rax, %r13
jge 0x1307
movq %r14, %rax
jmp 0x131a
subl $-0x80, %ebx
movslq %ebx, %rsi
movq %r14, %rdi
callq 0x1140
testq %rax, %rax
je 0x136c
movb %r12b, (%rax,%r13)
incq %r13
movq %rax, %r14
jmp 0x12e2
cmpl $-0x1, %r12d
sete %al
testq %r13, %r13
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1347
movq %r14, %rdi
callq 0x1030
pushq $-0x1
popq %rbp
jmp 0x137b
movl %r13d, %esi
movb $0x0, (%r14,%rsi)
incq %rsi
movq %r14, %rdi
callq 0x1140
testq %rax, %rax
cmoveq %r14, %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
jmp 0x137b
movl %r13d, %eax
movb $0x0, (%r14,%rax)
movq (%rsp), %rax
movq %r14, (%rax)
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/chbarts[P]aa-tree/aa-tree.c
// Function: insert
static struct node *insert(struct node *t, void *data, ftype dup,
                           ftype comp, jmp_buf env)
{
    if (t == NULL) {
        if ((t = malloc(sizeof(struct node))) == NULL) {
            longjmp(env, 2);
        }

        t->data = data;
        t->level = 1;
        t->left = NULL;
        t->right = NULL;
        return t;
    } else if (comp(data, t->data) == -1) {
        t->left = insert(t->left, data, dup, comp, env);
    } else if (comp(data, t->data) == 1) {
        t->right = insert(t->right, data, dup, comp, env);
    } else if (dup == NULL) {
        longjmp(env, 3);
    } else {
        if (dup(t->data, data) == 0) {
            return t;
        } else {
            longjmp(env, 4);
        }
    }

    t = skew(t);
    t = split(t);
    return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rsi, %r15
testq %rdi, %rdi
je 0x1481
movq %rcx, %r13
movq %rdx, %r12
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq %r15, %rdi
callq *%rcx
cmpl $-0x1, %eax
je 0x14a4
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq *%r13
cmpl $0x1, %eax
jne 0x14de
pushq $0x18
jmp 0x14a6
pushq $0x20
popq %rdi
callq 0x1130
testq %rax, %rax
je 0x1503
movq %rax, %r14
movq %r15, 0x8(%rax)
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
jmp 0x14f1
pushq $0x10
popq %rbp
movq (%r14,%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rbx, %r8
callq 0x1441
movq %rax, (%r14,%rbp)
movq %r14, %rdi
callq 0x1b42
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1b6a
testq %r12, %r12
je 0x1507
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq *%r12
testl %eax, %eax
jne 0x150b
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
jmp 0x150d
pushq $0x3
jmp 0x150d
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x1150
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: aa_traverse
int aa_traverse(aa * tree, void *(*func) (void *data), trav t)
{
    if (tree == NULL) {
        return 1;
    }

    switch (t) {
    case TRAV_IN:
        inorder(tree->root, func);
        break;
    case TRAV_POST:
        postorder(tree->root, func);
        break;
    case TRAV_PRE:
        preorder(tree->root, func);
        break;
    default:
        return 2;
        break;
    }

    return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x17ae
cmpl $0x2, %edx
je 0x17bc
cmpl $0x1, %edx
je 0x17b2
testl %edx, %edx
jne 0x17c8
movq (%rdi), %rdi
callq 0x17cd
jmp 0x17c4
pushq $0x1
jmp 0x17ca
movq (%rdi), %rdi
callq 0x1808
jmp 0x17c4
movq (%rdi), %rdi
callq 0x184c
xorl %eax, %eax
jmp 0x17cb
pushq $0x2
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: inorder
static void inorder(struct node *node, void *(*func) (void *data))
{
    if (node == NULL)
        return;

    if (node->left)
        inorder(node->left, func);

    node->data = func(node->data);

    if (node->right)
        inorder(node->right, func);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x1800
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x17ed
movq %rbx, %rsi
callq 0x17cd
movq 0x8(%r14), %rdi
callq *%rbx
movq %rax, 0x8(%r14)
movq 0x18(%r14), %r14
testq %r14, %r14
jne 0x17d7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: postorder
static void postorder(struct node *node, void *(*func) (void *data))
{
    if (node == NULL)
        return;

    if (node->left)
        postorder(node->left, func);

    if (node->right)
        postorder(node->right, func);

    node->data = func(node->data);
}

// Assembly:
testq %rdi, %rdi
je 0x184b
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x1828
movq %r14, %rsi
callq 0x1808
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x1839
movq %r14, %rsi
callq 0x1808
movq 0x8(%rbx), %rdi
callq *%r14
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: preorder
static void preorder(struct node *node, void *(*func) (void *data))
{
    if (node == NULL)
        return;

    node->data = func(node->data);

    if (node->left)
        preorder(node->left, func);

    if (node->right)
        preorder(node->right, func);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x187f
movq 0x8(%r14), %rdi
callq *%rbx
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x1876
movq %rbx, %rsi
callq 0x184c
movq 0x18(%r14), %r14
testq %r14, %r14
jne 0x1856
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: freetree
static void freetree(struct node *node)
{
    if (node == NULL)
        return;

    if (node->left)
        freetree(node->left);

    if (node->right)
        freetree(node->right);

    free(node);
}

// Assembly:
testq %rdi, %rdi
je 0x18ec
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x18d5
callq 0x18be
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x18e3
callq 0x18be
movq %rbx, %rdi
popq %rbx
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: aa_set_here
int aa_set_here(aa * tree, void *data, int (*dup) (void *orig, void *data))
{
    if (tree == NULL) {
        return 1;
    }

    if (tree->cursor == NULL) {
        return 2;
    }

    if (tree->comp(data, tree->cursor->data) == 0) {
        if (dup != NULL) {
            if (dup(tree->cursor->data, data) == 0) {
                return 0;
            } else {
                return 4;
            }

        } else {
            return 3;
        }

    } else {
        tree->cursor->data = data;
        return 0;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x193a
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x193e
movq %rdx, %r14
movq %rsi, %rbx
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *0x10(%r15)
testl %eax, %eax
je 0x1943
movq 0x8(%r15), %rax
movq %rbx, 0x8(%rax)
xorl %eax, %eax
jmp 0x1962
pushq $0x1
popq %rax
retq
pushq $0x2
popq %rax
jmp 0x1962
testq %r14, %r14
je 0x1968
movq 0x8(%r15), %rax
movq 0x8(%rax), %rdi
movq %rbx, %rsi
callq *%r14
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
shll $0x2, %eax
popq %rbx
popq %r14
popq %r15
retq
pushq $0x3
jmp 0x1940
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: aa_print
int aa_print(aa * tree, FILE * fp, void (*printer) (FILE *, void *))
{
    if (!tree)
        return -1;

    if (tree->root == NULL)
        return -2;

    fprintf(fp, "digraph aa_tree {\n");
    fprintf(fp, "node [shape = record];\n");
    tree_print(tree->root, 1, printer, fp);
    fprintf(fp, "}\n");

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x1a6f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
cmpq $0x0, (%rdi)
je 0x1a73
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x15f6(%rip), %rdi      # 0x3014
pushq $0x12
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1190
leaq 0x15f0(%rip), %rdi      # 0x3027
pushq $0x17
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1190
movq (%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1a82
leaq 0x15e2(%rip), %rdi      # 0x303f
pushq $0x2
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1190
xorl %eax, %eax
jmp 0x1a76
pushq $-0x1
popq %rax
retq
pushq $-0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: tree_print
static void tree_print(struct node *node, unsigned long long int n,
                       void (*printer) (FILE *, void *), FILE * fp)
{
    unsigned long long int pn = n / 2;

    fprintf(fp, "node%llu [label = \"<f0> | <f1> ", n);
    printer(fp, node->data);
    fprintf(fp, "|<f2> \"];\n");

    if (pn != 0) {
        if (n % 2 == 0) {
            fprintf(fp, "\"node%llu\":f0 -> \"node%llu\":f1;\n", pn, n);
        } else {
            fprintf(fp, "\"node%llu\":f2 -> \"node%llu\":f1;\n", pn, n);
        }
    }

    if (node->left)
        tree_print(node->left, 2 * n, printer, fp);

    if (node->right)
        tree_print(node->right, 2 * n + 1, printer, fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0xa
popq %r13
pushq $0x1
popq %rbp
movq %rbx, %rdi
leaq 0x1598(%rip), %rsi      # 0x3042
movq %r15, %rdx
xorl %eax, %eax
callq 0x1110
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq *%r14
leaq 0x159c(%rip), %rdi      # 0x3062
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x1190
cmpq $0x2, %r15
jb 0x1b03
movq %r15, %rdx
shrq %rdx
testb $0x1, %r15b
leaq 0x15a3(%rip), %rsi      # 0x308e
leaq 0x157b(%rip), %rax      # 0x306d
cmoveq %rax, %rsi
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x1110
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x1b1c
leaq (%r15,%r15), %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1a82
movq 0x18(%r12), %r12
testq %r12, %r12
je 0x1b33
leaq 0x1(,%r15,2), %r15
jmp 0x1aa0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/aa-tree.c
// Function: split
static struct node *split(struct node *t)
{
    struct node *r;

    if (t == NULL)
        return NULL;

    if ((t->right == NULL) || (t->right->right == NULL))
        return t;

    if (t->level == t->right->right->level) {
        r = t->right;
        t->right = r->left;
        r->left = t;
        r->level++;
        return r;
    } else {
        return t;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x1b9a
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x1b96
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x1b96
movl (%rdi), %edx
cmpl (%rcx), %edx
jne 0x1b96
movq 0x10(%rax), %rcx
movq %rcx, 0x18(%rdi)
movq %rdi, 0x10(%rax)
incl (%rax)
retq
movq %rdi, %rax
retq
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/asprintf.c
// Function: vasprintf
int vasprintf(char **ret, const char *fmt, va_list ap)
{
    int n;
    va_list ap2;

    va_copy(ap2, ap);

    if ((n = vsnprintf(NULL, 0, fmt, ap2)) < 0)
        goto error;

    va_end(ap2);

    if ((*ret = malloc(n + 1)) == NULL)
        goto error;

    if ((n = vsnprintf(*ret, n + 1, fmt, ap)) < 0) {
        free(*ret);
        goto error;
    }

    return n;

  error:
    *ret = NULL;
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdx), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
movups (%rdx), %xmm0
movaps %xmm0, (%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1070
testl %eax, %eax
js 0x1c08
movl %eax, %r12d
incl %r12d
movq %r12, %rdi
callq 0x1130
movq %rax, (%rbx)
testq %rax, %rax
je 0x1c08
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1070
testl %eax, %eax
jns 0x1c0f
movq (%rbx), %rdi
callq 0x1030
andq $0x0, (%rbx)
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/ll3.c
// Function: new_node
ll *new_node(int tag, void *data, ll * next)
{
    ll *new;

    if (!(new = malloc(sizeof(ll))))
        return NULL;

    new->tag = tag;
    new->data = data;
    new->nxt = next;

    return new;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
pushq $0x18
popq %rdi
callq 0x1130
testq %rax, %rax
je 0x1d78
movl %ebp, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/ll3.c
// Function: map
ll *map(ll * beg, void *(proc) (int, void *))
{
    ll *tmp = beg;

    if (!beg)
        return NULL;

    while (beg) {
        beg->data = proc(beg->tag, beg->data);
        beg = beg->nxt;
    }

    return tmp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1da9
movq %rsi, %r14
movq %rbx, %r15
testq %r15, %r15
je 0x1da9
movl (%r15), %edi
movq 0x8(%r15), %rsi
callq *%r14
movq %rax, 0x8(%r15)
movq 0x10(%r15), %r15
jmp 0x1d90
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/ll3.c
// Function: free_all_data
ll *free_all_data(ll * beg)
{
    ll *tmp = beg;

    if (!beg)
        return NULL;

    while (beg) {
        free(beg->data);
        beg->data = NULL;
        beg = beg->nxt;
    }

    return tmp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1e08
movq %rbx, %r14
testq %r14, %r14
je 0x1e08
movq 0x8(%r14), %rdi
callq 0x1030
andq $0x0, 0x8(%r14)
movq 0x10(%r14), %r14
jmp 0x1def
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: comparator
static int comparator(void *left, void *right)
{
    char *cl, *cr;
    int r;

    cl = (char *) get_data((ll *) left);
    cr = (char *) get_data((ll *) right);

    r = strcmp(cl, cr);

    if (r > 0) {
        r = 1;
    } else if (r < 0) {
        r = -1;
    }

    return (rev * r);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x1cd1
movq %rax, %r14
movq %rbx, %rdi
callq 0x1cd1
movq %r14, %rdi
movq %rax, %rsi
callq 0x10f0
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
negl %ecx
testl %eax, %eax
pushq $0x1
popq %rax
cmovlel %ecx, %eax
imull 0x3fc8(%rip), %eax      # 0x60ec
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: dofile
static void dofile(char *fname, FILE * fin, aa * tree, bool bylen)
{
    char *ln, *lnl;
    ll *lln;

    while (fggets(&ln, fin) == 0) {
#ifdef DEBUG
        printf("read: %s\n", ln);
#endif

        if (bylen) {
            if (asprintf
                (&lnl, "%llu:%s", (unsigned long long int) strlen(ln),
                 ln) == -1) {
                free(ln);
                error(tree);
            }

            free(ln);
            ln = lnl;
#ifdef DEBUG
            printf("%s\n", ln);
#endif
        }

        if ((lln = new_node(1, ln, NULL)) == NULL) {
            free(ln);
            error(tree);
        }

        switch (aa_add(tree, (void *) lln, duplicate)) {
        case 0:                /* no error */
            break;
        case 2:                /* memory error */
            free(ln);
            free(lln);
            error(tree);
            break;
        default:               /* can't happen */
            fprintf(stderr, "can't happen\n");
            free(ln);
            free(lln);
            cleanup(tree);
            exit(EXIT_FAILURE);
            break;
        }
    }

    if (ferror(fin) != 0)
        handle_ferr(fname, "sort2");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
pushq $0x1
popq %r13
leaq 0x390(%rip), %r14       # 0x24e2
movq %rsp, %rdi
movq %r15, %rsi
callq 0x12ac
testl %eax, %eax
jne 0x21e0
movq (%rsp), %r12
testb %bpl, %bpl
je 0x21a6
movq %r12, %rdi
callq 0x1090
leaq 0x10(%rsp), %rdi
leaq 0xfc6(%rip), %rsi       # 0x3144
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x1c1b
movl %eax, %r12d
movq (%rsp), %rdi
callq 0x1030
cmpl $-0x1, %r12d
je 0x2215
movq 0x10(%rsp), %r12
movq %r12, (%rsp)
movl %r13d, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1d55
testq %rax, %rax
je 0x220c
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x13ec
testl %eax, %eax
je 0x2152
cmpl $0x2, %eax
jne 0x221d
movq (%rsp), %rdi
callq 0x1030
movq %r12, %rdi
jmp 0x2210
movq %r15, %rdi
callq 0x1060
testl %eax, %eax
je 0x21fd
leaq 0xf4b(%rip), %rsi       # 0x313e
movq 0x8(%rsp), %rdi
callq 0x138c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x24b2
movq 0x3dd4(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0xf1e(%rip), %rdi       # 0x314c
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
movq (%rsp), %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x228b
pushq $0x1
popq %rdi
callq 0x1180
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: printall
static void *printall(void *data)
{
    ll *node = (ll *) data;
    char *ln;
    int n;

    n = get_tag(node);
    ln = get_data(node);
    while (n-- > 0)
        puts(ln);

    return data;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1cba
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1cd1
movq %rax, %r14
testl %ebp, %ebp
jle 0x2283
decl %ebp
movq %r14, %rdi
callq 0x1050
jmp 0x2273
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: usage
static void usage(char *pname)
{
    printf("Usage: %s [OPTION] [FILE...]\n", pname);
    puts("Sort files or, if no files on the command line, sort stdin.");
    puts("Multiple sorting criteria can be combined.");
    puts("All files sorted together into one output.");
    puts("");
    puts("  -u, --uniqify     Only print identical lines once");
    puts("  -r, --reverse     Reverse the sense of the comparison");
    puts("  -n, --numer       Sort numerically, then non-numerically");
    puts("  -b, --bylen       Sort by length first, then by other critera");
    puts("  -h, --help        Print this help");
    puts("  -v, --version     Print version information");
    puts("");
    puts("Report bugs to <chbarts@gmail.com>.");
}

// Assembly:
pushq %rbx
movq %rdi, %rsi
leaq 0xeb7(%rip), %rdi       # 0x3168
xorl %eax, %eax
callq 0x10c0
leaq 0xec7(%rip), %rdi       # 0x3186
callq 0x1050
leaq 0xef7(%rip), %rdi       # 0x31c2
callq 0x1050
leaq 0xf16(%rip), %rdi       # 0x31ed
callq 0x1050
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1040
leaq 0xf2b(%rip), %rdi       # 0x3218
callq 0x1050
leaq 0xf53(%rip), %rdi       # 0x324c
callq 0x1050
leaq 0xf7f(%rip), %rdi       # 0x3284
callq 0x1050
leaq 0xfae(%rip), %rdi       # 0x32bf
callq 0x1050
leaq 0xfe2(%rip), %rdi       # 0x32ff
callq 0x1050
leaq 0xffa(%rip), %rdi       # 0x3323
callq 0x1050
movl %ebx, %edi
callq 0x1040
leaq 0x1015(%rip), %rdi      # 0x3351
popq %rbx
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: version
static void version(void)
{
    puts("sort2 version 0.1.0");
    puts("Copyright 2014 Chris Barts.");
    puts("sort2 comes with NO WARRANTY to the extent permitted by law.");
    puts("You may redistribute this software under the terms");
    puts("of the GNU General Public License.");
    puts("For more information, see the file named COPYING");
    puts("in this program's distribution file.");
}

// Assembly:
pushq %rax
leaq 0x102b(%rip), %rdi      # 0x3375
callq 0x1050
leaq 0x1033(%rip), %rdi      # 0x3389
callq 0x1050
leaq 0x1043(%rip), %rdi      # 0x33a5
callq 0x1050
leaq 0x1074(%rip), %rdi      # 0x33e2
callq 0x1050
leaq 0x109b(%rip), %rdi      # 0x3415
callq 0x1050
leaq 0x10b2(%rip), %rdi      # 0x3438
callq 0x1050
leaq 0x10d7(%rip), %rdi      # 0x3469
popq %rax
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: lncomparator
static int lncomparator(void *left, void *right)
{
    ll *l = (ll *) left, *r = (ll *) right;
    unsigned long long int ln, rn;
    char *ls, *rs, *cro, *clo;
    int res = 0;

    ls = (char *) get_data(l);
    rs = (char *) get_data(r);

    ln = strtoll(ls, &clo, 10);
    rn = strtoll(rs, &cro, 10);

    if (ln < rn) {
        res = -1;
    } else if (ln > rn) {
        res = 1;
    } else {
        return sncomp(clo + 1, cro + 1);
    }

    return (rev * res);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
callq 0x1cd1
movq %rax, %r14
movq %rbx, %rdi
callq 0x1cd1
movq %rax, %rbx
movq %rsp, %rsi
pushq $0xa
popq %rbp
movq %r14, %rdi
movl %ebp, %edx
callq 0x1100
movq %rax, %r14
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1100
cmpq %rax, %r14
jae 0x23e1
pushq $-0x1
jmp 0x23e5
jbe 0x23f6
pushq $0x1
popq %rax
imull 0x3cff(%rip), %eax      # 0x60ec
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%rsp), %rdi
incq %rdi
movq 0x8(%rsp), %rsi
incq %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x253b
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: lprintall
static void *lprintall(void *data)
{
    ll *node = (ll *) data;
    char *ln, *lno;
    int n;

    ln = get_data(node);
    lno = strchr(ln, ':') + 1;
    n = get_tag(data);
    while (n-- > 0)
        puts(lno);

    return data;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1cd1
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x10b0
movq %rax, %r14
incq %r14
movq %rbx, %rdi
callq 0x1cba
movl %eax, %ebp
testl %ebp, %ebp
jle 0x2494
decl %ebp
movq %r14, %rdi
callq 0x1050
jmp 0x2484
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: duplicate
static int duplicate(void *orig, void *new)
{
    int n;
    ll *node = (ll *) orig, *node2 = (ll *) new;
    char *ln;

    n = get_tag(node);
    set_tag(node, n + 1);
    ln = get_data(node2);
    free(ln);
    free(node2);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1cba
leal 0x1(%rax), %esi
movq %r14, %rdi
callq 0x1cc6
movq %rbx, %rdi
callq 0x1cd1
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: freedata
static void *freedata(void *data)
{
    ll *node = (ll *) data;
    char *ln;

    ln = get_data(node);
    free(ln);
    free(node);
    return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1cd1
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/chbarts[P]aa-tree/sort2.c
// Function: sncomp
static int sncomp(char *left, char *right)
{
    long long int nl, nr;
    char *clo, *cro;
    int r = 0;

    nl = strtoll(left, &clo, 10);
    nr = strtoll(right, &cro, 10);

    if (nl < nr) {
        r = -1;
    } else if (nl > nr) {
        r = 1;
    } else {
        r = strcmp(clo, cro);

        if (r < 0) {
            r = -1;
        } else if (r > 0) {
            r = 1;
        }
    }

    return (rev * r);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
leaq 0x8(%rsp), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edx
callq 0x1100
movq %rax, %r14
movq %rsp, %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1100
pushq $-0x1
popq %rbx
cmpq %rax, %r14
jl 0x258c
jle 0x2574
pushq $0x1
popq %rbx
jmp 0x258c
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x10f0
testl %eax, %eax
js 0x258c
setne %al
movzbl %al, %ebx
imull 0x3b59(%rip), %ebx      # 0x60ec
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/main.c
// Function: main
int main(int argc, char *argv[]) {
  
  printf("lv_init\n");
  /*LittlevGL init*/
  lv_init();
  
  /*Linux frame buffer device init*/
  fbdev_init();

  /*A small buffer for LittlevGL to draw the screen's content*/
  static lv_color_t buf[DISP_BUF_SIZE];

  /*Initialize a descriptor for the buffer*/
  static lv_disp_buf_t disp_buf;
  lv_disp_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE);

  /*Initialize and register a display driver*/
  lv_disp_drv_t disp_drv;
  lv_disp_drv_init(&disp_drv);
  disp_drv.buffer = &disp_buf;
  disp_drv.flush_cb = fbdev_flush;
  lv_disp_drv_register(&disp_drv);
  
  /*Initialize and register an input device*/
  lv_indev_drv_t indev_drv;
  lv_indev_drv_init(&indev_drv);             /*Descriptor of a input device driver*/
  indev_drv.type = LV_INDEV_TYPE_POINTER;    /*Touch pad is a pointer-like device*/
  indev_drv.read_cb = xpt7603_read;      /*Set your driver function*/
  lv_indev_drv_register(&indev_drv);         /*Finally register the driver*/
  
  /* Demo Code - replace this with yours */
  /*Create a "Hello world!" label*/
  lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
  lv_label_set_text(label, "Hello world!");
  lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);
  
  /*Create a button*/
  lv_obj_t * btnLabel;

  lv_obj_t * btn1 = lv_btn_create(lv_scr_act(), NULL);
  lv_obj_set_event_cb(btn1, event_handler);
  lv_obj_align(btn1, NULL, LV_ALIGN_CENTER, 0, 0);

  btnLabel = lv_label_create(btn1, NULL);
  lv_label_set_text(btnLabel, "Press Me");
  
  printf("starting loop\n");
  while(1) {
    lv_tick_inc(5);
    lv_task_handler();
    usleep(5000);
  }
  
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
leaq 0x38de0(%rip), %rdi     # 0x3b01a
callq 0x2050
callq 0x425c
callq 0x3a998
leaq 0x5bc20(%rip), %rbx     # 0x5de70
leaq 0x4f419(%rip), %rsi     # 0x51670
movq %rbx, %rdi
xorl %edx, %edx
movl $0x6400, %ecx           # imm = 0x6400
callq 0x7b7f
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x7b5c
movq %rbx, 0x8(%r14)
leaq 0x3882d(%rip), %rax     # 0x3aaab
movq %rax, 0x18(%r14)
movq %r14, %rdi
callq 0x7b95
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x7ec8
movb $0x1, (%rbx)
leaq 0x38b85(%rip), %rax     # 0x3ae26
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x7ee4
callq 0x2352
movq %rax, %rdi
xorl %esi, %esi
callq 0x182f0
movq %rax, %rbx
leaq 0x38d3e(%rip), %rsi     # 0x3b004
movq %rax, %rdi
callq 0x18a9a
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5424
callq 0x2352
movq %rax, %rdi
xorl %esi, %esi
callq 0x122f0
movq %rax, %rbx
leaq 0x68(%rip), %rsi        # 0x2361
movq %rax, %rdi
callq 0x5fce
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5424
movq %rbx, %rdi
xorl %esi, %esi
callq 0x182f0
leaq 0x38cee(%rip), %rsi     # 0x3b011
movq %rax, %rdi
callq 0x18a9a
leaq 0x38cf0(%rip), %rdi     # 0x3b022
callq 0x2050
pushq $0x5
popq %rbx
movl %ebx, %edi
callq 0x800c
callq 0x269a5
movl $0x1388, %edi           # imm = 0x1388
callq 0x2120
jmp 0x233a
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_create
lv_group_t * lv_group_create(void)
{
    lv_group_t * group = lv_ll_ins_head(&LV_GC_ROOT(_lv_group_ll));
    LV_ASSERT_MEM(group);
    if(group == NULL) return NULL;
    lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *));

    group->obj_focus      = NULL;
    group->frozen         = 0;
    group->focus_cb       = NULL;
    group->click_focus    = 1;
    group->editing        = 0;
    group->refocus_policy = LV_GROUP_REFOCUS_POLICY_PREV;
    group->wrap           = 1;

#if LV_USE_USER_DATA
    memset(&group->user_data, 0, sizeof(lv_group_user_data_t));
#endif

    /*Initialize style modification callbacks from current theme*/
    refresh_theme(group, lv_theme_get_current());

    return group;
}

// Assembly:
pushq %rbx
leaq 0x641d3(%rip), %rdi     # 0x66570
callq 0x27d00
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x23f0
testq %rbx, %rbx
je 0x23eb
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x27cf0
andq $0x0, 0x18(%rbx)
movb 0x80(%rbx), %al
andq $0x0, 0x30(%rbx)
andb $-0x20, %al
orb $0x1c, %al
movb %al, 0x80(%rbx)
callq 0x2be75
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2401
movq %rbx, %rax
popq %rbx
retq
leaq 0x38c49(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x23ff
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: refresh_theme
static void refresh_theme(lv_group_t * g, lv_theme_t * th)
{
    g->style_mod_cb      = style_mod_def;
    g->style_mod_edit_cb = style_mod_edit_def;
    if(th) {
        if(th->group.style_mod_xcb) g->style_mod_cb = th->group.style_mod_xcb;
        if(th->group.style_mod_edit_xcb) g->style_mod_edit_cb = th->group.style_mod_edit_xcb;
    }
}

// Assembly:
leaq 0x737(%rip), %rax       # 0x2b3f
movq %rax, 0x20(%rdi)
leaq 0x7ba(%rip), %rax       # 0x2bcd
movq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x243c
movq 0x350(%rsi), %rax
testq %rax, %rax
je 0x242c
movq %rax, 0x20(%rdi)
movq 0x358(%rsi), %rax
testq %rax, %rax
je 0x243c
movq %rax, 0x28(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_del
void lv_group_del(lv_group_t * group)
{
    /*Defocus the the currently focused object*/
    if(group->obj_focus != NULL) {
        (*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
        lv_obj_invalidate(*group->obj_focus);
    }

    /*Remove the objects from the group*/
    lv_obj_t ** obj;
    LV_LL_READ(group->obj_ll, obj)
    {
        (*obj)->group_p = NULL;
    }

    lv_ll_clear(&(group->obj_ll));
    lv_ll_rem(&LV_GC_ROOT(_lv_group_ll), group);
    lv_mem_free(group);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x2461
movq (%rax), %rdi
pushq $0x11
popq %rsi
xorl %edx, %edx
callq *0x30(%rdi)
movq 0x18(%rbx), %rax
movq (%rax), %rdi
callq 0x493a
movq %rbx, %rdi
callq 0x27db9
testq %rax, %rax
je 0x2483
movq (%rax), %rcx
andq $0x0, 0x50(%rcx)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27e93
jmp 0x2469
movq %rbx, %rdi
callq 0x27eb0
leaq 0x640de(%rip), %rdi     # 0x66570
movq %rbx, %rsi
callq 0x27e1c
movq %rbx, %rdi
popq %rbx
jmp 0x27a7a
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_add_obj
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
{
    if(group == NULL) return;

    /*Do not add the object twice*/
    lv_obj_t ** obj_i;
    LV_LL_READ(group->obj_ll, obj_i)
    {
        if((*obj_i) == obj) {
            LV_LOG_INFO("lv_group_add_obj: the object is already added to this group");
            return;
        }
    }

    /*If the object is already in a group and focused then defocus it*/
    if(obj->group_p) {
        if(lv_obj_is_focused(obj)) {
            lv_group_refocus(obj->group_p);

            LV_LOG_INFO("lv_group_add_obj: assign object to an other group");
        }
    }

    obj->group_p     = group;
    lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll);
    LV_ASSERT_MEM(next);
    if(next == NULL) return;
    *next = obj;

    /* If the head and the tail is equal then there is only one object in the linked list.
     * In this case automatically activate it*/
    if(lv_ll_get_head(&group->obj_ll) == next) {
        lv_group_refocus(group);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x251b
movq %rsi, %r14
movq %rdi, %rbx
callq 0x27db9
testq %rax, %rax
je 0x24cf
cmpq %r14, (%rax)
je 0x251b
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27e93
jmp 0x24b8
cmpq $0x0, 0x50(%r14)
je 0x24eb
movq %r14, %rdi
callq 0x6812
testb %al, %al
je 0x24eb
movq 0x50(%r14), %rdi
callq 0x253c
movq %rbx, 0x50(%r14)
movq %rbx, %rdi
callq 0x27dd5
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x2521
testq %r15, %r15
je 0x251b
movq %r14, (%r15)
movq %rbx, %rdi
callq 0x27db9
cmpq %r15, %rax
je 0x2532
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38b18(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0x2530
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x253c
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_refocus
static void lv_group_refocus(lv_group_t * g)
{
    /*Refocus must temporarily allow wrapping to work correctly*/
    uint8_t temp_wrap = g->wrap;
    g->wrap           = 1;

    if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_NEXT)
        lv_group_focus_next(g);
    else if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_PREV)
        lv_group_focus_prev(g);
    /*Restore wrap property*/
    g->wrap = temp_wrap;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x80(%rdi), %bpl
movl %ebp, %eax
orb $0x10, %al
movb %al, 0x80(%rdi)
testb $0x8, %bpl
jne 0x2560
callq 0x27f9
jmp 0x2565
callq 0x294a
andb $0x10, %bpl
movb 0x80(%rbx), %al
andb $-0x11, %al
orb %bpl, %al
movb %al, 0x80(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_remove_obj
void lv_group_remove_obj(lv_obj_t * obj)
{
    lv_group_t * g = obj->group_p;
    if(g == NULL) return;
    if(g->obj_focus == NULL) return; /*Just to be sure (Not possible if there is at least one object in the group)*/

    /*Focus on the next object*/
    if(*g->obj_focus == obj) {
        /*If this is the only object in the group then focus to nothing.*/
        if(lv_ll_get_head(&g->obj_ll) == g->obj_focus && lv_ll_get_tail(&g->obj_ll) == g->obj_focus) {
            (*g->obj_focus)->signal_cb(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
        }
        /*If there more objects in the group then focus to the next/prev object*/
        else {
            lv_group_refocus(g);
        }
    }

    /* If the focuses object is still the same then it was the only object in the group but it will
     * be deleted. Set the `obj_focus` to NULL to get back to the initial state of the group with
     * zero objects*/
    if(*g->obj_focus == obj) {
        g->obj_focus = NULL;
    }

    /*Search the object and remove it from its group */
    lv_obj_t ** i;
    LV_LL_READ(g->obj_ll, i)
    {
        if(*i == obj) {
            lv_ll_rem(&g->obj_ll, i);
            lv_mem_free(i);
            obj->group_p = NULL;
            break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x50(%rdi), %r14
testq %r14, %r14
je 0x2613
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x2613
movq %rdi, %rbx
cmpq %rdi, (%rax)
jne 0x25cb
movq %r14, %rdi
callq 0x27db9
cmpq 0x18(%r14), %rax
jne 0x25c3
movq %r14, %rdi
callq 0x27ea3
movq 0x18(%r14), %rcx
cmpq %rcx, %rax
je 0x2619
movq %r14, %rdi
callq 0x253c
movq 0x18(%r14), %rax
cmpq %rbx, (%rax)
jne 0x25d9
andq $0x0, 0x18(%r14)
movq %r14, %rdi
callq 0x27db9
movq %rax, %r15
testq %rax, %rax
je 0x2613
cmpq %rbx, (%r15)
je 0x25fb
movq %r14, %rdi
movq %r15, %rsi
callq 0x27e93
jmp 0x25e1
movq %r14, %rdi
movq %r15, %rsi
callq 0x27e1c
movq %r15, %rdi
callq 0x27a7a
andq $0x0, 0x50(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq (%rcx), %rdi
pushq $0x11
popq %rsi
xorl %edx, %edx
callq *0x30(%rdi)
jmp 0x25cb
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_remove_all_objs
void lv_group_remove_all_objs(lv_group_t * group)
{
    /*Defocus the the currently focused object*/
    if(group->obj_focus != NULL) {
        (*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
        lv_obj_invalidate(*group->obj_focus);
        group->obj_focus = NULL;
    }

    /*Remove the objects from the group*/
    lv_obj_t ** obj;
    LV_LL_READ(group->obj_ll, obj)
    {
        (*obj)->group_p = NULL;
    }

    lv_ll_clear(&(group->obj_ll));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x264f
movq (%rax), %rdi
pushq $0x11
popq %rsi
xorl %edx, %edx
callq *0x30(%rdi)
movq 0x18(%rbx), %rax
movq (%rax), %rdi
callq 0x493a
andq $0x0, 0x18(%rbx)
movq %rbx, %rdi
callq 0x27db9
testq %rax, %rax
je 0x2671
movq (%rax), %rcx
andq $0x0, 0x50(%rcx)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27e93
jmp 0x2657
movq %rbx, %rdi
popq %rbx
jmp 0x27eb0
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_focus_obj
void lv_group_focus_obj(lv_obj_t * obj)
{
    if(obj == NULL) return;
    lv_group_t * g = obj->group_p;
    if(g == NULL) return;

    if(g->frozen != 0) return;

    /*On defocus edit mode must be leaved*/
    lv_group_set_editing(g, false);

    lv_obj_t ** i;
    LV_LL_READ(g->obj_ll, i)
    {
        if(*i == obj) {
            if(g->obj_focus != NULL) {
                (*g->obj_focus)->signal_cb(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
                lv_res_t res = lv_event_send(*g->obj_focus, LV_EVENT_DEFOCUSED, NULL);
                if(res != LV_RES_OK) return;
                lv_obj_invalidate(*g->obj_focus);
            }

            g->obj_focus = i;

            if(g->obj_focus != NULL) {
                (*g->obj_focus)->signal_cb(*g->obj_focus, LV_SIGNAL_FOCUS, NULL);
                if(g->focus_cb) g->focus_cb(g);
                lv_res_t res = lv_event_send(*g->obj_focus, LV_EVENT_FOCUSED, NULL);
                if(res != LV_RES_OK) return;
                lv_obj_invalidate(*g->obj_focus);

                /*If the object or its parent has `top == true` bring it to the foregorund*/
                obj_to_foreground(*g->obj_focus);
            }
            break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x2756
movq %rdi, %r15
movq 0x50(%rdi), %rbx
testq %rbx, %rbx
je 0x2756
testb $0x1, 0x80(%rbx)
jne 0x2756
movq %rbx, %rdi
xorl %esi, %esi
callq 0x275c
movq %rbx, %rdi
callq 0x27db9
movq %rax, %r14
testq %rax, %rax
je 0x2756
cmpq %r15, (%r14)
je 0x26d5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27e93
jmp 0x26b7
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x270a
movq (%rax), %rdi
pushq $0x11
popq %rsi
xorl %edx, %edx
callq *0x30(%rdi)
movq 0x18(%rbx), %rax
movq (%rax), %rdi
pushq $0xd
popq %rsi
xorl %edx, %edx
callq 0x4caf
cmpb $0x1, %al
jne 0x2756
movq 0x18(%rbx), %rax
movq (%rax), %rdi
callq 0x493a
movq %r14, 0x18(%rbx)
movq (%r14), %rdi
pushq $0x10
popq %rsi
xorl %edx, %edx
callq *0x30(%rdi)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x2727
movq %rbx, %rdi
callq *%rax
movq 0x18(%rbx), %rax
movq (%rax), %rdi
pushq $0xc
popq %rsi
xorl %edx, %edx
callq 0x4caf
cmpb $0x1, %al
jne 0x2756
movq 0x18(%rbx), %rax
movq (%rax), %rdi
callq 0x493a
movq 0x18(%rbx), %rax
movq (%rax), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x27cd
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_set_editing
void lv_group_set_editing(lv_group_t * group, bool edit)
{
    uint8_t en_val = edit ? 1 : 0;

    if(en_val == group->editing) return; /*Do not set the same mode again*/

    group->editing     = en_val;
    lv_obj_t * focused = lv_group_get_focused(group);

    if(focused) {
        focused->signal_cb(focused, LV_SIGNAL_FOCUS, NULL); /*Focus again to properly leave/open edit/navigate mode*/
        lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_FOCUSED, NULL);
        if(res != LV_RES_OK) return;
    }

    lv_obj_invalidate(focused);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb 0x80(%rdi), %al
testb $0x2, %al
sete %cl
xorb %sil, %cl
je 0x2778
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %r14
addb %sil, %sil
andb $-0x3, %al
orb %sil, %al
movb %al, 0x80(%rdi)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x27bc
movq (%rax), %rbx
testq %rbx, %rbx
je 0x27bc
pushq $0x10
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq *0x30(%rbx)
movq 0x18(%r14), %rax
movq (%rax), %rdi
pushq $0xc
popq %rsi
xorl %edx, %edx
callq 0x4caf
cmpb $0x1, %al
jne 0x2770
jmp 0x27be
xorl %ebx, %ebx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x493a
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: obj_to_foreground
static void obj_to_foreground(lv_obj_t * obj)
{
    /*Search for 'top' attribute*/
    lv_obj_t * i        = obj;
    lv_obj_t * last_top = NULL;
    while(i != NULL) {
        if(i->top != 0) last_top = i;
        i = lv_obj_get_parent(i);
    }

    if(last_top != NULL) {
        /*Move the last_top object to the foreground*/
        lv_obj_move_foreground(last_top);
    }
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x27e9
movzwl 0x58(%rdi), %eax
testb $0x20, %al
cmovneq %rdi, %rbx
callq 0x47bc
movq %rax, %rdi
jmp 0x27d0
testq %rbx, %rbx
je 0x27f7
movq %rbx, %rdi
popq %rbx
jmp 0x4feb
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_group.c
// Function: lv_group_send_data
lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c)
{
    lv_obj_t * act = lv_group_get_focused(group);
    if(act == NULL) return LV_RES_OK;

    lv_res_t res;

    res = act->signal_cb(act, LV_SIGNAL_CONTROL, &c);
    if(res != LV_RES_OK) return res;

    res = lv_event_send(act, LV_EVENT_KEY, &c);
    if(res != LV_RES_OK) return res;

    return res;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, 0xc(%rsp)
movb $0x1, %al
testq %rdi, %rdi
je 0x29b2
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
je 0x29b2
movq (%rcx), %rbx
testq %rbx, %rbx
je 0x29b2
pushq $0x12
popq %rsi
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq *0x30(%rbx)
cmpb $0x1, %al
jne 0x29b2
pushq $0xb
popq %rsi
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x4caf
addq $0x10, %rsp
popq %rbx
retq