// File: /workspace/github_c_makefile_star2_O1/beejjorgensen[P]conquest/conqbat.c
// Function: fire_salvo
void fire_salvo(tteam att_team, struct sttf *task, int tfnum,
                struct stplanet *planet, boolean first_time)
{
    int bases, att_forces, def_forces;
    boolean a_lose_none, p_lose_none;
    float att_odds, def_odds, attack_save, defend_save;
    tteam def_team;
    if (left_line[24]) {
        point(1, 24);
        printw(blank_line);
        left_line[24] = false;
    };
    if (att_team == ENEMY)
        def_team = player;
    else
        def_team = ENEMY;
    att_forces = weapons[att_team] * (task->c * c_guns + task->b * b_guns);
    def_forces =
        weapons[def_team] * (planet->mb * c_guns + planet->amb * b_guns);
    if (def_forces > 0) {
        att_odds = fmin((((float) def_forces) / att_forces), 14.0);
        attack_save = exp(log(0.8) * (att_odds));
        def_odds = fmin((float) att_forces / def_forces, 14.0);
        defend_save = exp(log(0.8) * (def_odds));
        point(1, 20);
        if (att_team == player)
            printw("TF%c", tfnum + 'a' - 1);
        else
            printw(" EN");
        printw(": %4d(weap %2d)sur: %4.0f", att_forces,
               weapons[att_team], attack_save * 100);
        point(1, 21);
        printw(" %c%d:%4d (weap %2d)sur: %4.0f", planet->pstar + 'A' - 1,
               planet->number,
               def_forces, weapons[def_team], defend_save * 100);
        point(1, 22);
        printw("Attacker losses:              ");
        point(1, 23);
        left_line[23] = true;
        printw(" Planet losses :              ");
        a_lose_none = true;
        p_lose_none = true;
        do {
            point(17, 22);
            lose(&task->c, &a_lose_none, 'c', attack_save);
            lose(&task->b, &a_lose_none, 'b', attack_save);
            point(17, 23);
            bases = planet->mb;
            lose(&planet->mb, &p_lose_none, 'm', defend_save);
            if (planet->mb != bases)
                printw("b");
            bases = planet->amb;
            lose(&planet->amb, &p_lose_none, 'a', defend_save);
            if (planet->amb != bases)
                printw("mb");
        }
        while (!first_time && p_lose_none && a_lose_none);
        if (a_lose_none) {
            point(17, 22);
            printw("(none)");
        };
        if (p_lose_none) {
            point(17, 23);
            printw("(none)");
        };
    };
    if ((planet->mb + planet->amb == 0)
        && (any_bc(att_team, planet->pstar))) {
        point(1, 24);
        printw("Planet %d falls!               ", planet->number);
        planet->team = att_team;
        planet->esee_team = att_team;
        planet->conquered = true;
        col_stars[task->dest][def_team]--;
        col_stars[task->dest][att_team]++;
        point(50, 1);
        pr5nt_star(planet->pstar);
        clear_field();
        on_board(stars[task->dest].x, stars[task->dest].y);
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x30(%rsp)
movq %rcx, %r12
movl %edx, 0x20(%rsp)
movq %rsi, %rbp
movl %edi, %r14d
leaq 0xbf8c(%rip), %rbx      # 0xf8d0
cmpl $0x0, 0x60(%rbx)
je 0x396e
movl $0x1, %edi
movl $0x18, %esi
callq 0x4f69
leaq 0x596f(%rip), %rdi      # 0x92cf
xorl %eax, %eax
callq 0x2030
movl $0x0, 0x60(%rbx)
xorl %esi, %esi
testl %r14d, %r14d
sete %sil
movl %r14d, 0x2c(%rsp)
movslq %r14d, %rax
movq %rax, 0x18(%rsp)
leaq 0xbd3d(%rip), %rdi      # 0xf6c8
leaq 0x18(%r12), %r15
movl 0x18(%r12), %eax
movl 0x1c(%r12), %ecx
leal (,%rax,8), %edx
subl %eax, %edx
leaq 0x1c(%r12), %r13
leal (%rcx,%rcx,4), %eax
leal (%rdx,%rax,8), %r14d
movq %rsi, 0x40(%rsp)
imull (%rdi,%rsi,4), %r14d
testl %r14d, %r14d
jle 0x3c9a
movq %r12, 0x38(%rsp)
movl 0x18(%rbp), %eax
movl 0x1c(%rbp), %ecx
leal (,%rax,8), %edx
subl %eax, %edx
leal (%rcx,%rcx,4), %eax
leal (%rdx,%rax,8), %r12d
movq 0x18(%rsp), %rbx
imull (%rdi,%rbx,4), %r12d
cvtsi2ss %r14d, %xmm0
movss %xmm0, 0x4(%rsp)
cvtsi2ss %r12d, %xmm1
movss %xmm1, 0x10(%rsp)
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
minsd 0x55fb(%rip), %xmm0     # 0x9008
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x55f3(%rip), %xmm0     # 0x9010
callq 0x2070
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x10(%rsp), %xmm0
divss 0x4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
minsd 0x55c4(%rip), %xmm0     # 0x9008
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x55bc(%rip), %xmm0     # 0x9010
callq 0x2070
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movl $0x1, %edi
movl $0x14, %esi
callq 0x4f69
cmpl $0x1, %ebx
jne 0x3a8e
movl 0x20(%rsp), %esi
addl $0x60, %esi
leaq 0x6555(%rip), %rdi      # 0x9fda
xorl %eax, %eax
callq 0x2030
jmp 0x3a9c
leaq 0x58eb(%rip), %rdi      # 0x9380
xorl %eax, %eax
callq 0x2030
leaq 0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movq %rbp, 0x10(%rsp)
leaq 0x1c(%rbp), %rbx
movq 0x18(%rsp), %rax
leaq 0xbc0e(%rip), %rbp      # 0xf6c8
movl (%rbp,%rax,4), %edx
movss 0x8(%rsp), %xmm0
mulss 0x58b0(%rip), %xmm0     # 0x937c
cvtss2sd %xmm0, %xmm0
leaq 0x58ad(%rip), %rdi      # 0x9384
movl %r12d, %esi
movb $0x1, %al
callq 0x2030
movl $0x1, %r12d
movl $0x1, %edi
movl $0x15, %esi
callq 0x4f69
movq 0x38(%rsp), %rax
movl (%rax), %edx
movl 0x30(%rax), %esi
addl $0x40, %esi
movq 0x40(%rsp), %rax
movl (%rbp,%rax,4), %r8d
movss 0x5867(%rip), %xmm0     # 0x937c
mulss 0x4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x5878(%rip), %rdi      # 0x939e
movl %r14d, %ecx
movb $0x1, %al
callq 0x2030
movl $0x1, %edi
movl $0x16, %esi
callq 0x4f69
leaq 0x5877(%rip), %rdi      # 0x93bd
xorl %eax, %eax
callq 0x2030
movl $0x1, %edi
movl $0x17, %esi
callq 0x4f69
leaq 0xbd6d(%rip), %rax      # 0xf8d0
movl %r12d, 0x5c(%rax)
leaq 0x586e(%rip), %rdi      # 0x93dc
xorl %eax, %eax
callq 0x2030
leaq 0x34(%rsp), %r14
movl $0x1, %eax
movl %eax, (%r14)
leaq 0xc(%rsp), %r12
movl %eax, (%r12)
movl $0x11, %edi
movl $0x16, %esi
callq 0x4f69
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x63, %edx
movss 0x8(%rsp), %xmm0
callq 0x2ad3
movq %rbx, %rdi
movq %r14, %rsi
movl $0x62, %edx
movss 0x8(%rsp), %xmm0
callq 0x2ad3
movl $0x11, %edi
movl $0x17, %esi
callq 0x4f69
movl (%r15), %ebp
movq %r15, %rdi
movq %r12, %rsi
movl $0x6d, %edx
movss 0x4(%rsp), %xmm0
callq 0x2ad3
cmpl %ebp, (%r15)
je 0x3c03
leaq 0x5559(%rip), %rdi      # 0x9155
xorl %eax, %eax
callq 0x2030
movl (%r13), %ebp
movq %r13, %rdi
movq %r12, %rsi
movl $0x61, %edx
movss 0x4(%rsp), %xmm0
callq 0x2ad3
cmpl %ebp, (%r13)
je 0x3c31
leaq 0x58ee(%rip), %rdi      # 0x9518
xorl %eax, %eax
callq 0x2030
movl 0x34(%rsp), %eax
cmpl $0x0, 0x30(%rsp)
jne 0x3c4b
cmpl $0x0, 0xc(%rsp)
je 0x3c4b
testl %eax, %eax
jne 0x3b8b
testl %eax, %eax
je 0x3c6c
movl $0x11, %edi
movl $0x16, %esi
callq 0x4f69
leaq 0x56c7(%rip), %rdi      # 0x932c
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rbp
movq 0x38(%rsp), %r12
je 0x3c9a
movl $0x11, %edi
movl $0x17, %esi
callq 0x4f69
leaq 0x5699(%rip), %rdi      # 0x932c
xorl %eax, %eax
callq 0x2030
movl (%r15), %eax
addl (%r13), %eax
movl 0x2c(%rsp), %ebx
jne 0x3d53
movl 0x30(%r12), %esi
movl %ebx, %edi
callq 0x224c
testl %eax, %eax
je 0x3d53
movl $0x1, %edi
movl $0x18, %esi
callq 0x4f69
movl (%r12), %esi
leaq 0x5722(%rip), %rdi      # 0x93fb
xorl %eax, %eax
callq 0x2030
movl %ebx, 0xc(%r12)
movl %ebx, 0x28(%r12)
movl $0x1, 0x20(%r12)
movslq 0x20(%rbp), %rax
leaq 0x9fe2(%rip), %rcx      # 0xdce0
leaq (%rcx,%rax,8), %rax
movq 0x40(%rsp), %rdx
decl (%rax,%rdx,4)
movslq 0x20(%rbp), %rax
leaq (%rcx,%rax,8), %rax
movq 0x18(%rsp), %rcx
incl (%rax,%rcx,4)
movl $0x32, %edi
movl $0x1, %esi
callq 0x4f69
movl 0x30(%r12), %edi
callq 0x7793
callq 0x731e
movslq 0x20(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq 0xb759(%rip), %rcx      # 0xf4a0
movl (%rcx,%rax,8), %edi
movl 0x4(%rcx,%rax,8), %esi
callq 0x7580
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq