// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqbat.c
// Function: play_salvo
void play_salvo(int starnum, boolean *Battl9)
{
    boolean battle;
    char tf_char, planch;
    int planet_num = 0, tf_num;
    boolean found;
    struct stplanet *pplanet;
    boolean first_time;
    battle = *Battl9;
    printw("Attack planet ");
    pplanet = stars[starnum].first_planet;
    if ((col_stars[starnum][ENEMY] > 1)) {
        printw(":");
        get_char(&planch);
        cle3r_left();
        planet_num = planch - '0';
        found = false;
        while (!found) {
            if (pplanet->number == planet_num)
                found = true;
            else {
                if (pplanet->next == nil)
                    found = true;
                else
                    pplanet = pplanet->next;
            }
        }
        if (pplanet->number != planet_num) {
            planet_num = 0;
            error_message();
            printw("! That is not a useable planet");
        } else if (pplanet->team != ENEMY) {
            error_message();
            printw(" !Not an enemy colony");
            planet_num = 0;
        };
    } else {
        while (pplanet->team != ENEMY)
            pplanet = pplanet->next;
        printw("%d", pplanet->number);
        cle3r_left();
    };
    if (planet_num != 0) {
        point(1, 19);
        printw(" attacking tf ");
        if (tf_stars[starnum][player] > 1) {
            printw(":");
            get_char(&tf_char);
            tf_num = tf_char - 'A' + 1;
        } else {
            tf_num = 1;
            while (tf[player][tf_num].dest != starnum ||
                   tf[player][tf_num].eta != 0)
                tf_num++;
            addch(tf_num + '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].dest != starnum) ||
                   (tf[player][tf_num].eta != 0)) {
            error_message();
            printw(" !Tf is not at this star      ");
        } else if ((tf[player][tf_num].b + tf[player][tf_num].c) == 0) {
            error_message();
            printw(" !Tf has no warships");
        } else {
            first_time = !pplanet->under_attack;
            if (!(pplanet->under_attack)) {
                pplanet->under_attack = true;
                point(50, 1);
                pr5nt_star(starnum);
                clear_field();
            };
            fire_salvo(player, &tf[player][tf_num], tf_num,
                       pplanet, first_time);
            zero_tf(player, tf_num);
            battle = (col_stars[starnum][ENEMY] > 0) &&
                (any_bc(player, starnum));
        };
    };
    *Battl9 = battle;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movl (%rsi), %r15d
leaq 0x57d5(%rip), %rdi      # 0x941b
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x2030
movslq %ebp, %r12
imulq $0x18, %r12, %rax
leaq 0xc832(%rip), %rcx      # 0x10490
movq 0x8(%rcx,%rax), %r14
leaq 0xb066(%rip), %rax      # 0xecd0
cmpl $0x1, (%rax,%r12,8)
jle 0x3cc2
leaq 0x5d0f(%rip), %rdi      # 0x9987
xorl %eax, %eax
callq 0x2030
movl %r15d, 0x8(%rsp)
leaq 0x16(%rsp), %r15
movq %r15, %rdi
callq 0x6d93
callq 0x6f4d
movsbl (%r15), %eax
movl 0x8(%rsp), %r15d
addl $-0x30, %eax
movl (%r14), %ecx
testl %r13d, %r13d
jne 0x3ce7
cmpl %eax, %ecx
je 0x3ceb
movq 0x38(%r14), %rcx
xorl %r13d, %r13d
testq %rcx, %rcx
sete %r13b
cmovneq %rcx, %r14
jmp 0x3ca2
cmpl $0x0, 0xc(%r14)
je 0x3ccf
movq 0x38(%r14), %r14
jmp 0x3cc2
movl (%r14), %esi
leaq 0x5b56(%rip), %rdi      # 0x982f
xorl %eax, %eax
callq 0x2030
callq 0x6f4d
jmp 0x3d64
cmpl %eax, %ecx
jne 0x3d51
cmpl $0x0, 0xc(%r14)
je 0x3d00
callq 0x6fb8
leaq 0x574b(%rip), %rdi      # 0x9449
jmp 0x3d5d
testl %eax, %eax
je 0x3d64
pushq $0x1
popq %rdi
pushq $0x13
popq %rsi
callq 0x4dbd
leaq 0x5749(%rip), %rdi      # 0x945f
xorl %eax, %eax
callq 0x2030
leaq 0xaefc(%rip), %rax      # 0xec20
cmpl $0x1, 0x4(%rax,%r12,8)
jle 0x3d76
leaq 0x5c54(%rip), %rdi      # 0x9987
xorl %eax, %eax
callq 0x2030
leaq 0x17(%rsp), %r15
movq %r15, %rdi
callq 0x6d93
movsbl (%r15), %r15d
addl $-0x40, %r15d
jmp 0x3daa
callq 0x6fb8
leaq 0x56cd(%rip), %rdi      # 0x942a
xorl %eax, %eax
callq 0x2030
movl %r15d, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x5d4, %eax            # imm = 0x5D4
addq 0xa226(%rip), %rax      # 0xdfa8
pushq $0x61
popq %rsi
cmpl %ebp, -0x4(%rax)
jne 0x3d8f
cmpl $0x0, (%rax)
je 0x3d97
incl %esi
addq $0x34, %rax
jmp 0x3d85
leal -0x60(%rsi), %r15d
movq 0xa246(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
callq 0x2090
leal -0x1b(%r15), %eax
cmpl $-0x1b, %eax
ja 0x3dc1
callq 0x6fb8
leaq 0x56af(%rip), %rdi      # 0x946e
jmp 0x3e09
movl %r15d, %eax
imulq $0x34, %rax, %rax
leaq 0xbbc1(%rip), %rcx      # 0xf990
movl 0x59c(%rcx,%rax), %edx
testl %edx, %edx
je 0x3dfd
cmpl %ebp, %edx
jne 0x3def
leaq (%rcx,%rax), %rsi
addq $0x57c, %rsi            # imm = 0x57C
cmpl $0x0, 0x24(%rsi)
je 0x3e1a
callq 0x6fb8
leaq 0x5691(%rip), %rdi      # 0x948c
jmp 0x3e09
callq 0x6fb8
leaq 0x5672(%rip), %rdi      # 0x947b
xorl %eax, %eax
callq 0x2030
movl 0x8(%rsp), %r15d
jmp 0x3d64
movl 0x1c(%rsi), %eax
addl 0x18(%rsi), %eax
jne 0x3e30
callq 0x6fb8
leaq 0x567d(%rip), %rdi      # 0x94ab
jmp 0x3e09
xorl %r13d, %r13d
cmpl $0x0, 0x24(%r14)
sete %r13b
jne 0x3e67
movl $0x1, 0x24(%r14)
pushq $0x32
popq %rdi
movq %rsi, 0x8(%rsp)
pushq $0x1
popq %rsi
callq 0x4dbd
movl %ebp, %edi
callq 0x72df
callq 0x6eef
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rdi
movl %r15d, %edx
movq %r14, %rcx
movl %r13d, %r8d
callq 0x383d
pushq $0x1
popq %rdi
movl %r15d, %esi
callq 0x35b4
leaq 0xae46(%rip), %rax      # 0xecd0
cmpl $0x0, (%rax,%r12,8)
jle 0x3ea9
pushq $0x1
popq %rdi
movl %ebp, %esi
callq 0x222c
xorl %r15d, %r15d
testl %eax, %eax
setne %r15b
jmp 0x3d64
xorl %r15d, %r15d
jmp 0x3d64
nopl (%rax)