LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmain.c
// Function: main
int main(void)
{
    initscr();

    printw("\n *** CONQUEST *** \n");
    initconst();
    initmach();
    do {
        inputplayer();
        if (!game_over) {
            inputmach();
            move_ships();
            battle();
            if (production_year == 4 && turn < 100) {
                invest();
            }
            up_year();
        }
        check_game_over();
    }
    while (!game_over);

    endwin();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x20e0
leaq 0x49d7(%rip), %rdi      # 0x9728
xorl %eax, %eax
callq 0x2030
callq 0x47bc
callq 0x4c28
leaq 0xbb3f(%rip), %rbx      # 0x108a8
leaq 0xba18(%rip), %r14      # 0x10788
leaq 0xba0d(%rip), %r15      # 0x10784
callq 0x6a17
cmpl $0x0, (%rbx)
jne 0x4da6
callq 0x50a0
callq 0x57c0
callq 0x36e4
cmpl $0x4, (%r14)
jne 0x4da1
cmpl $0x63, (%r15)
jg 0x4da1
callq 0x873c
callq 0x3695
callq 0x22d6
cmpl $0x0, (%rbx)
je 0x4d77
callq 0x20b0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmain.c
// Function: point
void point(int col, int row)
{
    move(row - 1, col - 1);     // curses is 0-based
    x_cursor = col;
    y_cursor = row;
    if ((x_cursor < 20) && (y_cursor != 18))
        left_line[y_cursor] = true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
movq 0x921b(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
leal -0x1(%rbx), %esi
leal -0x1(%r14), %edx
callq 0x20a0
leaq 0xbacd(%rip), %rax      # 0x108b0
movl %r14d, (%rax)
leaq 0xbac7(%rip), %rax      # 0x108b4
movl %ebx, (%rax)
cmpl $0x14, %r14d
setge %al
cmpl $0x12, %ebx
sete %cl
orb %al, %cl
jne 0x4e11
movslq %ebx, %rax
leaq 0xbab6(%rip), %rcx      # 0x108c0
movl $0x1, (%rcx,%rax,4)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmain.c
// Function: rnd
int rnd(int i)
{
    int k;
    k = lrand48() / 2;
    k = (k % i) + 1;
    return (k);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x20c0
pushq $0x2
popq %rcx
cqto
idivq %rcx
cltd
idivl %ebx
leal 0x1(%rdx), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: wander_bc
void wander_bc(struct sttf *task, float slist[nstars + 1])
{
    int ships, i, count, dest, new_tf;
    if ((task->b > 1) || (task->c > 1)) {
        count = 0;
        for (i = 1; i <= nstars; i++) {
            if (slist[i] != 0)
                count = count + 1;
        };
        if (count > 0) {
            dest = rnd(count);
            count = 0;
            i = 0;
            do {
                i = i + 1;
                if (slist[i] > 0)
                    count = count + 1;
            }
            while (count != dest);
            get_tf(ENEMY, &new_tf, task->dest);
            ships = task->b / 2;
            tf[ENEMY][new_tf].b = ships;
            task->b = task->b - ships;
            ships = task->c / 2;
            tf[ENEMY][new_tf].c = ships;
            task->c = task->c - ships;

            if (task->t > 3) {
                tf[ENEMY][new_tf].t = 2;
                task->t = task->t - 2;
            };

            tf[ENEMY][new_tf].dest = i;
            tf[ENEMY][new_tf].eta = (int) ((slist[i] - 0.01) /
                                           vel[ENEMY]) + 1;
            depart(task->dest);
        };
    };
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x1, 0x1c(%rdi)
jg 0x4ea4
cmpl $0x2, 0x18(%rbx)
jl 0x4f86
xorl %edi, %edi
pushq $0x1
popq %rax
xorps %xmm0, %xmm0
cmpq $0x16, %rax
je 0x4ec8
movss (%r14,%rax,4), %xmm1
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
subl %ecx, %edi
incq %rax
jmp 0x4eac
testl %edi, %edi
je 0x4f86
callq 0x4e19
xorl %r12d, %r12d
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movss 0x4(%r14,%r12,4), %xmm1
incq %r12
xorl %edx, %edx
ucomiss %xmm0, %xmm1
seta %dl
addl %edx, %ecx
cmpl %eax, %ecx
jne 0x4edd
movl 0x20(%rbx), %edx
leaq 0x4(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x2990
movslq (%r15), %rax
imulq $0x34, %rax, %rax
leaq 0xaa7b(%rip), %rcx      # 0xf990
movq 0x18(%rbx), %xmm0
movdqa %xmm0, %xmm1
psrld $0x1f, %xmm1
paddd %xmm0, %xmm1
psrad $0x1, %xmm1
movq %xmm1, 0x18(%rcx,%rax)
movq 0x18(%rbx), %xmm0
psubd %xmm1, %xmm0
movq %xmm0, 0x18(%rbx)
cmpl $0x4, 0x14(%rbx)
jl 0x4f52
movl $0x2, 0x14(%rcx,%rax)
addl $-0x2, 0x14(%rbx)
movl %r12d, 0x20(%rcx,%rax)
cvtss2sd (%r14,%r12,4), %xmm0
addsd 0x42f3(%rip), %xmm0     # 0x9258
leaq 0xb73c(%rip), %rdx      # 0x106a8
cvtsi2sdl (%rdx), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
incl %edx
movl %edx, 0x24(%rcx,%rax)
movl 0x20(%rbx), %edi
callq 0x4e5c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: eval_bc_col
int eval_bc_col(struct stplanet *planet)
{
    int result;
    if (!(stars[planet->pstar].visit[ENEMY])) {
        result = 600;
    } else {
        switch (planet->esee_team) {

        case none:
            result = 100;
            break;

        case ENEMY:
            if (planet->conquered)
                result = 1000;
            else {

                if (((6 * planet->amb + planet->mb) <= (planet->iu / 15))
                    && (!((!planet->conquered)
                          && (planet->iu < mb_cost)))
                    ) {
                    result = 300;
                } else {
                    result = 0;
                };
            };

            if (planet->amb >= 4)
                result = result - 250;

            break;

        case player:
            if (planet->conquered) {
                result = 400;
            } else {
                result = 200;
            };
            break;
        };                      /*switch ( */
        if ((planet->capacity < 40) && (planet->iu < 15))
            result = result - 100;
    };
    result = result + rnd(20);
    return (result);
}

// Assembly:
pushq %rbx
movslq 0x30(%rdi), %rax
imulq $0x18, %rax, %rax
leaq 0xb4ee(%rip), %rcx      # 0x10490
cmpl $0x0, 0x10(%rcx,%rax)
je 0x4ff9
movl 0x28(%rdi), %eax
cmpl $0x1, %eax
je 0x5000
testl %eax, %eax
jne 0x5013
cmpl $0x0, 0x20(%rdi)
movl 0x1c(%rdi), %esi
movl $0x3e8, %eax            # imm = 0x3E8
jne 0x4feb
imull $0x6, %esi, %r8d
addl 0x18(%rdi), %r8d
movl 0x14(%rdi), %ecx
pushq $0xf
popq %r9
movl %ecx, %eax
cltd
idivl %r9d
xorl %edx, %edx
cmpl %eax, %r8d
movl $0x12c, %eax            # imm = 0x12C
cmovgl %edx, %eax
cmpl $0x8, %ecx
cmovll %edx, %eax
leal -0xfa(%rax), %ebx
cmpl $0x4, %esi
cmovll %eax, %ebx
jmp 0x5016
movl $0x258, %ebx            # imm = 0x258
jmp 0x5028
cmpl $0x0, 0x20(%rdi)
movl $0xc8, %eax
movl $0x190, %ebx            # imm = 0x190
cmovel %eax, %ebx
jmp 0x5016
pushq $0x64
popq %rbx
cmpl $0x27, 0x4(%rdi)
jg 0x5028
cmpl $0xf, 0x14(%rdi)
leal -0x64(%rbx), %eax
cmovgel %ebx, %eax
movl %eax, %ebx
pushq $0x14
popq %rdi
callq 0x4e19
addl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: eval_t_col
int eval_t_col(struct stplanet *planet, float range)
{
    int result;
    if ((!stars[planet->pstar].visit[ENEMY]))
        result = 60;
    else {
        switch (planet->esee_team) {
        case none:
            result = 40;
            break;
        case ENEMY:
            result = 30;
            break;
        case player:
            result = 0;
        };                      /*switch ( */
        if ((planet->esee_team != player)
            && (planet->capacity - planet->inhabitants > 40 - (turn / 2)))
            result = result + 40;
    };
    result -= (int) (2 * range + .5);
    return (result);
}

// Assembly:
movslq 0x30(%rdi), %rax
imulq $0x18, %rax, %rax
leaq 0xb44d(%rip), %rcx      # 0x10490
cmpl $0x0, 0x10(%rcx,%rax)
je 0x5086
movl 0x28(%rdi), %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
je 0x5089
testl %ecx, %ecx
pushq $0x1e
popq %rax
pushq $0x28
popq %rsi
cmovel %eax, %esi
movl 0x4(%rdi), %r8d
subl 0x10(%rdi), %r8d
leaq 0xb716(%rip), %rax      # 0x10784
movl (%rax), %eax
pushq $-0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %ecx
addl $0x28, %ecx
leal 0x28(%rsi), %eax
cmpl %ecx, %r8d
cmovlel %esi, %eax
jmp 0x5089
pushq $0x3c
popq %rax
addss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x46a7(%rip), %xmm0     # 0x9740
cvttsd2si %xmm0, %ecx
subl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: inputmach
void inputmach(void)
{
    int count, tfnum, starnum;
    float slist[nstars + 1];
    for (tfnum = 1; tfnum <= 26; tfnum++) {
        if ((tf[ENEMY][tfnum].eta == 0) && (tf[ENEMY][tfnum].dest != 0)) {
            starnum = tf[ENEMY][tfnum].dest;
            get_stars(starnum, slist, &count);
            send_scouts(slist, &tf[ENEMY][tfnum]);
            send4transports(slist, &tf[ENEMY][tfnum]);
            move_bc(&tf[ENEMY][tfnum], slist);
            zero_tf(ENEMY, tfnum);
        };
    };
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0xa8de(%rip), %rbx      # 0xf990
addq $0x34, %rbx
pushq $-0x1a
popq %r12
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
testq %r12, %r12
je 0x5117
cmpl $0x0, 0x24(%rbx)
jne 0x510e
movl 0x20(%rbx), %edi
testl %edi, %edi
je 0x510e
movq %r14, %rsi
movq %r15, %rdx
callq 0x6e9e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5123
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52a3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5523
leal 0x1b(%r12), %esi
xorl %edi, %edi
callq 0x35b4
incq %r12
addq $0x34, %rbx
jmp 0x50c4
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: underdefended
boolean underdefended(int starnum)
{
    struct stplanet *pplanet;
    boolean result;
    result = false;
    pplanet = stars[starnum].first_planet;
    while ((pplanet != nil) && (!result)) {
        if ((pplanet->team == ENEMY) && (pplanet->iu > 10) &&
            ((6 * pplanet->amb + pplanet->mb) <
             conq_round(pplanet->iu / 15)))
            result = true;
        pplanet = pplanet->next;
    };
    return (result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movslq %edi, %rax
imulq $0x18, %rax, %rax
leaq 0xad6f(%rip), %rcx      # 0x10490
leaq (%rcx,%rax), %rbx
addq $0x8, %rbx
xorl %eax, %eax
pushq $0xf
popq %rbp
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x5772
testl %eax, %eax
jne 0x5772
xorl %eax, %eax
cmpl $0x0, 0xc(%rbx)
jne 0x576c
movl 0x14(%rbx), %ecx
cmpl $0xb, %ecx
jl 0x576c
imull $0x6, 0x1c(%rbx), %r14d
addl 0x18(%rbx), %r14d
movl %ecx, %eax
xorl %edx, %edx
divl %ebp
cvtsi2ss %eax, %xmm0
callq 0x4e31
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %r14d
setl %al
addq $0x38, %rbx
jmp 0x572e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqpl.c
// Function: send_tf
void send_tf(void)
{
    char tf_move;
    int tf_num;
    boolean error;
    printw("estination tf:");
    get_char(&tf_move);
    cle3r_left();
    point(1, 19);
    tf_num = tf_move - 'A' + 1;
    if ((tf_num < 1) || (tf_num > 26)) {
        error_message();
        printw(" !illegal tf");
    } else if (tf[player][tf_num].dest == 0) {
        error_message();
        printw(" !nonexistent tf");
    } else if ((tf[player][tf_num].eta != 0) &&
               ((tf[player][tf_num].eta != tf[player][tf_num].origeta) ||
                (tf[player][tf_num].withdrew))
        ) {
        error_message();
        printw(" !Tf is not in normal space  ");
    } else if (tf[player][tf_num].blasting) {
        error_message();
        printw(" !Tf is blasting a planet");
    } else {
        tf[player][tf_num].withdrew = false;
        set_des(tf_num, &error);
    };
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x319b(%rip), %rdi      # 0x9ab2
xorl %eax, %eax
callq 0x2030
leaq 0xb(%rsp), %rbx
movq %rbx, %rdi
callq 0x6d93
callq 0x6f4d
pushq $0x1
popq %rdi
pushq $0x13
popq %rsi
callq 0x4dbd
movsbl (%rbx), %edi
leal -0x5b(%rdi), %eax
cmpb $-0x1b, %al
ja 0x6953
callq 0x6fb8
leaq 0x3054(%rip), %rdi      # 0x99a5
jmp 0x69b6
addl $-0x40, %edi
movl %edi, %eax
imulq $0x34, %rax, %rax
leaq 0x902d(%rip), %rcx      # 0xf990
cmpl $0x0, 0x59c(%rcx,%rax)
je 0x6996
addq %rcx, %rax
addq $0x57c, %rax            # imm = 0x57C
movl 0x24(%rax), %ecx
testl %ecx, %ecx
je 0x69a4
cmpl 0x28(%rax), %ecx
jne 0x6988
cmpl $0x0, 0x30(%rax)
je 0x69a4
callq 0x6fb8
leaq 0x312d(%rip), %rdi      # 0x9ac1
jmp 0x69b6
callq 0x6fb8
leaq 0x3011(%rip), %rdi      # 0x99b3
jmp 0x69b6
cmpl $0x0, 0x2c(%rax)
je 0x69c3
callq 0x6fb8
leaq 0x3129(%rip), %rdi      # 0x9adf
xorl %eax, %eax
callq 0x2030
addq $0x10, %rsp
popq %rbx
retq
andl $0x0, 0x30(%rax)
leaq 0xc(%rsp), %rsi
callq 0x6b1c
jmp 0x69bd
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqpl.c
// Function: quit
void quit(void)
{
    char answer;
    cle2r_screen();
    printw("Quit game....[verify]\n");
    get_char(&answer);
    if (answer != 'Y')
        printmap();
    else {
        game_over = true;
    };
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0x6f9d
leaq 0x3115(%rip), %rdi      # 0x9af9
xorl %eax, %eax
callq 0x2030
leaq 0xf(%rsp), %rbx
movq %rbx, %rdi
callq 0x6d93
cmpb $0x59, (%rbx)
jne 0x6a0c
leaq 0x9ea4(%rip), %rax      # 0x108a8
movl $0x1, (%rax)
jmp 0x6a11
callq 0x5edc
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqpl.c
// Function: inputplayer
void inputplayer(void)
{
    char key;
    boolean fin;
    point(33, 20);
    printw("* Movement *    ");
    fin = false;
    do {
        point(1, 18);
        printw("?                             ");
        point(2, 18);
        get_char(&key);
        switch (key) {
        case 'M':
            printmap();
            break;
        case 'B':
            bl2st_planet();
            break;
        case 'G':
        case ' ':
            fin = true;
            break;
        case 'H':
            help(1);
            break;
        case 'L':
            land();
            break;
        case 'D':
            send_tf();
            break;
        case 'S':
            starsum();
            break;
        case 'N':
            make_tf();
            break;
        case 'J':
            join_tf();
            break;
        case 'C':
            print_col();
            break;
        case 'R':
            ressum();
            break;
        case 'Q':
            fin = true;
            quit();
            break;
        case '?':
            break;
        case 'T':
            tfsum();
            break;
        default:
            error_message();
            printw("  !illegal command");
        };                      /*switch ( */
    }
    while (!fin);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0x21
popq %rdi
pushq $0x14
popq %rsi
callq 0x4dbd
leaq 0x30dc(%rip), %rdi      # 0x9b10
xorl %eax, %eax
callq 0x2030
pushq $0x1
popq %rbx
pushq $0x12
popq %rbp
leaq 0x30d9(%rip), %r14      # 0x9b21
pushq $0x2
popq %r15
leaq 0x7(%rsp), %r12
leaq 0x2ddc(%rip), %r13      # 0x9834
movl %ebx, %edi
movl %ebp, %esi
callq 0x4dbd
movq %r14, %rdi
xorl %eax, %eax
callq 0x2030
movl %r15d, %edi
movl %ebp, %esi
callq 0x4dbd
movq %r12, %rdi
callq 0x6d93
movzbl 0x7(%rsp), %eax
leal -0x3f(%rax), %ecx
cmpl $0x15, %ecx
ja 0x6ae9
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
callq 0x609c
jmp 0x6a58
callq 0x5edc
jmp 0x6a58
callq 0x7c42
jmp 0x6a58
movl %ebx, %edi
callq 0x706a
jmp 0x6a58
callq 0x40b4
jmp 0x6a58
callq 0x690b
jmp 0x6a58
callq 0x64ce
jmp 0x6a58
callq 0x3eb4
jmp 0x6a58
callq 0x418b
jmp 0x6a58
callq 0x7920
jmp 0x6a58
callq 0x7716
jmp 0x6a58
cmpl $0x20, %eax
je 0x6b0b
callq 0x6fb8
leaq 0x3046(%rip), %rdi      # 0x9b40
xorl %eax, %eax
callq 0x2030
jmp 0x6a58
callq 0x69d3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: read_char
void read_char(char *C)
{
    char result;
    result = getch();
    if (result == 0x0d || result == 0x0a)
        result = '\n';
    if (result == 0x7f)
        result = '\b';
    *C = toupper(result);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x729a(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
callq 0x2100
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0xa000000, %ecx        # imm = 0xA000000
pushq $0xa
popq %rdx
cmovel %edx, %eax
cmpl $0xd000000, %ecx        # imm = 0xD000000
cmovel %edx, %eax
cmpb $0x7f, %al
pushq $0x8
popq %r14
cmovnel %eax, %r14d
callq 0x2080
movq (%rax), %rax
movsbq %r14b, %rcx
movb (%rax,%rcx,4), %al
movb %al, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: get_line
void get_line(char *iline, int *Ind0, int onech)
{
    char ch;
    int ind;

    ind = 1;
    do {
        read_char(&ch);
        if (ch == '\b') {       /*backspace */
            if (ind != 1) {
                if ((ind != 1) && onech) {
                    addch('\b');
                    ind = ind - 1;
                };
                if ((ind != 1) && !onech) {
                    printw("\b \b");
                    ind = ind - 1;
                }
            };
        } else if (ch != '\n') {
            printw("%c", ch);
            iline[ind] = ch;
            ind = ind + 1;
            if (onech) {
                addch(' ');
                iline[ind] = ' ';
                ind = ind + 1;
            };
        };
    }
    while (ind < 25 && ch != '\n');
    while (ind != 80) {
        iline[ind] = ' ';
        ind = ind + 1;
    };
    *Ind0 = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0xf(%rsp), %r15
movq %r15, %rdi
callq 0x6d40
movzbl 0xf(%rsp), %eax
cmpl $0x8, %eax
je 0x6e29
cmpl $0xa, %eax
je 0x6e6e
movsbl %al, %r13d
leaq 0x316a(%rip), %rdi      # 0x9f5e
movl %r13d, %esi
xorl %eax, %eax
callq 0x2030
movslq %ebx, %rax
leaq 0x1(%rax), %r12
movb %r13b, (%r14,%rax)
testl %ebp, %ebp
je 0x6e5f
movq 0x71d4(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
pushq $0x20
popq %rsi
callq 0x2090
movb $0x20, (%r14,%r12)
addl $0x2, %ebx
jmp 0x6e5c
pushq $0x1
popq %rax
movl %eax, %r12d
cmpl $0x1, %ebx
je 0x6e5f
testl %ebp, %ebp
je 0x6e4c
movq 0x71a9(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
pushq $0x8
popq %rsi
callq 0x2090
jmp 0x6e5a
leaq 0x2d92(%rip), %rdi      # 0x9be5
xorl %eax, %eax
callq 0x2030
decl %ebx
movl %ebx, %r12d
movl %r12d, %ebx
cmpl $0x19, %r12d
jl 0x6dce
jmp 0x6e71
movl %ebx, %r12d
movslq %r12d, %rax
cmpq $0x50, %rax
je 0x6e84
movb $0x20, (%r14,%rax)
incq %rax
jmp 0x6e74
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: get_stars
void get_stars(int s_star, float slist[nstars + 1], int *C0unt)
{
    int starnum, count;

    count = 0;
    for (starnum = 1; starnum <= nstars; starnum++) {
        if (range[0] >= r2nge[s_star][starnum]) {
            count = count + 1;
            slist[starnum] = r2nge[s_star][starnum];
        } else
            slist[starnum] = 0;
    };
    *C0unt = count;
}

// Assembly:
leaq 0x980b(%rip), %rax      # 0x106b0
movl (%rax), %eax
movslq %edi, %rcx
imulq $0x58, %rcx, %rcx
addq 0x713b(%rip), %rcx      # 0xdff0
xorl %edi, %edi
pushq $0x1
popq %r8
cmpq $0x16, %r8
je 0x6eec
movl (%rcx,%r8,4), %r11d
xorl %r9d, %r9d
cmpl %r11d, %eax
setge %r10b
jge 0x6ed6
xorps %xmm0, %xmm0
jmp 0x6edb
cvtsi2ss %r11d, %xmm0
movb %r10b, %r9b
addl %r9d, %edi
movss %xmm0, (%rsi,%r8,4)
incq %r8
jmp 0x6ebb
movl %edi, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: clear_field
void clear_field(void)
{
    int new_bottom, y;
    new_bottom = y_cursor - 1;
    if (new_bottom < bottom_field) {
        for (y = new_bottom + 1; y <= bottom_field; y++) {
            point(50, y);
            printw(blank_line);
        };
    };
    bottom_field = new_bottom;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x99b6(%rip), %rax      # 0x108b4
movl (%rax), %r15d
leaq 0x99a4(%rip), %r12      # 0x108ac
movl (%r12), %eax
cmpl %eax, %r15d
jle 0x6f21
decl %r15d
movl %r15d, (%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x32
popq %rbx
leaq 0x23a4(%rip), %r14      # 0x92cf
movl %r15d, %ebp
cmpl %eax, %ebp
jg 0x6f11
movl %ebx, %edi
movl %ebp, %esi
callq 0x4dbd
movq %r14, %rdi
xorl %eax, %eax
callq 0x2030
incl %ebp
movl (%r12), %eax
jmp 0x6f2e
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: cle3r_left
void cle3r_left(void)
{
    int i;
    for (i = 19; i <= 24; i++) {
        if (left_line[i]) {
            point(1, i);
            printw(blank_line);
            left_line[i] = false;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x13
popq %rbx
leaq 0x9962(%rip), %r15      # 0x108c0
pushq $0x1
popq %rbp
leaq 0x2367(%rip), %r14      # 0x92cf
cmpq $0x19, %rbx
je 0x6f92
cmpl $0x0, (%r15,%rbx,4)
je 0x6f8d
movl %ebp, %edi
movl %ebx, %esi
callq 0x4dbd
movq %r14, %rdi
xorl %eax, %eax
callq 0x2030
andl $0x0, (%r15,%rbx,4)
incq %rbx
jmp 0x6f68
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: get_token
void get_token(char *line, int *Index0, int *Value0, char *Token0)
{
    int index, value;
    char token;
    index = *Index0;
    value = 0;
    token = ' ';
    while (line[index] == ' ' && (index < 80))
        index = index + 1;
    if (index < 80) {
        if ((line[index] < '0') || (line[index] > '9'))
            value = 1;
        else {
            while (line[index] >= '0' && (line[index] <= '9')) {
                value = 10 * value + line[index] - '0';
                index = index + 1;
            };
        };
        token = line[index];
        index = index + 1;
    }
    while (line[index] != ' ' && (index < 80))
        index = index + 1;
    while (line[index] == ' ' && (index < 80))
        index = index + 1;
    *Index0 = index;
    *Value0 = value;
    *Token0 = token;
}

// Assembly:
movslq (%rsi), %r9
leal -0x1(%r9), %r8d
movq %r9, %rax
movb (%rdi,%r9), %r10b
incq %r9
incl %r8d
cmpq $0x4f, %rax
jg 0x6fe3
cmpb $0x20, %r10b
je 0x6fca
cmpq $0x4f, %rax
jg 0x7000
leal -0x3a(%r10), %eax
cmpb $-0xa, %al
jae 0x7043
pushq $0x1
popq %rax
movslq %r8d, %r8
movb (%rdi,%r8), %r9b
incl %r8d
jmp 0x7005
xorl %eax, %eax
movb $0x20, %r9b
movslq %r8d, %r11
leal -0x2(%r11), %r8d
leaq 0x1(%r11), %r10
incl %r8d
cmpq $0x4f, %r11
jg 0x7023
cmpb $0x20, (%rdi,%r11)
movq %r10, %r11
jne 0x700c
decq %r10
incl %r8d
cmpq $0x4f, %r10
jg 0x703a
cmpb $0x20, (%rdi,%r10)
leaq 0x1(%r10), %r10
je 0x7026
movl %r8d, (%rsi)
movl %eax, (%rdx)
movb %r9b, (%rcx)
retq
addq %rdi, %r9
xorl %eax, %eax
leal -0x30(%r10), %r11d
cmpb $0x9, %r11b
ja 0x6ff4
movzbl %r10b, %r10d
imull $0xa, %eax, %eax
addl %r10d, %eax
addl $-0x30, %eax
movb (%r9), %r10b
incl %r8d
incq %r9
jmp 0x7048
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: help
void help(int which)
{
    struct helpst *h;
    int j;

    j = 1;
    point(50, j++);
    if (which == 0)
        h = help0;
    if (which == 1)
        h = help1;
    if (which == 2)
        h = help2;
    if (which == 3)
        h = help3;
    if (which == 4)
        h = help4;
    while (h->cmd != 0) {
        printw("%2s - %-25s", h->cmd, h->does);
        point(50, j++);
        h++;
    }
    clear_field();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebp
pushq $0x32
popq %rbx
pushq $0x1
popq %rsi
movl %ebx, %edi
callq 0x4dbd
cmpl $0x1, %ebp
leaq 0x70c5(%rip), %rax      # 0xe150
leaq 0x701e(%rip), %rcx      # 0xe0b0
cmoveq %rax, %rcx
cmpl $0x2, %ebp
leaq 0x7190(%rip), %rax      # 0xe230
cmovneq %rcx, %rax
cmpl $0x3, %ebp
leaq 0x7222(%rip), %rcx      # 0xe2d0
cmovneq %rax, %rcx
cmpl $0x4, %ebp
leaq 0x72c4(%rip), %r12      # 0xe380
cmovneq %rcx, %r12
pushq $0x2
popq %r15
leaq 0x2d24(%rip), %r14      # 0x9def
movq (%r12), %rsi
testq %rsi, %rsi
je 0x70fa
movq 0x8(%r12), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2030
leal 0x1(%r15), %ebp
movl %ebx, %edi
movl %r15d, %esi
callq 0x4dbd
addq $0x10, %r12
movl %ebp, %r15d
jmp 0x70cb
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6eef
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: on_board
void on_board(int x, int y)
{
    int i;
    int starnum;
    board[x][y].tf = ' ';
    i = 1;
    do {
        if ((tf[player][i].dest != 0) && (tf[player][i].x == x)
            && (tf[player][i].y == y)) {
            if (board[x][y].tf == ' ')
                board[x][y].tf = i + 'a' - 1;
            else {
                board[x][y].tf = '*';
                i = 27;
            };
        };
        i = i + 1;
    }
    while (i <= 26);
    if (board[x][y].star != '.') {
        board[x][y].enemy = ' ';
        starnum = board[x][y].star - 'A' + 1;
        if (col_stars[starnum][player] != 0)
            board[x][y].enemy = '@';
    };
    update_board(x, y, both);
}

// Assembly:
movslq %edi, %rax
movslq %esi, %rcx
imulq $0xc, %rcx, %rcx
imulq $0xc0, %rax, %rdx
addq 0x6e79(%rip), %rdx      # 0xdf98
leaq (%rdx,%rcx), %rax
movl $0x20, 0x8(%rcx,%rdx)
pushq $0x20
popq %r9
pushq $0x61
popq %rcx
xorl %edx, %edx
leaq 0x8855(%rip), %r8       # 0xf990
cmpl $0x0, 0x5d0(%r8,%rdx)
je 0x7166
cmpl %edi, 0x5b0(%r8,%rdx)
jne 0x7166
cmpl %esi, 0x5b4(%r8,%rdx)
jne 0x7166
cmpl $0x20, %r9d
jne 0x71a8
movl %ecx, 0x8(%rax)
movl %ecx, %r9d
incl %ecx
addq $0x34, %rdx
cmpq $0x548, %rdx            # imm = 0x548
jne 0x713b
movslq 0x4(%rax), %rcx
cmpq $0x2e, %rcx
je 0x71a0
leaq 0x7b4a(%rip), %rdx      # 0xecd0
xorl %r8d, %r8d
cmpl $0x0, -0x1fc(%rdx,%rcx,8)
setne %r8b
shll $0x5, %r8d
addl $0x20, %r8d
movl %r8d, (%rax)
pushq $0x2
popq %rdx
jmp 0x2ca4
movl $0x2a, 0x8(%rax)
jmp 0x7175
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqs3.c
// Function: pr3nt_tf
void pr3nt_tf(int i)
{
    int x, y;
    if ((i != 0) && (i < 27)) {
        if (tf[player][i].dest != 0) {
            printw("TF%c:", i + 'a' - 1);
            x = tf[player][i].x;
            y = tf[player][i].y;
            if (tf[player][i].eta == 0)
                addch(tf[player][i].dest + 'A' - 1);
            else
                addch(' ');
            printw("(%2d,%2d)               ", x, y);
            point(x_cursor + 14, y_cursor);
            x_cursor = x_cursor - 14;
            disp_tf(&tf[player][i]);
            if (tf[player][i].eta != 0) {
                printw("%c2m", 0x9b);
                printw("%c%d",
                       tf[player][i].dest + 'A' - 1, tf[player][i].eta);
                printw("%c0m", 0x9b);
            };
            point(x_cursor, y_cursor + 1);
        };
    };
}

// Assembly:
testl %edi, %edi
sete %al
cmpl $0x1b, %edi
setge %cl
orb %al, %cl
jne 0x723e
movl %edi, %esi
movslq %edi, %rax
imulq $0x34, %rax, %rax
leaq 0x879a(%rip), %rcx      # 0xf990
cmpl $0x0, 0x59c(%rcx,%rax)
je 0x723e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq (%rcx,%rax), %rbx
addq $0x57c, %rbx            # imm = 0x57C
addl $0x60, %esi
leaq 0x2bfb(%rip), %rdi      # 0x9e17
xorl %eax, %eax
callq 0x2030
movl (%rbx), %ebp
movl 0x4(%rbx), %r14d
cmpl $0x0, 0x24(%rbx)
movq 0x6db4(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
je 0x723f
pushq $0x20
popq %rsi
jmp 0x7245
retq
movl 0x20(%rbx), %esi
addl $0x40, %esi
callq 0x2090
leaq 0x2bcc(%rip), %rdi      # 0x9e1d
movl %ebp, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2030
leaq 0x964c(%rip), %r14      # 0x108b0
movl (%r14), %edi
addl $0xe, %edi
leaq 0x9643(%rip), %r15      # 0x108b4
movl (%r15), %esi
callq 0x4dbd
addl $-0xe, (%r14)
movq %rbx, %rdi
callq 0x274e
cmpl $0x0, 0x24(%rbx)
je 0x72c8
leaq 0x2ba4(%rip), %rdi      # 0x9e36
movl $0x9b, %esi
xorl %eax, %eax
callq 0x2030
movl 0x20(%rbx), %esi
movl 0x24(%rbx), %edx
addl $0x40, %esi
leaq 0x1eb8(%rip), %rdi      # 0x9166
xorl %eax, %eax
callq 0x2030
leaq 0x2b7f(%rip), %rdi      # 0x9e3b
movl $0x9b, %esi
xorl %eax, %eax
callq 0x2030
movl (%r14), %edi
movl (%r15), %esi
incl %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4dbd
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqsubs.c
// Function: pr2nt_res
void pr2nt_res(char field)
{
    switch (field) {
    case 'V':
        point(53, 18);
        printw("V:%2d", vel[player]);
        if (vel[player] < max_vel)
            printw(" res: %3d need:%4d", vel_working[player],
                   vel_req[vel[player] + 1]);
        else
            printw("                   ");
        break;
    case 'R':
        point(53, 19);
        printw("R:%2d", range[player]);
        if (range[player] < bdsize)
            printw(" res: %3d need:%4d", ran_working[player],
                   ran_req[range[player] + 1]);
        else
            printw("                   ");
        break;
    case 'W':
        point(53, 20);
        printw("W:%2d", weapons[player]);
        if (weapons[player] < 10)
            printw(" res: %3d need:%4d", weap_working[player],
                   weap_req[weapons[player] + 1]);
        else
            printw("                   ");
        break;
    };                          /*switch ( */
}

// Assembly:
pushq %rbx
cmpl $0x52, %edi
je 0x76b4
cmpl $0x57, %edi
je 0x7674
cmpl $0x56, %edi
jne 0x7714
pushq $0x35
popq %rdi
pushq $0x12
popq %rsi
callq 0x4dbd
leaq 0x9066(%rip), %rbx      # 0x106a8
movl 0x4(%rbx), %esi
leaq 0x2872(%rip), %rdi      # 0x9ebe
xorl %eax, %eax
callq 0x2030
movslq 0x4(%rbx), %rax
cmpq $0xb, %rax
jg 0x7705
leaq 0x9068(%rip), %rcx      # 0x106d0
movl 0x4(%rcx), %esi
leaq 0x90de(%rip), %rcx      # 0x10750
jmp 0x76f2
pushq $0x35
popq %rdi
pushq $0x14
popq %rsi
callq 0x4dbd
leaq 0x9032(%rip), %rbx      # 0x106b8
movl 0x4(%rbx), %esi
leaq 0x284d(%rip), %rdi      # 0x9edd
xorl %eax, %eax
callq 0x2030
movslq 0x4(%rbx), %rax
cmpq $0x9, %rax
jg 0x7705
leaq 0x9018(%rip), %rcx      # 0x106c0
movl 0x4(%rcx), %esi
leaq 0x902e(%rip), %rcx      # 0x106e0
jmp 0x76f2
pushq $0x35
popq %rdi
pushq $0x13
popq %rsi
callq 0x4dbd
leaq 0x8fea(%rip), %rbx      # 0x106b0
movl 0x4(%rbx), %esi
leaq 0x2807(%rip), %rdi      # 0x9ed7
xorl %eax, %eax
callq 0x2030
movslq 0x4(%rbx), %rax
cmpq $0xe, %rax
jg 0x7705
leaq 0x8fe0(%rip), %rcx      # 0x106c8
movl 0x4(%rcx), %esi
leaq 0x901e(%rip), %rcx      # 0x10710
movl 0x4(%rcx,%rax,4), %edx
leaq 0x27c7(%rip), %rdi      # 0x9ec4
xorl %eax, %eax
popq %rbx
jmp 0x2030
leaq 0x1bce(%rip), %rdi      # 0x92da
xorl %eax, %eax
popq %rbx
jmp 0x2030
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqsubs.c
// Function: ressum
void ressum(void)
{
    char key;
    int value, ind;
    char iline[81];
    printw("esearch field(s):");
    get_line(iline, &ind, true);
    get_token(iline, &ind, &value, &key);
    cle3r_left();
    if (key == ' ') {
        pr2nt_res('R');
        pr2nt_res('V');
        pr2nt_res('W');
    } else {
        do {
            pr2nt_res(key);
            get_token(iline, &ind, &value, &key);
        }
        while (key != ' ');
    };
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x27bb(%rip), %rdi      # 0x9ee3
xorl %eax, %eax
callq 0x2030
leaq 0x10(%rsp), %rbx
leaq 0x8(%rsp), %r14
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6dae
leaq 0xc(%rsp), %rdx
leaq 0x7(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x6fc3
callq 0x6f4d
movb (%r15), %al
cmpb $0x20, %al
jne 0x7785
pushq $0x52
popq %rdi
callq 0x7618
pushq $0x56
popq %rdi
callq 0x7618
pushq $0x57
popq %rdi
callq 0x7618
jmp 0x77ba
leaq 0x10(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x7(%rsp), %r12
movsbl %al, %edi
callq 0x7618
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x6fc3
movb 0x7(%rsp), %al
cmpb $0x20, %al
jne 0x7799
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqtf.c
// Function: make_tf
void make_tf(void)
{
    char task;
    int tf_num;
    boolean error;
    int new_tf;
    printw("ew tf- from tf:");
    get_char(&task);
    cle3r_left();
    tf_num = task - 'A' + 1;
    error = (tf_num < 1) || (tf_num > 26);
    if (!error)
        error = (tf[player][tf_num].eta != 0) ||
            (tf[player][tf_num].dest == 0);
    if (error) {
        error_message();
        printw("  !illegal tf");
    } else if (tf[player][tf_num].blasting) {
        error = true;
        error_message();
        printw(" !Tf is blasting a planet     ");
    } else {
        point(1, 19);
        split_tf(&tf_num, &new_tf);
        point(1, 20);
        pr3nt_tf(new_tf);
        point(1, 21);
        pr3nt_tf(tf_num);
    };
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x25e5(%rip), %rdi      # 0x9f15
xorl %eax, %eax
callq 0x2030
leaq 0x7(%rsp), %rbx
movq %rbx, %rdi
callq 0x6d93
callq 0x6f4d
movsbl (%rbx), %eax
leal -0x5b(%rax), %ecx
addl $-0x40, %eax
movl %eax, 0x8(%rsp)
cmpb $-0x1a, %cl
jb 0x7972
movl %eax, %eax
imulq $0x34, %rax, %rax
leaq 0x8028(%rip), %rcx      # 0xf990
cmpl $0x0, 0x5a0(%rcx,%rax)
je 0x798f
callq 0x6fb8
leaq 0x2026(%rip), %rdi      # 0x99a4
xorl %eax, %eax
callq 0x2030
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq (%rcx,%rax), %rdx
addq $0x57c, %rdx            # imm = 0x57C
cmpl $0x0, 0x20(%rdx)
je 0x7972
cmpl $0x0, 0x5a8(%rcx,%rax)
je 0x79b8
callq 0x6fb8
leaq 0x256f(%rip), %rdi      # 0x9f25
jmp 0x797e
pushq $0x1
popq %rbx
pushq $0x13
popq %rsi
movl %ebx, %edi
callq 0x4dbd
leaq 0x8(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7a00
pushq $0x14
popq %rsi
movl %ebx, %edi
callq 0x4dbd
movl (%r15), %edi
callq 0x71d7
pushq $0x15
popq %rsi
movl %ebx, %edi
callq 0x4dbd
movl (%r14), %edi
callq 0x71d7
jmp 0x7985
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqve.c
// Function: invest
void invest(void)
{
    int newborn, starnum;
    struct stplanet *pplan;
    production_year = 0;
    point(33, 20);
    printw("* investment *  ");
    for (starnum = 1; starnum <= nstars; starnum++) {
        pplan = stars[starnum].first_planet;
        while (pplan != nil) {
            if (((pplan->esee_team) == player)
                && ((pplan->capacity) > 10)
                && ((pplan->esee_def) < 12))
                pplan->esee_def = (pplan->esee_def) + 1;
            if ((pplan->team) != none) {
                newborn = conq_round((pplan->inhabitants)
                                     * growth_rate[pplan->team] *
                                     (1 -
                                      ((pplan->inhabitants) /
                                       (pplan->capacity))));
                if (pplan->conquered)
                    newborn = newborn / 2;
                pplan->inhabitants = (pplan->inhabitants)
                    + newborn;
                pplan->iu = (pplan->iu) + newborn;
                if (pplan->team == ENEMY)
                    inv_enemy(pplan);
                else
                    inv_player(stars[starnum].x, stars[starnum].y, pplan);
            };
            pplan = pplan->next;
        };
    };
    battle();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x803a(%rip), %rax      # 0x10788
andl $0x0, (%rax)
pushq $0x21
popq %rdi
pushq $0x14
popq %rsi
callq 0x4dbd
leaq 0x1a20(%rip), %rdi      # 0xa183
xorl %eax, %eax
callq 0x2030
pushq $0x1
popq %r14
leaq 0x7f2b(%rip), %r12      # 0x106a0
pushq $0x1
popq %rbp
pushq $0x2
popq %r13
cmpq $0x16, %r14
je 0x8842
imulq $0x18, %r14, %rax
leaq 0x7cff(%rip), %rcx      # 0x10490
leaq (%rcx,%rax), %r15
leaq (%rcx,%rax), %rbx
addq $0x8, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x883a
cmpl $0x1, 0x28(%rbx)
jne 0x87c2
cmpl $0xb, 0x4(%rbx)
jl 0x87c2
movl 0x2c(%rbx), %eax
cmpl $0xb, %eax
jg 0x87c2
incl %eax
movl %eax, 0x2c(%rbx)
movslq 0xc(%rbx), %rcx
cmpq $0x2, %rcx
je 0x8831
movl 0x10(%rbx), %eax
cvtsi2ss %eax, %xmm1
mulss (%r12,%rcx,4), %xmm1
cltd
idivl 0x4(%rbx)
movl %ebp, %ecx
subl %eax, %ecx
cvtsi2ss %ecx, %xmm0
mulss %xmm1, %xmm0
callq 0x4e31
movl %eax, %ecx
cltd
idivl %r13d
cmpl $0x0, 0x20(%rbx)
cmovel %ecx, %eax
movq 0x10(%rbx), %xmm0
movd %eax, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, 0x10(%rbx)
cmpl $0x0, 0xc(%rbx)
je 0x8829
movl (%r15), %edi
movl 0x4(%r15), %esi
movq %rbx, %rdx
callq 0x80fe
jmp 0x8831
movq %rbx, %rdi
callq 0x7e54
addq $0x38, %rbx
jmp 0x879d
incq %r14
jmp 0x877c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36e4
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: send_all
void send_all(int socket, void* buffer, int64_t length) {
    char* ptr = (char*)buffer;
    int64_t i = 0;
    while (length > 0) {
        i = send(socket, ptr, length, 0);
        if (i < 1) {
            if(verbose_socklibc>=1) {
				WARNING("%s", "Could not send all data. Trying again.");
			}
            sleep(1);
        }
        ptr += i;
        length -= i;
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1fd4(%rip), %r13      # 0x33a0
pushq $0x1
popq %r15
testq %rbx, %rbx
jle 0x1429
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x10d0
movq %rax, %r12
testq %rax, %rax
jg 0x13fd
cmpl $0x0, 0x4d5d(%rip)      # 0x6150
jg 0x1405
movl %r15d, %edi
callq 0x1250
addq %r12, %r14
subq %r12, %rbx
jmp 0x13d0
movq 0x4bec(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1ca0(%rip), %rsi      # 0x30b6
leaq 0x1f7a(%rip), %rdx      # 0x3397
movq %r13, %rcx
xorl %eax, %eax
callq 0x1130
jmp 0x13f5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: recv_full_msg
int64_t recv_full_msg(int socket, void* buffer, int64_t length) {
    int64_t expected_length = 0;
    recv_all(socket, &expected_length, sizeof(int64_t));

	if(verbose_socklibc>=4){	
		INFO("Receiving a message of size %ld.", expected_length);
	}
	
    if (expected_length > length) {
        WARNING("Buffer of size %ld is too small to fit expected data.",
                expected_length);
    }

    recv_all(socket, buffer, expected_length);
    return expected_length;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %rsi
andq $0x0, (%rsi)
pushq $0x8
popq %rdx
callq 0x14d3
cmpl $0x4, 0x4cf0(%rip)      # 0x6150
jge 0x1487
movq 0x8(%rsp), %rcx
cmpq %r14, %rcx
jg 0x14ad
movl %ebp, %edi
movq %rbx, %rsi
movq %rcx, %rdx
callq 0x14d3
movq 0x8(%rsp), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x4b6a(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq 0x8(%rsp), %rcx
leaq 0x1b67(%rip), %rsi      # 0x3004
leaq 0x1b8d(%rip), %rdx      # 0x3031
xorl %eax, %eax
callq 0x1130
jmp 0x1462
movq 0x4b44(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1b81(%rip), %rsi      # 0x303f
leaq 0x1b6c(%rip), %rdx      # 0x3031
xorl %eax, %eax
callq 0x1130
movq 0x8(%rsp), %rcx
jmp 0x146c
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: recv_all
void recv_all(int socket, void* buffer, int64_t length) {
    char* ptr = (char*)buffer;
    int64_t i = 0;
    while (length > 0) {
        i = recv(socket, ptr, length, 0);
        if (i < 1) {
			if(verbose_socklibc>=1){
				WARNING("%s", "Could not receive all data. Trying again.");
			}
            sleep(1);
        }
        ptr += i;
        length -= i;
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1ee3(%rip), %r13      # 0x33d0
pushq $0x1
popq %r15
testq %rbx, %rbx
jle 0x154a
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1050
movq %rax, %r12
testq %rax, %rax
jg 0x151e
cmpl $0x0, 0x4c3c(%rip)      # 0x6150
jg 0x1526
movl %r15d, %edi
callq 0x1250
addq %r12, %r14
subq %r12, %rbx
jmp 0x14f1
movq 0x4acb(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1b7f(%rip), %rsi      # 0x30b6
leaq 0x1e89(%rip), %rdx      # 0x33c7
movq %r13, %rcx
xorl %eax, %eax
callq 0x1130
jmp 0x1516
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: recv_full_msg_try
int64_t recv_full_msg_try(int socket, void* buffer, int64_t length, int times) {
    int64_t expected_length = 0;
    int64_t ret = recv_all_try(socket, &expected_length, sizeof(int64_t), times);
    if (ret < 0) {
        return ret;
    }

	if(verbose_socklibc>=4){
		INFO("Receiving a message of size %ld.", expected_length);
	}
	
    if (expected_length > length && verbose_socklibc>=1) {
        WARNING("Buffer of size %ld is too small to fit expected data.",
                expected_length);
    }

    ret = recv_all_try(socket, buffer, expected_length, times);
    if (ret < 0) {
        return ret;
    }
    return expected_length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebp
movq %rsp, %rsi
andq $0x0, (%rsi)
pushq $0x8
popq %rdx
callq 0x160f
testl %eax, %eax
js 0x15ae
movl 0x4bcd(%rip), %eax      # 0x6150
cmpl $0x4, %eax
jge 0x15e1
movq (%rsp), %rcx
cmpq %r15, %rcx
jle 0x1595
testl %eax, %eax
jg 0x15bc
movl %ebp, %edi
movq %r14, %rsi
movq %rcx, %rdx
movl %ebx, %ecx
callq 0x160f
testl %eax, %eax
js 0x15ae
movq (%rsp), %rax
jmp 0x15b1
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x4a35(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1a72(%rip), %rsi      # 0x303f
leaq 0x1abb(%rip), %rdx      # 0x308f
xorl %eax, %eax
callq 0x1130
movq (%rsp), %rcx
jmp 0x1595
movq 0x4a10(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq (%rsp), %rcx
leaq 0x1a0e(%rip), %rsi      # 0x3004
leaq 0x1a92(%rip), %rdx      # 0x308f
xorl %eax, %eax
callq 0x1130
movl 0x4b46(%rip), %eax      # 0x6150
jmp 0x1588
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: recv_all_try
int recv_all_try(int socket, void* buffer, int64_t length, int times) {
    char* ptr = (char*)buffer;
    int64_t i = 0;
    int counter = 0;
    while (length > 0) {
        i = recv(socket, ptr, length, 0);
        if (i < 1) {
			if(verbose_socklibc>=3){
				WARNING("%s", "Could not receive all data. Trying again.");
			}
            sleep(1);
            counter++;
            if (counter >= times) {
				if(verbose_socklibc>=2){
					ERROR("%s", "Socket is probably broken. Giving up.");
				}
                return -1;
            }
        }
        ptr += i;
        length -= i;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
xorl %r13d, %r13d
testq %r14, %r14
jle 0x168e
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1050
movq %rax, %rbx
testq %rax, %rax
jg 0x165e
cmpl $0x3, 0x4b04(%rip)      # 0x6150
jge 0x1666
pushq $0x1
popq %rdi
callq 0x1250
incl %r13d
cmpl %ebp, %r13d
jge 0x1692
addq %rbx, %r15
subq %rbx, %r14
jmp 0x1628
movq 0x498b(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1a3f(%rip), %rsi      # 0x30b6
leaq 0x1d7c(%rip), %rdx      # 0x33fa
leaq 0x1d4b(%rip), %rcx      # 0x33d0
xorl %eax, %eax
callq 0x1130
jmp 0x164e
xorl %ebx, %ebx
jmp 0x169e
pushq $-0x1
popq %rbx
cmpl $0x2, 0x4ab4(%rip)      # 0x6150
jge 0x16af
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4942(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1d47(%rip), %rsi      # 0x3407
leaq 0x1d33(%rip), %rdx      # 0x33fa
leaq 0x1d54(%rip), %rcx      # 0x3422
xorl %eax, %eax
callq 0x1130
jmp 0x169e
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: errorCheck
void errorCheck(int ret, char* msg) {
    if (ret == -1) {
        if(verbose_socklibc>=1){
			perror(msg);
		}
        exit(EXIT_FAILURE);
    }
}

// Assembly:
cmpl $-0x1, %edi
je 0x187f
retq
pushq %rax
cmpl $0x0, 0x48c9(%rip)      # 0x6150
jle 0x1891
movq %rsi, %rdi
callq 0x11c0
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: TCP_server_accept_client
int TCP_server_accept_client(int listenfd) {
    int connectfd;

    struct sockaddr_in client;
    socklen_t clientlen = sizeof(client);

    //accept connections
    connectfd = accept(listenfd, (struct sockaddr*)&client, &clientlen);
    errorCheck(connectfd, "Cannot accept");

    //get ip to string
    char ip[16];
    inet_ntop(AF_INET, &client.sin_addr, ip, clientlen);
	if(verbose_socklibc>=4){
		INFO("Client %s:%d connected.", ip, client.sin_port);
	}

    return connectfd;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
leaq 0xc(%rsp), %r14
movl $0x10, (%r14)
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x11d0
movl %eax, %ebx
leaq 0x18e5(%rip), %rsi      # 0x31a7
movl %eax, %edi
callq 0x1879
leaq 0x14(%rsp), %rsi
movl (%r14), %ecx
pushq $0x2
popq %rdi
leaq 0x20(%rsp), %rdx
callq 0x1030
cmpl $0x4, 0x486b(%rip)      # 0x6150
jge 0x18f1
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq 0x4700(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movzwl 0x12(%rsp), %r8d
leaq 0x18ad(%rip), %rsi      # 0x31b5
leaq 0x18ca(%rip), %rdx      # 0x31d9
leaq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0x1130
jmp 0x18e7
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: TCP_server_disconnect_client
void TCP_server_disconnect_client(int connectfd) {
    //close sockets
    int ret = close(connectfd);
    errorCheck(ret, "Cannot close socket.");
    if(verbose_socklibc>=4){
		INFO("%s", "Client disconnected.");
	}
}

// Assembly:
pushq %rax
callq 0x1100
leaq 0x18c8(%rip), %rsi      # 0x31f2
movl %eax, %edi
callq 0x1879
cmpl $0x4, 0x4818(%rip)      # 0x6150
jge 0x193c
popq %rax
retq
movq 0x46b5(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x18ba(%rip), %rsi      # 0x3207
leaq 0x18c2(%rip), %rdx      # 0x3216
leaq 0x18d8(%rip), %rcx      # 0x3233
xorl %eax, %eax
popq %r8
jmp 0x1130
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/socket.c
// Function: TCP_client_disconnect
void TCP_client_disconnect(int socketfd) {
    //closing sockets
    int ret = shutdown(socketfd, SHUT_RDWR);
    errorCheck(ret, "Cannot disconnect.");
    ret = close(socketfd);
    errorCheck(ret, "Cannot close socket.");
}

// Assembly:
pushq %rbx
movl %edi, %ebx
pushq $0x2
popq %rsi
callq 0x10a0
leaq 0x1647(%rip), %rsi      # 0x3384
movl %eax, %edi
callq 0x1879
movl %ebx, %edi
callq 0x1100
leaq 0x14a0(%rip), %rsi      # 0x31f2
movl %eax, %edi
popq %rbx
jmp 0x1879
nop
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/f5pl.c
// Function: sig_handler
void sig_handler(int sig) {
    void* array[100];
    size_t size = backtrace(array, 100);
    ERROR("I regret to inform that a segmentation fault occurred. But at least "
          "it is better than a wrong answer%s",
          ".");
    fprintf(stderr,
            "[%s::DEBUG]\033[1;35m Here is the backtrace in case it is of any "
            "use:\n",
            __func__);
    backtrace_symbols_fd(&array[2], size - 1, STDERR_FILENO);
    fprintf(stderr, "\033[0m\n");
    exit(EXIT_FAILURE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x320, %rsp            # imm = 0x320
movq %rsp, %rdi
pushq $0x64
popq %rsi
callq 0x10c0
movl %eax, %ebx
movq 0x3dd0(%rip), %r15      # 0x5ff8
movq (%r15), %rdi
leaq 0x152a(%rip), %rsi      # 0x375c
leaq 0x15a2(%rip), %r14      # 0x37db
leaq 0x145b(%rip), %rcx      # 0x369b
movq %r14, %rdx
xorl %eax, %eax
callq 0x1130
movq (%r15), %rdi
leaq 0x1593(%rip), %rsi      # 0x37e7
movq %r14, %rdx
xorl %eax, %eax
callq 0x1130
leaq 0x10(%rsp), %rdi
decl %ebx
pushq $0x2
popq %rdx
movl %ebx, %esi
callq 0x1060
movq (%r15), %rcx
leaq 0x15fa(%rip), %rdi      # 0x3873
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x1220
pushq $0x1
popq %rdi
callq 0x1200