// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqpl.c
// Function: bl2st_planet
void bl2st_planet(void)
{
    char tf_char, pl_char;
    int tf_num, planet_num;
    tplanet *pplanet;
    int factors, starnum;
    boolean see, done;
    char iline[81];
    int ind, amount;
    char dum;
    printw("last");
    cle3r_left();
    point(1, 19);
    printw("Firing TF:");
    get_char(&tf_char);
    tf_num = tf_char - '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) {
        error_message();
        printw(" !Tf is not in normal space   ");
    } else if (tf[player][tf_num].blasting) {
        error_message();
        printw(" !Tf is already blasting     ");
    } else if ((tf[player][tf_num].b == 0) && (tf[player][tf_num].c == 0)) {
        error_message();
        printw(" !Tf has no warships         ");
    } else {
        starnum = tf[player][tf_num].dest;
        pplanet = stars[starnum].first_planet;
        if (pplanet == nil) {
            error_message();
            printw(" !No planets at star %c       ", starnum + 'A' - 1);
        } else {
            point(1, 20);
            printw("Target colony ");
            if (pplanet->next == nil) {
                printw("%2d", pplanet->number);
            } else {
                printw(":");
                get_char(&pl_char);
                planet_num = pl_char - '0';
                done = false;
                while (!done) {
                    if (pplanet->number == planet_num)
                        done = true;
                    else {
                        if (pplanet->next == nil)
                            done = true;
                        else
                            pplanet = pplanet->next;
                    };
                };
                if (pplanet->number != planet_num) {
                    error_message();
                    printw(" !No such planet at this star ");
                    pplanet = nil;
                };
            };
            if (pplanet != nil) {
                if (pplanet->team == ENEMY) {
                    error_message();
                    printw(" !Conquer it first!");
                } else if ((pplanet->team == player)
                           && (!pplanet->conquered)
                    ) {
                    error_message();
                    printw(" !That is a human colony!!    ");
                } else {
                    factors = weapons[player]
                        * ((tf[player][tf_num].c * c_guns) +
                           (tf[player][tf_num].b * b_guns));
                    point(1, 21);
                    printw("Units (max %3d) :", factors / 4);
                    point(18, 21);
                    get_line(iline, &ind, false);
                    get_token(iline, &ind, &amount, &dum);
                    if (amount < 0)
                        factors = 0;
                    else if (amount > 0)
                        factors = MIN(factors, amount * 4);
                    tf[player][tf_num].blasting = true;
                    point(1, 22);
                    printw("Blasting %3d units", factors / 4);
                    blast(pplanet, factors);
                    point(1, 23);
                    left_line[23] = true;
                    addch(pplanet->pstar + 'A' - 1);
                    pplanet->psee_capacity = pplanet->capacity;
                    see = true;
                    if (((y_cursor > 21) && (x_cursor >= 50)) ||
                        (y_cursor > 24)) {
                        pause();
                        clear_field();
                        point(50, 1);
                    };
                    printw("%d:%2d                         ",
                           pplanet->number, pplanet->psee_capacity);
                    point(x_cursor + 5, y_cursor);
                    x_cursor = x_cursor - 5;
                    if (pplanet->psee_capacity == 0)
                        printw(" Decimated");
                    else if ((pplanet->team == none) && see)
                        printw(" No colony");
                    else if (pplanet->team == player) {
                        printw("(%2d,/%3d)", pplanet->inhabitants,
                               pplanet->iu);
                        if (pplanet->conquered)
                            printw("Con");
                        else
                            printw("   ");
                        if (pplanet->mb != 0)
                            printw("%2dmb", pplanet->mb);
                        else
                            printw("    ");
                        if (pplanet->amb != 0)
                            printw("%2damb", pplanet->amb);
                    } else if ((pplanet->team == ENEMY) && see) {
                        printw("*EN*");
                        if (see && pplanet->conquered) {
                            printw("Conquered");
                        } else
                            printw("   ");
                        if (pplanet->under_attack) {
                            if (pplanet->mb != 0)
                                printw("%2dmb", pplanet->mb);
                            else
                                printw("    ");
                            if (pplanet->amb != 0)
                                printw("%2damb", pplanet->amb);
                        };
                    };
                    point(x_cursor, y_cursor + 1);

                };
            };
        };
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x37db(%rip), %rdi      # 0x988c
xorl %eax, %eax
callq 0x2030
callq 0x6f4d
pushq $0x1
popq %rdi
pushq $0x13
popq %rsi
callq 0x4dbd
leaq 0x37c2(%rip), %rdi      # 0x9891
xorl %eax, %eax
callq 0x2030
leaq 0x7(%rsp), %rbx
movq %rbx, %rdi
callq 0x6d93
movzbl (%rbx), %eax
leal -0x5b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x60fc
callq 0x6fb8
leaq 0x3374(%rip), %rdi      # 0x946e
jmp 0x6158
andl $0x1f, %eax
imulq $0x34, %rax, %rax
leaq 0x9886(%rip), %rcx      # 0xf990
movslq 0x59c(%rcx,%rax), %r14
testq %r14, %r14
je 0x6137
leaq (%rcx,%rax), %r15
addq $0x57c, %r15            # imm = 0x57C
cmpl $0x0, 0x24(%r15)
je 0x6145
callq 0x6fb8
leaq 0x3767(%rip), %rdi      # 0x989c
jmp 0x6158
callq 0x6fb8
leaq 0x3338(%rip), %rdi      # 0x947b
jmp 0x6158
cmpl $0x0, 0x2c(%r15)
je 0x616e
callq 0x6fb8
leaq 0x3763(%rip), %rdi      # 0x98bb
xorl %eax, %eax
callq 0x2030
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x1c(%r15)
jne 0x6180
cmpl $0x0, 0x18(%r15)
je 0x62ec
imulq $0x18, %r14, %rax
leaq 0xa305(%rip), %rcx      # 0x10490
movq 0x8(%rcx,%rax), %rbx
testq %rbx, %rbx
je 0x61f6
pushq $0x1
popq %rdi
pushq $0x14
popq %rsi
callq 0x4dbd
leaq 0x376f(%rip), %rdi      # 0x9916
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2030
cmpq $0x0, 0x38(%rbx)
je 0x6215
leaq 0x37c9(%rip), %rdi      # 0x9987
xorl %eax, %eax
callq 0x2030
leaq 0x6(%rsp), %r14
movq %r14, %rdi
callq 0x6d93
movsbl (%r14), %eax
addl $-0x30, %eax
movl (%rbx), %ecx
testl %ebp, %ebp
jne 0x6227
cmpl %eax, %ecx
je 0x622f
movq 0x38(%rbx), %rcx
xorl %ebp, %ebp
testq %rcx, %rcx
sete %bpl
cmovneq %rcx, %rbx
jmp 0x61d9
callq 0x6fb8
addl $0x40, %r14d
leaq 0x36f1(%rip), %rdi      # 0x98f7
movl %r14d, %esi
xorl %eax, %eax
callq 0x2030
jmp 0x615f
movl (%rbx), %esi
leaq 0x399f(%rip), %rdi      # 0x9bbd
xorl %eax, %eax
callq 0x2030
jmp 0x622f
cmpl %eax, %ecx
jne 0x62fd
movl 0xc(%rbx), %eax
cmpl $0x1, %eax
je 0x624c
testl %eax, %eax
jne 0x6256
callq 0x6fb8
leaq 0x36fd(%rip), %rdi      # 0x9944
jmp 0x6158
cmpl $0x0, 0x20(%rbx)
je 0x640d
imull $0x7, 0x18(%r15), %eax
imull $0x28, 0x1c(%r15), %r14d
leaq 0xa451(%rip), %rcx      # 0x106b8
addl %eax, %r14d
imull 0x4(%rcx), %r14d
pushq $0x1
popq %rdi
pushq $0x15
popq %r12
movl %r12d, %esi
callq 0x4dbd
pushq $0x4
popq %rcx
movl %r14d, %eax
cltd
idivl %ecx
leaq 0x36e9(%rip), %rdi      # 0x9977
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
pushq $0x12
popq %rdi
movl %r12d, %esi
callq 0x4dbd
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x6dae
leaq 0x8(%rsp), %rbp
leaq 0x5(%rsp), %rcx
movq %r12, %rdi
xorl %r12d, %r12d
movq %r13, %rsi
movq %rbp, %rdx
callq 0x6fc3
movl (%rbp), %eax
testl %eax, %eax
js 0x6311
je 0x630e
shll $0x2, %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
movl %eax, %r12d
jmp 0x6311
callq 0x6fb8
leaq 0x35e1(%rip), %rdi      # 0x98d9
jmp 0x6158
callq 0x6fb8
leaq 0x361c(%rip), %rdi      # 0x9925
jmp 0x6158
movl %r14d, %r12d
pushq $0x1
popq %rbp
movl %ebp, 0x2c(%r15)
pushq $0x16
popq %rsi
movl %ebp, %edi
callq 0x4dbd
movl %r12d, %eax
cltd
pushq $0x4
popq %rcx
idivl %ecx
leaq 0x3657(%rip), %rdi      # 0x9989
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
movl %r12d, %esi
callq 0x37b8
pushq $0x17
popq %rsi
movl %ebp, %edi
callq 0x4dbd
leaq 0xa569(%rip), %rax      # 0x108c0
movl %ebp, 0x5c(%rax)
movq 0x7c87(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
movl 0x30(%rbx), %esi
addl $0x40, %esi
callq 0x2090
movl 0x4(%rbx), %edx
movl %edx, 0x8(%rbx)
leaq 0xa538(%rip), %r14      # 0x108b4
movl (%r14), %esi
cmpl $0x16, %esi
setge %al
leaq 0xa524(%rip), %r15      # 0x108b0
cmpl $0x32, (%r15)
setge %cl
cmpl $0x18, %esi
jg 0x639c
andb %cl, %al
je 0x63b4
callq 0x71b1
callq 0x6eef
pushq $0x32
popq %rdi
pushq $0x1
popq %rsi
callq 0x4dbd
movl 0x8(%rbx), %edx
movl (%rbx), %esi
leaq 0x310c(%rip), %rdi      # 0x94c9
xorl %eax, %eax
callq 0x2030
movl (%r15), %edi
addl $0x5, %edi
movl (%r14), %esi
callq 0x4dbd
addl $-0x5, (%r15)
cmpl $0x0, 0x8(%rbx)
je 0x63fa
movl 0xc(%rbx), %eax
testl %eax, %eax
je 0x6451
cmpl $0x1, %eax
je 0x641e
cmpl $0x2, %eax
jne 0x64bc
leaq 0x30fc(%rip), %rdi      # 0x94f4
jmp 0x6401
leaq 0x30e8(%rip), %rdi      # 0x94e9
xorl %eax, %eax
callq 0x2030
jmp 0x64bc
callq 0x6fb8
leaq 0x353f(%rip), %rdi      # 0x9958
jmp 0x6158
movl 0x10(%rbx), %esi
movl 0x14(%rbx), %edx
leaq 0x30d4(%rip), %rdi      # 0x94ff
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x20(%rbx)
leaq 0x31a8(%rip), %rax      # 0x95e5
leaq 0x30c6(%rip), %rdi      # 0x950a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2030
jmp 0x6482
leaq 0x30c3(%rip), %rdi      # 0x951b
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x20(%rbx)
leaq 0x317b(%rip), %rax      # 0x95e5
leaq 0x30af(%rip), %rdi      # 0x9520
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x24(%rbx)
je 0x64bc
movl 0x18(%rbx), %esi
testl %esi, %esi
je 0x6499
leaq 0x307e(%rip), %rdi      # 0x950e
xorl %eax, %eax
callq 0x2030
jmp 0x64a7
leaq 0x3144(%rip), %rdi      # 0x95e4
xorl %eax, %eax
callq 0x2030
movl 0x1c(%rbx), %esi
testl %esi, %esi
je 0x64bc
leaq 0x305f(%rip), %rdi      # 0x9514
xorl %eax, %eax
callq 0x2030
movl (%r15), %edi
movl (%r14), %esi
incl %esi
callq 0x4dbd
jmp 0x615f