LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdi, %r14
subl 0xc(%rdi), %ebx
movl %ebx, %ecx
callq 0x33e5
movq 0x5942(%rip), %r15      # 0x8fe0
movq (%r15), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x22e0
cmpl $0x0, 0x30(%r14)
jle 0x36ed
incl %ebx
xorl %r12d, %r12d
movq (%r15), %rdi
leal (%rbx,%r12), %esi
xorl %edx, %edx
callq 0x2160
cmpl $-0x1, %eax
je 0x36e1
movq (%r15), %rdi
movq 0x38(%r14), %rax
movq (%rax,%r12,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
incq %r12
movslq 0x30(%r14), %rax
cmpq %rax, %r12
jl 0x36b9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: 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:
movl 0x10(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rdi)
movl 0xc(%rdi), %ecx
movl 0x8(%rdi), %edx
addl %ecx, %edx
movq (%rdi), %rsi
movl 0x14(%rsi), %esi
cmpl %edx, %eax
jge 0x39d3
leal 0x2(%rax), %ecx
cmpl %esi, %ecx
jg 0x39df
retq
incl %edx
cmpl %esi, %edx
jge 0x39df
incl %ecx
movl %ecx, 0xc(%rdi)
retq
movl %eax, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movl 0xc(%rdi), %eax
movl 0x10(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
setg %dl
subl %edx, %ecx
movl %ecx, 0x10(%rdi)
cmpl %eax, %ecx
jge 0x39fe
decl %eax
movl %eax, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rax
movq 0x18(%rax), %rax
movslq 0x10(%rdi), %rcx
movq (%rax,%rcx,8), %r14
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x3a6b
movl 0x7c(%r14), %r15d
leaq (%rax,%r15,4), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2070
movq 0x558d(%rip), %rcx      # 0x8fc8
movl (%rcx), %ebp
testq %rax, %rax
je 0x3a4f
subq %rbx, %rax
shrq $0x2, %rax
incl %eax
cmpl %ebp, %eax
jb 0x3a64
movslq %ebp, %r12
movq %rbx, %rdi
callq 0x21b0
movq %rax, %rcx
movl %ebp, %eax
cmpq %r12, %rcx
jbe 0x3a6b
addl %eax, %r15d
movl %r15d, 0x7c(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: 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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x18(%rax), %rax
movslq 0x10(%rdi), %rcx
movq (%rax,%rcx,8), %r14
movl 0x7c(%r14), %ebx
testl %ebx, %ebx
je 0x3ae4
movq 0x552f(%rip), %rax      # 0x8fc8
movl (%rax), %ebp
movq 0x50(%r14), %r15
decl %ebx
leaq (%r15,%rbx,4), %rdi
addq $-0x4, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x2594
testq %rax, %rax
je 0x3acf
movq %rax, %rcx
leaq (%r15,%rbx,4), %rax
subq %rcx, %rax
shrq $0x2, %rax
movl 0x7c(%r14), %ecx
jmp 0x3ad5
movl 0x7c(%r14), %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %ebp
testl %edx, %edx
cmovel %ebp, %edx
subl %edx, %ecx
movl %ecx, 0x7c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movb 0x2c(%rdi), %al
testb $0x1, %al
jne 0x3b17
orb $0x1, %al
movb %al, 0x2c(%rdi)
movl 0x8(%rdi), %eax
movl 0x10(%rdi), %ecx
subl 0x28(%rdi), %eax
incl %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rdi), %edx
addl %eax, %edx
cmpl %edx, %ecx
jle 0x3b17
subl %eax, %ecx
movl %ecx, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %r14
pushq %rbx
pushq %rax
movl $0xc8, %edi
callq 0x2260
movq %rax, %rbx
movq 0x5029(%rip), %r14      # 0x8fe0
movq (%r14), %rdi
callq 0x22f0
leaq 0x25d3(%rip), %rdx      # 0x6599
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2380
movq (%r14), %rdi
callq 0x2220
movq (%r14), %rdi
movq %rbx, %rsi
movl $0xc8, %edx
callq 0x2390
movb $0x0, 0xc7(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x10d1(%rip), %r12      # 0x50e4
leaq 0x52a6(%rip), %r13      # 0x92c0
movq %rbx, %rdi
callq 0x4426
movl %eax, %ebp
cmpl $0x2, %eax
jne 0x4064
cmpl $0x2, %r15d
ja 0x4061
movl %r15d, %eax
movslq (%r12,%rax,4), %rax
imulq $0x1f0, %rax, %rax      # imm = 0x1F0
leaq (%rax,%r13), %r14
addq $0x1bc, %r14            # imm = 0x1BC
movq 0x8(%rbx), %rax
movslq 0x10(%rbx), %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x21e0
orb $0x1, -0x7(%r14)
incl %r15d
testl %ebp, %ebp
jne 0x401a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: displayCmd
void displayCmd (optOption *option)
{
    printf("   ");
    if (option->opt_long[0] != '\0')
        printf("--%-10s ", option->opt_long);
    else
        printf("             ");

    if (option->opt_short != '\0')
        printf("-%c ", option->opt_short);
    else
        printf("   ");

    switch(option->arg) {
    case OPT_STRING:
        printf("[String] ");
        break;
    case OPT_INT:
        printf("[Int]    ");
        break;
    case OPT_NONE:
        printf("         ");
        break;
    }

    printf(" : %s\n", option->helpText);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x2535(%rip), %rdi      # 0x65b7
xorl %eax, %eax
callq 0x2030
cmpb $0x0, (%rbx)
je 0x40a1
leaq 0x250f(%rip), %rdi      # 0x65a4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2030
jmp 0x40af
leaq 0x2505(%rip), %rdi      # 0x65ad
xorl %eax, %eax
callq 0x2030
movsbl 0x1f(%rbx), %esi
testl %esi, %esi
je 0x40c7
leaq 0x24fd(%rip), %rdi      # 0x65bb
xorl %eax, %eax
callq 0x2030
jmp 0x40d5
leaq 0x24e9(%rip), %rdi      # 0x65b7
xorl %eax, %eax
callq 0x2030
movl 0x20(%rbx), %eax
cmpq $0x2, %rax
ja 0x40f3
leaq 0x100b(%rip), %rcx      # 0x50f0
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
xorl %eax, %eax
callq 0x2030
addq $0x24, %rbx
leaq 0x24d6(%rip), %rdi      # 0x65d4
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/main.c
// Function: displayHelp
void displayHelp (optParser *parser)
{
    optOption **option;

    printf("Usage: %s [flags] [subreddit] [username] [password] \n\n", parser->argv[0]);
    printf("Below is a list of all the flags reconized by creddit.\n");
    printf(" [String] --> argument takes a string\n");
    printf(" [Int]    --> argument takes an integer value\n");

    printf("\n");
    for (option = parser->options; *option != NULL; option++)
        displayCmd(*option);

    printf("\nYou will be prompted for a password if you don't include one\n");

    printf("\nTo report any bugs, submit patches, etc. Please see the github page at:\n");
    printf("http://www.github.com/Cotix/cReddit\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %rsi
leaq 0x24c0(%rip), %rdi      # 0x65db
xorl %eax, %eax
callq 0x2030
leaq 0x24fb(%rip), %rdi      # 0x6624
callq 0x22a0
leaq 0x2526(%rip), %rdi      # 0x665b
callq 0x22a0
leaq 0x2540(%rip), %rdi      # 0x6681
callq 0x22a0
movl $0xa, %edi
callq 0x2270
movq 0x20(%rbx), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4171
addq $0x8, %rbx
callq 0x4077
movq (%rbx), %rdi
addq $0x8, %rbx
testq %rdi, %rdi
jne 0x4160
leaq 0x2537(%rip), %rdi      # 0x66af
callq 0x22a0
leaq 0x2569(%rip), %rdi      # 0x66ed
callq 0x22a0
leaq 0x25a6(%rip), %rdi      # 0x6736
popq %rbx
jmp 0x22a0
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/opt.c
// Function: optAddOptions
void optAddOptions (optParser *parser, optOption *options, int optionCount)
{
    const int blockSize = 100;
    int opt = parser->optCount, i;
    parser->optCount += optionCount;

    /* Make sure to leave one empty arg */
    if (parser->optCount + 1 >= parser->optAllocCount) {
        do {
            parser->optAllocCount += blockSize;
            parser->options = realloc(parser->options, parser->optAllocCount * sizeof(optOption*));
            memset(parser->options, 0, blockSize * sizeof(optOption*));
        } while (parser->optCount + 1 >= parser->optAllocCount);
    }

    for (i = 0; i < optionCount; i++)
        parser->options[opt + i] = options + i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x18(%rdi), %r13
leal (%r13,%r15), %eax
movl %eax, 0x18(%rdi)
leal (%r15,%r13), %ecx
incl %ecx
movl 0x1c(%rdi), %eax
cmpl %eax, %ecx
jl 0x43f4
movq 0x20(%r14), %r12
leal 0x64(%rax), %ecx
movl %ecx, 0x1c(%r14)
cltq
leaq 0x320(,%rax,8), %rsi
movq %r12, %rdi
callq 0x2320
movq %rax, %r12
movq %rax, 0x20(%r14)
movl $0x320, %edx            # imm = 0x320
movq %rax, %rdi
xorl %esi, %esi
callq 0x2110
movl 0x18(%r14), %ecx
movl 0x1c(%r14), %eax
incl %ecx
cmpl %eax, %ecx
jge 0x43b7
testl %r15d, %r15d
jle 0x4413
movl %r15d, %eax
movq 0x20(%r14), %rcx
movq %rbx, (%rcx,%r13,8)
incq %r13
addq $0x1f0, %rbx            # imm = 0x1F0
decq %rax
jne 0x43fc
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/opt.c
// Function: optRunParser
optResponse optRunParser (optParser *parser)
{
    optResponse res = OPT_CONTINUE;

    if (parser->options == NULL)
        return OPT_SUCCESS;

    parser->curopt++;

    while ((parser->curopt != parser->argc) && res == OPT_CONTINUE) {
        if ((parser->argv)[parser->curopt][0] == '-') {
            if (parser->argv[parser->curopt][1] == '-')
                res = optParseLong(parser);
            else
                res = optParseChars(parser);

            parser->curopt++;
        } else {
            res = OPT_UNUSED;
        }
    }
    if (parser->curopt == parser->argc && res == OPT_CONTINUE)
        res = OPT_SUCCESS;

    return res;
}

// Assembly:
cmpq $0x0, 0x20(%rdi)
je 0x445d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movslq 0x10(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rdi)
movl (%rdi), %edx
cmpl %edx, %ecx
jne 0x4460
movb $0x1, %sil
movl $0x3, %ebp
movl %ecx, %edx
jmp 0x4587
xorl %eax, %eax
retq
movq 0x8(%rbx), %rsi
movq 0x8(%rsi,%rax,8), %rsi
movl $0x2, %ebp
cmpb $0x2d, (%rsi)
jne 0x4580
movq %rsp, %r14
cmpb $0x2d, 0x1(%rsi)
jne 0x44cc
movq 0x20(%rbx), %r13
addq $0x2, %rsi
movq %r14, %rdi
callq 0x21e0
movq (%r13), %r15
movl $0x1, %r12d
testq %r15, %r15
je 0x4554
addq $0x8, %r13
movq %r15, %rdi
movq %r14, %rsi
callq 0x2280
testl %eax, %eax
je 0x4543
movq (%r13), %r15
addq $0x8, %r13
testq %r15, %r15
jne 0x44a7
jmp 0x4554
movq %rsi, %rdi
callq 0x20d0
movq %rax, %r15
movl $0x1, 0x14(%rbx)
movl $0x3, %r12d
cmpl $0x2, %r15d
jl 0x4554
movl $0x1, %ecx
movq 0x20(%rbx), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0x453b
movq 0x8(%rbx), %rdx
movslq 0x10(%rbx), %rdi
movq (%rdx,%rdi,8), %rdx
movslq %ecx, %rcx
movb (%rdx,%rcx), %cl
addq $0x8, %rax
cmpb %cl, 0x1f(%rsi)
je 0x4524
movq (%rax), %rsi
addq $0x8, %rax
testq %rsi, %rsi
jne 0x4511
jmp 0x453b
movq %rbx, %rdi
callq 0x45a3
movl 0x14(%rbx), %ecx
incl %ecx
movl %ecx, 0x14(%rbx)
cmpl %r15d, %ecx
jl 0x44ef
jmp 0x4554
movl $0x1, %r12d
jmp 0x4554
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45a3
movl $0x3, %r12d
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl (%rbx), %edx
cmpl $0x3, %r12d
sete %sil
jne 0x4584
cmpl %edx, %ecx
je 0x4584
movq 0x8(%rbx), %rsi
movq 0x8(%rsi,%rax,8), %rsi
cmpb $0x2d, (%rsi)
je 0x447a
xorl %esi, %esi
jmp 0x4587
movl %r12d, %ebp
xorl %eax, %eax
cmpl %edx, %ecx
cmovnel %ebp, %eax
testb %sil, %sil
cmovel %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cotix[P]cReddit/src/opt.c
// Function: optProcessOption
static optResponse optProcessOption (optParser *parser, optOption *option)
{
    option->isSet = 1;
    switch (option->arg) {
    case OPT_INT:
        return optReadInt(parser, option);

    case OPT_STRING:
        return optReadString(parser, option);

    default:
        break;
    }
    return OPT_CONTINUE;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
orb $0x1, 0x1b5(%rsi)
movl 0x20(%rsi), %eax
cmpl $0x2, %eax
je 0x45dc
cmpl $0x1, %eax
jne 0x45da
movslq 0x10(%rdi), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x10(%rdi)
movq 0x8(%rdi), %rcx
movq 0x8(%rcx,%rax,8), %rdi
callq 0x22d0
movl %eax, 0x1b8(%rbx)
popq %rbx
retq
movslq 0x10(%rdi), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x10(%rdi)
addq $0x1bc, %rbx            # imm = 0x1BC
movq 0x8(%rdi), %rcx
movq 0x8(%rcx,%rax,8), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x21e0
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/example/example2.c
// Function: main
int main(int argc, char **argv)
{
	rbtree_t tree = RBTREE_INIT(keycmp);
	int i;
	info_t *info;
	rbnode_t *n;
	
	/* insert */
	for(i = 0; i < 10; i++) {
		info = malloc(sizeof(info_t));
		info->entry.key = itop(i);
		info->value = i;
		rbtree_insert(&tree, &info->entry);
	}
	
	/* lookup */
	n = rbtree_lookup(&tree, itop(5));
	if (n)
		printf("Find %d.\n", rbtree_container_of(n, info_t, entry)->value);
	else
		printf("5 not exist.\n");
	
	/* delete */
	rbtree_remove(&tree, n);
	
	/* print */
	printf("parent node color   dir value\n");
	rbtree_foreach_inorder(&tree, print_node, NULL);
	
	free_rbtree(&tree);
	
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movups 0x236e(%rip), %xmm0     # 0x3dd8
movq %rsp, %rbx
movaps %xmm0, (%rbx)
xorl %r14d, %r14d
movl $0x30, %edi
callq 0x1070
leaq 0x8(%rax), %rsi
movq %r14, 0x8(%rax)
movl %r14d, (%rax)
movq %rbx, %rdi
callq 0x117c
incq %r14
cmpq $0xa, %r14
jne 0x1a73
movq %rsp, %rdi
movl $0x5, %esi
callq 0x13d8
movq %rax, %rbx
testq %rax, %rax
je 0x1ac1
movl -0x8(%rbx), %esi
leaq 0x54c(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1060
jmp 0x1acd
leaq 0x58a(%rip), %rdi       # 0x2052
callq 0x1050
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1414
leaq 0x57d(%rip), %rdi       # 0x205f
callq 0x1050
leaq 0x2b(%rip), %rsi        # 0x1b19
movq %r14, %rdi
xorl %edx, %edx
callq 0x1853
leaq 0x99(%rip), %rsi        # 0x1b98
movq %r14, %rdi
xorl %edx, %edx
callq 0x18bb
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/example/example2.c
// Function: print_node
static int print_node(rbtree_t *tree, rbnode_t *n, void *state)
{
	info_t *info = rbtree_container_of(n, info_t, entry);
	if (rbnode_is_root(n)) {
		printf("       %4d %5s       %5d\n",
			ptoi(n->key),
			rbnode_is_red(n) ? "red" : "black",
			info->value);
	}
	else {
		printf("%6d %4d %5s %5s %5d\n",
			ptoi(n->parent->key),
			ptoi(n->key),
			rbnode_is_red(n) ? "red" : "black",
			rbnode_is_right(n) ? "right" : "left",
			info->value);
	}
	return 0;
}

// Assembly:
pushq %rax
movq 0x20(%rsi), %rdi
testq %rdi, %rdi
je 0x1b69
movl (%rdi), %eax
movl -0x8(%rsi), %r9d
movl (%rsi), %edx
cmpl $0x1, 0x8(%rsi)
leaq 0x4f2(%rip), %r8        # 0x2028
leaq 0x4ef(%rip), %rcx       # 0x202c
cmoveq %r8, %rcx
cmpq %rsi, 0x18(%rdi)
leaq 0x4fb(%rip), %rsi       # 0x2047
leaq 0x4fa(%rip), %r8        # 0x204d
cmoveq %rsi, %r8
leaq 0x4d4(%rip), %rdi       # 0x2032
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
jmp 0x1b94
movl -0x8(%rsi), %ecx
movl (%rsi), %eax
cmpl $0x1, 0x8(%rsi)
leaq 0x4af(%rip), %rsi       # 0x2028
leaq 0x4ac(%rip), %rdx       # 0x202c
cmoveq %rsi, %rdx
leaq 0x483(%rip), %rdi       # 0x200e
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/util.c
// Function: do_debugf
void
do_debugf(int level, const char *format, ...)
{
    va_list args;
    va_start(args, format);
    if(debug_level >= level) {
        vfprintf(stderr, format, args);
        fflush(stderr);
    }
    va_end(args);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x3100
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %r10, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x10131(%rip), %rax     # 0x13258
cmpl %edi, (%rax)
jge 0x3134
addq $0xd0, %rsp
popq %rbx
retq
movq 0xfebd(%rip), %rbx      # 0x12ff8
movq (%rbx), %rdi
movq %rsp, %rdx
callq 0x2300
movq (%rbx), %rdi
callq 0x2250
jmp 0x312b
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/shncpd.c
// Function: check_interface
static int
check_interface(struct interface *iif)
{
    int ifindex, rc;
    struct ipv6_mreq mreq;

    ifindex = if_nametoindex(iif->ifname);
    if(ifindex != iif->ifindex) {
        iif->ifindex = ifindex;
        if(iif->ifindex > 0) {
            memset(&mreq, 0, sizeof(mreq));
            memcpy(&mreq.ipv6mr_multiaddr, &protocol_group, 16);
            mreq.ipv6mr_interface = iif->ifindex;
            rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_JOIN_GROUP,
                            (char*)&mreq, sizeof(mreq));
            if(rc < 0) {
                perror("setsockopt(IPV6_JOIN_GROUP)");
                iif->ifindex = 0;
                goto fail;
            }
            schedule_ra(iif, 1, 0);
            return 1;
        }
    }
 fail:
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x21f0
xorl %ebx, %ebx
cmpl 0x8(%r14), %eax
je 0x451f
movl %eax, 0x8(%r14)
testl %eax, %eax
jle 0x451f
movups 0xed7d(%rip), %xmm0     # 0x13260
movq %rsp, %rcx
movaps %xmm0, (%rcx)
movl %eax, 0x10(%rcx)
movl 0xed92(%rip), %edi      # 0x13284
movl $0x29, %esi
movl $0x14, %edx
movl $0x14, %r8d
callq 0x20a0
testl %eax, %eax
js 0x4529
movl $0x1, %ebx
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x74b8
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x8ee2(%rip), %rdi      # 0xd412
callq 0x22e0
movl $0x0, 0x8(%r14)
jmp 0x451f
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/shncpd.c
// Function: check_routing
static int
check_routing()
{
    int is_now_a_router = kernel_router();

    if(is_now_a_router != was_a_router) {
        debugf("Change in routing status: %d -> %d\n",
               was_a_router, is_now_a_router);
        was_a_router = is_now_a_router;
        ra_routing_change(is_now_a_router);
        republish(0, 0);
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbx
xorl %eax, %eax
callq 0xb36f
movl 0xed0f(%rip), %edx      # 0x1325c
cmpl %edx, %eax
jne 0x4553
popq %rbx
retq
movl %eax, %ebx
cmpl $0x2, 0xecfc(%rip)      # 0x13258
jge 0x4575
movl %ebx, 0xecf8(%rip)      # 0x1325c
movl %ebx, %edi
callq 0x79f3
xorl %edi, %edi
xorl %esi, %esi
popq %rbx
jmp 0x47aa
leaq 0x8eb2(%rip), %rsi      # 0xd42e
movl $0x2, %edi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30a8
jmp 0x455e
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: find_neighbour
struct neighbour *
find_neighbour(struct interface *interface, const unsigned char *id,
               unsigned int eid, const struct sockaddr_in6 *create)
{
    int i;

    if(id_eq(id, myid)) {
        fprintf(stderr, "Attempting to find myself.\n");
        return NULL;
    }

    for(i = 0; i < numneighs; i++) {
        if(neighs[i].interface == interface &&
           id_eq(neighs[i].id, id) && neighs[i].eid == eid) {
            if(create &&
               memcmp(&neighs[i].addr,
                      &create->sin6_addr, sizeof(create->sin6_addr)) != 0 &&
               neighs[i].port == ntohs(create->sin6_port)) {
                debugf("Neighbour changed address.\n");
                memcpy(&neighs[i].addr, create, sizeof(*create));
                neighs[i].port = ntohs(create->sin6_port);
            }
            return &neighs[i];
        }
    }

    if(!create || numneighs >= MAXNEIGHS)
        return NULL;

    memset(&neighs[i], 0, sizeof(struct neighbour));
    neighs[i].interface = interface;
    memcpy(neighs[i].id, id, 4);
    neighs[i].eid = eid;
    memcpy(&neighs[i].addr, &create->sin6_addr, sizeof(create->sin6_addr));
    neighs[i].port = ntohs(create->sin6_port);
    neighs[i].last_contact = now;

    numneighs++;

    republish(1, 1);
    return &neighs[i];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl (%rsi), %eax
leaq 0xec29(%rip), %rcx      # 0x13280
cmpl (%rcx), %eax
je 0x4799
movslq 0xec42(%rip), %rax      # 0x132a8
testq %rax, %rax
jle 0x469c
leaq 0xf832(%rip), %r15      # 0x13ea4
movq %rax, %rcx
cmpq %rdi, -0x14(%r15)
jne 0x468e
movl -0xc(%r15), %r8d
cmpl (%rsi), %r8d
jne 0x468e
cmpl %edx, -0x8(%r15)
je 0x4739
addq $0x40, %r15
decq %rcx
jne 0x4675
movq %rax, %rcx
jmp 0x469e
xorl %ecx, %ecx
testq %rbx, %rbx
sete %r8b
cmpl $0x28, %eax
setge %r9b
orb %r8b, %r9b
je 0x46b6
xorl %r14d, %r14d
jmp 0x4730
shlq $0x6, %rcx
leaq 0xf7cf(%rip), %r8       # 0x13e90
leaq (%r8,%rcx), %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rcx,%r8)
movaps %xmm0, 0x30(%rcx,%r8)
movaps %xmm0, 0x20(%rcx,%r8)
movaps %xmm0, 0x10(%rcx,%r8)
movq %rdi, (%rcx,%r8)
movl (%rsi), %esi
movl %esi, 0x8(%rcx,%r8)
movl %edx, 0xc(%rcx,%r8)
movups 0x8(%rbx), %xmm0
movups %xmm0, 0x14(%rcx,%r8)
movzwl 0x2(%rbx), %edx
rolw $0x8, %dx
movw %dx, 0x10(%rcx,%r8)
leaq 0xeb62(%rip), %rdx      # 0x13270
movdqu (%rdx), %xmm0
movdqu %xmm0, 0x28(%rcx,%r8)
incl %eax
movl %eax, 0xeb87(%rip)      # 0x132a8
movl $0x1, %edi
movl $0x1, %esi
callq 0x47aa
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq -0x14(%r15), %r14
testq %rbx, %rbx
je 0x4730
movdqu (%r15), %xmm0
movdqu 0x8(%rbx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x4730
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
cmpw %ax, -0x4(%r15)
jne 0x4730
leaq 0xeae7(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x47a3
movdqu (%rbx), %xmm0
movdqu 0xc(%rbx), %xmm1
movdqu %xmm1, 0xc(%r15)
movdqu %xmm0, (%r15)
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
movw %ax, -0x4(%r15)
jmp 0x4730
callq 0x25a7
jmp 0x46b1
callq 0x2596
jmp 0x4776
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: flush_neighbour
void
flush_neighbour(struct neighbour *neigh)
{
    int i = neigh - neighs;

    assert(i >= 0 && i < numneighs);

    if(i < numneighs - 1)
        neighs[i] = neighs[numneighs - 1];
    MEM_UNDEFINED(neighs + numneighs - 1, sizeof(struct neighbour));

    numneighs--;
    republish(1, 1);
}

// Assembly:
leaq 0xf573(%rip), %rax      # 0x13e90
subq %rax, %rdi
shrq $0x6, %rdi
testl %edi, %edi
js 0x4983
movl 0xe97a(%rip), %ecx      # 0x132a8
cmpl %edi, %ecx
jle 0x4983
decl %ecx
cmpl %edi, %ecx
jbe 0x496e
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
shlq $0x6, %rdi
movl %ecx, %edx
shlq $0x6, %rdx
movaps (%rdx,%rax), %xmm0
movaps 0x10(%rdx,%rax), %xmm1
movaps 0x20(%rdx,%rax), %xmm2
movaps 0x30(%rdx,%rax), %xmm3
movaps %xmm3, 0x30(%rdi,%rax)
movaps %xmm2, 0x20(%rdi,%rax)
movaps %xmm1, 0x10(%rdi,%rax)
movaps %xmm0, (%rdi,%rax)
movl %ecx, 0xe934(%rip)      # 0x132a8
movl $0x1, %edi
movl $0x1, %esi
jmp 0x47aa
pushq %rax
leaq 0x8b4b(%rip), %rdi      # 0xd4d6
leaq 0x8b5c(%rip), %rsi      # 0xd4ee
leaq 0x8b5d(%rip), %rcx      # 0xd4f6
movl $0x80, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: find_node
struct node *
find_node(const unsigned char *id, int create)
{
    int p = 0;

    if(numnodes > 0) {
        int m, g = numnodes - 1, c;

        do {
            m = (p + g) / 2;
            c = memcmp(id, nodes[m].id, 4);
            if(c == 0)
                return &nodes[m];
            else if(c < 0)
                g = m - 1;
            else
                p = m + 1;
        } while(p <= g);
    }

    if(!create || numnodes >= MAXNODES)
        return NULL;

    if(p < numnodes)
        memmove(nodes + p + 1, nodes + p,
                (numnodes - p) * sizeof(struct node));
    memset(&nodes[p], 0, sizeof(struct node));
    memcpy(nodes[p].id, id, 4);
    numnodes++;

    return &nodes[p];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xe8ef(%rip), %r14d     # 0x132a4
testl %r14d, %r14d
jle 0x4a08
leal -0x1(%r14), %edi
xorl %ecx, %ecx
leaq 0xfec9(%rip), %rax      # 0x14890
movl (%rbx), %edx
bswapl %edx
leal (%rdi,%rcx), %r8d
shrl %r8d
imulq $0x70, %r8, %r9
movl 0x8(%r9,%rax), %r10d
bswapl %r10d
xorl %r11d, %r11d
cmpl %r10d, %edx
seta %r11b
sbbl $0x0, %r11d
je 0x4a91
js 0x49fc
incl %r8d
movl %r8d, %ecx
jmp 0x4a02
decl %r8d
movl %r8d, %edi
cmpl %edi, %ecx
jle 0x49cb
jmp 0x4a0a
xorl %ecx, %ecx
testl %esi, %esi
sete %al
cmpl $0x64, %r14d
setge %dl
orb %al, %dl
je 0x4a1e
xorl %eax, %eax
jmp 0x4a94
movl %r14d, %eax
movl %ecx, %r12d
leaq 0xfe65(%rip), %r15      # 0x14890
subl %ecx, %eax
jle 0x4a4a
imulq $0x70, %r12, %rcx
leaq (%r15,%rcx), %rsi
leaq (%rcx,%r15), %rdi
addq $0x70, %rdi
cltq
imulq $0x70, %rax, %rdx
callq 0x22b0
imulq $0x70, %r12, %rcx
leaq (%r15,%rcx), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rcx,%r15)
movaps %xmm0, 0x50(%rcx,%r15)
movaps %xmm0, 0x40(%rcx,%r15)
movaps %xmm0, 0x30(%rcx,%r15)
movaps %xmm0, 0x20(%rcx,%r15)
movaps %xmm0, 0x10(%rcx,%r15)
movaps %xmm0, (%rcx,%r15)
movl (%rbx), %edx
movl %edx, 0x8(%rcx,%r15)
incl %r14d
movl %r14d, 0xe815(%rip)     # 0x132a4
jmp 0x4a94
addq %r9, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: flush_node
void
flush_node(struct node *node)
{
    int i = node - nodes;
    int j;

    assert(i >= 0 && i < numnodes);

    free(node->neighs);
    free(node->data);
    destroy_prefix_list(node->assigned);
    destroy_prefix_list(node->addresses);
    for(j = 0; j < node->numexts; j++)
        destroy_external(node->exts[j]);
    free(node->exts);

    if(i < numnodes - 1)
        memmove(nodes + i, nodes + i + 1,
                (numnodes - i - 1) * sizeof(struct node));
    MEM_UNDEFINED(nodes + numnodes - 1, sizeof(struct node));

    numnodes--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xfde1(%rip), %r14      # 0x14890
movq %rdi, %rax
subq %r14, %rax
sarq $0x4, %rax
movabsq $0x6db6db6db6db6db7, %r15 # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %r15
testl %r15d, %r15d
js 0x4b79
cmpl %r15d, 0xe7cd(%rip)     # 0x132a4
jle 0x4b79
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
callq 0x2040
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x50(%rbx), %rdi
callq 0x92d1
movq 0x58(%rbx), %rdi
callq 0x92d1
cmpl $0x0, 0x68(%rbx)
jle 0x4b26
xorl %r12d, %r12d
movq 0x60(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x4b98
incq %r12
movslq 0x68(%rbx), %rax
cmpq %rax, %r12
jl 0x4b0d
movq 0x60(%rbx), %rdi
callq 0x2040
movl 0xe76f(%rip), %eax      # 0x132a4
leal -0x1(%rax), %ebx
cmpl %r15d, %ebx
jle 0x4b67
movl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
imulq $0x70, %rcx, %rcx
leaq (%r14,%rcx), %rdi
leaq (%rcx,%r14), %rsi
addq $0x70, %rsi
notl %r15d
addl %r15d, %eax
cltq
imulq $0x70, %rax, %rdx
callq 0x22b0
movl %ebx, 0xe737(%rip)      # 0x132a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x899f(%rip), %rdi      # 0xd51f
leaq 0x8967(%rip), %rsi      # 0xd4ee
leaq 0x89a8(%rip), %rcx      # 0xd536
movl $0xb3, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: node_hash
void
node_hash(unsigned char *h, const unsigned char *data, int len)
{
    md5_state_t ms;
    unsigned char digest[16];
    md5_init(&ms);
    md5_append(&ms, data, len);
    md5_finish(&ms, digest);
    memcpy(h, digest, 8);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xb780
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0xb799
movq %rsp, %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xbfd9
movq (%rbx), %rax
movq %rax, (%r15)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: network_hash
int
network_hash(unsigned char *h)
{
    md5_state_t ms;
    unsigned char digest[16];
    int i;

    /* This relies on the node table being sorted. */

    md5_init(&ms);
    for(i = 0; i < numnodes; i++) {
        unsigned char s[4];
        DO_HTONL(s, nodes[i].seqno);
        md5_append(&ms, s, 4);
        md5_append(&ms, nodes[i].datahash, 8);
    }
    md5_finish(&ms, digest);
    memcpy(h, digest, 8);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
callq 0xb780
cmpl $0x0, 0xe40a(%rip)      # 0x132a4
jle 0x4eea
leaq 0xfa09(%rip), %r14      # 0x148ac
xorl %r13d, %r13d
leaq 0x18(%rsp), %r15
movq %rsp, %r12
movl 0x8(%r14), %eax
bswapl %eax
movl %eax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0xb799
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0xb799
incq %r13
movslq 0xe3c3(%rip), %rax      # 0x132a4
addq $0x70, %r14
cmpq %rax, %r13
jl 0x4eae
leaq 0x18(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0xbfd9
movq (%r14), %rax
movq %rax, (%rbx)
movl $0x1, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/state.c
// Function: all_dhcp_data
struct prefix_list *
all_dhcp_data(int ntp, int v4, int v6)
{
    int i, j, k;
    struct prefix_list *pl = create_prefix_list(), *pl2;

    for(i = 0; i < numnodes; i++) {
        for(j = 0; j < nodes[i].numexts; j++) {
            struct prefix_list *data =
                ntp ? nodes[i].exts[j]->ntp : nodes[i].exts[j]->dns;
            if(data == NULL)
                continue;
            for(k = 0; k < nodes[i].exts[j]->dns->numprefixes; k++) {
                struct prefix *p = &data->prefixes[k];
                if((!v4 && prefix_v4(p)) || (!v6 && !prefix_v4(p)))
                    continue;
                pl2 = prefix_list_cons_prefix(pl, p);
                if(pl2 == NULL) {
                    destroy_prefix_list(pl);
                    return NULL;
                }
                pl = pl2;
            }
        }
    }
    return pl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, 0x8(%rsp)
movl %esi, 0xc(%rsp)
movl %edi, %r14d
callq 0x92c2
movl 0xe36d(%rip), %edx      # 0x132a4
testl %edx, %edx
jle 0x5049
xorl %ecx, %ecx
testl %r14d, %r14d
setne %cl
leaq 0x8(,%rcx,8), %rsi
xorl %edi, %edi
leaq 0xf938(%rip), %r8       # 0x14890
movq %rsi, 0x18(%rsp)
imulq $0x70, %rdi, %rbx
movl 0x68(%rbx,%r8), %ecx
testl %ecx, %ecx
jle 0x502e
movq %rdi, 0x10(%rsp)
addq %r8, %rbx
xorl %r13d, %r13d
movq 0x60(%rbx), %rdx
movq (%rdx,%r13,8), %rdx
movq (%rdx,%rsi), %rdi
movq %rdi, 0x20(%rsp)
testq %rdi, %rdi
je 0x500d
movq 0x8(%rdx), %rdx
cmpw $0x0, 0x8(%rdx)
jle 0x500d
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %rax, %r14
movq 0x20(%rsp), %rax
movq (%rax), %r15
addq %rbp, %r15
cmpl $0x0, 0xc(%rsp)
je 0x4fd9
cmpl $0x0, 0x8(%rsp)
jne 0x4fc7
movq %r15, %rdi
callq 0x99f6
testl %eax, %eax
je 0x4fe5
movq %r14, %rdi
movq %r15, %rsi
callq 0x92ec
testq %rax, %rax
jne 0x4fe8
jmp 0x503f
movq %r15, %rdi
callq 0x99f6
testl %eax, %eax
je 0x4fb4
movq %r14, %rax
incq %r12
movq 0x60(%rbx), %rcx
movq (%rcx,%r13,8), %rcx
movq 0x8(%rcx), %rcx
movswq 0x8(%rcx), %rcx
addq $0x1c, %rbp
cmpq %rcx, %r12
jl 0x4f9f
movl 0x68(%rbx), %ecx
movq 0x18(%rsp), %rsi
incq %r13
movslq %ecx, %rdx
cmpq %rdx, %r13
jl 0x4f79
movl 0xe282(%rip), %edx      # 0x132a4
movq 0x10(%rsp), %rdi
leaq 0xf862(%rip), %r8       # 0x14890
incq %rdi
movslq %edx, %rcx
cmpq %rcx, %rdi
jl 0x4f5d
jmp 0x5049
movq %r14, %rdi
callq 0x92d1
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/send.c
// Function: flushbuf
int
flushbuf()
{
    struct sockaddr_in6 tob, *to;
    int rc;

    if(!buffered)
        return 0;

    if(buffered_interface) {
        memset(&tob, 0, sizeof(tob));
        tob.sin6_family = AF_INET6;
        memcpy(&tob.sin6_addr, &protocol_group, 16);
        tob.sin6_port = htons(protocol_port);
        tob.sin6_scope_id = buffered_interface->ifindex;
        to = &tob;
    } else {
        to = &buffered_sin6;
    }

    rc = sendto(protocol_socket, sendbuf, buffered, 0,
                (struct sockaddr*)to, sizeof(struct sockaddr_in6));

    if(rc < 0) {
        int saved_errno = errno;
        perror("sendto");
        errno = saved_errno;
    }

    buffered_interface = NULL;
    buffered = 0;
    MEM_UNDEFINED(sendbuf, SENDBUF_SIZE);
    MEM_UNDEFINED(&buffered_sin6, sizeof(buffered_sin6));

    return rc;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movslq 0x123ec(%rip), %rdx     # 0x17450
testq %rdx, %rdx
je 0x50b3
movq 0x123e8(%rip), %rax     # 0x17458
testq %rax, %rax
je 0x50b7
leaq 0x4(%rsp), %r8
movl $0x0, 0x4(%r8)
movw $0xa, (%r8)
leaq 0xe1d1(%rip), %rcx      # 0x13260
movups (%rcx), %xmm0
leaq 0xe147(%rip), %rcx      # 0x131e0
movzwl (%rcx), %ecx
rolw $0x8, %cx
movups %xmm0, 0x8(%r8)
movw %cx, 0x2(%r8)
movl 0x8(%rax), %eax
movl %eax, 0x18(%r8)
jmp 0x50be
xorl %ebx, %ebx
jmp 0x50f7
leaq 0x123a2(%rip), %r8      # 0x17460
leaq 0xe1bf(%rip), %rax      # 0x13284
movl (%rax), %edi
movq 0x123b2(%rip), %rsi     # 0x17480
xorl %ecx, %ecx
movl $0x1c, %r9d
callq 0x2170
movq %rax, %rbx
testl %ebx, %ebx
js 0x50ff
movq $0x0, 0x1236b(%rip) # 0x17458
movl $0x0, 0x12359(%rip)     # 0x17450
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
retq
callq 0x25e5
jmp 0x50e2
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/send.c
// Function: buffer_network_state
int
buffer_network_state(const struct sockaddr_in6 *sin6,
                     struct interface *interface)
{
    unsigned char h[8];
    int rc;
    rc = network_hash(h);
    if(rc < 0)
        return -1;
    debugf("-> NETWORK-STATE %s%s\n",
           format_64(h), interface ? " (multicast)" : "");
    buffer_tlv(4, h, 8, sin6, interface);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rdi
callq 0x4e79
testl %eax, %eax
js 0x5345
leaq 0xdf37(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x5352
movq %rsp, %rsi
movl $0x4, %edi
movl $0x8, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x5106
movl $0x1, %eax
jmp 0x534a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x2607
jmp 0x5326
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/send.c
// Function: buffer_node_state
int
buffer_node_state(struct node *node, int full,
                  const struct sockaddr_in6 *sin6, struct interface *interface)
{
    int buflen = full ? 20 + node->datalen : 20;
    unsigned char buf[buflen];
    int i = 0;
    long long orig_delay =
        (now.tv_sec - node->orig_time.tv_sec) * 1000LL +
        ((long long)now.tv_nsec - node->orig_time.tv_nsec + 999999) / 1000000;

    BYTES(node->id, 4);
    LONG(node->seqno);
    LONG((unsigned)orig_delay);
    BYTES(node->datahash, 8);
    if(full) {
        BYTES(node->data, node->datalen);
    }
    assert(i == buflen);
    debugf("-> NODE-STATE %s%s\n",
           format_32(node->id),
           full && interface ? " (full, multicast)" :
           full ? " (full)" :
           interface ? " (multicast)" : "");
    return buffer_tlv(5, buf, buflen, sin6, interface);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r13
movl %esi, %r9d
movq %rdi, %r12
movl $0x14, %ecx
movl $0x14, %r15d
testl %esi, %esi
je 0x5394
movl 0x18(%r12), %r15d
addl $0x14, %r15d
movl %r15d, %esi
movq %rsp, %rdi
addq $0xf, %rsi
andq $-0x10, %rsi
movq %rdi, %r14
subq %rsi, %r14
movq %r14, %rsp
leaq 0xdebe(%rip), %rax      # 0x13270
movl (%rax), %edx
subl 0x28(%r12), %edx
imull $0x3e8, %edx, %r8d      # imm = 0x3E8
movq 0x8(%rax), %rax
subq 0x30(%r12), %rax
addq $0xf423f, %rax          # imm = 0xF423F
movabsq $0x431bde82d7b634db, %rdx # imm = 0x431BDE82D7B634DB
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x12, %rdx
addl %eax, %edx
addl %r8d, %edx
negq %rsi
movl 0x8(%r12), %eax
movl %eax, (%r14)
movl 0x24(%r12), %eax
bswapl %eax
movl %eax, 0x4(%r14)
bswapl %edx
movl %edx, 0x8(%r14)
movq 0x1c(%r12), %rax
movq %rax, 0xc(%rdi,%rsi)
testl %r9d, %r9d
je 0x5446
leaq 0x14(%r14), %rdi
movq 0x10(%r12), %rsi
movq %r13, -0x38(%rbp)
movq %rbx, -0x30(%rbp)
movl 0x18(%r12), %ebx
movq %rbx, %rdx
movl %r9d, %r13d
callq 0x2210
movl %r13d, %r9d
leal 0x14(%rbx), %ecx
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %r13
cmpl %r15d, %ecx
jne 0x5495
leaq 0xde06(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x547c
movl $0x5, %edi
movq %r14, %rsi
movl %r15d, %edx
movq %r13, %rcx
movq %rbx, %r8
callq 0x5106
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r12
xorl %edx, %edx
testl %r9d, %r9d
sete %dl
movq %r12, %rdi
movq %rbx, %rsi
callq 0x263b
jmp 0x5457
leaq 0x8257(%rip), %rdi      # 0xd6f3
leaq 0x825c(%rip), %rsi      # 0xd6ff
leaq 0x825c(%rip), %rcx      # 0xd706
movl $0xb1, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/ra.c
// Function: ra_retract
void
ra_retract(const struct prefix *prefix)
{
    int i;
    for(i = 0; i < numinterfaces; i++) {
        if(interfaces[i].ifindex > 0) {
            struct prefix_list *pl =
                prefix_list_cons_prefix(interfaces[i].retractions, prefix);
            if(pl)
                interfaces[i].retractions = pl;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xbe3c(%rip), %r14      # 0x132a0
cmpl $0x0, (%r14)
jle 0x74ac
movq %rdi, %rbx
movl $0x90, %r15d
addq 0xbb5e(%rip), %r15      # 0x12fd8
xorl %r12d, %r12d
cmpl $0x0, -0x88(%r15)
jle 0x749a
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x92ec
testq %rax, %rax
je 0x749a
movq %rax, (%r15)
incq %r12
movslq (%r14), %rax
addq $0x98, %r15
cmpq %rax, %r12
jl 0x747d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/ra.c
// Function: schedule_ra
void
schedule_ra(struct interface *interface, int soon, int override)
{
    int a, b;

    if(interface == NULL) {
        int i;
        for(i = 0; i < numinterfaces; i++) {
            if(interfaces[i].ifindex > 0)
                schedule_ra(&interfaces[i], soon, override);
        }
        return;
    }

    if(soon) {
        a = 0;
        b = MAX_RA_DELAY_TIME;
    } else {
        a = MIN_RTR_ADV_INTERVAL;
        b = MAX_RTR_ADV_INTERVAL;
    }

    if(!override && interface->ra_timeout.tv_sec > 0 &&
       ts_minus_msec(&interface->ra_timeout, &now) < b)
        return;

    ts_add_msec(&interface->ra_timeout, &now, a);
    ts_add_random(&interface->ra_timeout, &interface->ra_timeout, b - a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %ebx
testq %rdi, %rdi
je 0x752e
movq %rdi, %r14
xorl %eax, %eax
testl %ebx, %ebx
movl $0x30570, %r12d         # imm = 0x30570
cmovnel %eax, %r12d
movl $0x927c0, %r13d         # imm = 0x927C0
movl $0x1f4, %r15d           # imm = 0x1F4
cmovnel %r15d, %r13d
testl %ebp, %ebp
je 0x7570
addq $0x70, %r14
leaq 0xbd74(%rip), %rsi      # 0x13270
movq %r14, %rdi
movl %r12d, %edx
callq 0xb514
testl %ebx, %ebx
movl $0x62250, %eax          # imm = 0x62250
cmovel %eax, %r15d
movq %r14, %rdi
movq %r14, %rsi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb5e5
leaq 0xbd6b(%rip), %r15      # 0x132a0
movl (%r15), %eax
testl %eax, %eax
jle 0x7594
leaq 0xbd6d(%rip), %r14      # 0x132b0
xorl %r12d, %r12d
cmpl $0x0, 0x8(%r14)
jle 0x755c
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x74b8
movl (%r15), %eax
incq %r12
movslq %eax, %rcx
addq $0x98, %r14
cmpq %rcx, %r12
jl 0x7546
jmp 0x7594
cmpq $0x0, 0x70(%r14)
jle 0x74f1
leaq 0x70(%r14), %rdi
leaq 0xbcea(%rip), %rsi      # 0x13270
callq 0xb4e5
cmpl %r13d, %eax
jge 0x74f1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/ra.c
// Function: ra_setup
int
ra_setup()
{
    int rc;
    rc = setup_ra_socket();
    if(rc < 0) {
        perror("setup_ra_socket");
        return rc;
    }
    schedule_ra(NULL, 1, 1);
    return 1;
}

// Assembly:
pushq %rbx
callq 0x7278
testl %eax, %eax
js 0x75c7
movl $0x1, %ebx
xorl %edi, %edi
movl $0x1, %esi
movl $0x1, %edx
callq 0x74b8
movl %ebx, %eax
popq %rbx
retq
movl %eax, %ebx
leaq 0x6730(%rip), %rdi      # 0xdd00
callq 0x22e0
jmp 0x75c3
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/ra.c
// Function: ra_cleanup
void
ra_cleanup()
{
    if(ra_socket >= 0) {
        if(is_a_router()) {
            debugf("Retracting RA.\n");
            send_multicast_ra(NULL, -1);
        }
        close(ra_socket);
    }
    ra_socket = -1;
}

// Assembly:
cmpl $0x0, 0xbc0e(%rip)      # 0x131ec
js 0x7611
pushq %rax
callq 0x343e
testl %eax, %eax
je 0x7602
leaq 0xbc67(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x761c
xorl %edi, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x7623
movl 0xbbe4(%rip), %edi      # 0x131ec
callq 0x2190
addq $0x8, %rsp
movl $0xffffffff, 0xbbd1(%rip) # imm = 0xFFFFFFFF
retq
callq 0x2d83
jmp 0x75f6
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/dhcpv4.c
// Function: flush_lease
void
flush_lease(struct lease *lease)
{
    int i = lease - leases;

    assert(i >= 0 && i < numleases);

    if(i < numleases - 1)
        leases[i] = leases[numleases - 1];
    MEM_UNDEFINED(leases + numleases - 1, sizeof(struct lease));
    numleases--;
}

// Assembly:
movq 0xf859(%rip), %rax      # 0x17488
subq %rax, %rdi
sarq $0x4, %rdi
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rdx
testl %edx, %edx
js 0x7c93
movl 0xf842(%rip), %ecx      # 0x17490
cmpl %edx, %ecx
jle 0x7c93
decl %ecx
cmpl %edx, %ecx
jbe 0x7c8c
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
movl %ecx, %esi
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
movups (%rax,%rsi), %xmm0
movups 0x10(%rax,%rsi), %xmm1
movups 0x20(%rax,%rsi), %xmm2
movups %xmm2, 0x20(%rax,%rdx)
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
movl %ecx, 0xf7fe(%rip)      # 0x17490
retq
pushq %rax
leaq 0x60ed(%rip), %rdi      # 0xdd88
leaq 0x60fe(%rip), %rsi      # 0xdda0
leaq 0x6100(%rip), %rcx      # 0xdda9
movl $0x47, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/dhcpv4.c
// Function: find_lease
struct lease *
find_lease(const unsigned char *ip, int create)
{
    int i;
    for(i = 0; i < numleases; i++)
        if(memcmp(leases[i].ip, ip, 4) == 0)
            return &leases[i];

    if(create) {
        if(numleases >= maxleases) {
            struct lease *nl =
                realloc(leases, (numleases * 2 + 2) * sizeof(struct lease));
            if(nl) {
                leases = nl;
                maxleases = numleases * 2 + 2;
            }
        }
        memset(&leases[numleases], 0, sizeof(struct lease));
        memcpy(leases[numleases].ip, ip, 4);
        return &leases[numleases++];
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xf7cb(%rip), %r15      # 0x17490
testq %r15, %r15
jle 0x7ce7
movq 0xf7b7(%rip), %rax      # 0x17488
movq %r15, %rcx
movl (%rax), %edx
cmpl (%rbx), %edx
je 0x7d60
addq $0x30, %rax
decq %rcx
jne 0x7cd4
testl %esi, %esi
je 0x7d5e
movq 0xf796(%rip), %r14      # 0x17488
cmpl 0xf79b(%rip), %r15d     # 0x17494
jl 0x7d2c
leaq 0x2(,%r15,2), %r12
movq %r12, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq %r14, %rdi
callq 0x2280
testq %rax, %rax
je 0x7d2c
movq %rax, 0xf766(%rip)      # 0x17488
movl %r12d, 0xf76b(%rip)     # 0x17494
movq %rax, %r14
leaq (%r15,%r15,2), %rcx
shlq $0x4, %rcx
leaq (%r14,%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r14,%rcx)
movups %xmm0, 0x10(%r14,%rcx)
movups %xmm0, (%r14,%rcx)
movl (%rbx), %edx
movl %edx, (%r14,%rcx)
leal 0x1(%r15), %ecx
movl %ecx, 0xf734(%rip)      # 0x17490
jmp 0x7d60
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq