// File: /workspace/github_c_makefile_star2_O3/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 0x5516
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa148(%rip), %rdx      # 0xf490
addq $0x28, %rdx
xorl %ecx, %ecx
movl $0x1, %esi
xorps %xmm0, %xmm0
cmpl $0x0, (%rdx)
jne 0x536f
movss (%r14,%rsi,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x536f
movslq %ecx, %rdi
incl %ecx
movl %esi, 0x14(%rsp,%rdi,4)
incq %rsi
addq $0x18, %rdx
cmpq $0x16, %rsi
jne 0x5356
testl %ecx, %ecx
jle 0x5459
movl %ecx, %r15d
leaq 0x9602(%rip), %r13      # 0xe990
leaq 0x888b(%rip), %r12      # 0xdc20
leaq 0x8934(%rip), %rbp      # 0xdcd0
testl %eax, %eax
jle 0x5508
movl 0x20(%rbx), %edx
xorl %edi, %edi
leaq 0xc(%rsp), %rsi
callq 0x2ac4
movslq 0xc(%rsp), %rax
imulq $0x34, %rax, %rax
movl $0x1, 0x10(%r13,%rax)
movl %r15d, %edi
callq 0x4fd5
cltq
movslq 0x10(%rsp,%rax,4), %rcx
movslq 0xc(%rsp), %rdx
imulq $0x34, %rdx, %rdx
movl %ecx, 0x20(%r13,%rdx)
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rcx,4), %xmm0
addsd 0x3ead(%rip), %xmm0     # 0x92a0
leaq 0xa2ae(%rip), %rcx      # 0xf6a8
xorps %xmm1, %xmm1
cvtsi2sdl (%rcx), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
incl %ecx
movl %ecx, 0x24(%r13,%rdx)
movslq 0x20(%rbx), %rcx
movl 0x4(%rbp,%rcx,8), %edx
addl 0x4(%r12,%rcx,8), %edx
jle 0x542d
leaq 0xa3ca(%rip), %rdx      # 0xf7f0
movl $0x1, (%rdx,%rcx,4)
movl 0x10(%rsp,%r15,4), %ecx
movl %ecx, 0x10(%rsp,%rax,4)
leaq -0x1(%r15), %rdx
movl 0x10(%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x10(%rbx)
cmpq $0x1, %r15
movq %rdx, %r15
jg 0x539c
cmpl $0x2, %ecx
jl 0x5508
leaq 0x9530(%rip), %r12      # 0xe990
leaq 0x87b9(%rip), %rbp      # 0xdc20
leaq 0x8862(%rip), %r15      # 0xdcd0
movl $0x15, %edi
callq 0x4fd5
movslq %eax, %r13
xorps %xmm0, %xmm0
ucomiss (%r14,%r13,4), %xmm0
jae 0x546e
movl 0x20(%rbx), %edx
xorl %edi, %edi
leaq 0xc(%rsp), %rsi
callq 0x2ac4
movslq 0xc(%rsp), %rax
imulq $0x34, %rax, %rax
movl $0x1, 0x10(%r12,%rax)
movl %r13d, 0x20(%r12,%rax)
xorps %xmm0, %xmm0
cvtss2sd (%r14,%r13,4), %xmm0
addsd 0x3de4(%rip), %xmm0     # 0x92a0
leaq 0xa1e5(%rip), %rcx      # 0xf6a8
xorps %xmm1, %xmm1
cvtsi2sdl (%rcx), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
incl %ecx
movl %ecx, 0x24(%r12,%rax)
movslq 0x20(%rbx), %rax
movl 0x4(%r15,%rax,8), %ecx
addl 0x4(%rbp,%rax,8), %ecx
jle 0x54f6
leaq 0xa301(%rip), %rcx      # 0xf7f0
movl $0x1, (%rcx,%rax,4)
movl 0x10(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
cmpl $0x1, %eax
jg 0x546e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq