// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/src/main.c
// Function: linkScreenRenderLine
void linkScreenRenderLine (LinkScreen *screen, int line, int width)
{
    size_t tmp, title;
    size_t offset;
    if (screen->allocLineCount <= line) {
        screen->allocLineCount = line + 100;
        screen->screenLines = realloc(screen->screenLines, screen->allocLineCount * sizeof(wchar_t*));
        memset(screen->screenLines + screen->allocLineCount - 100, 0, sizeof(wchar_t*) * 100);
    }

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

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

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

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

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

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq 0x20(%rsp), %rax
movl 0x18(%rax), %eax
cmpl 0x1c(%rsp), %eax
jg 0x3a91
movl 0x1c(%rsp), %ecx
addl $0x64, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x18(%rax), %rsi
shlq $0x3, %rsi
callq 0x22f0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x18(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdi
addq $-0x320, %rdi           # imm = 0xFCE0
xorl %esi, %esi
movl $0x320, %edx            # imm = 0x320
callq 0x2110
movq 0x20(%rsp), %rax
movl 0x14(%rax), %eax
cmpl 0x1c(%rsp), %eax
jge 0x3aab
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x14(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x18(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x2, %rsi
callq 0x22f0
movq %rax, %rdx
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x18(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movl 0x1c(%rsp), %ecx
addl $0x1, %ecx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq 0x1c(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl 0x58(%rax), %r8d
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq 0x1c(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x18(%rax), %r9
leaq 0x383f(%rip), %rdx      # 0x7380
movb $0x0, %al
callq 0x2270
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21a0
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rdi
callq 0x21a0
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x18(%rsp), %rcx
subq (%rsp), %rcx
cmpq %rcx, %rax
ja 0x3c2a
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jb 0x3bd6
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
addq (%rsp), %rcx
movl $0x20, (%rax,%rcx,4)
jmp 0x3c15
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
addq (%rsp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x3c17
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x3b8f
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x18(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
addq $0x28, %rsp
retq
nopl (%rax)