// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x9785(%rip), %rdi      # 0xe51b
movb $0x0, %al
callq 0x2030
movslq -0x4(%rbp), %rcx
leaq 0xf6f8(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0xdf1e(%rip), %rax      # 0x12ce0
cmpl $0x1, (%rax,%rcx,8)
jle 0x4e8f
leaq 0x9d6c(%rip), %rdi      # 0xeb3f
movb $0x0, %al
callq 0x2030
leaq -0x16(%rbp), %rdi
callq 0xa480
callq 0xa720
movsbl -0x16(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4e08
jmp 0x4e40
movq -0x30(%rbp), %rax
movl (%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x4e1c
movl $0x1, -0x24(%rbp)
jmp 0x4e3e
movq -0x30(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x4e30
movl $0x1, -0x24(%rbp)
jmp 0x4e3c
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x4e3e
jmp 0x4df9
movq -0x30(%rbp), %rax
movl (%rax), %eax
cmpl -0x1c(%rbp), %eax
je 0x4e67
movl $0x0, -0x1c(%rbp)
callq 0xa7c0
leaq 0x96cc(%rip), %rdi      # 0xe52a
movb $0x0, %al
callq 0x2030
jmp 0x4e8d
movq -0x30(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x4e8b
callq 0xa7c0
leaq 0x96cc(%rip), %rdi      # 0xe549
movb $0x0, %al
callq 0x2030
movl $0x0, -0x1c(%rbp)
jmp 0x4e8d
jmp 0x4ec2
jmp 0x4e91
movq -0x30(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x4ea9
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x4e91
movq -0x30(%rbp), %rax
movl (%rax), %esi
leaq 0x9ab5(%rip), %rdi      # 0xe96b
movb $0x0, %al
callq 0x2030
callq 0xa720
cmpl $0x0, -0x1c(%rbp)
je 0x515f
movl $0x1, %edi
movl $0x13, %esi
callq 0x69f0
leaq 0x967d(%rip), %rdi      # 0xe55f
movb $0x0, %al
callq 0x2030
movslq -0x4(%rbp), %rcx
leaq 0xdd3c(%rip), %rax      # 0x12c30
cmpl $0x1, 0x4(%rax,%rcx,8)
jle 0x4f21
leaq 0x9c3d(%rip), %rdi      # 0xeb3f
movb $0x0, %al
callq 0x2030
leaq -0x15(%rbp), %rdi
callq 0xa480
movsbl -0x15(%rbp), %eax
subl $0x41, %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4f9b
movl $0x1, -0x20(%rbp)
movslq -0x20(%rbp), %rcx
leaq 0xea6d(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %ecx
movb $0x1, %al
cmpl -0x4(%rbp), %ecx
movb %al, -0x35(%rbp)
jne 0x4f6f
movslq -0x20(%rbp), %rcx
leaq 0xea48(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x24(%rax)
setne %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x4f78
jmp 0x4f83
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4f28
movq 0xd066(%rip), %rax      # 0x11ff0
movq (%rax), %rdi
movl -0x20(%rbp), %esi
addl $0x61, %esi
subl $0x1, %esi
callq 0x20a0
cmpl $0x1, -0x20(%rbp)
jl 0x4fa7
cmpl $0x1a, -0x20(%rbp)
jle 0x4fbf
callq 0xa7c0
leaq 0x95bb(%rip), %rdi      # 0xe56e
movb $0x0, %al
callq 0x2030
jmp 0x515d
movslq -0x20(%rbp), %rcx
leaq 0xe9d6(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
jne 0x4ff5
callq 0xa7c0
leaq 0x9592(%rip), %rdi      # 0xe57b
movb $0x0, %al
callq 0x2030
jmp 0x515b
movslq -0x20(%rbp), %rcx
leaq 0xe9a0(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0x5033
movslq -0x20(%rbp), %rcx
leaq 0xe980(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x24(%rax)
je 0x504b
callq 0xa7c0
leaq 0x954d(%rip), %rdi      # 0xe58c
movb $0x0, %al
callq 0x2030
jmp 0x5159
movslq -0x20(%rbp), %rcx
leaq 0xe94a(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movslq -0x20(%rbp), %rdx
leaq 0xe92f(%rip), %rcx      # 0x139a0
addq $0x57c, %rcx            # imm = 0x57C
imulq $0x34, %rdx, %rdx
addq %rdx, %rcx
addl 0x18(%rcx), %eax
cmpl $0x0, %eax
jne 0x509f
callq 0xa7c0
leaq 0x9518(%rip), %rdi      # 0xe5ab
movb $0x0, %al
callq 0x2030
jmp 0x5157
movq -0x30(%rbp), %rax
cmpl $0x0, 0x24(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x50e5
movq -0x30(%rbp), %rax
movl $0x1, 0x24(%rax)
movl $0x32, %edi
movl $0x1, %esi
callq 0x69f0
movl -0x4(%rbp), %edi
callq 0xaeb0
callq 0xa6a0
movslq -0x20(%rbp), %rax
leaq 0xe8b0(%rip), %rsi      # 0x139a0
addq $0x57c, %rsi            # imm = 0x57C
imulq $0x34, %rax, %rax
addq %rax, %rsi
movl -0x20(%rbp), %edx
movq -0x30(%rbp), %rcx
movl -0x34(%rbp), %r8d
movl $0x1, %edi
callq 0x48a0
movl -0x20(%rbp), %esi
movl $0x1, %edi
callq 0x4280
movslq -0x4(%rbp), %rdx
xorl %eax, %eax
leaq 0xdbb3(%rip), %rcx      # 0x12ce0
cmpl $0x0, (%rcx,%rdx,8)
movb %al, -0x36(%rbp)
jle 0x514c
movl -0x4(%rbp), %esi
movl $0x1, %edi
callq 0x2250
cmpl $0x0, %eax
setne %al
movb %al, -0x36(%rbp)
movb -0x36(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
jmp 0x5159
jmp 0x515b
jmp 0x515d
jmp 0x515f
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nop