// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/link.c
// Function: redditGetListing
EXPORT_SYMBOL RedditErrno redditGetListing (RedditLinkList *list)
{
    char subred[1024], *kindStr = NULL;
    TokenParserResult res;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_STRING("modhash", list->modhash),
        ADD_TOKEN_IDENT_STRING("kind",    kindStr),
        ADD_TOKEN_IDENT_FUNC  ("data",    getListingHelper),
        ADD_TOKEN_IDENT_STRING("after",   list->afterId),
        {0}
    };

    strcpy(subred, REDDIT_URL);
    if (list->subreddit != NULL)
        strcat(subred, list->subreddit);

    if (list->type == REDDIT_NEW)
        strcat(subred, REDDIT_SUB_NEW);
    else if (list->type == REDDIT_RISING)
        strcat(subred, REDDIT_SUB_RISING);
    else if (list->type == REDDIT_CONTR)
        strcat(subred, REDDIT_SUB_CONTROVERSIAL);
    else if (list->type == REDDIT_TOP)
        strcat(subred, REDDIT_SUB_TOP);

    strcat(subred, REDDIT_JSON);

    if (list->linkCount > 0)
        sprintf(subred + strlen(subred), "?after=%s", list->afterId);

    res = redditRunParser(subred, NULL, ids, list);

    free(kindStr);

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

// Assembly:
subq $0x558, %rsp            # imm = 0x558
movq %rdi, 0x548(%rsp)
movq $0x0, 0x138(%rsp)
leaq 0x2cd4(%rip), %rax      # 0x8496
movq %rax, 0x10(%rsp)
movl $0x2, 0x18(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x548(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movb $0x1, 0x3c(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x2b97(%rip), %rax      # 0x83ae
movq %rax, 0x48(%rsp)
movl $0x2, 0x50(%rsp)
movl $0x0, 0x54(%rsp)
leaq 0x138(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
movl $0x0, 0x70(%rsp)
movb $0x1, 0x74(%rsp)
movq $0x0, 0x78(%rsp)
leaq 0x2b4b(%rip), %rax      # 0x83b3
movq %rax, 0x80(%rsp)
movl $0x3, 0x88(%rsp)
movl $0x2, 0x8c(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0xa0(%rsp)
movl $0x0, 0xa8(%rsp)
movb $0x0, 0xac(%rsp)
leaq 0x22c(%rip), %rax       # 0x5af0
movq %rax, 0xb0(%rsp)
leaq 0x2bcb(%rip), %rax      # 0x849e
movq %rax, 0xb8(%rsp)
movl $0x2, 0xc0(%rsp)
movl $0x0, 0xc4(%rsp)
movq 0x548(%rsp), %rax
addq $0x20, %rax
movq %rax, 0xc8(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xd8(%rsp)
movl $0x0, 0xe0(%rsp)
movb $0x1, 0xe4(%rsp)
movq $0x0, 0xe8(%rsp)
leaq 0x10(%rsp), %rdi
addq $0xe0, %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x2100
leaq 0x140(%rsp), %rdi
leaq 0x2a55(%rip), %rsi      # 0x83b8
callq 0x2070
movq 0x548(%rsp), %rax
cmpq $0x0, (%rax)
je 0x598e
leaq 0x140(%rsp), %rdi
movq 0x548(%rsp), %rax
movq (%rax), %rsi
callq 0x2260
movq 0x548(%rsp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x59b2
leaq 0x140(%rsp), %rdi
leaq 0x2af9(%rip), %rsi      # 0x84a4
callq 0x2260
jmp 0x5a22
movq 0x548(%rsp), %rax
cmpl $0x2, 0x10(%rax)
jne 0x59d6
leaq 0x140(%rsp), %rdi
leaq 0x2ada(%rip), %rsi      # 0x84a9
callq 0x2260
jmp 0x5a20
movq 0x548(%rsp), %rax
cmpl $0x3, 0x10(%rax)
jne 0x59fa
leaq 0x140(%rsp), %rdi
leaq 0x2abe(%rip), %rsi      # 0x84b1
callq 0x2260
jmp 0x5a1e
movq 0x548(%rsp), %rax
cmpl $0x4, 0x10(%rax)
jne 0x5a1c
leaq 0x140(%rsp), %rdi
leaq 0x2aa9(%rip), %rsi      # 0x84c0
callq 0x2260
jmp 0x5a1e
jmp 0x5a20
jmp 0x5a22
leaq 0x140(%rsp), %rdi
leaq 0x2bb4(%rip), %rsi      # 0x85e5
callq 0x2260
movq 0x548(%rsp), %rax
cmpl $0x0, 0x14(%rax)
jle 0x5a80
leaq 0x140(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x20d0
movq 0x8(%rsp), %rdi
addq %rax, %rdi
movq 0x548(%rsp), %rax
movq 0x20(%rax), %rdx
leaq 0x2a4c(%rip), %rsi      # 0x84c5
movb $0x0, %al
callq 0x2290
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq 0x548(%rsp), %rcx
xorl %eax, %eax
movl %eax, %esi
movb $0x0, %al
callq 0x6ed0
movl %eax, 0x134(%rsp)
movq 0x138(%rsp), %rdi
callq 0x2040
cmpl $0x0, 0x134(%rsp)
jne 0x5acb
movl $0x0, 0x554(%rsp)
jmp 0x5ad6
movl $0x2, 0x554(%rsp)
movl 0x554(%rsp), %eax
addq $0x558, %rsp            # imm = 0x558
retq
nopw %cs:(%rax,%rax)