// File: /workspace/github_c_makefile_star2_O0/beejjorgensen[P]conquest/conqmc.c
// Function: wander_bc
void wander_bc(struct sttf *task, float slist[nstars + 1])
{
    int ships, i, count, dest, new_tf;
    if ((task->b > 1) || (task->c > 1)) {
        count = 0;
        for (i = 1; i <= nstars; i++) {
            if (slist[i] != 0)
                count = count + 1;
        };
        if (count > 0) {
            dest = rnd(count);
            count = 0;
            i = 0;
            do {
                i = i + 1;
                if (slist[i] > 0)
                    count = count + 1;
            }
            while (count != dest);
            get_tf(ENEMY, &new_tf, task->dest);
            ships = task->b / 2;
            tf[ENEMY][new_tf].b = ships;
            task->b = task->b - ships;
            ships = task->c / 2;
            tf[ENEMY][new_tf].c = ships;
            task->c = task->c - ships;

            if (task->t > 3) {
                tf[ENEMY][new_tf].t = 2;
                task->t = task->t - 2;
            };

            tf[ENEMY][new_tf].dest = i;
            tf[ENEMY][new_tf].eta = (int) ((slist[i] - 0.01) /
                                           vel[ENEMY]) + 1;
            depart(task->dest);
        };
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jg 0x6ba8
movq -0x8(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jle 0x6d69
movl $0x0, -0x1c(%rbp)
movl $0x1, -0x18(%rbp)
cmpl $0x15, -0x18(%rbp)
jg 0x6beb
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x6bd5
jp 0x6bd5
jmp 0x6bde
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6be0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6bb6
cmpl $0x0, -0x1c(%rbp)
jle 0x6d67
movl -0x1c(%rbp), %edi
callq 0x6a70
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6c35
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6c37
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x6c0e
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edx
xorl %edi, %edi
leaq -0x24(%rbp), %rsi
callq 0x2e80
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0xcd2f(%rip), %rax      # 0x139a0
imulq $0x34, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
subl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0xccf4(%rip), %rax      # 0x139a0
imulq $0x34, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
subl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpl $0x3, 0x14(%rax)
jle 0x6cfb
movslq -0x24(%rbp), %rcx
leaq 0xccc4(%rip), %rax      # 0x139a0
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
subl $0x2, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x14(%rax)
movl -0x18(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0xcc97(%rip), %rax      # 0x139a0
imulq $0x34, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x75b4(%rip), %xmm1     # 0xe2e0
subsd %xmm1, %xmm0
leaq 0xd981(%rip), %rax      # 0x146b8
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
addl $0x1, %ecx
movslq -0x24(%rbp), %rdx
leaq 0xcc4f(%rip), %rax      # 0x139a0
imulq $0x34, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x6b40
jmp 0x6d69
addq $0x30, %rsp
popq %rbp
retq
nop