LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: cliVersion
static sds cliVersion() {
    sds version;
    version = sdscatprintf(sdsempty(), "%s", REDIS_VERSION);

    /* Add git commit and working tree status when available */
    if (strtoll(redisGitSHA1(),NULL,16)) {
        version = sdscatprintf(version, " (git:%s", redisGitSHA1());
        if (strtoll(redisGitDirty(),NULL,10))
            version = sdscatprintf(version, "-dirty");
        version = sdscat(version, ")");
    }
    return version;
}

// Assembly:
pushq %rbx
callq 0xed22
leaq 0x1d3c3(%rip), %rsi     # 0x30032
leaq 0x20b24(%rip), %rdx     # 0x3379a
movq %rax, %rdi
xorl %eax, %eax
callq 0xf2d0
movq %rax, %rbx
callq 0x13e70
movq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd340
testq %rax, %rax
je 0x12cf5
callq 0x13e70
leaq 0x20af9(%rip), %rsi     # 0x337a1
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xf2d0
movq %rax, %rbx
callq 0x13e78
movq %rax, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xd340
testq %rax, %rax
je 0x12ce5
leaq 0x20ad2(%rip), %rsi     # 0x337aa
movq %rbx, %rdi
xorl %eax, %eax
callq 0xf2d0
movq %rax, %rbx
leaq 0x221f4(%rip), %rsi     # 0x34ee0
movq %rbx, %rdi
popq %rbx
jmp 0xef47
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: cliRefreshPrompt
static void cliRefreshPrompt(void) {
    int len;

    if (config.hostsocket != NULL)
        len = snprintf(config.prompt,sizeof(config.prompt),"redis %s",
                       config.hostsocket);
    else
        len = snprintf(config.prompt,sizeof(config.prompt),
                       strchr(config.hostip,':') ? "[%s]:%d" : "%s:%d",
                       config.hostip, config.hostport);
    /* Add [dbnum] if needed */
    if (config.dbnum != 0)
        len += snprintf(config.prompt+len,sizeof(config.prompt)-len,"[%d]",
            config.dbnum);
    snprintf(config.prompt+len,sizeof(config.prompt)-len,"> ");
}

