// File: /workspace/github_c_makefile_star2_O3/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 0x34b7(%rip), %rdi      # 0x98cc
xorl %eax, %eax
callq 0x2030
callq 0x7322
movl $0x1, %edi
movl $0x13, %esi
callq 0x4f79
leaq 0x349a(%rip), %rdi      # 0x98d1
xorl %eax, %eax
callq 0x2030
leaq 0x7(%rsp), %rbx
movq %rbx, %rdi
callq 0x7153
movzbl (%rbx), %eax
leal -0x5b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x6464
callq 0x738e
leaq 0x3054(%rip), %rdi      # 0x94b6
jmp 0x64be
andl $0x1f, %eax
imulq $0x34, %rax, %rax
leaq 0x851e(%rip), %rcx      # 0xe990
movslq 0x59c(%rcx,%rax), %r14
testq %r14, %r14
je 0x649e
leaq (%rcx,%rax), %rbp
addq $0x57c, %rbp            # imm = 0x57C
cmpl $0x0, 0x24(%rbp)
je 0x64ac
callq 0x738e
leaq 0x3440(%rip), %rdi      # 0x98dc
jmp 0x64be
callq 0x738e
leaq 0x3019(%rip), %rdi      # 0x94c3
jmp 0x64be
cmpl $0x0, 0x2c(%rbp)
je 0x64d4
callq 0x738e
leaq 0x343d(%rip), %rdi      # 0x98fb
xorl %eax, %eax
callq 0x2030
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x1c(%rbp)
jne 0x64e4
cmpl $0x0, 0x18(%rbp)
je 0x65b3
leaq (%r14,%r14,2), %rax
leaq 0x8fa1(%rip), %rcx      # 0xf490
movq 0x8(%rcx,%rax,8), %rbx
testq %rbx, %rbx
je 0x6567
movl $0x1, %edi
movl $0x14, %esi
callq 0x4f79
leaq 0x3447(%rip), %rdi      # 0x9956
xorl %eax, %eax
callq 0x2030
cmpq $0x0, 0x38(%rbx)
je 0x6586
leaq 0x34a3(%rip), %rdi      # 0x99c7
xorl %eax, %eax
callq 0x2030
leaq 0x6(%rsp), %r14
movq %r14, %rdi
callq 0x7153
movsbl (%r14), %eax
addl $-0x30, %eax
movq %rbx, %rcx
movq %rcx, %rbx
cmpl %eax, (%rcx)
je 0x6552
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
jne 0x6542
cmpl %eax, (%rbx)
je 0x6596
callq 0x738e
leaq 0x3403(%rip), %rdi      # 0x9965
jmp 0x64be
callq 0x738e
addl $0x40, %r14d
leaq 0x33c0(%rip), %rdi      # 0x9937
movl %r14d, %esi
xorl %eax, %eax
callq 0x2030
jmp 0x64c5
movl (%rbx), %esi
leaq 0x366e(%rip), %rdi      # 0x9bfd
xorl %eax, %eax
callq 0x2030
movl 0xc(%rbx), %eax
cmpl $0x1, %eax
je 0x65c4
testl %eax, %eax
jne 0x65ce
callq 0x738e
leaq 0x33d6(%rip), %rdi      # 0x9984
jmp 0x64be
callq 0x738e
leaq 0x335a(%rip), %rdi      # 0x9919
jmp 0x64be
cmpl $0x0, 0x20(%rbx)
je 0x6788
leaq 0x90e3(%rip), %rax      # 0xf6b8
movl 0x18(%rbp), %ecx
movl 0x1c(%rbp), %edx
leal (,%rcx,8), %esi
subl %ecx, %esi
leal (%rdx,%rdx,4), %ecx
leal (%rsi,%rcx,8), %r14d
imull 0x4(%rax), %r14d
movl $0x1, %edi
movl $0x15, %esi
callq 0x4f79
leal 0x3(%r14), %esi
testl %r14d, %r14d
cmovnsl %r14d, %esi
sarl $0x2, %esi
leaq 0x33a3(%rip), %rdi      # 0x99b7
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x2030
movl $0x12, %edi
movl $0x15, %esi
callq 0x4f79
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0x716e
leaq 0x8(%rsp), %r13
leaq 0x5(%rsp), %rcx
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x739d
movl (%r13), %eax
testl %eax, %eax
js 0x6677
je 0x6674
shll $0x2, %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
movl %eax, %r15d
jmp 0x6677
movl %r14d, %r15d
movl $0x1, %r14d
movl %r14d, 0x2c(%rbp)
movl $0x1, %edi
movl $0x16, %esi
callq 0x4f79
leal 0x3(%r15), %esi
testl %r15d, %r15d
cmovnsl %r15d, %esi
sarl $0x2, %esi
leaq 0x3324(%rip), %rdi      # 0x99c9
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3900
movl $0x1, %edi
movl $0x17, %esi
callq 0x4f79
leaq 0x91f3(%rip), %rax      # 0xf8c0
movl %r14d, 0x5c(%rax)
movq 0x6910(%rip), %rax      # 0xcfe8
movq (%rax), %rdi
movl 0x30(%rbx), %esi
addl $0x40, %esi
callq 0x20a0
movl 0x4(%rbx), %edx
movl %edx, 0x8(%rbx)
leaq 0x91c1(%rip), %r14      # 0xf8b4
movl (%r14), %esi
cmpl $0x16, %esi
setge %al
leaq 0x91ad(%rip), %r15      # 0xf8b0
cmpl $0x32, (%r15)
setge %cl
cmpl $0x18, %esi
jg 0x6713
andb %cl, %al
je 0x672f
callq 0x75db
callq 0x72c9
movl $0x32, %edi
movl $0x1, %esi
callq 0x4f79
movl 0x8(%rbx), %edx
movl (%rbx), %esi
leaq 0x2dd9(%rip), %rdi      # 0x9511
xorl %eax, %eax
callq 0x2030
movl (%r15), %edi
addl $0x5, %edi
movl (%r14), %esi
callq 0x4f79
addl $-0x5, (%r15)
cmpl $0x0, 0x8(%rbx)
je 0x6775
movl 0xc(%rbx), %eax
testl %eax, %eax
je 0x67cc
cmpl $0x1, %eax
je 0x6799
cmpl $0x2, %eax
jne 0x6837
leaq 0x2dc9(%rip), %rdi      # 0x953c
jmp 0x677c
leaq 0x2db5(%rip), %rdi      # 0x9531
xorl %eax, %eax
callq 0x2030
jmp 0x6837
callq 0x738e
leaq 0x3204(%rip), %rdi      # 0x9998
jmp 0x64be
movl 0x10(%rbx), %esi
movl 0x14(%rbx), %edx
leaq 0x2da1(%rip), %rdi      # 0x9547
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x20(%rbx)
leaq 0x2e6d(%rip), %rax      # 0x9625
leaq 0x2d93(%rip), %rdi      # 0x9552
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2030
jmp 0x67fd
leaq 0x2d90(%rip), %rdi      # 0x9563
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x20(%rbx)
leaq 0x2e40(%rip), %rax      # 0x9625
leaq 0x2d7c(%rip), %rdi      # 0x9568
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x24(%rbx)
je 0x6837
movl 0x18(%rbx), %esi
testl %esi, %esi
je 0x6814
leaq 0x2d4b(%rip), %rdi      # 0x9556
xorl %eax, %eax
callq 0x2030
jmp 0x6822
leaq 0x2e09(%rip), %rdi      # 0x9624
xorl %eax, %eax
callq 0x2030
movl 0x1c(%rbx), %esi
testl %esi, %esi
je 0x6837
leaq 0x2d2c(%rip), %rdi      # 0x955c
xorl %eax, %eax
callq 0x2030
movl (%r15), %edi
movl (%r14), %esi
incl %esi
callq 0x4f79
jmp 0x64c5