LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x8f17
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9660
movl %eax, -0x38(%rbp)
cmpl $-0x1, -0x38(%rbp)
je 0x8f00
cmpq $0x0, -0x28(%rbp)
je 0x8ee7
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x8ef7
movl -0x38(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x8f1e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x8eb3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x8fec
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9660
movl %eax, -0x40(%rbp)
cmpl $-0x1, -0x40(%rbp)
je 0x8fd2
cmpq $0x0, -0x28(%rbp)
je 0x8f8f
movl -0x3c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x8f9f
movl -0x40(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x38(%rbp)
je 0x8fc9
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8fbd
movq -0x38(%rbp), %rax
movl $0x1, (%rax)
jmp 0x8fc7
movq -0x38(%rbp), %rax
movl $0x0, (%rax)
jmp 0x8fc9
movl $0x1, -0x4(%rbp)
jmp 0x8ff3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x8f57
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x21(%rbp)
jle 0x902c
cmpq $0x0, -0x10(%rbp)
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x9035
jmp 0x904c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9016
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jae 0x9069
movl $0x0, -0x4(%rbp)
jmp 0x9083
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x94f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x19(%rbp)
jle 0x90b8
cmpq $0x0, -0x10(%rbp)
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x90c1
jmp 0x90d8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x90a2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
cmpq %rcx, %rax
jae 0x90f6
movq $0x0, -0x8(%rbp)
jmp 0x910a
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movslq -0x18(%rbp), %rsi
callq 0x9730
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/Liutos[P]Eloquent/utils/string.c
// Function: string_init
string_t *string_init(string_t *s)
{
    s->capacity = DELTA;
    s->length = 0;
    s->text = calloc(s->capacity, sizeof(char));
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0xa, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x20a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9230
cmpl $0x0, %eax
je 0x91fe
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x9260
movb -0x9(%rbp), %dl
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x92ea
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
callq 0x91d0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x92c0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x91d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Liutos[P]Eloquent/utils/string.c
// Function: string_printf
int string_printf(string_t *s, const char *fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    int len = vsnprintf(s->text, s->capacity - 1, fmt, ap);
    if (len >= s->capacity - 1) {
        s->capacity = len + DELTA;
        s->text = realloc(s->text, s->capacity * sizeof(char));
    }
    return vsnprintf(s->text, s->capacity - 1, fmt, ap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0x937b
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rax
leaq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
subq $0x1, %rsi
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x2040
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jb 0x942e
movl -0x34(%rbp), %eax
addl $0xa, %eax
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x0, %rsi
callq 0x2100
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
decq %rsi
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x2040
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Liutos[P]Eloquent/utils/vector.c
// Function: vector_init
vector_t *vector_init(vector_t *v)
{
    v->slots = NULL;
    v->capacity = 0;
    v->count = 0;
    return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x95e0
cmpl $0x0, %eax
je 0x95ac
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x9610
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x96ba
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
cmpl $0x0, %eax
je 0x96af
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x96c1
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x967b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/global.c
// Function: valloc_sprintf
static char *valloc_sprintf (const char *format, va_list lst)
{
    va_list cpy;
    va_copy(cpy, lst);

    size_t size = vsnprintf(NULL, 0, format, cpy) + 1;
    char *buf = malloc(size);

    if (!buf)
        return NULL;

    buf[0] = '\0';

    vsnprintf(buf, size, format, lst);
    return buf;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
leaq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq 0x38(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x2150
addl $0x1, %eax
cltq
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x2250
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x25a6
movq $0x0, 0x40(%rsp)
jmp 0x25ce
movq (%rsp), %rax
movb $0x0, (%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
callq 0x2150
movq (%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x26b3
jmp 0x2705
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x26ed
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2220
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x26bb
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x2220
movq 0x10(%rsp), %rdi
callq 0x2220
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
movb $0x0, %al
callq 0x21e0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rdi
callq 0x2060
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movl 0x4(%rsp), %ecx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rdi
callq 0x2140
movq 0x7851(%rip), %rax      # 0x9fc0
movl (%rax), %ecx
subl $0x1, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %eax
movl $0x5, %ecx
cltd
idivl %ecx
movl %eax, %ecx
shll $0x2, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0xc(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
leaq 0x7a13(%rip), %rcx      # 0xa1d0
movq %rcx, 0x38(%rax)
movq 0x10(%rsp), %rax
movl $0x1a, 0x30(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: commentLineFree
void commentLineFree(CommentLine *line)
{
    if (line == NULL)
        return ;
    free(line->text);
    free(line);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
jne 0x281e
jmp 0x2833
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x2220
movq (%rsp), %rdi
callq 0x2220
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x2883
jmp 0x28f0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x28bd
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2810
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x288b
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2220
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0xc(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: commentScreenFree
void commentScreenFree(CommentScreen *screen)
{
    if (screen == NULL)
        return ;
    commentScreenFreeLines(screen);

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

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
jne 0x290e
jmp 0x292d
movq (%rsp), %rdi
callq 0x2870
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2220
movq (%rsp), %rdi
callq 0x2220
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jl 0x2993
movq 0x10(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x64, %ecx
movl %ecx, 0xc(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rsp), %rax
movslq 0xc(%rax), %rsi
shlq $0x3, %rsi
callq 0x22f0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x2250
movq %rax, 0x10(%rsp)
imull $0x3, 0x18(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0x21a0
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rdx
shlq $0x2, %rdx
movl $0x20, %esi
callq 0x2110
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x2a79
movq 0x10(%rsp), %rdi
movslq 0x8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movl 0x1c(%rsp), %eax
addl $0x1, %eax
subl 0x8(%rsp), %eax
movslq %eax, %rsi
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x20(%rsp), %rax
movl 0x5c(%rax), %r8d
leaq 0x4844(%rip), %rdx      # 0x72b4
movb $0x0, %al
callq 0x2270
jmp 0x2aaf
movq 0x10(%rsp), %rdi
movslq 0x8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movl 0x1c(%rsp), %eax
addl $0x1, %eax
subl 0x8(%rsp), %eax
movslq %eax, %rsi
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rcx
leaq 0x4854(%rip), %rdx      # 0x72fc
movb $0x0, %al
callq 0x2270
movq 0x10(%rsp), %rdi
callq 0x21a0
movl %eax, (%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl 0x1c(%rsp), %ecx
subl (%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2b43
movl 0xc(%rsp), %eax
movl 0x4(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2b1e
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rax
movslq 0xc(%rsp), %rcx
cmpl $0xa, (%rax,%rcx,4)
je 0x2b1e
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rax
movslq 0xc(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
addl (%rsp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2b34
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
addl (%rsp), %ecx
movslq %ecx, %rcx
movl $0x20, (%rax,%rcx,4)
jmp 0x2b36
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x2ac4
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x2c4a
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
callq 0x27e0
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x4(%rsp), %edx
callq 0x29c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movl 0x4(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2930
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
je 0x2c31
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x24(%rsp), %edx
movl 0x4(%rsp), %ecx
callq 0x2b50
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x14(%rax)
movq 0x8(%rsp), %rax
movl 0x14(%rax), %eax
addl (%rsp), %eax
movl %eax, (%rsp)
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2b80
movl (%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: getCommentScreenFromCommentList
CommentScreen *getCommentScreenFromCommentList(RedditCommentList *list, int width)
{
    CommentScreen *screen;
    if (list == NULL)
        return NULL;

    screen = commentScreenNew();

    getCommentScreenRecurse(screen, list->baseComment, width, -1);

    return screen;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x2cc0
movq $0x0, 0x20(%rsp)
jmp 0x2cef
callq 0x2840
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movl 0x14(%rsp), %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2b50
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x8(%rsp), %rdx
addl 0x18(%rdx), %ecx
cmpl %ecx, %eax
jle 0x2d6c
movq -0x8(%rsp), %rax
movl 0x1c(%rax), %eax
movq -0x8(%rsp), %rcx
addl 0x18(%rcx), %eax
addl $0x1, %eax
movq -0x8(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2d5c
movq -0x8(%rsp), %rax
movl 0x1c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0x2d6a
movq -0x8(%rsp), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
jmp 0x2d93
movq -0x8(%rsp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jle 0x2d91
movq -0x8(%rsp), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
jmp 0x2d93
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rcx
movslq 0x20(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
movl %eax, -0x10(%rsp)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
movq -0x8(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2e42
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
cmpl -0x10(%rsp), %eax
jge 0x2e00
jmp 0x2e42
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
cmpl -0x10(%rsp), %eax
jne 0x2e40
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
subl 0x20(%rax), %ecx
movq -0x8(%rsp), %rax
addl 0x1c(%rax), %ecx
movl %ecx, 0x1c(%rax)
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x20(%rax)
jmp 0x2e42
jmp 0x2dce
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rcx
movslq 0x20(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
movl %eax, -0x10(%rsp)
movl -0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rsp)
cmpl $0x0, %eax
jl 0x2f07
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
cmpl -0x10(%rsp), %eax
jge 0x2eab
jmp 0x2f07
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
cmpl -0x10(%rsp), %eax
jne 0x2f02
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
subl 0x20(%rax), %ecx
movq -0x8(%rsp), %rax
addl 0x1c(%rax), %ecx
movl %ecx, 0x1c(%rax)
movq -0x8(%rsp), %rax
cmpl $0x0, 0x1c(%rax)
jge 0x2ef4
movq -0x8(%rsp), %rax
movl $0x0, 0x1c(%rax)
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x20(%rax)
jmp 0x2f07
jmp 0x2e7e
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rsp), %rax
cmpl $0x0, 0x20(%rax)
jge 0x2f3c
movq -0x8(%rsp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rsp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x2f5c
movq -0x8(%rsp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movslq 0x20(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x18(%rsp), %rcx
movslq 0x84(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0x2070
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x3005
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
addq $0x1, %rax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x24(%rcx), %eax
jae 0x3003
movl 0x4(%rsp), %ecx
movq 0x18(%rsp), %rax
addl 0x84(%rax), %ecx
movl %ecx, 0x84(%rax)
jmp 0x3036
jmp 0x3005
movq 0x10(%rsp), %rdi
callq 0x21a0
movq 0x20(%rsp), %rcx
movslq 0x24(%rcx), %rcx
cmpq %rcx, %rax
jbe 0x3036
movq 0x20(%rsp), %rax
movl 0x24(%rax), %ecx
movq 0x18(%rsp), %rax
addl 0x84(%rax), %ecx
movl %ecx, 0x84(%rax)
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rsp), %rcx
movslq 0x20(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x84(%rax)
jne 0x307b
jmp 0x315a
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rsp), %rcx
movl 0x84(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
addq $-0x4, %rdi
movq 0x28(%rsp), %rax
movl 0x84(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
movl $0xa, %edx
callq 0x25e0
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x30f9
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x10(%rsp)
jmp 0x3108
movq 0x28(%rsp), %rax
movl 0x84(%rax), %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x30(%rsp), %rcx
xorl %edx, %edx
divl 0x24(%rcx)
cmpl $0x0, %edx
jne 0x3129
movq 0x30(%rsp), %rax
movl 0x24(%rax), %edx
movl %edx, 0xc(%rsp)
jmp 0x313b
movl 0x10(%rsp), %eax
movq 0x30(%rsp), %rcx
xorl %edx, %edx
divl 0x24(%rcx)
movl %edx, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %edx
movq 0x28(%rsp), %rax
movl 0x84(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x84(%rax)
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movb 0x2c(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x36c6
movq -0x8(%rsp), %rax
movb 0x2c(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x2c(%rax)
movq -0x8(%rsp), %rax
movl 0x28(%rax), %edx
subl $0x1, %edx
movq -0x8(%rsp), %rax
movl 0x18(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x8(%rsp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0x18(%rcx), %ecx
movq -0x8(%rsp), %rdx
addl 0x1c(%rdx), %ecx
cmpl %ecx, %eax
jle 0x36c4
movq -0x8(%rsp), %rax
movl 0x20(%rax), %ecx
movq -0x8(%rsp), %rax
subl 0x18(%rax), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x36c6
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x3c96
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl $0x2d, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x3c6e
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x6332(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
movl %eax, %edx
callq 0x22b0
movq 0x631a(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl 0x10(%rsp), %esi
xorl %edx, %edx
callq 0x2160
cmpl $-0x1, %eax
jne 0x3cdb
jmp 0x3cf4
movq 0x62fe(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2280
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenRenderHelpText
void linkScreenRenderHelpText (LinkScreen *screen, wchar_t *tmpbuf, int bufLen, int screenLines)
{
    int i;
    int lastLine = screenLines - screen->offset;

    linkScreenSetupSplit(screen, tmpbuf, bufLen, lastLine);

    attron(COLOR_PAIR(1));

    for(i = 0; i < screen->helpLineCount; i++)
        mvaddwstr(lastLine + 1 + i, 0, screen->helpText[i]);

}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
subl 0xc(%rcx), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x14(%rsp), %edx
movl 0x8(%rsp), %ecx
callq 0x3c50
movq 0x60bc(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x22b0
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x3fa1
movq 0x608e(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl 0x8(%rsp), %esi
addl $0x1, %esi
addl 0xc(%rsp), %esi
xorl %edx, %edx
callq 0x2160
cmpl $-0x1, %eax
jne 0x3f6e
jmp 0x3f94
movq 0x606b(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2280
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x3f3d
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenDown
void linkScreenDown(LinkScreen *screen)
{
    screen->selected++;
    if (screen->selected > screen->offset + screen->displayed) {
        if (screen->offset + screen->displayed + 1 < screen->list->linkCount)
            screen->offset++;
        else
            screen->selected--;
    } else if (screen->selected + 1 > screen->list->linkCount) {
        screen->selected--;
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rsp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0xc(%rcx), %ecx
movq -0x8(%rsp), %rdx
addl 0x8(%rdx), %ecx
cmpl %ecx, %eax
jle 0x42ff
movq -0x8(%rsp), %rax
movl 0xc(%rax), %eax
movq -0x8(%rsp), %rcx
addl 0x8(%rcx), %eax
addl $0x1, %eax
movq -0x8(%rsp), %rcx
movq (%rcx), %rcx
cmpl 0x14(%rcx), %eax
jge 0x42ef
movq -0x8(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x42fd
movq -0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x4327
movq -0x8(%rsp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movq -0x8(%rsp), %rcx
movq (%rcx), %rcx
cmpl 0x14(%rcx), %eax
jle 0x4325
movq -0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x4327
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenUp
void linkScreenUp(LinkScreen *screen)
{
    screen->selected--;
    if (screen->selected < 0)
        screen->selected++;
    if (screen->selected < screen->offset)
        screen->offset--;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jge 0x435c
movq -0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rsp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x437c
movq -0x8(%rsp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenTextScrollDown
void linkScreenTextScrollDown(LinkScreen *screen)
{
    RedditLink *current = screen->list->links[screen->selected];

    if (current->wselftextEsc == NULL)
        return;

    wchar_t *currentTextPointer = &(current->wselftextEsc[current->advance]);
    wchar_t *foundNewLineString = wcschr(currentTextPointer, '\n');
    int screenWidth = COLS;

    // 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 < screenWidth)
        {
            // Step past the newline char
            current->advance += distanceToNewLine;
            return;
        }
    }

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

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rcx
movslq 0x10(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x43b8
jmp 0x4454
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x18(%rsp), %rcx
movl 0x7c(%rcx), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0x2070
movq %rax, 0x8(%rsp)
movq 0x5bd8(%rip), %rax      # 0x9fc8
movl (%rax), %eax
movl %eax, 0x4(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x4431
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
addq $0x1, %rax
movl %eax, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x442f
movl (%rsp), %ecx
movq 0x18(%rsp), %rax
addl 0x7c(%rax), %ecx
movl %ecx, 0x7c(%rax)
jmp 0x4454
jmp 0x4431
movq 0x10(%rsp), %rdi
callq 0x21a0
movslq 0x4(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x4454
movl 0x4(%rsp), %ecx
movq 0x18(%rsp), %rax
addl 0x7c(%rax), %ecx
movl %ecx, 0x7c(%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenTextScrollUp
void linkScreenTextScrollUp(LinkScreen *screen)
{
    RedditLink *current = screen->list->links[screen->selected];
    int screenWidth = COLS;

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

    wchar_t *currentTextPointer = &(current->wselftextEsc[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 % screenWidth == 0) ?
                        screenWidth :
                        distanceToNewLine % screenWidth;

    current->advance -= distanceToScroll;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x30(%rsp), %rcx
movslq 0x10(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movq 0x5b3a(%rip), %rax      # 0x9fc8
movl (%rax), %eax
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x7c(%rax)
jne 0x44a4
jmp 0x4568
movq 0x28(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x28(%rsp), %rcx
movl 0x7c(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x4, %rdi
movq 0x28(%rsp), %rax
movl 0x7c(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x25e0
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x451c
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x8(%rsp)
jmp 0x4528
movq 0x28(%rsp), %rax
movl 0x7c(%rax), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
xorl %edx, %edx
divl 0x24(%rsp)
cmpl $0x0, %edx
jne 0x4541
movl 0x24(%rsp), %edx
movl %edx, 0x4(%rsp)
jmp 0x454f
movl 0x8(%rsp), %eax
xorl %edx, %edx
divl 0x24(%rsp)
movl %edx, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %edx
movq 0x28(%rsp), %rax
movl 0x7c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x7c(%rax)
addq $0x38, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenOpenLink
void linkScreenOpenLink(LinkScreen *screen)
{
    if (!screen->linkOpen) {
        screen->linkOpen = 1;
        screen->displayed -= screen->linkOpenSize - 1;
        if (screen->selected > screen->displayed + screen->offset)
            screen->offset = screen->selected - screen->displayed;
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movb 0x2c(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x45e6
movq -0x8(%rsp), %rax
movb 0x2c(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x2c(%rax)
movq -0x8(%rsp), %rax
movl 0x28(%rax), %edx
subl $0x1, %edx
movq -0x8(%rsp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x8(%rsp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0x8(%rcx), %ecx
movq -0x8(%rsp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jle 0x45e4
movq -0x8(%rsp), %rax
movl 0x10(%rax), %ecx
movq -0x8(%rsp), %rax
subl 0x8(%rax), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0xc(%rax)
jmp 0x45e6
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: getPassword
char *getPassword()
{
    const int MAX_PASSWD_SIZE = 200;
    char *password = malloc(MAX_PASSWD_SIZE);

    clear();
    mvprintw(0, 0, "Password: ");
    refresh();

    getnstr(password, MAX_PASSWD_SIZE);
    password[MAX_PASSWD_SIZE - 1] = '\0';
    return password;
}

// Assembly:
subq $0x18, %rsp
movl $0xc8, 0x14(%rsp)
movl $0xc8, %edi
callq 0x2250
movq %rax, 0x8(%rsp)
movq 0x527e(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
callq 0x22c0
xorl %esi, %esi
leaq 0x272e(%rip), %rdx      # 0x74a1
movl %esi, %edi
movb $0x0, %al
callq 0x2350
movq 0x525d(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
callq 0x2210
movq 0x524e(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
movl $0xc8, %edx
callq 0x2360
movq 0x8(%rsp), %rax
movb $0x0, 0xc7(%rax)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: handleArguments
void handleArguments (optParser *parser)
{
    optResponse res;
    int unusedCount = 0;
    int optUnused[3] = { MOPT_SUBREDDIT, MOPT_USERNAME, MOPT_PASSWORD };

    do {
       res = optRunParser(parser);
       if (res == OPT_UNUSED) {
           if (unusedCount < (sizeof(optUnused)/sizeof(optUnused[0]))) {
               int optC = optUnused[unusedCount];
               strcpy(mainOptions[optC].svalue, parser->argv[parser->curopt]);
               mainOptions[optC].isSet = 1;
           }

           unusedCount++;
       }

    } while (res != OPT_SUCCESS);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x2890(%rip), %rax      # 0x7668
movq %rax, 0xc(%rsp)
movl 0x288d(%rip), %eax      # 0x7670
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rdi
callq 0x5430
movl %eax, 0x1c(%rsp)
cmpl $0x2, 0x1c(%rsp)
jne 0x4e83
movslq 0x18(%rsp), %rax
cmpq $0x3, %rax
jae 0x4e78
movslq 0x18(%rsp), %rax
movl 0xc(%rsp,%rax,4), %eax
movl %eax, 0x8(%rsp)
movslq 0x8(%rsp), %rax
leaq 0x547c(%rip), %rdi      # 0xa2a0
imulq $0x1f0, %rax, %rax      # imm = 0x1F0
addq %rax, %rdi
addq $0x1bc, %rdi            # imm = 0x1BC
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
movslq 0x10(%rcx), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x21d0
movslq 0x8(%rsp), %rcx
leaq 0x5444(%rip), %rax      # 0xa2a0
imulq $0x1f0, %rcx, %rcx      # imm = 0x1F0
addq %rcx, %rax
movb 0x1b5(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x1b5(%rax)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x4e85
cmpl $0x0, 0x1c(%rsp)
jne 0x4de7
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)