// Assembly:
pushq %rbx
movq 0x30e4b(%rip), %rcx     # 0x43d48
testq %rcx, %rcx
je 0x12f1e
leaq 0x30ecf(%rip), %rdi     # 0x43dd8
leaq 0x20a12(%rip), %rdx     # 0x33922
movl $0x80, %esi
xorl %eax, %eax
callq 0xd1e0
jmp 0x12f64
movq 0x30e13(%rip), %rbx     # 0x43d38
movq %rbx, %rdi
movl $0x3a, %esi
callq 0xd1c0
testq %rax, %rax
leaq 0x209f7(%rip), %rax     # 0x33933
leaq 0x209e8(%rip), %rdx     # 0x3392b
cmoveq %rax, %rdx
movl 0x30df2(%rip), %r8d     # 0x43d40
leaq 0x30e83(%rip), %rdi     # 0x43dd8
movl $0x80, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xd1e0
movl %eax, %ebx
movl 0x30df4(%rip), %ecx     # 0x43d60
testl %ecx, %ecx
je 0x12f9d
movslq %ebx, %rbx
leaq 0x30dbe(%rip), %rax     # 0x43d38
leaq (%rbx,%rax), %rdi
addq $0xa0, %rdi
movl $0x80, %esi
subq %rbx, %rsi
leaq 0x209a5(%rip), %rdx     # 0x33939
xorl %eax, %eax
callq 0xd1e0
addl %eax, %ebx
movslq %ebx, %rax
leaq 0x30d91(%rip), %rcx     # 0x43d38
leaq (%rax,%rcx), %rdi
addq $0xa0, %rdi
movl $0x80, %esi
subq %rax, %rsi
leaq 0x21100(%rip), %rdx     # 0x340c1
xorl %eax, %eax
popq %rbx
jmp 0xd1e0
// File: /workspace/github_c_makefile_star2_O1/sos22[P]unexec/unexec.c
// Function: free_with_mmap
static void free_with_mmap(void const * what) {
    if (what == NULL) return;
    size_t const * sizes = what;
    sizes--;
    assert(sizes[0] != 0);
    assert(!(sizes[0] & (PAGE_SIZE - 1)));
    munmap((void *)sizes, sizes[0]); }

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x1293
movq -0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x1295
movq %rsi, %rax
shlq $0x34, %rax
jne 0x12b4
addq $-0x8, %rdi
popq %rbp
jmp 0x1130
popq %rbp
retq
leaq 0x1d74(%rip), %rdi      # 0x3010
leaq 0x1d7b(%rip), %rsi      # 0x301e
leaq 0x1d7d(%rip), %rcx      # 0x3027
movl $0x75, %edx
callq 0x10a0
leaq 0x1d8e(%rip), %rdi      # 0x3049
leaq 0x1d5c(%rip), %rsi      # 0x301e
leaq 0x1d5e(%rip), %rcx      # 0x3027
movl $0x76, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/sos22[P]unexec/unexec.c
// Function: alloc_with_mmap
static void * alloc_with_mmap(size_t sz) {
    sz = (sz + sizeof(size_t) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
    void * res = mmap(NULL,
                      sz,
                      PROT_READ|PROT_WRITE,
                      MAP_PRIVATE|MAP_ANONYMOUS,
                      -1,
                      0);
    assert(res != MAP_FAILED);
    size_t * res_sz = res;
    res_sz[0] = sz;
    return res_sz + 1; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x1007, %rbx           # imm = 0x1007
andq $-0x1000, %rbx          # imm = 0xF000
xorl %edi, %edi
movq %rbx, %rsi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x1080
cmpq $-0x1, %rax
je 0x2602
movq %rbx, (%rax)
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xab4(%rip), %rdi       # 0x30bd
leaq 0xa0e(%rip), %rsi       # 0x301e
leaq 0xab8(%rip), %rcx       # 0x30cf
movl $0x6c, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/sos22[P]unexec/unexec.c
// Function: alloc_in_trampoline
static void * alloc_in_trampoline(size_t sz, struct trampoline * tramp) {
    static char failure[PAGE_SIZE];
    assert(sz < sizeof(failure));
    tramp->used += sz;
    if (tramp->used > tramp->allocated) return failure;
    else return tramp->allocator + tramp->used - sz; }

// Assembly:
cmpq $0x1000, %rdi           # imm = 0x1000
jae 0x264b
movl 0x4(%rsi), %eax
addl %edi, %eax
movl %eax, 0x4(%rsi)
leaq (%rax,%rsi), %rcx
subq %rdi, %rcx
subq $-0x80, %rcx
cmpl (%rsi), %eax
leaq 0x2a9a(%rip), %rax      # 0x50e0
cmovbeq %rcx, %rax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xb0c(%rip), %rdi       # 0x3162
leaq 0x9c1(%rip), %rsi       # 0x301e
leaq 0xb13(%rip), %rcx       # 0x3177
movl $0x8f, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/sos22[P]unexec/unexec.c
// Function: strdup_in_trampoline
static char * strdup_in_trampoline(const char *what, struct trampoline * tramp){
    size_t sz = strlen(what);
    void * res = alloc_in_trampoline(sz + 1, tramp);
    memcpy(res, what, sz + 1);
    return res; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1070
leaq 0x1(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2621
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1110
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFreeReplies
EXPORT_SYMBOL void redditCommentFreeReplies (RedditComment *comment)
{
    int i;
    if (comment == NULL)
        return ;
    for (i = 0; i < comment->replyCount; i++)
        redditCommentFree(comment->replies[i]);

    free(comment->replies);
}

// Assembly:
testq %rdi, %rdi
je 0x2373
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x2363
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x20d0
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x234b
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFree
EXPORT_SYMBOL void redditCommentFree (RedditComment *comment)
{
    if (comment == NULL)
        return ;

    free(comment->body);
    free(comment->bodyEsc);
    free(comment->wbodyEsc);
    free(comment->id);
    free(comment->author);
    free(comment->parentId);
    free(comment->linkId);
    redditCommentFreeChildren(comment);
    free(comment->childrenId);
    redditCommentFreeReplies(comment);
    free(comment);
}

// Assembly:
testq %rdi, %rdi
je 0x23de
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
callq 0x2040
movq 0x40(%rbx), %rdi
callq 0x2040
movq 0x48(%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0x2040
movq 0x20(%rbx), %rdi
callq 0x2040
movq 0x28(%rbx), %rdi
callq 0x2040
movq 0x30(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x23df
movq 0x68(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x20f0
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFreeChildren
static void redditCommentFreeChildren (RedditComment *comment)
{
    int i;
    if (comment == NULL || comment->directChildrenIds == NULL)
        return ;

    for (i = 0; i < comment->directChildrenCount; i++)
        free(comment->directChildrenIds[i]);

    free(comment->directChildrenIds);
    comment->directChildrenIds = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x242c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x70(%rdi)
je 0x2425
cmpl $0x0, 0x60(%rbx)
jle 0x2414
xorl %r14d, %r14d
movq 0x70(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2040
incq %r14
movslq 0x60(%rbx), %rax
cmpq %rax, %r14
jl 0x23fb
movq 0x70(%rbx), %rdi
callq 0x2040
movq $0x0, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentAddReply
EXPORT_SYMBOL void redditCommentAddReply (RedditComment *comment, RedditComment *reply)
{
    comment->replyCount++;
    RedditComment* ptr = comment;
    while (ptr != NULL) {
        ptr->totalReplyCount += reply->totalReplyCount + 1;
        ptr = ptr->parent;
    }
    comment->replies = rrealloc(comment->replies, (comment->replyCount) * sizeof(RedditComment*));
    comment->replies[comment->replyCount - 1] = reply;
    reply->parent = comment;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rdi), %rsi
incq %rsi
movl %esi, (%rdi)
movq %rdi, %rax
movl 0x5c(%rbx), %ecx
movl 0x5c(%rax), %edx
addl %edx, %ecx
incl %ecx
movl %ecx, 0x5c(%rax)
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x2442
movq 0x8(%r14), %rdi
shlq $0x3, %rsi
callq 0x354f
movq %rax, 0x8(%r14)
movslq (%r14), %rcx
movq %rbx, -0x8(%rax,%rcx,8)
movq %r14, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentListFree
EXPORT_SYMBOL void redditCommentListFree (RedditCommentList *list)
{
    if (list == NULL)
        return ;
    redditCommentFree(list->baseComment);
    redditLinkFree(list->post);
    free(list->permalink);
    free(list->id);
    free(list);
}

// Assembly:
testq %rdi, %rdi
je 0x24c9
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20d0
movq 0x8(%rbx), %rdi
callq 0x2170
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: getCommentReplies
DEF_TOKEN_CALLBACK(getCommentReplies)
{
    ARG_COMMENT_LISTING
    char *kindStr = NULL;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_STRING("kind", kindStr),
        ADD_TOKEN_IDENT_FUNC  ("data", getCommentListHelper),
        {0}
    };

    parseTokens(parser, ids, list, comment);
    free(kindStr);
}

// Assembly:
movq %rdx, %rax
movl (%rdx), %edx
cmpq $0x28, %rdx
ja 0x287d
movq %rdx, %rcx
addq 0x10(%rax), %rcx
addl $0x8, %edx
movl %edx, (%rax)
jmp 0x2889
movq 0x8(%rax), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq (%rcx), %rdx
movl (%rax), %esi
cmpq $0x28, %rsi
ja 0x28a2
movq %rsi, %rcx
addq 0x10(%rax), %rcx
addl $0x8, %esi
movl %esi, (%rax)
jmp 0x28ae
movq 0x8(%rax), %rcx
leaq 0x8(%rcx), %rsi
movq %rsi, 0x8(%rax)
pushq %rbx
subq $0xc0, %rsp
movq (%rcx), %rcx
xorl %eax, %eax
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
leaq 0x383c(%rip), %r8       # 0x6106
leaq 0x10(%rsp), %rsi
movq %r8, (%rsi)
movq $0x2, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsi)
movl $0x0, 0x28(%rsi)
movb $0x1, 0x2c(%rsi)
movq %rax, 0x30(%rsi)
leaq 0x3810(%rip), %r8       # 0x610b
movq %r8, 0x38(%rsi)
movabsq $0x200000003, %r8       # imm = 0x200000003
movq %r8, 0x40(%rsi)
movups %xmm0, 0x48(%rsi)
movups %xmm0, 0x55(%rsi)
leaq 0x1bb(%rip), %r8        # 0x2ad7
movq %r8, 0x68(%rsi)
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x80(%rsi)
movaps %xmm0, 0x90(%rsi)
movq %rax, 0xa0(%rsi)
xorl %eax, %eax
callq 0x4a54
movq (%rbx), %rdi
callq 0x2040
addq $0xc0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditGetCommentList
EXPORT_SYMBOL RedditErrno redditGetCommentList (RedditCommentList *list)
{
    char fullLink[2048], *kindStr = NULL;
    TokenParserResult res;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_STRING("id",   list->id),
        ADD_TOKEN_IDENT_STRING("kind", kindStr),
        ADD_TOKEN_IDENT_FUNC  ("data", getCommentListHelper),
        {0}
    };

    strcpy(fullLink, REDDIT_URL);
    strcat(fullLink, list->permalink);
    strcat(fullLink, REDDIT_JSON);

    if (list->baseComment == NULL)
        list->baseComment = redditCommentNew();

    res = redditRunParser(fullLink, NULL, ids, list, list->baseComment);

    free(kindStr);

    if (res == TOKEN_PARSER_SUCCESS)
        return REDDIT_SUCCESS;
    else
        return REDDIT_ERROR_RESPONSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x8f0, %rsp            # imm = 0x8F0
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x8(%rsp), %rax
movq %r15, (%rax)
leaq 0x3743(%rip), %rcx      # 0x60b5
movq %rcx, 0x10(%rsp)
movl $0x2, %ecx
movq %rcx, 0x18(%rsp)
leaq 0x18(%rdi), %rdx
movq %rdx, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movl %r15d, 0x38(%rsp)
movb $0x1, %dl
movb %dl, 0x3c(%rsp)
movq %r15, 0x40(%rsp)
leaq 0x375d(%rip), %rsi      # 0x6106
movq %rsi, 0x48(%rsp)
movq %rcx, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movaps %xmm0, 0x60(%rsp)
movl %r15d, 0x70(%rsp)
movb %dl, 0x74(%rsp)
movq %r15, 0x78(%rsp)
leaq 0x3739(%rip), %rax      # 0x610b
movq %rax, 0x80(%rsp)
movabsq $0x200000003, %rax      # imm = 0x200000003
movq %rax, 0x88(%rsp)
movups %xmm0, 0x9d(%rsp)
movaps %xmm0, 0x90(%rsp)
leaq 0xd4(%rip), %rax        # 0x2ad7
movq %rax, 0xb0(%rsp)
movups %xmm0, 0xb8(%rsp)
movups %xmm0, 0xc8(%rsp)
movups %xmm0, 0xd8(%rsp)
movq %r15, 0xe8(%rsp)
movabsq $0x6d6f632e746964, %rax # imm = 0x6D6F632E746964
leaq 0xf0(%rsp), %r14
movq %rax, 0xe(%r14)
movups 0x36c8(%rip), %xmm0     # 0x6110
movaps %xmm0, (%r14)
movq 0x10(%rdi), %rsi
movq %r14, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x20b0
movl $0x6f736a2e, 0xf0(%rsp,%rax) # imm = 0x6F736A2E
movw $0x6e, 0xf4(%rsp,%rax)
cmpq %r15, (%rbx)
jne 0x2a99
movl $0x88, %edi
callq 0x3538
movq %rax, %r14
movl $0x88, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x20e0
movq %r14, (%rbx)
movq (%rbx), %r8
leaq 0xf0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
xorl %esi, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4d7a
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movq 0x8(%rsp), %rdi
callq 0x2040
addl %ebx, %ebx
movl %ebx, %eax
addq $0x8f0, %rsp            # imm = 0x8F0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditGetCommentChildren
EXPORT_SYMBOL RedditErrno redditGetCommentChildren (RedditCommentList *list, RedditComment *parent)
{
    TokenParserResult res;
    char postText[4096];
    int i, endCount, children;
    int preCheck;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_FUNC  ("things", getMoreChildren),
        {0}
    };

    sprintf(postText, "api_type=json&link_id=t3_%s&children=", list->post->id);
    if (parent->directChildrenCount > 20)
        children = 20;
    else
        children = parent->directChildrenCount;

    if (children == 0)
        return REDDIT_ERROR;

    strcat(postText, parent->directChildrenIds[0]);
    for (i = 1; i < children; i++) {
        strcat(postText, ",");
        strcat(postText, parent->directChildrenIds[i]);
    }

    preCheck = parent->totalReplyCount;

    res = redditRunParser(REDDIT_API_MORECHILDREN, postText, ids, list, parent);

    if (preCheck == parent->totalReplyCount)
        parent->totalReplyCount -= children;

    endCount = parent->directChildrenCount - children;
    for (i = parent->directChildrenCount - 1; i >= endCount; i--)
        free(parent->directChildrenIds[i]);

    parent->directChildrenCount = endCount;

    if (res == TOKEN_PARSER_SUCCESS)
        return REDDIT_SUCCESS;
    else
        return REDDIT_ERROR_RESPONSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1088, %rsp           # imm = 0x1088
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5fff(%rip), %rsi      # 0x8cf0
leaq 0x10(%rsp), %rdi
movl $0xe, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq 0x8(%r14), %rax
movq 0x8(%rax), %rdx
leaq 0x3420(%rip), %rsi      # 0x612d
leaq 0x80(%rsp), %rdi
xorl %eax, %eax
callq 0x2230
movl 0x60(%rbx), %r12d
cmpl $0x14, %r12d
movl $0x14, %eax
cmovll %r12d, %eax
testl %r12d, %r12d
je 0x2e05
movl %eax, 0x4(%rsp)
movq %r14, 0x8(%rsp)
movq 0x70(%rbx), %rbp
movq (%rbp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x2220
cmpl $0x2, %r12d
jl 0x2d94
movl 0x4(%rsp), %r14d
movl $0x1, %r13d
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0x20b0
movw $0x2c, 0x80(%rsp,%rax)
movq (%rbp,%r13,8), %rsi
movq %r15, %rdi
callq 0x2220
incq %r13
cmpq %r13, %r14
jne 0x2d6d
movl 0x5c(%rbx), %r14d
leaq 0x33b4(%rip), %rdi      # 0x6153
leaq 0x80(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4d7a
movl %eax, %ebp
movl 0x5c(%rbx), %eax
cmpl %eax, %r14d
movl 0x4(%rsp), %ecx
jne 0x2dce
subl %ecx, %eax
movl %eax, 0x5c(%rbx)
movslq 0x60(%rbx), %r14
movslq %ecx, %rax
movq %r14, %r15
subq %rax, %r15
testl %r12d, %r12d
jle 0x2df6
movq 0x70(%rbx), %rax
movq -0x8(%rax,%r14,8), %rdi
decq %r14
callq 0x2040
cmpq %r15, %r14
jg 0x2de0
movl %r15d, 0x60(%rbx)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
addl %eax, %eax
jmp 0x2e0a
movl $0x1, %eax
addq $0x1088, %rsp           # imm = 0x1088
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: getMoreChildren
DEF_TOKEN_CALLBACK(getMoreChildren)
{
    ARG_MORECHILDREN
    char *kind = NULL;
    int arry_size = parser->tokens[parser->currentToken].size;
    int i = 0;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_STRING("kind", kind), /* Note -- Keep this key first in
                                                 the array, or change the
                                                 number in readChild */
        ADD_TOKEN_IDENT_FUNC("data", readChild),
        {0}
    };

    parser->currentToken++;
    for (; i < arry_size; i++) {
        int nextObj = parser->currentToken + parser->tokens[parser->currentToken].full_size + 1;
        parseTokens(parser, ids, list, parent);
        free(kind);
        kind = NULL;
        parser->currentToken = nextObj;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x2e46
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x2e52
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %r14
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x2e6b
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x2e77
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %r15
xorl %eax, %eax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rbx), %rdx
movslq 0x14(%rbx), %rsi
leaq (%rsi,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rsi, %rdi
movl 0xc(%rdx,%rdi), %ebp
leaq 0x3264(%rip), %rdx      # 0x6106
movq %rdx, 0x10(%rsp)
movq $0x2, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movl $0x0, 0x38(%rsp)
movb $0x1, 0x3c(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x3235(%rip), %rcx      # 0x610b
movq %rcx, 0x48(%rsp)
movabsq $0x200000003, %rcx      # imm = 0x200000003
movq %rcx, 0x50(%rsp)
movups %xmm0, 0x58(%rsp)
movups %xmm0, 0x65(%rsp)
leaq 0x180(%rip), %rcx       # 0x307b
movq %rcx, 0x78(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0xa0(%rsp)
movq %rax, 0xb0(%rsp)
leal 0x1(%rsi), %eax
movl %eax, 0x14(%rbx)
testl %ebp, %ebp
jle 0x2f7b
leaq 0x10(%rsp), %r12
movslq 0x14(%rbx), %rax
movq 0x8(%rbx), %rcx
leaq (%rax,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
movl 0x14(%rcx,%rdx), %ecx
leal (%rax,%rcx), %r13d
incl %r13d
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x4a54
movq 0x8(%rsp), %rdi
callq 0x2040
movq $0x0, 0x8(%rsp)
movl %r13d, 0x14(%rbx)
decl %ebp
jne 0x2f2f
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentAddMore
static void redditCommentAddMore (TokenParser *parser, RedditComment *parent)
{
    int i;

    redditCommentFreeChildren(parent);

    parent->directChildrenCount = parser->tokens[parser->currentToken].full_size;
    parent->directChildrenIds = rmalloc(parent->directChildrenCount * sizeof(char*));

    for (i = 0; i < parent->directChildrenCount; i++) {
        parser->currentToken++;
        parent->directChildrenIds[i] = getCopyOfToken(parser->block->memory, parser->tokens[parser->currentToken]);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x23df
movq 0x8(%r14), %rax
movslq 0x14(%r14), %rcx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movslq 0x14(%rax,%rdx), %rdi
movl %edi, 0x60(%rbx)
shlq $0x3, %rdi
callq 0x3538
movq %rax, 0x70(%rbx)
cmpl $0x0, 0x60(%rbx)
jle 0x3071
xorl %r15d, %r15d
movslq 0x14(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x14(%r14)
movq (%r14), %rdx
movq 0x8(%r14), %rsi
movq (%rdx), %rdi
leaq (%rcx,%rcx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x1(%rax,%rcx), %rax
movups (%rsi,%rax), %xmm0
movups 0xc(%rsi,%rax), %xmm1
movups %xmm1, 0x2c(%rsp)
movaps %xmm0, 0x20(%rsp)
movups 0x2c(%rsp), %xmm0
movups %xmm0, 0xc(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x44fe
movq 0x70(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movslq 0x60(%rbx), %rax
cmpq %rax, %r15
jl 0x300f
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: readChild
DEF_TOKEN_CALLBACK(readChild)
{
    ARG_MORECHILDREN

    struct MoreChildren child = {0};
    RedditComment *comment, *foundParent;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_STRING("parent_id",child.parent),
        ADD_TOKEN_IDENT_INT   ("count",    child.count),
        ADD_TOKEN_IDENT_FUNC  ("children", readMore),
        {0}
    };

    /* Note: Requires 'kind' to be the first key in the ids array */
    if (strcmp(*((char**)idents[0].value), "more") == 0) {
        parseTokens(parser, ids, parent, &child);
        free(child.parent);
    } else {
        comment = redditGetComment(parser, list);

        foundParent = redditCommentFindParent(parent, comment->parentId);
        if (foundParent == NULL)
            free(foundParent);
        else
            redditCommentAddReply(foundParent, comment);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rdi, %rbx
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x30a0
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x30ac
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %r14
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x30c5
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x30d1
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %r15
xorps %xmm0, %xmm0
movq %rsp, %rax
movaps %xmm0, (%rax)
leaq 0x2fd4(%rip), %rcx      # 0x60b8
movq %rcx, 0x10(%rsp)
movq $0x2, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movups %xmm0, 0x28(%rsp)
movl $0x0, 0x38(%rsp)
movb $0x1, 0x3c(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
leaq 0x3068(%rip), %rcx      # 0x617f
movq %rcx, 0x48(%rsp)
movq $0x1, 0x50(%rsp)
leaq 0x8(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movq %rax, 0x78(%rsp)
movaps %xmm0, 0x60(%rsp)
movq %rax, 0x6d(%rsp)
leaq 0x3040(%rip), %rcx      # 0x6185
movq %rcx, 0x80(%rsp)
movabsq $0x200000003, %rcx      # imm = 0x200000003
movq %rcx, 0x88(%rsp)
movaps %xmm0, 0x90(%rsp)
movups %xmm0, 0x9d(%rsp)
leaq 0x98(%rip), %rcx        # 0x320e
movq %rcx, 0xb0(%rsp)
movq %rax, 0xe8(%rsp)
movups %xmm0, 0xd8(%rsp)
movups %xmm0, 0xc8(%rsp)
movups %xmm0, 0xb8(%rsp)
movq 0x10(%rsi), %rax
movq (%rax), %rdi
leaq 0x2fe8(%rip), %rsi      # 0x6194
callq 0x2120
testl %eax, %eax
je 0x31e1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24ca
movq %rax, %rbx
movq 0x28(%rax), %rsi
movq %r15, %rdi
callq 0x32a7
testq %rax, %rax
je 0x3201
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2150
jmp 0x3201
leaq 0x10(%rsp), %rsi
movq %rsp, %r14
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4a54
movq (%r14), %rdi
callq 0x2040
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: readMore
DEF_TOKEN_CALLBACK(readMore)
{
    RedditComment *base        = va_arg(args, RedditComment*);
    struct MoreChildren *child = va_arg(args, struct MoreChildren*);


    RedditComment *parent = redditCommentFindParent(base, child->parent);

    if (parent == NULL) {
        /* If we didn't find parent, we just advance past the array */
        parser->currentToken += parser->tokens[parser->currentToken].full_size;
    } else {
        redditCommentAddMore(parser, parent);
        parent->totalReplyCount = child->count;
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x322c
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x3238
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %rdi
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x3251
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x325d
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %r15
movq (%r15), %rsi
callq 0x32a7
testq %rax, %rax
je 0x3285
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2fc7
movl 0x8(%r15), %eax
movl %eax, 0x5c(%r14)
jmp 0x32a1
movq 0x8(%rbx), %rax
movslq 0x14(%rbx), %rcx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl 0x14(%rax,%rdx), %eax
addl %ecx, %eax
movl %eax, 0x14(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFindParent
static RedditComment *redditCommentFindParent (RedditComment *base, char *parentId)
{
    char pid[8];
    RedditComment *current;

    int stackSize = 100;
    RedditComment **stack = rmalloc(sizeof(RedditComment*) * stackSize);;
    int top = 0;

    /* We might have, Ex. 't1_idvalu', we just want 'idvalu' from that */
    if (parentId[2] == '_')
        strcpy(pid, parentId + 3);
    else
        strcpy(pid, parentId);

    stack[0] = base;
    top = 0;
    /* Keep looping and decrementing our stack index until it's under zero */
    for(; top >= 0; top--) {

        /* Grab the RedditComment on the top of the stack */
        current = stack[top];

        /* If it's the right one, jump to the cleanup code */
        if (strcmp(pid, current->id) == 0)
            goto cleanup;

        /* If it's not and it has some replies to it, add all the replies to
         * the stack and keep going */
        if (current->replyCount > 0) {
            if (top + current->replyCount >= stackSize) {
                stackSize += current->replyCount;
                stack = realloc(stack, sizeof(RedditComment*) * stackSize);
            }
            /* Copy the contents of the replies array right onto the stack. */
            memcpy(stack + top, current->replies, current->replyCount * sizeof(RedditComment*));
            top += current->replyCount;
        }
    }

    current = NULL;

cleanup:;
    free(stack);
    return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x320, %edi            # imm = 0x320
callq 0x3538
xorl %ecx, %ecx
cmpb $0x5f, 0x2(%r14)
movq %rax, %rbx
sete %cl
leaq (%rcx,%rcx,2), %rsi
addq %r14, %rsi
movq %rsp, %rdi
callq 0x2070
movq %r15, (%rbx)
movl $0x64, %ebp
xorl %r12d, %r12d
movl %r12d, %r13d
movq (%rbx,%r13,8), %r15
movq 0x18(%r15), %rsi
movq %rsp, %rdi
callq 0x2120
testl %eax, %eax
je 0x3350
movl (%r15), %r14d
testl %r14d, %r14d
jle 0x3340
leal (%r14,%r12), %eax
cmpl %ebp, %eax
jl 0x3329
addl %ebp, %r14d
leaq (,%r14,8), %rsi
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rbx
movl %r14d, %ebp
leaq (%rbx,%r13,8), %rdi
movq 0x8(%r15), %rsi
movslq (%r15), %rdx
shlq $0x3, %rdx
callq 0x2140
addl (%r15), %r12d
leal -0x1(%r12), %eax
testl %r12d, %r12d
movl %eax, %r12d
jg 0x32e9
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2040
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/cookie.c
// Function: redditCookieNew
EXPORT_SYMBOL void redditCookieNew(char *name, char *data)
{
    RedditCookieLink *link = rmalloc(sizeof(RedditCookieLink));

    link->name = rmalloc(strlen(name) + 1);
    link->data = rmalloc(strlen(data) + 1);

    strcpy(link->name, name);
    strcpy(link->data, data);

    /*
     * If for whatever reason we don't have an allocated reddit-state yet
     * Make a new one
     */
    if (currentRedditState == NULL)
        currentRedditState = redditStateNew();

    /* Attach the link */
    link->next = currentRedditState->base;
    currentRedditState->base = link;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x18, %edi
callq 0x3538
movq %rax, %rbx
movq %r15, %rdi
callq 0x20b0
leaq 0x1(%rax), %rdi
callq 0x3538
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x20b0
leaq 0x1(%rax), %rdi
callq 0x3538
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x2070
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x2070
leaq 0x5d6b(%rip), %r14      # 0x9138
cmpq $0x0, (%r14)
jne 0x33dd
xorl %eax, %eax
callq 0x21f0
movq %rax, (%r14)
movq (%r14), %rax
movq (%rax), %rax
movq %rax, (%rbx)
movq (%r14), %rax
movq %rbx, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/cookie.c
// Function: redditCookieFree
EXPORT_SYMBOL void redditCookieFree(RedditCookieLink *link)
{
    if (link == NULL)
        return ;
    free(link->name);
    free(link->data);
    free(link);
}

// Assembly:
testq %rdi, %rdi
je 0x3416
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2040
movq 0x10(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/cookie.c
// Function: redditRemoveCookie
EXPORT_SYMBOL void redditRemoveCookie(char *name)
{
    RedditCookieLink *prev = NULL, *node;

    /* Incase no state has yet been set */
    if (currentRedditState == NULL) return ;

    for(node = currentRedditState->base; node != NULL; prev = node, node = node->next) {
        if (strcmp(node->name, name) == 0) {
            /* Found the node */
            if (prev != NULL)
                prev->next = node->next;
            else
                currentRedditState->base = node->next;

            redditCookieFree(node);
            break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x5d12(%rip), %rax      # 0x9138
movq (%rax), %r15
testq %r15, %r15
je 0x3475
movq %rdi, %rbx
xorl %r14d, %r14d
movq %r15, %rcx
movq %r14, %r12
movq (%rcx), %r14
testq %r14, %r14
je 0x3475
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0x2120
movq %r14, %rcx
testl %eax, %eax
jne 0x3437
testq %r12, %r12
movq (%r14), %rax
cmovneq %r12, %r15
movq %rax, (%r15)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2110
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/cookie.c
// Function: redditGetCookieString
EXPORT_SYMBOL char *redditGetCookieString()
{
    char *cookieStr = NULL;
    int currentLength = 0;
    RedditCookieLink *node;

    if (currentRedditState == NULL) return NULL;

    for(node = currentRedditState->base; node != NULL; node = node->next) {
        int add_size = strlen(node->name) + strlen(node->data) + 2;
        currentLength += add_size;
        cookieStr = rrealloc(cookieStr, currentLength);
        if (node != currentRedditState->base)
            strcat(cookieStr, "&");
        else
            cookieStr[0] = 0;

        strcat(cookieStr, node->name);
        strcat(cookieStr, "=");
        strcat(cookieStr, node->data);
    }

    return cookieStr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x5ca7(%rip), %r15      # 0x9138
movq (%r15), %rax
testq %rax, %rax
je 0x3527
movq (%rax), %r12
xorl %r13d, %r13d
testq %r12, %r12
je 0x3527
xorl %ebx, %ebx
movq 0x8(%r12), %rdi
callq 0x20b0
movq %rax, %r14
movq 0x10(%r12), %rdi
callq 0x20b0
addl %r14d, %eax
addl %eax, %r13d
addl $0x2, %r13d
movslq %r13d, %rsi
movq %rbx, %rdi
callq 0x354f
movq %rax, %rbx
movq (%r15), %rax
cmpq (%rax), %r12
je 0x34f1
movq %rbx, %rdi
callq 0x20b0
movw $0x26, (%rbx,%rax)
jmp 0x34f4
movb $0x0, (%rbx)
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x20b0
movw $0x3d, (%rbx,%rax)
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x2220
movq (%r12), %r12
testq %r12, %r12
jne 0x34aa
jmp 0x3529
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/global.c
// Function: rmalloc
void *rmalloc(size_t bytes)
{
    void *m = malloc(bytes);
    if (m == NULL)
        exit(EXIT_FAILURE);
    return m;
}

// Assembly:
pushq %rax
callq 0x2160
testq %rax, %rax
je 0x3545
popq %rcx
retq
movl $0x1, %edi
callq 0x2240
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/global.c
// Function: rrealloc
void *rrealloc(void *old, size_t bytes)
{
    void *m = realloc(old, bytes);
    if (m == NULL)
        exit(EXIT_FAILURE);
    return m;
}

// Assembly:
pushq %rax
callq 0x21a0
testq %rax, %rax
je 0x355c
popq %rcx
retq
movl $0x1, %edi
callq 0x2240
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/link.c
// Function: redditLinkFree
EXPORT_SYMBOL void redditLinkFree (RedditLink *link)
{
    if (link == NULL)
        return ;

    free(link->selftext);
    free(link->title);

    free(link->selftextEsc);
    free(link->titleEsc);

    free(link->wselftextEsc);
    free(link->wtitleEsc);

    free(link->id);
    free(link->permalink);
    free(link->author);
    free(link->url);

    free(link);
}

// Assembly:
testq %rdi, %rdi
je 0x3b0f
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x2040
movq 0x28(%rbx), %rdi
callq 0x2040
movq 0x40(%rbx), %rdi
callq 0x2040
movq 0x38(%rbx), %rdi
callq 0x2040
movq 0x50(%rbx), %rdi
callq 0x2040
movq 0x48(%rbx), %rdi
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2040
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0x2040
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/link.c
// Function: redditLinkListFreeLinks
EXPORT_SYMBOL void redditLinkListFreeLinks (RedditLinkList *list)
{
    int i;
    if (list == NULL)
        return ;
    for (i = 0; i < list->linkCount; i++)
        redditLinkFree(list->links[i]);
    free(list->links);
    list->links = NULL;
    list->linkCount = 0;
}

// Assembly:
testq %rdi, %rdi
je 0x3b7c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x3b5d
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2170
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x3b44
movq 0x18(%rbx), %rdi
callq 0x2040
movq $0x0, 0x18(%rbx)
movl $0x0, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/link.c
// Function: redditLinkListFree
EXPORT_SYMBOL void redditLinkListFree (RedditLinkList *list)
{
    if (list == NULL)
        return ;
    redditLinkListFreeLinks(list);
    free(list->subreddit);
    free(list->modhash);
    free(list->afterId);
    free(list);
}

// Assembly:
testq %rdi, %rdi
je 0x3bae
pushq %rbx
movq %rdi, %rbx
callq 0x2060
movq (%rbx), %rdi
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2040
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/link.c
// Function: getListingHelper
DEF_TOKEN_CALLBACK(getListingHelper)
{
    ARG_LIST_GET_LISTING


    /* Search for the 'kind' ident, and check if it was set to 't3' */
    int i;
    for (i = 0; idents[i].name != NULL; i++)
        if (strcmp(idents[i].name, "kind") == 0)
            if (idents[i].value != NULL && strcmp(*((char**)idents[i].value), "t3") == 0)
                redditLinkListAddLink(list, redditGetLink(parser));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x433d
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0x4349
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x43ce
movq (%rax), %rbp
addq $0x38, %rbx
leaq 0x1da7(%rip), %r15      # 0x6106
leaq 0x1e28(%rip), %r12      # 0x618e
movq %r15, %rsi
callq 0x2120
testl %eax, %eax
je 0x4380
movq (%rbx), %rdi
addq $0x38, %rbx
testq %rdi, %rdi
jne 0x4366
jmp 0x43ce
movq -0x28(%rbx), %rax
testq %rax, %rax
je 0x4372
movq (%rax), %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x4372
movq %r14, %rdi
callq 0x3bea
movq %rax, %r13
movslq 0x14(%rbp), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x14(%rbp)
movq 0x18(%rbp), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x354f
movq %rax, 0x18(%rbp)
movslq 0x14(%rbp), %rcx
movq %r13, -0x8(%rax,%rcx,8)
jmp 0x4372
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/state.c
// Function: redditStateFree
EXPORT_SYMBOL void redditStateFree(RedditState *state)
{
    if (state == NULL)
        return ;
    /* First free the linked-list of cookies */
    RedditCookieLink *tmp;
    RedditCookieLink *node;
    for(node = state->base; node != NULL; node = tmp) {
        tmp = node->next;
        redditCookieFree(node);
    }

    free(state->userAgent);

    /* Free the actual state */
    free(state);
}

// Assembly:
testq %rdi, %rdi
je 0x442f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x4417
movq (%rdi), %r14
callq 0x2110
movq %r14, %rdi
testq %r14, %r14
jne 0x4407
movq 0x8(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: memoryBlockNew
MemoryBlock *memoryBlockNew()
{
    MemoryBlock *block = rmalloc(sizeof(MemoryBlock));
    block->memory = rmalloc(1);
    block->memory[0] = 0;
    block->size   = 0;
    return block;
}

// Assembly:
pushq %rbx
movl $0x10, %edi
callq 0x3538
movq %rax, %rbx
movl $0x1, %edi
callq 0x3538
movq %rax, (%rbx)
movb $0x0, (%rax)
movq $0x0, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: tokenParserNew
TokenParser *tokenParserNew()
{
    TokenParser *parser = rmalloc(sizeof(TokenParser));
    memset(parser, 0, sizeof(TokenParser));
    parser->block = memoryBlockNew();
    return parser;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0x18, %edi
callq 0x3538
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r15d, %r15d
movq %r15, 0x10(%rax)
movl $0x10, %edi
callq 0x3538
movq %rax, %r14
movl $0x1, %edi
callq 0x3538
movq %rax, (%r14)
movb $0x0, (%rax)
movq %r15, 0x8(%r14)
movq %r14, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: tokenParserFree
void tokenParserFree(TokenParser *parser)
{
    if (parser == NULL)
        return ;
    memoryBlockFree(parser->block);
    free(parser->tokens);
    free(parser);
}

// Assembly:
testq %rdi, %rdi
je 0x44fd
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x4473
movq 0x8(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: getCopyOfToken
char *getCopyOfToken(const char *json, jsmntok_t token)
{
    char *copy;
    if (token.end - token.start + 1 < 1)
        return NULL;

    copy = rmalloc(token.end - token.start + 1);
    memcpy(copy, json + token.start, token.end - token.start);
    copy[token.end - token.start] = 0;
    return copy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x38(%rsp), %r15d
movslq 0x34(%rsp), %r12
subl %r12d, %r15d
js 0x453f
movq %rdi, %rbx
leal 0x1(%r15), %edi
callq 0x3538
movq %rax, %r14
addq %r12, %rbx
movl %r15d, %r15d
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2140
movb $0x0, (%r14,%r15)
jmp 0x4542
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: trueFalseString
char *trueFalseString(char *string, bool tf)
{
    if (tf)
        strcpy(string, "true");
    else
        strcpy(string, "false");

    return string;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
je 0x4563
movb $0x0, 0x4(%rax)
movl $0x65757274, (%rax)     # imm = 0x65757274
retq
movw $0x65, 0x4(%rax)
movl $0x736c6166, (%rax)     # imm = 0x736C6166
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: vparseTokens
void vparseTokens (TokenParser *p, TokenIdent *identifiers, va_list args)
{
    int tokenCount = 0, i;
    int identCount = 0;

    while (identifiers[identCount].name != NULL)
        identCount++;

    if (identCount == 0)
        return ;

    tokenCount = p->tokens[p->currentToken].full_size;
    if (tokenCount == 0)
        return ;

    tokenCount += p->currentToken;

    for (; p->currentToken < tokenCount; (p->currentToken)++) {
        if (p->tokens[p->currentToken].type == JSMN_OBJECT || p->tokens[p->currentToken].type == JSMN_ARRAY)
            continue;

        /* We only need to check key values */
        if (!p->tokens[p->currentToken].is_key)
            continue;

        for (i = 0; i < identCount; i++)
            if (performIdentAction(p, identifiers, i, args)) {
                (p->currentToken)--;
                break;
            }

    }

    return ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %r12d
movq %rsi, %rax
decq %r12
cmpq $0x0, (%rax)
leaq 0x38(%rax), %rax
jne 0x49ac
testq %r12, %r12
je 0x4a45
movq 0x8(%r15), %rcx
movslq 0x14(%r15), %rax
leaq (%rax,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
movl 0x14(%rcx,%rdx), %r13d
testl %r13d, %r13d
je 0x4a45
addl %eax, %r13d
movl 0x14(%r15), %eax
cmpl %r13d, %eax
jge 0x4a45
negq %r12
movq 0x8(%r15), %rcx
movslq %eax, %rdx
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdx, %rax
movl (%rcx,%rax), %edx
decl %edx
cmpl $0x2, %edx
jb 0x4a36
addq %rax, %rcx
testb $0x1, 0x10(%rcx)
je 0x4a36
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x458e
testl %eax, %eax
jne 0x4a32
incl %ebp
cmpl %ebp, %r12d
jne 0x4a15
jmp 0x4a36
decl 0x14(%r15)
movl 0x14(%r15), %eax
incl %eax
movl %eax, 0x14(%r15)
cmpl %r13d, %eax
jl 0x49ee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/token.c
// Function: writeToParser
static size_t writeToParser(void *contents, size_t size, size_t nmemb, void *userp)
{
    size_t realsize = size * nmemb;
    TokenParser *parser = (TokenParser*)userp;

    parser->block->memory = rrealloc(parser->block->memory, parser->block->size + realsize + 1);

    memcpy(parser->block->memory + parser->block->size, contents, realsize);
    parser->block->size += realsize;
    parser->block->memory[parser->block->size] = 0;

    return realsize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
imulq %rsi, %rbx
movq (%rcx), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rax
leaq (%rbx,%rax), %rsi
incq %rsi
callq 0x354f
movq (%r14), %rcx
movq %rax, (%rcx)
addq 0x8(%rcx), %rax
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2140
movq (%r14), %rax
movq 0x8(%rax), %rcx
addq %rbx, %rcx
movq %rcx, 0x8(%rax)
movq (%rax), %rax
movb $0x0, (%rax,%rcx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/user.c
// Function: redditUserNew
EXPORT_SYMBOL RedditUser *redditUserNew()
{
    RedditUser *log = rmalloc(sizeof(RedditUser));

    memset(log, 0, sizeof(RedditUser));
    log->commentKarma = -1;
    log->linkKarma    = -1;

    return log;
}

// Assembly:
pushq %rax
movl $0x28, %edi
callq 0x3538
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq $-0x1, 0x18(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/user.c
// Function: redditUserFree
EXPORT_SYMBOL void redditUserFree (RedditUser *log)
{
    if (log == NULL)
        return ;
    free(log->name);
    free(log->id);
    free(log->modhash);
    free(log);
}

// Assembly:
testq %rdi, %rdi
je 0x502f
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2040
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x8(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/Cotix[P]cReddit/libreddit/user.c
// Function: redditUserLoggedNew
EXPORT_SYMBOL RedditUserLogged *redditUserLoggedNew()
{
    RedditUserLogged *user = rmalloc(sizeof(RedditUserLogged));

    user->userInfo     = redditUserNew();
    user->stayLoggedOn = false;
    user->userState    = REDDIT_USER_OFFLINE;

    return user;
}

// Assembly:
pushq %rbx
movl $0x10, %edi
callq 0x3538
movq %rax, %rbx
movl $0x28, %edi
callq 0x3538
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq $-0x1, 0x18(%rax)
movq %rax, 0x8(%rbx)
movb $0x0, 0x4(%rbx)
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %rbx, %rax
popq %rbx
retq