// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: send_scouts
void send_scouts(float slist[nstars + 1], struct sttf *task)
{
    int dest, new_tf, j, doind;
    int doable[nstars + 1];
    if (task->s > 0) {
        doind = 0;
        for (j = 1; j <= nstars; j++) {
            if ((!stars[j].visit[ENEMY]) && (slist[j] > 0)) {
                doind = doind + 1;
                doable[doind] = j;
            };
        };
        while ((doind > 0) && (task->s > 0)) {
            get_tf(ENEMY, &new_tf, task->dest);
            tf[ENEMY][new_tf].s = 1;
            dest = rnd(doind);
            tf[ENEMY][new_tf].dest = doable[dest];
            tf[ENEMY][new_tf].eta =
                (int) ((slist[doable[dest]] - 0.01) / vel[ENEMY])
                + 1;
            depart(task->dest);
            doable[dest] = doable[doind];
            doind = doind - 1;
            task->s = task->s - 1;
        };
        while (task->s > 0) {
            do {
                dest = rnd(nstars);
            }
            while (slist[dest] <= 0);
            get_tf(ENEMY, &new_tf, task->dest);
            tf[ENEMY][new_tf].s = 1;
            tf[ENEMY][new_tf].dest = dest;
            tf[ENEMY][new_tf].eta =
                (int) ((slist[dest] - 0.01) / vel[ENEMY]) + 1;
            depart(task->dest);
            task->s = task->s - 1;
        };
    };
}

// Assembly:
movl 0x10(%rsi), %eax
testl %eax, %eax
jle 0x52a2
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb347(%rip), %rcx      # 0x10490
addq $0x28, %rcx
xorl %edx, %edx
pushq $0x1
popq %rsi
xorps %xmm0, %xmm0
cmpq $0x16, %rsi
je 0x517d
cmpl $0x0, (%rcx)
jne 0x5174
movss (%r14,%rsi,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x5174
movslq %edx, %rdi
incl %edx
movl %esi, 0x14(%rsp,%rdi,4)
incq %rsi
addq $0x18, %rcx
jmp 0x5155
movl %edx, %r15d
leaq 0xa809(%rip), %r13      # 0xf990
leaq 0xb51a(%rip), %rbp      # 0x106a8
testl %r15d, %r15d
jle 0x5290
testl %eax, %eax
jle 0x5290
movl 0x20(%rbx), %edx
xorl %edi, %edi
leaq 0xc(%rsp), %rsi
callq 0x2990
movslq 0xc(%rsp), %rax
imulq $0x34, %rax, %rax
movl $0x1, 0x10(%r13,%rax)
movl %r15d, %edi
callq 0x4e19
movslq %eax, %r12
movslq 0x10(%rsp,%r12,4), %rax
movslq 0xc(%rsp), %rcx
imulq $0x34, %rcx, %rcx
movl %eax, 0x20(%r13,%rcx)
cvtss2sd (%r14,%rax,4), %xmm0
cvtsi2sdl (%rbp), %xmm1
addsd 0x4067(%rip), %xmm0     # 0x9258
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
incl %eax
movl %eax, 0x24(%r13,%rcx)
movl 0x20(%rbx), %edi
callq 0x4e5c
movl 0x10(%rsp,%r15,4), %eax
movl %eax, 0x10(%rsp,%r12,4)
decq %r15
movl 0x10(%rbx), %eax
decl %eax
movl %eax, 0x10(%rbx)
jmp 0x518e
pushq $0x15
popq %rdi
callq 0x4e19
movslq %eax, %r12
xorps %xmm0, %xmm0
ucomiss (%r14,%r12,4), %xmm0
jae 0x5222
movl 0x20(%rbx), %edx
leaq 0xc(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x2990
movslq (%r15), %rax
imulq $0x34, %rax, %rax
movl $0x1, 0x10(%r13,%rax)
movl %r12d, 0x20(%r13,%rax)
cvtss2sd (%r14,%r12,4), %xmm0
addsd 0x3fec(%rip), %xmm0     # 0x9258
cvtsi2sdl (%rbp), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
incl %ecx
movl %ecx, 0x24(%r13,%rax)
movl 0x20(%rbx), %edi
callq 0x4e5c
movl 0x10(%rbx), %eax
decl %eax
movl %eax, 0x10(%rbx)
testl %eax, %eax
jg 0x5222
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq