// File: /workspace/github_c_makefile_star2_O1/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 0x348b(%rip), %rdi      # 0x987c
xorl %eax, %eax
callq 0x2030
callq 0x7377
movl $0x1, %edi
movl $0x13, %esi
callq 0x4f69
leaq 0x346e(%rip), %rdi      # 0x9881
xorl %eax, %eax
callq 0x2030
leaq 0x7(%rsp), %rbx
movq %rbx, %rdi
callq 0x7187
movzbl (%rbx), %eax
leal -0x5b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x6440
callq 0x73e3
leaq 0x3030(%rip), %rdi      # 0x946e
jmp 0x649a
andl $0x1f, %eax
imulq $0x34, %rax, %rax
leaq 0x8552(%rip), %rcx      # 0xe9a0
movslq 0x59c(%rcx,%rax), %r14
testq %r14, %r14
je 0x647a
leaq (%rcx,%rax), %rbp
addq $0x57c, %rbp            # imm = 0x57C
cmpl $0x0, 0x24(%rbp)
je 0x6488
callq 0x73e3
leaq 0x3414(%rip), %rdi      # 0x988c
jmp 0x649a
callq 0x73e3
leaq 0x2ff5(%rip), %rdi      # 0x947b
jmp 0x649a
cmpl $0x0, 0x2c(%rbp)
je 0x64b0
callq 0x73e3
leaq 0x3411(%rip), %rdi      # 0x98ab
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 0x64c0
cmpl $0x0, 0x18(%rbp)
je 0x65c0
leaq (%r14,%r14,2), %rax
leaq 0x8fd5(%rip), %rcx      # 0xf4a0
movq 0x8(%rcx,%rax,8), %rbx
testq %rbx, %rbx
je 0x656b
movl $0x1, %r15d
movl $0x1, %edi
movl $0x14, %esi
callq 0x4f69
leaq 0x3411(%rip), %rdi      # 0x9906
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x2030
cmpq $0x0, 0x38(%rbx)
je 0x658a
leaq 0x3466(%rip), %rdi      # 0x9977
xorl %eax, %eax
callq 0x2030
leaq 0x6(%rsp), %r14
movq %r14, %rdi
callq 0x7187
movsbl (%r14), %eax
addl $-0x30, %eax
movl $0x1, %ecx
cmpl %eax, (%rbx)
jne 0x653a
movl %ecx, %r12d
jmp 0x654c
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
cmovneq %rcx, %rbx
cmovel %r15d, %r12d
movl %r12d, %ecx
testl %ecx, %ecx
je 0x652c
cmpl %eax, (%rbx)
je 0x659a
callq 0x73e3
leaq 0x33b5(%rip), %rdi      # 0x9915
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2030
jmp 0x659a
callq 0x73e3
addl $0x40, %r14d
leaq 0x336c(%rip), %rdi      # 0x98e7
movl %r14d, %esi
xorl %eax, %eax
callq 0x2030
jmp 0x64a1
movl (%rbx), %esi
leaq 0x361a(%rip), %rdi      # 0x9bad
xorl %eax, %eax
callq 0x2030
testq %rbx, %rbx
je 0x64a1
movl 0xc(%rbx), %eax
cmpl $0x1, %eax
je 0x65d1
testl %eax, %eax
jne 0x65db
callq 0x73e3
leaq 0x3379(%rip), %rdi      # 0x9934
jmp 0x649a
callq 0x73e3
leaq 0x32fd(%rip), %rdi      # 0x98c9
jmp 0x649a
cmpl $0x0, 0x20(%rbx)
je 0x6795
leaq 0x90e6(%rip), %rax      # 0xf6c8
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 0x4f69
leal 0x3(%r14), %esi
testl %r14d, %r14d
cmovnsl %r14d, %esi
sarl $0x2, %esi
leaq 0x3346(%rip), %rdi      # 0x9967
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x2030
movl $0x12, %edi
movl $0x15, %esi
callq 0x4f69
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0x71a2
leaq 0x8(%rsp), %r13
leaq 0x5(%rsp), %rcx
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x73f2
movl (%r13), %eax
testl %eax, %eax
js 0x6684
je 0x6681
shll $0x2, %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
movl %eax, %r15d
jmp 0x6684
movl %r14d, %r15d
movl $0x1, %r14d
movl %r14d, 0x2c(%rbp)
movl $0x1, %edi
movl $0x16, %esi
callq 0x4f69
leal 0x3(%r15), %esi
testl %r15d, %r15d
cmovnsl %r15d, %esi
sarl $0x2, %esi
leaq 0x32c7(%rip), %rdi      # 0x9979
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3890
movl $0x1, %edi
movl $0x17, %esi
callq 0x4f69
leaq 0x91f6(%rip), %rax      # 0xf8d0
movl %r14d, 0x5c(%rax)
movq 0x6903(%rip), %rax      # 0xcfe8
movq (%rax), %rdi
movl 0x30(%rbx), %esi
addl $0x40, %esi
callq 0x20a0
movl 0x4(%rbx), %eax
movl %eax, 0x8(%rbx)
leaq 0x91c4(%rip), %r14      # 0xf8c4
movl (%r14), %edx
cmpl $0x16, %edx
setge %al
leaq 0x91b0(%rip), %r15      # 0xf8c0
cmpl $0x32, (%r15)
setge %cl
cmpl $0x18, %edx
jg 0x6720
andb %cl, %al
je 0x6739
callq 0x763e
callq 0x731e
movl $0x32, %edi
movl $0x1, %esi
callq 0x4f69
movl (%rbx), %esi
movl 0x8(%rbx), %edx
leaq 0x2d84(%rip), %rdi      # 0x94c9
xorl %eax, %eax
callq 0x2030
movl (%r15), %edi
addl $0x5, %edi
movl (%r14), %esi
callq 0x4f69
addl $-0x5, (%r15)
cmpl $0x0, 0x8(%rbx)
je 0x6782
movl 0xc(%rbx), %eax
testl %eax, %eax
je 0x67d9
cmpl $0x1, %eax
je 0x67a6
cmpl $0x2, %eax
jne 0x6844
leaq 0x2d74(%rip), %rdi      # 0x94f4
jmp 0x6789
leaq 0x2d60(%rip), %rdi      # 0x94e9
xorl %eax, %eax
callq 0x2030
jmp 0x6844
callq 0x73e3
leaq 0x31a7(%rip), %rdi      # 0x9948
jmp 0x649a
movl 0x10(%rbx), %esi
movl 0x14(%rbx), %edx
leaq 0x2d4c(%rip), %rdi      # 0x94ff
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x20(%rbx)
leaq 0x2e10(%rip), %rax      # 0x95d5
leaq 0x2d3e(%rip), %rdi      # 0x950a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2030
jmp 0x680a
leaq 0x2d3b(%rip), %rdi      # 0x951b
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x20(%rbx)
leaq 0x2de3(%rip), %rax      # 0x95d5
leaq 0x2d27(%rip), %rdi      # 0x9520
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x24(%rbx)
je 0x6844
movl 0x18(%rbx), %esi
testl %esi, %esi
je 0x6821
leaq 0x2cf6(%rip), %rdi      # 0x950e
xorl %eax, %eax
callq 0x2030
jmp 0x682f
leaq 0x2dac(%rip), %rdi      # 0x95d4
xorl %eax, %eax
callq 0x2030
movl 0x1c(%rbx), %esi
testl %esi, %esi
je 0x6844
leaq 0x2cd7(%rip), %rdi      # 0x9514
xorl %eax, %eax
callq 0x2030
movl (%r15), %edi
movl (%r14), %esi
incl %esi
callq 0x4f69
jmp 0x64a1