// File: /workspace/github_c_makefile_star2_O1/beejjorgensen[P]conquest/conqmo.c
// Function: move_ships
void move_ships(void)
{
    float ratio, prob;
    int there, dx, dy, i;
    tteam tm;
    struct stplanet *pplanet;
    boolean any, loss;
    /*clear the board */
    for (i = 1; i <= 26; i++) {
        if ((tf[player][i].dest != 0) && (tf[player][i].eta != 0)) {
            board[tf[player][i].x][tf[player][i].y].tf = ' ';
            update_board(tf[player][i].x, tf[player][i].y, right);
        };
    };
    /*move ships of both teams */
    tm = ENEMY;
    do {
        for (i = 1; i <= 26; i++) {
            if ((tf[tm][i].dest != 0) && (tf[tm][i].eta != 0)) {
                tf[tm][i].eta = tf[tm][i].eta - 1;
                if ((!stars[tf[tm][i].dest].visit[tm]) &&
                    (tf[tm][i].eta == 0) && (tm == player)) {

                    left_line[20] = true;
                    cle3r_left();
                    point(1, 19);
                    printw("Task force %c exploring %c.\n", '`' + i,
                           tf[tm][i].dest + '@');
                    prob = (t_e_prob + rnd(t_e_var) * tf[tm][i].t) / 100.0;
                    if (tf[tm][i].s != 0)
                        prob =
                            (s_e_prob +
                             rnd(s_e_var) * tf[tm][i].s) / 100.0;
                    if (tf[tm][i].c != 0)
                        prob =
                            (c_e_prob +
                             rnd(c_e_var) * tf[tm][i].c) / 100.0;
                    if (tf[tm][i].b != 0)
                        prob =
                            (b_e_prob +
                             rnd(b_e_var) * tf[tm][i].b) / 100.0;
                    if (prob > 100)
                        prob = 100;
                    loss = true;
                    lose(&tf[tm][i].t, &loss, 't', prob);
                    lose(&tf[tm][i].s, &loss, 's', prob);
                    lose(&tf[tm][i].c, &loss, 'c', prob);
                    lose(&tf[tm][i].b, &loss, 'b', prob);
                    if (loss)
                        printw("No ships");
                    printw(" destroyed.");
                    left_line[23] = true;
                    pause();
                    tf[tm][i].eta = 1;  /* fool zero tf */
                    zero_tf(tm, i);
                    tf[tm][i].eta = 0;  /* fool zero tf */
                }
                if (tf[tm][i].dest != 0) {
                    if (tm == player) {
                        dx = stars[tf[tm][i].dest].x;
                        dy = stars[tf[tm][i].dest].y;
                        ratio =
                            1.0 -
                            ((float) tf[tm][i].eta / tf[tm][i].origeta);
                        tf[tm][i].x =
                            tf[tm][i].xf +
                            conq_round(ratio * (dx - tf[tm][i].xf));
                        tf[tm][i].y =
                            tf[tm][i].yf +
                            conq_round(ratio * (dy - tf[tm][i].yf));
                        if (tf[tm][i].eta == 0) {
                            pplanet = stars[tf[tm][i].dest].first_planet;
                            while (pplanet != nil) {
                                pplanet->psee_capacity = pplanet->capacity;
                                pplanet = pplanet->next;
                            }
                            player_arrivals[tf[tm][i].dest] = true;
                            if (!stars[tf[tm][i].dest].visit[tm]) {
                                board[tf[tm][i].x][tf[tm][i].y].enemy =
                                    ' ';
                                update_board(tf[tm][i].x, tf[tm][i].y,
                                             left);
                                stars[tf[tm][i].dest].visit[tm] = true;
                            };
                        };
                    };
                    if ((tm == ENEMY) && (tf[tm][i].eta == 0)) {
                        pplanet = stars[tf[tm][i].dest].first_planet;
                        stars[tf[tm][i].dest].visit[ENEMY] = true;
                        while (pplanet != nil) {
                            pplanet->esee_team = pplanet->team;
                            pplanet = pplanet->next;
                        };
                        if (tf_stars[tf[tm][i].dest][ENEMY] > 0) {
                            there = 1;
                            while ((there == i)
                                   || (tf[ENEMY][there].dest !=
                                       tf[ENEMY][i]
                                       .dest)
                                   || (tf[ENEMY][there].eta != 0))
                                there = there + 1;
                            joinsilent(ENEMY, &tf[ENEMY][i],
                                       &tf[ENEMY][there]);
                        };
                        if ((tf_stars[tf[tm][i].dest][player] > 0) ||
                            (col_stars[tf[tm][i].dest][player] > 0))
                            enemy_arrivals[tf[tm][i].dest] = true;
                    };
                    if (tf[tm][i].eta == 0)
                        tf_stars[tf[tm][i].dest][tm]++;
                };
            };
        };
        tm++;
    }
    while (tm != none);
    /* put the good guys on the board */
    for (i = 1; i <= 26; i++) {
        if (tf[player][i].dest != 0) {
            tf[player][i].blasting = false;
            dx = tf[player][i].x;
            dy = tf[player][i].y;
            if (board[dx][dy].tf == ' ')
                board[dx][dy].tf = i + 'a' - 1;
            else if (board[dx][dy].tf != i + 'a' - 1)
                board[dx][dy].tf = '*';
            update_board(dx, dy, right);
        };
    };
    any = false;
    for (i = 1; i <= nstars; i++) {
        if (player_arrivals[i]) {
            if ((!any)) {
                point(33, 21);
                printw("Player arrivals :               ");
                point(50, 21);
                any = true;
            };
            addch(i + 'A' - 1);
            player_arrivals[i] = false;
        };
    };
    if ((!any)) {
        point(33, 21);
        printw(blank_line);
    };
    any = false;
    for (i = 1; i <= nstars; i++) {
        if (enemy_arrivals[i]) {
            if ((!any)) {
                point(33, 22);
                printw("Enemy arrivals  :               ");
                point(50, 22);
                any = true;
            };
            addch(i + 'A' - 1);
            enemy_arrivals[i] = false;
        };
    };
    if ((!any)) {
        point(33, 22);
        printw(blank_line);
    };
    any = false;
    for (i = 1; i <= nstars; i++) {
        if (en_departures[i]) {
            if (!any) {
                point(33, 23);
                printw("Enemy departures:               ");
                point(50, 23);
                any = true;
            };
            addch(i + 'A' - 1);
            en_departures[i] = false;
        };
    };
    if ((!any)) {
        point(33, 23);
        printw(blank_line);
    };
    for (i = 1; i <= nstars; i++)
        revolt(i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorl %ebx, %ebx
leaq 0x8eed(%rip), %r15      # 0xe9a0
cmpl $0x0, 0x5d0(%r15,%rbx)
je 0x5afb
cmpl $0x0, 0x5d4(%r15,%rbx)
je 0x5afb
movslq 0x5b0(%r15,%rbx), %rdi
movslq 0x5b4(%r15,%rbx), %rsi
leaq (%rsi,%rsi,2), %rax
leaq (%rdi,%rdi,2), %rcx
shlq $0x6, %rcx
addq 0x74bc(%rip), %rcx      # 0xcfa8
movl $0x20, 0x8(%rcx,%rax,4)
xorl %edx, %edx
callq 0x2d64
addq $0x34, %rbx
cmpq $0x548, %rbx            # imm = 0x548
jne 0x5ab3
movb $0x1, %al
movl %eax, 0x8(%rsp)
leaq 0x998b(%rip), %rbx      # 0xf4a0
movq $0x0, 0x20(%rsp)
xorl %r8d, %r8d
movl $0x1, %r13d
imulq $0x57c, %r8, %r9        # imm = 0x57C
xorl %r14d, %r14d
movq %r8, 0x18(%rsp)
movq %r9, 0x10(%rsp)
imulq $0x34, %r13, %rbp
leaq (%r9,%r15), %r12
movslq 0x20(%rbp,%r12), %rax
testq %rax, %rax
je 0x5f74
addq %rbp, %r12
movl 0x24(%r12), %ecx
testl %ecx, %ecx
je 0x5f74
leaq (%rax,%rax,2), %rdx
shlq $0x3, %rdx
addq %rbx, %rdx
decl %ecx
movl %ecx, 0x24(%r12)
sete %al
cmpl $0x0, 0x10(%rdx,%r8,4)
jne 0x5d60
andb 0x20(%rsp), %al
je 0x5d60
leaq 0x9d3d(%rip), %rax      # 0xf8d0
movl $0x1, 0x50(%rax)
callq 0x7377
movl $0x1, %edi
movl $0x13, %esi
callq 0x4f69
movl 0x20(%r12), %edx
addl $0x40, %edx
movl %r13d, %esi
orl $0x60, %esi
leaq 0x3b99(%rip), %rdi      # 0x975c
xorl %eax, %eax
callq 0x2030
movl $0x5, %edi
callq 0x4fc5
imull 0x14(%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x3b4f(%rip), %xmm0     # 0x9738
leaq 0x10(%r12), %rbx
cmpl $0x0, 0x10(%r12)
je 0x5c12
movl $0xa, %edi
callq 0x4fc5
imull (%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x3b2e(%rip), %xmm0     # 0x9740
leaq 0x18(%r12), %r15
cmpl $0x0, 0x18(%r12)
je 0x5c3c
movl $0xa, %edi
callq 0x4fc5
imull (%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x3b0c(%rip), %xmm0     # 0x9748
movq %r15, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
leaq 0x1c(%r12), %r15
cmpl $0x0, 0x1c(%r12)
je 0x5c70
movl $0x3, %edi
callq 0x4fc5
imull (%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x3ae0(%rip), %xmm0     # 0x9750
divsd 0x33a0(%rip), %xmm0     # 0x9018
cvtsd2ss %xmm0, %xmm0
leaq 0x14(%r12), %rdi
movss 0x36f3(%rip), %xmm1     # 0x937c
minss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
movl $0x1, 0xc(%rsp)
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
movl $0x74, %edx
movaps %xmm1, %xmm0
callq 0x2ad3
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movl $0x73, %edx
movss 0x4(%rsp), %xmm0
callq 0x2ad3
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
movl $0x63, %edx
movss 0x4(%rsp), %xmm0
callq 0x2ad3
movq %r15, %rdi
movq %rbx, %rsi
movl $0x62, %edx
movss 0x4(%rsp), %xmm0
callq 0x2ad3
cmpl $0x0, 0xc(%rsp)
je 0x5d0b
leaq 0x3a75(%rip), %rdi      # 0x9779
xorl %eax, %eax
callq 0x2030
leaq 0x3a70(%rip), %rdi      # 0x9782
xorl %eax, %eax
callq 0x2030
leaq 0x9bb0(%rip), %rax      # 0xf8d0
movl $0x1, %ebx
movl %ebx, 0x5c(%rax)
callq 0x763e
movl %ebx, 0x24(%r12)
movl $0x1, %edi
movl %r13d, %esi
callq 0x3695
movl $0x0, 0x24(%r12)
leaq 0x8c51(%rip), %r15      # 0xe9a0
leaq 0x974a(%rip), %rbx      # 0xf4a0
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
movslq 0x20(%r12), %rax
testq %rax, %rax
je 0x5f74
testb $0x1, 0x20(%rsp)
je 0x5ea6
leaq (%rax,%rax,2), %rax
movl (%rbx,%rax,8), %ecx
leaq 0x9719(%rip), %rdx      # 0xf4a0
movl 0x4(%rdx,%rax,8), %ebx
xorps %xmm0, %xmm0
cvtsi2ssl 0x24(%r12), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0x28(%r12), %xmm1
divss %xmm1, %xmm0
movss 0x39ad(%rip), %xmm1     # 0x9758
subss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
movl 0x8(%r12), %r15d
subl %r15d, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
mulss %xmm1, %xmm0
callq 0x4fe2
addl %r15d, %eax
movl %eax, (%r12)
movl 0xc(%r12), %r15d
subl %r15d, %ebx
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
leaq 0x96b6(%rip), %rbx      # 0xf4a0
mulss 0x4(%rsp), %xmm0
callq 0x4fe2
movq 0x10(%rsp), %r9
movq 0x18(%rsp), %r8
addl %r15d, %eax
leaq 0x8b97(%rip), %r15      # 0xe9a0
movl %eax, 0x4(%r12)
cmpl $0x0, 0x24(%r12)
jne 0x5ea6
movslq 0x20(%r12), %rdx
leaq (%rdx,%rdx,2), %rcx
movq 0x8(%rbx,%rcx,8), %rsi
testq %rsi, %rsi
je 0x5e39
movl 0x4(%rsi), %edi
movl %edi, 0x8(%rsi)
movq 0x38(%rsi), %rsi
jmp 0x5e28
leaq 0x9a20(%rip), %rsi      # 0xf860
movl $0x1, (%rsi,%rdx,4)
shlq $0x3, %rcx
addq %rbx, %rcx
cmpl $0x0, 0x10(%rcx,%r8,4)
jne 0x5ea6
movslq (%r12), %rdi
movslq %eax, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdi,%rdi,2), %rdx
shlq $0x6, %rdx
addq 0x7138(%rip), %rdx      # 0xcfa8
movl $0x20, (%rdx,%rcx,4)
movl %eax, %esi
movl $0x1, %edx
callq 0x2d64
movq 0x10(%rsp), %r9
movq 0x18(%rsp), %r8
movslq 0x20(%r12), %rax
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq %rbx, %rax
movl $0x1, 0x10(%rax,%r8,4)
testb $0x1, 0x8(%rsp)
je 0x5f58
cmpl $0x0, 0x24(%r12)
jne 0x5f58
movslq 0x20(%r12), %rax
leaq (%rax,%rax,2), %rdx
movq 0x8(%rbx,%rdx,8), %rcx
movl $0x1, 0x10(%rbx,%rdx,8)
testq %rcx, %rcx
je 0x5ee4
movl 0xc(%rcx), %edx
movl %edx, 0x28(%rcx)
movq 0x38(%rcx), %rcx
jmp 0x5ed3
leaq 0x7d45(%rip), %rcx      # 0xdc30
cmpl $0x0, (%rcx,%rax,8)
jle 0x5f29
addq %r15, %rbp
leaq 0x34(%r15), %rdx
movq %r14, %rax
subq $0x1, %rax
jb 0x5f0f
movl 0x20(%rdx), %ecx
cmpl 0x20(%rbp), %ecx
jne 0x5f0f
cmpl $0x0, 0x24(%rdx)
je 0x5f15
addq $0x34, %rdx
jmp 0x5efb
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2a93
movq 0x10(%rsp), %r9
movq 0x18(%rsp), %r8
movslq 0x20(%r12), %rax
leaq 0x7cfb(%rip), %rcx      # 0xdc30
cmpl $0x0, 0x4(%rcx,%rax,8)
jg 0x5f4a
leaq 0x7d9d(%rip), %rcx      # 0xdce0
cmpl $0x0, 0x4(%rcx,%rax,8)
jle 0x5f58
leaq 0x984f(%rip), %rcx      # 0xf7a0
movl $0x1, (%rcx,%rax,4)
cmpl $0x0, 0x24(%r12)
jne 0x5f74
movslq 0x20(%r12), %rax
shlq $0x3, %rax
addq 0x7070(%rip), %rax      # 0xcfe0
incl (%rax,%r8,4)
incq %r13
incq %r14
cmpq $0x1b, %r13
jne 0x5b3b
movl $0x1, %r8d
movl $0x0, 0x8(%rsp)
testb $0x1, 0x20(%rsp)
movb $0x1, %al
movq %rax, 0x20(%rsp)
je 0x5b21
movl $0x5b0, %ebx            # imm = 0x5B0
addq 0x7008(%rip), %rbx      # 0xcfb8
movl $0x61, %r14d
leaq 0x97e3(%rip), %r12      # 0xf7a0
leaq 0x7ddc(%rip), %r15      # 0xdda0
cmpl $0x0, 0x20(%rbx)
je 0x6016
movl $0x0, 0x2c(%rbx)
movslq (%rbx), %rdi
movslq 0x4(%rbx), %rsi
leaq (%rsi,%rsi,2), %rax
leaq (%rdi,%rdi,2), %rcx
shlq $0x6, %rcx
addq %r15, %rcx
movl 0x8(%rcx,%rax,4), %r8d
cmpq $0x20, %r8
jne 0x5ffb
leal -0x60(%r14), %edx
orl $0x60, %edx
jmp 0x6005
movl $0x2a, %edx
cmpq %r8, %r14
je 0x600f
leaq (%rcx,%rax,4), %rax
addq $0x8, %rax
movl %edx, (%rax)
xorl %edx, %edx
callq 0x2d64
incq %r14
addq $0x34, %rbx
cmpq $0x7b, %r14
jne 0x5fc4
movl $0x1, %r15d
leaq 0x375e(%rip), %rbx      # 0x978e
movq 0x6fb1(%rip), %r14      # 0xcfe8
xorl %eax, %eax
leaq 0x9820(%rip), %r13      # 0xf860
cmpl $0x0, (%r13,%r15,4)
je 0x6090
testl %eax, %eax
jne 0x6074
movl $0x21, %edi
movl $0x15, %esi
callq 0x4f69
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
movl $0x32, %edi
movl $0x15, %esi
callq 0x4f69
movq (%r14), %rdi
movl %r15d, %esi
orl $0x40, %esi
callq 0x20a0
movl $0x0, (%r13,%r15,4)
movl $0x1, %eax
incq %r15
cmpq $0x16, %r15
jne 0x6040
testl %eax, %eax
jne 0x60ba
movl $0x21, %edi
movl $0x15, %esi
callq 0x4f69
leaq 0x321c(%rip), %rdi      # 0x92cf
xorl %eax, %eax
callq 0x2030
movl $0x1, %r15d
leaq 0x36e8(%rip), %rbx      # 0x97af
xorl %eax, %eax
cmpl $0x0, (%r12,%r15,4)
je 0x6117
testl %eax, %eax
jne 0x60fc
movl $0x21, %edi
movl $0x16, %esi
callq 0x4f69
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
movl $0x32, %edi
movl $0x16, %esi
callq 0x4f69
movq (%r14), %rdi
movl %r15d, %esi
orl $0x40, %esi
callq 0x20a0
movl $0x0, (%r12,%r15,4)
movl $0x1, %eax
incq %r15
cmpq $0x16, %r15
jne 0x60c9
testl %eax, %eax
jne 0x6141
movl $0x21, %edi
movl $0x16, %esi
callq 0x4f69
leaq 0x3195(%rip), %rdi      # 0x92cf
xorl %eax, %eax
callq 0x2030
movl $0x1, %r15d
leaq 0x96b2(%rip), %r12      # 0xf800
leaq 0x367b(%rip), %rbx      # 0x97d0
xorl %eax, %eax
cmpl $0x0, (%r12,%r15,4)
je 0x61a5
testl %eax, %eax
jne 0x618a
movl $0x21, %edi
movl $0x17, %esi
callq 0x4f69
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
movl $0x32, %edi
movl $0x17, %esi
callq 0x4f69
movq (%r14), %rdi
movl %r15d, %esi
orl $0x40, %esi
callq 0x20a0
movl $0x0, (%r12,%r15,4)
movl $0x1, %eax
incq %r15
cmpq $0x16, %r15
jne 0x6157
testl %eax, %eax
jne 0x61cf
movl $0x21, %edi
movl $0x17, %esi
callq 0x4f69
leaq 0x3107(%rip), %rdi      # 0x92cf
xorl %eax, %eax
callq 0x2030
movl $0x1, %ebx
movl %ebx, %edi
callq 0x43a8
incl %ebx
cmpl $0x16, %ebx
jne 0x61d4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)