LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/parser.c
// Function: parser_getcons
static ast_kind_t parser_getcons(parser_t *parser, ast_t **ast)
{
    int line = parser->lexer->tk_line;
    int column = parser->lexer->tk_column;

    ast_t *car = NULL;
    ast_kind_t kind = parser_getast(parser, &car);
    if (kind == AST_INVALID) {
        if (ast != NULL)
            *ast = car;
        return AST_INVALID;
    }
    if (kind == AST_RIGHT_PAREN) {
        if (ast != NULL)
            *ast = ast_eoc_new();
        return AST_END_OF_CONS;
    }
    ast_t *cdr = NULL;
    if (parser_getcons(parser, &cdr) == AST_INVALID) {
        if (ast != NULL)
            *ast = cdr;
        return AST_INVALID;
    }
    if (ast != NULL) {
        *ast = ast_cons_new(car, cdr);
        (*ast)->line = line;
        (*ast)->column = column;
    }
    return AST_CONS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movsd 0x18(%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
callq 0x540c
cmpl $0x6, %eax
je 0x5501
testl %eax, %eax
jne 0x5512
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x555c
movq 0x8(%rsp), %rax
jmp 0x5559
movl $0x2, %ebp
testq %rbx, %rbx
je 0x555c
callq 0x58a9
jmp 0x5559
movq %rsp, %rsi
movq $0x0, (%rsi)
movq %r14, %rdi
callq 0x54be
testl %eax, %eax
je 0x554e
movl $0x1, %ebp
testq %rbx, %rbx
je 0x555c
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x587f
movq %rax, (%rbx)
movaps 0x10(%rsp), %xmm0
movlps %xmm0, 0x4(%rax)
jmp 0x555c
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x555c
movq (%rsp), %rax
movq %rax, (%rbx)
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_new
env_t *env_new(env_t *outer)
{
    env_t *env = malloc(sizeof(env_t));
    vector_init(&env->data);
    env->outer = outer;
    return env;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0x20e0
movq %rax, %r14
movq %rax, %rdi
callq 0x6198
movq %rbx, 0x18(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_push
void env_push(env_t *env, const char *name, value_t *value, int *index, int *offset)
{
    if (index != NULL)
        *index = 0;
    if (offset != NULL)
        *offset = env->data.count;
    binding_t *b = binding_new(name, value);
    vector_push(&env->data, (intptr_t)b);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testq %rcx, %rcx
je 0x55c1
movl $0x0, (%rcx)
testq %r8, %r8
je 0x55cd
movl 0x10(%r14), %eax
movl %eax, (%r8)
movl $0x10, %edi
callq 0x20e0
movq %r15, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x61d6
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_set
void env_set(env_t *env, const char *name, value_t *value)
{
    for (int i = 0; i < env->data.count; i++) {
        binding_t *b = (binding_t *)vector_ref(&env->data, i);
        if (b->name != NULL && strcmp(b->name, name) == 0) {
            b->value = value;
            return;
        }
    }
    binding_t *b = binding_new(name, value);
    vector_push(&env->data, (intptr_t)b);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq $0x0, 0x10(%rdi)
je 0x5635
xorl %r12d, %r12d
movq %r14, %rdi
movq %r12, %rsi
callq 0x629b
movq (%rax), %rdi
testq %rdi, %rdi
je 0x562c
movq %rax, %r13
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
je 0x565a
incq %r12
cmpq %r12, 0x10(%r14)
ja 0x560a
movl $0x10, %edi
callq 0x20e0
movq %r15, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x61d6
movq %rbx, 0x8(%r13)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_locate
int env_locate(env_t *env, const char *name, int *index, int *offset)
{
    int i = 0;
    while (!env_isempty(env)) {
        for (int j = 0; j < env->data.count; j++) {
            binding_t *b = (binding_t *)vector_ref(&env->data, j);
            if (b->name != NULL && strcmp(b->name, name) == 0) {
                if (index != NULL)
                    *index = i;
                if (offset != NULL)
                    *offset = j;
                return OK;
            }
        }
        env = env->outer;
        i++;
    }
    return ERR;
}

// Assembly:
testq %rdi, %rdi
je 0x56fb
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
xorl %ebp, %ebp
cmpq $0x0, 0x10(%r12)
je 0x56c7
xorl %r13d, %r13d
movq %r12, %rdi
movq %r13, %rsi
callq 0x629b
movq (%rax), %rdi
testq %rdi, %rdi
je 0x56bd
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
je 0x56d7
incq %r13
cmpq %r13, 0x10(%r12)
ja 0x569e
movq 0x18(%r12), %r12
incl %ebp
testq %r12, %r12
jne 0x5693
xorl %eax, %eax
jmp 0x56ec
testq %r14, %r14
je 0x56df
movl %ebp, (%r14)
movl $0x1, %eax
testq %rbx, %rbx
je 0x56ec
movl %r13d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_update
int env_update(env_t *env, int index, int offset, value_t *value)
{
    for (int i = 0; i < index && env != NULL; i++)
        env = env->outer;
    if (env == NULL || offset > env->data.count - 1)
        return ERR;
    binding_t *b = (binding_t *)vector_ref(&env->data, offset);
    b->value = value;
    return OK;
}

// Assembly:
pushq %rbx
movq %rcx, %rbx
testl %esi, %esi
setle %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x5725
movl $0x1, %eax
movq 0x18(%rdi), %rdi
cmpl %esi, %eax
jge 0x5725
incl %eax
testq %rdi, %rdi
jne 0x5716
xorl %eax, %eax
testq %rdi, %rdi
je 0x5749
movslq %edx, %rsi
movq 0x10(%rdi), %rcx
decq %rcx
cmpq %rsi, %rcx
jb 0x5749
callq 0x629b
movq %rbx, 0x8(%rax)
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_get
value_t *env_get(env_t *env, const char *name)
{
    while (!env_isempty(env)) {
        for (int i = 0; i < env->data.count; i++) {
            binding_t *b = (binding_t *)vector_ref(&env->data, i);
            if (b->name != NULL && strcmp(b->name, name) == 0)
                return b->value;
        }
        env = env->outer;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x57a7
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
cmpq $0x0, 0x10(%r15)
je 0x5796
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0x629b
movq (%rax), %rdi
testq %rdi, %rdi
je 0x578d
movq %rax, %r13
movq %r14, %rsi
callq 0x20c0
testl %eax, %eax
je 0x57a1
incq %r12
cmpq %r12, 0x10(%r15)
ja 0x576b
movq 0x18(%r15), %r15
testq %r15, %r15
jne 0x5761
jmp 0x57a9
movq 0x8(%r13), %rbx
jmp 0x57a9
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/env.c
// Function: env_ref
value_t *env_ref(env_t *env, int index, int offset)
{
    for (int i = 0; i < index && env != NULL; i++)
        env = env->outer;
    if (env == NULL || offset > env->data.count - 1)
        return NULL;
    binding_t *b = (binding_t *)vector_ref(&env->data, offset);
    return (value_t *)b->value;
}

// Assembly:
pushq %rax
testl %esi, %esi
setle %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x57da
movl $0x1, %eax
movq 0x18(%rdi), %rdi
cmpl %esi, %eax
jge 0x57da
incl %eax
testq %rdi, %rdi
jne 0x57cb
testq %rdi, %rdi
je 0x57ee
movslq %edx, %rsi
movq 0x10(%rdi), %rax
decq %rax
cmpq %rsi, %rax
jae 0x57f2
xorl %eax, %eax
jmp 0x57fb
callq 0x629b
movq 0x8(%rax), %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/ast.c
// Function: ast_ident_new
ast_t *ast_ident_new(const char *id)
{
    ast_t *a = ast_alloc(AST_IDENTIFIER);
    a->u.ident_val = string_new();
    string_assign(a->u.ident_val, id);
    return a;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0x20e0
movq %rax, %r14
movl $0x4, (%rax)
callq 0x5fdf
movq %rax, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x606b
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/ast.c
// Function: ast_free
void ast_free(ast_t *a)
{
    switch (a->kind) {
        case AST_CONS:
            ast_free(a->u.cons_val.car);
            ast_free(a->u.cons_val.cdr);
            break;
        case AST_IDENTIFIER:
            string_free(a->u.ident_val);
            break;
        default :;
    }
    free(a);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x4, %eax
je 0x5944
cmpl $0x1, %eax
jne 0x594d
movq 0x10(%rbx), %rdi
callq 0x5920
movq 0x18(%rbx), %rdi
callq 0x5920
jmp 0x594d
movq 0x10(%rbx), %rdi
callq 0x6014
movq %rbx, %rdi
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/ast.c
// Function: ast_print
void ast_print(ast_t *a, FILE *output)
{
    switch (a->kind) {
        case AST_CONS:
            ast_print_cons(a, output);
            break;
        case AST_END_OF_CONS:
            fprintf(output, "()");
            break;
        case AST_IDENTIFIER:
            fprintf(output, "%s", a->u.ident_val->text);
            break;
        case AST_INTEGER:
            fprintf(output, "%d", AST_INT_VALUE(a));
            break;
        default :
            fprintf(stderr, "Don't know how to print: %d", a->kind);
            exit(1);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x5a23
movq %rsi, %rbx
leaq 0x1e4d(%rip), %rdx      # 0x77c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x10(%rdi), %r15
movq 0x18(%rdi), %r14
movl $0x28, %edi
movq %rbx, %rsi
callq 0x20a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5956
cmpl $0x2, (%r14)
je 0x59c6
leaq 0x1761(%rip), %rdi      # 0x710a
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2140
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5956
movl $0x29, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x20a0
movq 0x10(%rdi), %rax
movq (%rax), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2070
movl 0x10(%rdi), %edx
leaq 0x1d51(%rip), %rsi      # 0x7747
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x20d0
leaq 0x16b7(%rip), %rdi      # 0x70c3
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x2140
movl %eax, %edi
callq 0x2226
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/ast.c
// Function: ast_cons_length
int ast_cons_length(ast_t *cons)
{
    assert(cons->kind == AST_CONS || cons->kind == AST_END_OF_CONS);
    int i = 0;
    while (cons->kind != AST_END_OF_CONS) {
        i++;
        cons = AST_CONS_CDR(cons);
    }
    return i;
}

// Assembly:
pushq %rax
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
cmpl $0x1, %eax
ja 0x5a4b
xorl %eax, %eax
cmpl $0x2, %ecx
je 0x5a49
xorl %eax, %eax
incl %eax
movq 0x18(%rdi), %rdi
cmpl $0x2, (%rdi)
jne 0x5a3e
popq %rcx
retq
leaq 0x1d9e(%rip), %rdi      # 0x77f0
leaq 0x1dcf(%rip), %rsi      # 0x7828
leaq 0x1dce(%rip), %rcx      # 0x782e
movl $0x72, %edx
callq 0x2060
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/ast.c
// Function: is_valof_form
int is_valof_form(ast_t *expr)
{
    if (expr->kind == AST_CONS
            && AST_CONS_CAR(expr)->kind == AST_IDENTIFIER
            && strcmp(AST_IDENT_NAME( AST_CONS_CAR(expr) ), "valof") == 0
            && AST_CONS_CADR(expr)->kind == AST_IDENTIFIER)
        return 1;
    else
        return 0;
}

// Assembly:
pushq %rbx
cmpl $0x1, (%rdi)
jne 0x5aa5
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpl $0x4, (%rax)
jne 0x5aa5
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x1937(%rip), %rsi      # 0x73c1
callq 0x20c0
testl %eax, %eax
jne 0x5aa5
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rcx
movl $0x1, %eax
cmpl $0x4, (%rcx)
je 0x5aa7
xorl %eax, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/lexer.c
// Function: lexer_new
lexer_t *lexer_new(FILE *src)
{
    lexer_t *l = malloc(sizeof(lexer_t));
    l->src = src;
    l->text = string_new();
    l->tk_line = l->line = 1;
    l->tk_column = l->column = 0;
    return l;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0x20e0
movq %rax, %r14
movq %rbx, (%rax)
callq 0x5fdf
movq %rax, 0x8(%r14)
movaps 0x1d7d(%rip), %xmm0     # 0x7850
movups %xmm0, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/lexer.c
// Function: lexer_gettoken
token_t lexer_gettoken(lexer_t *l)
{
    int c = lexer_getc(l);
    switch (c) {
        case EOF: return TOKEN_EOF;
        case ' ': case '\n': case '\t': return lexer_gettoken(l);
        case '(': return TOKEN_LEFT_PAREN;
        case ')': return TOKEN_RIGHT_PAREN;
        case ';':
            lexer_skip_comment(l);
            return lexer_gettoken(l);
        default :
            if (isdigit(c))
                return lexer_getinteger(l, c);
            else
                return lexer_getidentifier(l, c);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x5c4e
movl %eax, %r14d
cmpl $0x1f, %eax
jle 0x5b22
cmpl $0x28, %r14d
jg 0x5b2d
cmpl $0x20, %r14d
je 0x5b04
jmp 0x5b57
leal -0x9(%r14), %eax
cmpl $0x2, %eax
jb 0x5b04
jmp 0x5b47
cmpl $0x3b, %r14d
jne 0x5b67
movq %rbx, %rdi
callq 0x5c4e
cmpl $-0x1, %eax
je 0x5b04
cmpl $0xa, %eax
jne 0x5b33
jmp 0x5b04
cmpl $-0x1, %r14d
jne 0x5b77
movl $0x1, %eax
jmp 0x5c3a
cmpl $0x28, %r14d
jne 0x5b77
movl $0x4, %eax
jmp 0x5c3a
cmpl $0x29, %r14d
jne 0x5b77
movl $0x5, %eax
jmp 0x5c3a
callq 0x2150
movq %rax, %r15
movq (%rax), %rax
movslq %r14d, %rcx
movzwl (%rax,%rcx,2), %ebp
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rax
movq %rax, 0x18(%rbx)
callq 0x60a4
btl $0xb, %ebp
jb 0x5bf7
movabsq $0x60000000001, %r12    # imm = 0x60000000001
movq 0x8(%rbx), %rdi
movsbl %r14b, %esi
callq 0x6029
movq %rbx, %rdi
callq 0x5c4e
movl %eax, %r14d
movq (%r15), %rax
movslq %r14d, %rcx
movzwl (%rax,%rcx,2), %eax
btl $0xd, %eax
jb 0x5c43
movl %r14d, %eax
incl %eax
cmpl $0x2a, %eax
ja 0x5baa
btq %rax, %r12
jae 0x5baa
decl 0x14(%rbx)
movq (%rbx), %rsi
movl %r14d, %edi
callq 0x2100
movl $0x2, %eax
jmp 0x5c3a
movq 0x8(%rbx), %rdi
movsbl %r14b, %esi
callq 0x6029
movq %rbx, %rdi
callq 0x5c4e
movl %eax, %r14d
movq (%r15), %rax
movslq %r14d, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x5bf7
cmpl $0xa, %r14d
jne 0x5c27
decl 0x10(%rbx)
jmp 0x5c2a
decl 0x14(%rbx)
movq (%rbx), %rsi
movl %r14d, %edi
callq 0x2100
movl $0x3, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xa, %r14d
jne 0x5be2
decl 0x10(%rbx)
jmp 0x5be5
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/lexer.c
// Function: lexer_getc
static int lexer_getc(lexer_t *l)
{
    int c = fgetc(l->src);
    if (c == '\n') {
        l->line++;
        l->column = 0;
    } else
        l->column++;
    return c;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2090
cmpl $0xa, %eax
jne 0x5c6b
incl 0x10(%rbx)
movl $0x0, 0x14(%rbx)
jmp 0x5c6e
incl 0x14(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_table_set
void hash_table_set(hash_table_t *tbl, void *key, void *value)
{
    size_t i = hash_table_hash(tbl, key);
    table_entry_t *ent = tbl->slots[i];
    while (ent != NULL) {
        if (hash_table_iseq(tbl, ent->key, key))
            break;
        ent = ent->next;
    }
    if (ent == NULL) {
        ent = malloc(sizeof(table_entry_t));
        ent->key = key;
        ent->next = tbl->slots[i];
        tbl->slots[i] = ent;
    }
    ent->value = value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq *0x18(%r12)
xorl %ebp, %ebp
xorl %edx, %edx
divq 0x8(%r12)
movq %rdx, %r15
movq (%r12), %rbx
movq (%rbx,%rdx,8), %r13
testq %r13, %r13
je 0x5d27
movq (%r13), %rdi
movq %r14, %rsi
callq *0x20(%r12)
testl %eax, %eax
jne 0x5d3f
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x5d06
movq (%r12), %rbx
movq (%rbx,%r15,8), %rbp
movl $0x18, %edi
callq 0x20e0
movq %rax, %r13
movq %r14, (%rax)
movq %rbp, 0x10(%rax)
movq %rax, (%rbx,%r15,8)
movq (%rsp), %rax
movq %rax, 0x8(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_table_get
void *hash_table_get(hash_table_t *tbl, void *key, int *is_found)
{
    size_t i = hash_table_hash(tbl, key);
    table_entry_t *ent = tbl->slots[i];
    while (ent != NULL) {
        if (hash_table_iseq(tbl, ent->key, key)) {
            if (is_found != NULL)
                *is_found = 1;
            return ent->value;
        }
        ent = ent->next;
    }
    if (is_found != NULL)
        *is_found = 0;
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq *0x18(%r15)
xorl %edx, %edx
divq 0x8(%r15)
movq (%r15), %rax
movq (%rax,%rdx,8), %r12
testq %r12, %r12
je 0x5d96
movq (%r12), %rdi
movq %r14, %rsi
callq *0x20(%r15)
testl %eax, %eax
jne 0x5da5
movq 0x10(%r12), %r12
jmp 0x5d7b
testq %rbx, %rbx
je 0x5da1
movl $0x0, (%rbx)
xorl %eax, %eax
jmp 0x5db5
testq %rbx, %rbx
je 0x5db0
movl $0x1, (%rbx)
movq 0x8(%r12), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_str
size_t hash_str(void *str)
{
    const char *_str = str;
    unsigned int seed = 131;
    unsigned int hash = 0;
    while (*_str != '\0') {
        hash = hash * seed + (*_str);
        _str++;
    }
    return hash & 0x7FFFFFFF;
}

// Assembly:
movb (%rdi), %cl
xorl %eax, %eax
testb %cl, %cl
je 0x5de9
incq %rdi
movsbl %cl, %ecx
imull $0x83, %eax, %eax
addl %ecx, %eax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x5dd0
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_new
seg_vector_t *seg_vector_new(seg_vector_t *next)
{
    seg_vector_t *sv = malloc(sizeof(*sv));
    sv->data = vector_new();
    sv->next = next;
    return sv;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %edi
callq 0x20e0
movq %rax, %r14
callq 0x61aa
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_locate
int seg_vector_locate(seg_vector_t *sv, const void *key, vec_comp_func_t comp_func, int *seg_index, int *vector_index)
{
    int si = 0;
    while (sv != NULL) {
        int vi = vector_posif(sv->data, (intptr_t)key, comp_func);
        if (vi != -1) {
            if (seg_index != NULL)
                *seg_index = si;
            if (vector_index != NULL)
                *vector_index = vi;
            return 1;
        }
        sv = sv->next;
        si++;
    }
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x5e90
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
movq (%r13), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6223
cmpl $-0x1, %eax
jne 0x5e93
movq 0x8(%r13), %r13
incl %ebp
testq %r13, %r13
jne 0x5e6d
xorl %eax, %eax
jmp 0x5ea9
xorl %eax, %eax
retq
movl %eax, %ecx
testq %r14, %r14
je 0x5e9d
movl %ebp, (%r14)
movl $0x1, %eax
testq %rbx, %rbx
je 0x5ea9
movl %ecx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_locate2
int seg_vector_locate2(seg_vector_t *sv, const void *key, vec_comp_func_t comp_func, int *seg_index, int *vector_index, int *is_last_seg)
{
    int si = 0;
    while (sv != NULL) {
        int vi = vector_posif(sv->data, (intptr_t)key, comp_func);
        if (vi != -1) {
            if (seg_index != NULL)
                *seg_index = si;
            if (vector_index != NULL)
                *vector_index = vi;
            if (is_last_seg != NULL) {
                if (sv->next == NULL)
                    *is_last_seg = 1;
                else
                    *is_last_seg = 0;
            }
            return 1;
        }
        sv = sv->next;
        si++;
    }
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x5eff
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movq %r9, (%rsp)
xorl %ebx, %ebx
movq (%r14), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x6223
cmpl $-0x1, %eax
jne 0x5f02
movq 0x8(%r14), %r14
incl %ebx
testq %r14, %r14
jne 0x5edd
xorl %eax, %eax
jmp 0x5f2d
xorl %eax, %eax
retq
testq %r12, %r12
movq (%rsp), %rdx
je 0x5f0f
movl %ebx, (%r12)
testq %r15, %r15
je 0x5f17
movl %eax, (%r15)
movl $0x1, %eax
testq %rdx, %rdx
je 0x5f2d
xorl %ecx, %ecx
cmpq $0x0, 0x8(%r14)
sete %cl
movl %ecx, (%rdx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_set
int seg_vector_set(seg_vector_t *sv, void *obj, int i, int j)
{
    while (i > 0 && sv != NULL) {
        sv = sv->next;
        i--;
    }
    if (sv->data->count < j)
        return 0;
    vector_set(sv->data, (intptr_t)obj, j);
    return 1;
}

// Assembly:
pushq %rax
testl %edx, %edx
setle %al
testq %rdi, %rdi
sete %r8b
orb %al, %r8b
jne 0x5f5e
movq 0x8(%rdi), %rdi
cmpl $0x2, %edx
jb 0x5f5e
decl %edx
testq %rdi, %rdi
jne 0x5f4e
movq (%rdi), %rdi
movslq %ecx, %rdx
xorl %eax, %eax
cmpq %rdx, 0x10(%rdi)
jb 0x5f78
movl %ecx, %edx
callq 0x61c1
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_ref
void *seg_vector_ref(seg_vector_t *sv, int i, int j)
{
    while (i > 0 && sv != NULL) {
        sv = sv->next;
        i--;
    }
    if (sv->data->count < j)
        return NULL;
    return (void *)vector_ref(sv->data, j);
}

// Assembly:
pushq %rax
testl %esi, %esi
setle %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x5f9a
movq 0x8(%rdi), %rdi
cmpl $0x2, %esi
jb 0x5f9a
decl %esi
testq %rdi, %rdi
jne 0x5f8a
movq (%rdi), %rdi
movslq %edx, %rsi
cmpq %rsi, 0x10(%rdi)
jae 0x5faa
xorl %eax, %eax
jmp 0x5faf
callq 0x629b
popq %rcx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/string.c
// Function: string_addc
void string_addc(string_t *s, char c)
{
    if (string_isfull(s))
        string_incr(s, DELTA);
    s->text[s->length] = c;
    s->length++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rcx
leaq 0x1(%rcx), %rdx
cmpq %rsi, %rdx
jb 0x605c
addq $0xa, %rsi
movq %rsi, 0x8(%rbx)
movq %rax, %rdi
callq 0x2110
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb %bpl, (%rax,%rcx)
incq 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/string.c
// Function: string_assign
void string_assign(string_t *str, const char *src)
{
    while (*src != '\0') {
        string_addc(str, *src);
        src++;
    }
    string_addc(str, '\0');
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rsi), %al
testb %al, %al
je 0x6093
movq %rsi, %r14
incq %r14
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6029
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x607e
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6029
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/vector.c
// Function: vector_push
void vector_push(vector_t *v, intptr_t data)
{
#define DELTA 10
    if (vector_isfull(v))
        vector_incr(v, DELTA);
    v->slots[v->count] = data;
    v->count++;
#undef DELTA
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
leaq 0x1(%rcx), %rsi
cmpq %rdx, %rsi
jb 0x6213
leaq 0xa(%rdx), %rcx
movq %rcx, 0x8(%rbx)
leaq 0x50(,%rdx,8), %rsi
movq %rax, %rdi
callq 0x2110
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
incq 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Liutos[P]Eloquent/utils/vector.c
// Function: vector_posif
int vector_posif(vector_t *v, intptr_t key, vec_comp_func_t comp_func)
{
    int i = 0;
    while (i < v->count) {
        if ((*comp_func)(v->slots[i], key))
            return i;
        i++;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x0, 0x10(%rdi)
je 0x6265
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq (%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r15, %rsi
callq *%r14
testl %eax, %eax
jne 0x6262
incq %r13
cmpq %r13, 0x10(%r12)
ja 0x6244
jmp 0x6265
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: linkScreenFree
void linkScreenFree(LinkScreen *screen)
{
    int i;
    if (screen == NULL)
        return ;
    for (i = 0; i < screen->allocLineCount; i++)
        free(screen->screenLines[i]);

    free(screen->screenLines);
    free(screen);
}

// Assembly:
testq %rdi, %rdi
je 0x2609
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x18(%rdi)
jle 0x25f1
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2230
incq %r14
movslq 0x18(%rbx), %rax
cmpq %rax, %r14
jl 0x25d8
movq 0x20(%rbx), %rdi
callq 0x2230
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2230
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: linkScreenSetup
void linkScreenSetup(LinkScreen *screen, const char *subreddit, const RedditListType listType)
{
    screen->list = redditLinkListNew();
    screen->list->subreddit = redditCopyString(subreddit);
    screen->list->type = listType;

    redditGetListing(screen->list);

    screen->displayed = LINES - 1;
    screen->linkOpenSize = (screen->displayed / 5) * 4;

    screen->offset = 0;
    screen->selected = 0;

    /* Assign help-screen text */
    screen->helpText = linkScreenHelp;
    screen->helpLineCount = sizeof(linkScreenHelp)/sizeof(linkScreenHelp[0]);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
callq 0x21f0
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x2060
movq (%rbx), %rdi
movq %rax, (%rdi)
movl %ebp, 0x10(%rdi)
callq 0x2140
movq 0x6983(%rip), %rax      # 0x8fc0
movl (%rax), %eax
decl %eax
movl %eax, 0x8(%rbx)
cltq
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x21, %rax
addl %ecx, %eax
shll $0x2, %eax
movl %eax, 0x28(%rbx)
movq $0x0, 0xc(%rbx)
leaq 0x6b81(%rip), %rax      # 0x91f0
movq %rax, 0x38(%rbx)
movl $0x1a, 0x30(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenFreeLines
void commentScreenFreeLines (CommentScreen *screen)
{
    int i;
    if (screen == NULL)
        return ;
    for (i = 0; i < screen->lineCount; i++)
        commentLineFree(screen->lines[i]);
    free(screen->lines);
    screen->lines = NULL;
    screen->lineCount = 0;
    screen->allocLineCount = 0;
}

// Assembly:
testq %rdi, %rdi
je 0x2700
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
cmpl $0x0, 0x8(%rdi)
jle 0x26eb
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x268e
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x26d2
movq 0x10(%rbx), %rdi
callq 0x2230
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenFree
void commentScreenFree(CommentScreen *screen)
{
    if (screen == NULL)
        return ;
    commentScreenFreeLines(screen);

    free(screen->lines);
    free(screen);
}

// Assembly:
testq %rdi, %rdi
je 0x2721
pushq %rbx
movq %rdi, %rbx
callq 0x26b8
movq 0x10(%rbx), %rdi
callq 0x2230
movq %rbx, %rdi
popq %rbx
jmp 0x2230
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenAddLine
void commentScreenAddLine(CommentScreen *screen, CommentLine *line)
{
    screen->lineCount++;
    if (screen->lineCount >= screen->allocLineCount) {
        screen->allocLineCount+=100;
        screen->lines = realloc(screen->lines, sizeof(CommentLine**) * screen->allocLineCount);
    }
    screen->lines[screen->lineCount - 1] = line;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %ecx
incl %ecx
movl %ecx, 0x8(%rdi)
movslq 0xc(%rdi), %rax
cmpl %eax, %ecx
jge 0x2742
movq 0x10(%r14), %rax
jmp 0x2763
leaq 0x64(%rax), %rcx
movl %ecx, 0xc(%r14)
movq 0x10(%r14), %rdi
leaq 0x320(,%rax,8), %rsi
callq 0x2320
movq %rax, 0x10(%r14)
movl 0x8(%r14), %ecx
movslq %ecx, %rcx
movq %rbx, -0x8(%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: createCommentLine
wchar_t *createCommentLine(RedditComment *comment, int width, int indent)
{
    wchar_t *text = malloc(sizeof(wchar_t) * (width+1));
    int i, ilen = indent * 3, bodylen, texlen;

    bodylen = wcslen(comment->wbodyEsc);
    memset(text, 32, sizeof(wchar_t) * (width));
    text[width] = (wchar_t)0;

    if (comment->directChildrenCount > 0)
        swprintf(text + ilen, width + 1 - ilen, L"%s (%d hidden) > ", comment->author, comment->totalReplyCount);
    else
        swprintf(text + ilen, width + 1 - ilen, L"%s > ", comment->author);

    texlen = wcslen(text);
    for (i = 0; i <= width - texlen - 1; i++)
        if (i <= bodylen - 1 && comment->wbodyEsc[i] != L'\n')
            text[i + texlen] = comment->wbodyEsc[i];
        else
            text[i + texlen] = (wchar_t)32;

    return text;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r12d
movl %esi, %ebx
movq %rdi, %r14
movslq %esi, %r13
leaq 0x4(,%r13,4), %rdi
callq 0x2260
movq %rax, %r15
leal (%r12,%r12,2), %ebp
movq 0x48(%r14), %rdi
callq 0x21b0
movq %rax, %r12
leaq (,%r13,4), %rdx
movq %r15, %rdi
movl $0x20, %esi
callq 0x2110
movl $0x0, (%r15,%r13,4)
subl %ebp, %r13d
incl %r13d
cmpl $0x0, 0x60(%r14)
movslq %ebp, %rax
leaq (%r15,%rax,4), %rdi
movslq %r13d, %rsi
movq 0x20(%r14), %rcx
jle 0x27f5
movl 0x5c(%r14), %r8d
leaq 0x3bc0(%rip), %rdx      # 0x63ac
xorl %eax, %eax
callq 0x2290
jmp 0x2803
leaq 0x3bf8(%rip), %rdx      # 0x63f4
xorl %eax, %eax
callq 0x2290
movq %r15, %rdi
callq 0x21b0
cmpl %ebx, %eax
jns 0x283d
movslq %r12d, %rcx
subl %eax, %ebx
cltq
leaq (%r15,%rax,4), %rax
xorl %edx, %edx
cmpq %rcx, %rdx
jge 0x282d
movq 0x48(%r14), %rsi
movl (%rsi,%rdx,4), %esi
cmpl $0xa, %esi
jne 0x2832
movl $0x20, %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rbx
jne 0x281c
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: getCommentScreenRecurse
int getCommentScreenRecurse(CommentScreen *screen, RedditComment *comment, int width, int indent)
{
    int i;
    RedditComment *current;
    CommentLine *line;
    int indentCur = indent + 1;
    int nested = 0;
    for (i = 0; i < comment->replyCount; i++) {
        current = comment->replies[i];
        line = commentLineNew();
        line->text = createCommentLine(current, width, indentCur);
        line->indentCount = indentCur;
        line->comment = current;
        commentScreenAddLine(screen, line);
        if (current->replyCount) {
            line->foldCount = getCommentScreenRecurse(screen, current, width, indentCur);
            nested += line->foldCount;
        }
        nested++;
    }
    return nested;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x0, (%rsi)
jle 0x2902
movl %ecx, %ebx
movq %rdi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
incl %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rsi, 0x10(%rsp)
movl %ebx, (%rsp)
movl 0x4(%rsp), %r14d
movq 0x8(%rsi), %rax
movq (%rax,%r15,8), %r13
movl $0x1, %edi
movl $0x20, %esi
callq 0x2170
movq %rax, %rbp
movq %r13, %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x2773
movq %rax, (%rbp)
movl %ebx, 0x18(%rbp)
movq %r13, 0x8(%rbp)
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2722
cmpl $0x0, (%r13)
je 0x28ea
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movl (%rsp), %ebx
movl %ebx, %ecx
callq 0x284f
movl %eax, 0x14(%rbp)
addl %eax, %r12d
jmp 0x28ed
movl (%rsp), %ebx
incl %r12d
incq %r15
movq 0x10(%rsp), %rsi
movslq (%rsi), %rax
cmpq %rax, %r15
jl 0x2886
jmp 0x2905
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenDown
void commentScreenDown(CommentScreen *screen)
{
    screen->selected++;
    if (screen->selected > screen->offset + screen->displayed) {
        if (screen->offset + screen->displayed + 1 < screen->lineCount)
            screen->offset++;
        else
            screen->selected--;
    } else if (screen->selected > screen->lineCount - 1) {
        screen->selected--;
    }
}

// Assembly:
movl 0x1c(%rdi), %ecx
movl 0x20(%rdi), %eax
leal 0x1(%rax), %edx
movl %edx, 0x20(%rdi)
movl 0x18(%rdi), %edx
addl %ecx, %edx
cmpl %edx, %eax
jge 0x299e
movl 0x8(%rdi), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x29ab
retq
incl %edx
cmpl 0x8(%rdi), %edx
jge 0x29ab
incl %ecx
movl %ecx, 0x1c(%rdi)
retq
movl %eax, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenLevelDown
void commentScreenLevelDown(CommentScreen *screen) 
{
    int newPosition = screen->selected;
    int indentCount = screen->lines[screen->selected]->indentCount;
    while (++newPosition < screen->lineCount) {
        if (screen->lines[newPosition]->indentCount < indentCount)
            return;
        if (screen->lines[newPosition]->indentCount == indentCount) {
            screen->offset += newPosition - screen->selected;
            screen->selected = newPosition;
            return;
        }
    }
}

// Assembly:
movslq 0x20(%rdi), %rcx
movl %ecx, %eax
movq 0x10(%rdi), %rdx
leaq (%rdx,%rcx,8), %rdx
addq $0x8, %rdx
movq -0x8(%rdx), %rsi
movl 0x18(%rsi), %r8d
movslq 0x8(%rdi), %r9
incq %rcx
xorl %esi, %esi
leaq (%rcx,%rsi), %r10
cmpq %r9, %r10
jge 0x29f8
movq (%rdx,%rsi,8), %r10
movl 0x18(%r10), %r10d
cmpl %r8d, %r10d
jl 0x29f8
incq %rsi
cmpl %r8d, %r10d
jne 0x29d2
addl %esi, %eax
addl %esi, 0x1c(%rdi)
movl %eax, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenLevelUp
void commentScreenLevelUp(CommentScreen *screen)
{
    int newPosition = screen->selected;
    int indentCount = screen->lines[screen->selected]->indentCount;
    while (--newPosition >= 0) {
        if (screen->lines[newPosition]->indentCount < indentCount)
            return;
        if (screen->lines[newPosition]->indentCount == indentCount) {
            screen->offset += newPosition - screen->selected;
            if (screen->offset < 0) screen->offset = 0;
            screen->selected = newPosition;
            return;
        }
    }
}

// Assembly:
movl 0x20(%rdi), %eax
movq 0x10(%rdi), %rcx
movslq %eax, %rdx
movq (%rcx,%rdx,8), %rdx
movl 0x18(%rdx), %edx
leaq (%rcx,%rax,8), %rsi
addq $-0x8, %rsi
xorl %ecx, %ecx
leal (%rax,%rcx), %r8d
testl %r8d, %r8d
jle 0x2a46
movq (%rsi), %r8
movl 0x18(%r8), %r8d
cmpl %edx, %r8d
jl 0x2a46
decl %ecx
addq $-0x8, %rsi
cmpl %edx, %r8d
jne 0x2a14
addl %ecx, %eax
addl 0x1c(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovgl %ecx, %edx
movl %edx, 0x1c(%rdi)
movl %eax, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenUp
void commentScreenUp(CommentScreen *screen)
{
    screen->selected--;
    if (screen->selected < 0)
        screen->selected++;
    if (screen->selected < screen->offset)
        screen->offset--;
}

// Assembly:
movl 0x1c(%rdi), %eax
movl 0x20(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
setg %dl
subl %edx, %ecx
movl %ecx, 0x20(%rdi)
cmpl %eax, %ecx
jge 0x2a62
decl %eax
movl %eax, 0x1c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenCommentScrollDown
void commentScreenCommentScrollDown(CommentScreen *screen)
{
    RedditComment *current = screen->lines[screen->selected]->comment;
    wchar_t *currentTextPointer = &(current->wbodyEsc[current->advance]);
    
    wchar_t *foundNewLineString = wcschr(currentTextPointer, L'\n');

    // We found a \n char, so advance to it if it's before end-of-screen
    if (foundNewLineString != NULL) 
    {
        unsigned int distanceToNewLine = foundNewLineString - currentTextPointer + 1;
        if (distanceToNewLine < screen->width)
        {
            current->advance += distanceToNewLine;
            return;
        }
    }

    if (wcslen(currentTextPointer) > screen->width)
        current->advance += screen->width;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rax
movslq 0x20(%rdi), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %r15
movslq 0x84(%r15), %r12
leaq (,%r12,4), %rbx
addq 0x48(%r15), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2070
testq %rax, %rax
je 0x2ab6
subq %rbx, %rax
shrq $0x2, %rax
incl %eax
movl 0x24(%r14), %ebp
cmpl %ebp, %eax
jae 0x2aba
jmp 0x2acf
movl 0x24(%r14), %ebp
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rcx
movslq %ebp, %rdx
movl %ebp, %eax
cmpq %rdx, %rcx
jbe 0x2ad9
addl %eax, %r12d
movl %r12d, 0x84(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenCommentScrollUp
void commentScreenCommentScrollUp(CommentScreen *screen)
{
    RedditComment *current = screen->lines[screen->selected]->comment;

    if (current->advance == 0)
        return;

    wchar_t *currentTextPointer = &(current->wbodyEsc[current->advance - 1]);
    const wchar_t *foundNewLineString = reverse_wcsnchr(currentTextPointer - 1, current->advance - 1, L'\n');

    unsigned int distanceToScroll = 0;
    unsigned int distanceToNewLine = 0;

    if (foundNewLineString != NULL)
        distanceToNewLine = currentTextPointer - foundNewLineString;
                            /*wcslen(foundNewLineString);*/
    else
        distanceToNewLine = current->advance;

    distanceToScroll = (distanceToNewLine % screen->width == 0) ?
                        screen->width :
                        distanceToNewLine % screen->width;

    current->advance -= distanceToScroll;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movslq 0x20(%rdi), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %r14
movslq 0x84(%r14), %r15
testq %r15, %r15
je 0x2b61
movq %rdi, %rbx
movq 0x48(%r14), %r12
leaq -0x1(%r15), %rsi
leaq (%r12,%r15,4), %rdi
addq $-0x8, %rdi
movl $0xa, %edx
callq 0x2594
testq %rax, %rax
je 0x2b43
movq %rax, %rcx
leaq (%r12,%r15,4), %rax
addq $-0x4, %rax
subq %rcx, %rax
shrq $0x2, %rax
movl 0x84(%r14), %ecx
jmp 0x2b4c
movl 0x84(%r14), %ecx
movl %ecx, %eax
movl 0x24(%rbx), %esi
xorl %edx, %edx
divl %esi
testl %edx, %edx
cmovel %esi, %edx
subl %edx, %ecx
movl %ecx, 0x84(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: commentScreenOpenComment
void commentScreenOpenComment(CommentScreen *screen)
{
    if (!screen->commentOpen) {
        screen->commentOpen = 1;
        screen->displayed -= screen->commentOpenSize - 1;
        if (screen->selected > screen->displayed + screen->offset)
            screen->offset = screen->selected - screen->displayed;
    }
}

// Assembly:
movb 0x2c(%rdi), %al
testb $0x1, %al
jne 0x308b
orb $0x1, %al
movb %al, 0x2c(%rdi)
movl 0x18(%rdi), %eax
movl 0x20(%rdi), %ecx
subl 0x28(%rdi), %eax
incl %eax
movl %eax, 0x18(%rdi)
movl 0x1c(%rdi), %edx
addl %eax, %edx
cmpl %edx, %ecx
jle 0x308b
subl %eax, %ecx
movl %ecx, 0x1c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: linkScreenRenderLine
void linkScreenRenderLine (LinkScreen *screen, int line, int width)
{
    size_t tmp, title;
    size_t offset;
    if (screen->allocLineCount <= line) {
        screen->allocLineCount = line + 100;
        screen->screenLines = realloc(screen->screenLines, screen->allocLineCount * sizeof(wchar_t*));
        memset(screen->screenLines + screen->allocLineCount - 100, 0, sizeof(wchar_t*) * 100);
    }

    if (screen->screenLineCount < line)
        screen->screenLineCount = line;

    screen->screenLines[line] = realloc(screen->screenLines[line], (width + 1) * sizeof(wchar_t));

    swprintf(screen->screenLines[line], width + 1, L"%2d. [%4d] %20s - ", line + 1, screen->list->links[line]->score, screen->list->links[line]->author);

    offset = wcslen(screen->screenLines[line]);
    title = wcslen(screen->list->links[line]->wtitleEsc);
    for (tmp = 0; tmp <= width - offset; tmp++)
        if (tmp >= title)
            screen->screenLines[line][tmp + offset] = (wchar_t)32;
        else
            screen->screenLines[line][tmp + offset] = screen->list->links[line]->wtitleEsc[tmp];

    screen->screenLines[line][width] = (wchar_t)0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r12
cmpl %esi, 0x18(%rdi)
jg 0x3315
leal 0x64(%r12), %eax
movl %eax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
leaq 0x320(,%r12,8), %rsi
callq 0x2320
movq %rax, 0x20(%rbx)
movslq 0x18(%rbx), %rcx
leaq (%rax,%rcx,8), %rdi
addq $-0x320, %rdi           # imm = 0xFCE0
movl $0x320, %edx            # imm = 0x320
xorl %esi, %esi
callq 0x2110
cmpl %ebp, 0x14(%rbx)
jge 0x331d
movl %ebp, 0x14(%rbx)
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
movslq %r14d, %rax
movq %rax, (%rsp)
leaq 0x1(%rax), %r14
leaq 0x4(,%rax,4), %rsi
callq 0x2320
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq (%rbx), %rax
movq 0x20(%rbx), %rcx
movq (%rcx,%r12,8), %rdi
incl %ebp
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rax
movl 0x58(%rax), %r8d
movq 0x18(%rax), %r9
leaq 0x310f(%rip), %rdx      # 0x6478
xorl %r13d, %r13d
movq %r14, %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2290
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %r14
movq %r14, %rdi
callq 0x21b0
movq %rax, %r15
movq (%rbx), %rax
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rax
movq 0x48(%rax), %rbx
movq %rbx, %rdi
callq 0x21b0
movq (%rsp), %rdi
movq %rdi, %rcx
subq %r15, %rcx
leaq (%r14,%r15,4), %rdx
movl $0x20, %esi
cmpq %rax, %r13
jae 0x33be
movl (%rbx,%r13,4), %esi
movl %esi, (%rdx,%r13,4)
leaq 0x1(%r13), %rsi
cmpq %rcx, %r13
movq %rsi, %r13
jb 0x33b0
movl $0x0, (%r14,%rdi,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: linkScreenSetupSplit
void linkScreenSetupSplit (LinkScreen *screen, wchar_t *tmpbuf, int bufLen, int lastLine)
{
    int i;

    for (i = 0; i < bufLen; i++)
        tmpbuf[i] = L'-';

    tmpbuf[bufLen] = (wchar_t)0;
    attron(COLOR_PAIR(2));
    mvaddwstr(lastLine, 0, tmpbuf);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rsi, %rbx
testl %edx, %edx
jle 0x34f4
movl %edx, %ecx
leal 0x3(%rdx), %eax
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %eax
shlq $0x4, %rax
movdqa 0x1bf9(%rip), %xmm1     # 0x5010
movdqa 0x1c01(%rip), %xmm2     # 0x5020
xorl %ecx, %ecx
movdqa 0x1c07(%rip), %xmm3     # 0x5030
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x1c07(%rip), %xmm5     # 0x5040
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x3475
movl $0x2d, (%rbx,%rcx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x348c
movl $0x2d, 0x4(%rbx,%rcx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %esi
testb $0x1, %sil
je 0x34cc
movl $0x2d, 0x8(%rbx,%rcx)
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x34df
movl $0x2d, 0xc(%rbx,%rcx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x3439
movslq %edx, %rax
movl $0x0, (%rbx,%rax,4)
movq 0x5adb(%rip), %r14      # 0x8fe0
movq (%r14), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %edx, %edx
callq 0x22e0
movq (%r14), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2160
cmpl $-0x1, %eax
je 0x3539
movq (%r14), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
jmp 0x22b0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: linkScreenRenderLinkText
void linkScreenRenderLinkText (LinkScreen *screen, wchar_t *tmpbuf, int bufLen, int screenLines)
{
    RedditLink *current;
    int lastLine = screenLines - screen->offset;

    linkScreenSetupSplit(screen, tmpbuf, bufLen, lastLine);

    attron(COLOR_PAIR(1));
    if (screen->list->linkCount >= screen->selected) {
        current = screen->list->links[screen->selected];
        if (current != NULL) {
            swprintf(tmpbuf, bufLen, L"%s - %d Score / %d Comments / %s \nTitle: ", current->author, current->score, current->numComments, current->created_utc);
            mvaddwstr(lastLine + 1, 0, tmpbuf);
            addwstr(current->wtitleEsc);
            addch('\n');
            swprintf(tmpbuf, bufLen, L"-------\n");
            addwstr(tmpbuf);

            if (current->flags & REDDIT_LINK_IS_SELF)
                addwstr(&(current->wselftextEsc[current->advance]));
            else
                addstr(current->url);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
subl 0xc(%rdi), %ebp
movl %ebp, %ecx
callq 0x33e5
movq 0x5a7a(%rip), %r12      # 0x8fe0
movq (%r12), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x22e0
movq (%r15), %rax
movslq 0x10(%r15), %rcx
cmpl %ecx, 0x14(%rax)
jl 0x3651
movq 0x18(%rax), %rax
movq (%rax,%rcx,8), %r15
testq %r15, %r15
je 0x3651
movslq %r14d, %r14
movq 0x18(%r15), %rcx
movl 0x58(%r15), %r8d
movl 0x64(%r15), %r9d
movq 0x70(%r15), %rax
movq %rax, (%rsp)
leaq 0x2f0f(%rip), %rdx      # 0x64c4
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2290
movq (%r12), %rdi
incl %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x2160
cmpl $-0x1, %eax
je 0x35e7
movq (%r12), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq (%r12), %rdi
movq 0x48(%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq (%r12), %rdi
movl $0xa, %esi
callq 0x22c0
leaq 0x2f5e(%rip), %rdx      # 0x656c
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2290
movq (%r12), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
testb $0x1, 0x78(%r15)
movq (%r12), %rdi
jne 0x365e
movq 0x20(%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2350
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x7c(%r15), %esi
shlq $0x2, %rsi
addq 0x50(%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22b0