// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
leaq 0x1000f(%rip), %rax     # 0x148d0
cmpl $0x0, 0x60(%rax)
je 0x48f2
movl $0x1, %edi
movl $0x18, %esi
callq 0x69f0
leaq 0x9af2(%rip), %rdi      # 0xe3cf
movb $0x0, %al
callq 0x2030
leaq 0xffe5(%rip), %rax      # 0x148d0
movl $0x0, 0x60(%rax)
cmpl $0x0, -0x4(%rbp)
jne 0x4901
movl $0x1, -0x4c(%rbp)
jmp 0x4908
movl $0x0, -0x4c(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0xfdb5(%rip), %rax      # 0x146c8
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
imull $0x7, 0x18(%rcx), %ecx
movq -0x10(%rbp), %rdx
imull $0x28, 0x1c(%rdx), %edx
addl %edx, %ecx
imull %ecx, %eax
movl %eax, -0x2c(%rbp)
movslq -0x4c(%rbp), %rcx
leaq 0xfd8f(%rip), %rax      # 0x146c8
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
imull $0x7, 0x18(%rcx), %ecx
movq -0x20(%rbp), %rdx
imull $0x28, 0x1c(%rdx), %edx
addl %edx, %ecx
imull %ecx, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x4c58
cvtsi2ssl -0x30(%rbp), %xmm0
cvtsi2ssl -0x2c(%rbp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x9698(%rip), %xmm1     # 0xe010
minsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
movsd 0x967b(%rip), %xmm0     # 0xe008
callq 0x2090
movss -0x3c(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
callq 0x2060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
cvtsi2ssl -0x2c(%rbp), %xmm0
cvtsi2ssl -0x30(%rbp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x9649(%rip), %xmm1     # 0xe010
minsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x40(%rbp)
movsd 0x962c(%rip), %xmm0     # 0xe008
callq 0x2090
movss -0x40(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
callq 0x2060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x48(%rbp)
movl $0x1, %edi
movl $0x14, %esi
callq 0x69f0
cmpl $0x1, -0x4(%rbp)
jne 0x4a2a
movl -0x14(%rbp), %esi
addl $0x61, %esi
subl $0x1, %esi
leaq 0xa7d0(%rip), %rdi      # 0xf1f1
movb $0x0, %al
callq 0x2030
jmp 0x4a38
leaq 0x9a4f(%rip), %rdi      # 0xe480
movb $0x0, %al
callq 0x2030
movl -0x2c(%rbp), %esi
movslq -0x4(%rbp), %rcx
leaq 0xfc82(%rip), %rax      # 0x146c8
movl (%rax,%rcx,4), %edx
movss 0x9a2b(%rip), %xmm0     # 0xe47c
mulss -0x44(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x9a23(%rip), %rdi      # 0xe484
movb $0x1, %al
callq 0x2030
movl $0x1, %edi
movl $0x15, %esi
callq 0x69f0
movq -0x20(%rbp), %rax
movl 0x30(%rax), %esi
addl $0x41, %esi
subl $0x1, %esi
movq -0x20(%rbp), %rax
movl (%rax), %edx
movl -0x30(%rbp), %ecx
movslq -0x4c(%rbp), %rdi
leaq 0xfc30(%rip), %rax      # 0x146c8
movl (%rax,%rdi,4), %r8d
movss 0x99d8(%rip), %xmm0     # 0xe47c
mulss -0x48(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x99ea(%rip), %rdi      # 0xe49e
movb $0x1, %al
callq 0x2030
movl $0x1, %edi
movl $0x16, %esi
callq 0x69f0
leaq 0x99ec(%rip), %rdi      # 0xe4bd
movb $0x0, %al
callq 0x2030
movl $0x1, %edi
movl $0x17, %esi
callq 0x69f0
leaq 0xfde2(%rip), %rax      # 0x148d0
movl $0x1, 0x5c(%rax)
leaq 0x99e0(%rip), %rdi      # 0xe4dc
movb $0x0, %al
callq 0x2030
movl $0x1, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movl $0x11, %edi
movl $0x16, %esi
callq 0x69f0
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movss -0x44(%rbp), %xmm0
leaq -0x34(%rbp), %rsi
movl $0x63, %edx
callq 0x31e0
movq -0x10(%rbp), %rdi
addq $0x1c, %rdi
movss -0x44(%rbp), %xmm0
leaq -0x34(%rbp), %rsi
movl $0x62, %edx
callq 0x31e0
movl $0x11, %edi
movl $0x17, %esi
callq 0x69f0
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
movss -0x48(%rbp), %xmm0
leaq -0x38(%rbp), %rsi
movl $0x6d, %edx
callq 0x31e0
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0x28(%rbp), %eax
je 0x4ba4
leaq 0x95b4(%rip), %rdi      # 0xe151
movb $0x0, %al
callq 0x2030
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x1c, %rdi
movss -0x48(%rbp), %xmm0
leaq -0x38(%rbp), %rsi
movl $0x61, %edx
callq 0x31e0
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
cmpl -0x28(%rbp), %eax
je 0x4be3
leaq 0x9a3c(%rip), %rdi      # 0xe618
movb $0x0, %al
callq 0x2030
jmp 0x4be5
xorl %eax, %eax
cmpl $0x0, -0x24(%rbp)
movb %al, -0x4d(%rbp)
jne 0x4c05
xorl %eax, %eax
cmpl $0x0, -0x38(%rbp)
movb %al, -0x4d(%rbp)
je 0x4c05
cmpl $0x0, -0x34(%rbp)
setne %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x4b11
cmpl $0x0, -0x34(%rbp)
je 0x4c33
movl $0x11, %edi
movl $0x16, %esi
callq 0x69f0
leaq 0x9800(%rip), %rdi      # 0xe42c
movb $0x0, %al
callq 0x2030
cmpl $0x0, -0x38(%rbp)
je 0x4c56
movl $0x11, %edi
movl $0x17, %esi
callq 0x69f0
leaq 0x97dd(%rip), %rdi      # 0xe42c
movb $0x0, %al
callq 0x2030
jmp 0x4c58
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
addl 0x1c(%rcx), %eax
cmpl $0x0, %eax
jne 0x4d65
movl -0x4(%rbp), %edi
movq -0x20(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x2250
cmpl $0x0, %eax
je 0x4d65
movl $0x1, %edi
movl $0x18, %esi
callq 0x69f0
movq -0x20(%rbp), %rax
movl (%rax), %esi
leaq 0x9858(%rip), %rdi      # 0xe4fb
movb $0x0, %al
callq 0x2030
movl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rcx
leaq 0xe008(%rip), %rax      # 0x12ce0
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x4c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rcx
leaq 0xdfe5(%rip), %rax      # 0x12ce0
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl $0x32, %edi
movl $0x1, %esi
callq 0x69f0
movq -0x20(%rbp), %rax
movl 0x30(%rax), %edi
callq 0xaeb0
callq 0xa6a0
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rcx
leaq 0xf762(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rcx
leaq 0xf74a(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %esi
callq 0xaa50
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)