// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqmc.c
// Function: send4transports
void send4transports(float slist[nstars + 1], struct sttf *task)
{
    int new_tf, to_land, sec_star, sec_score, best_star, top_score,
        score, starnum;
    int xstar;
    struct stplanet *pplan, *best_plan;
    int trash1, trash2;

    if (task->t > 0) {
        best_star = 0;
        sec_star = 0;
        sec_score = -11000;
        top_score = -10000;
        best_plan = nil;
        for (starnum = 1; starnum <= nstars; starnum++) {
            if ((slist[starnum] > 0) || (starnum == task->dest)) {
                pplan = stars[starnum].first_planet;
                while (pplan != nil) {
                    score = eval_t_col(pplan, slist[starnum]);
                    xstar = starnum;
                    if (score > top_score) {
                        swap(&best_star, &xstar);
                        swap(&top_score, &score);
                        best_plan = pplan;
                    };
                    if (score > sec_score) {
                        sec_score = score;
                        sec_star = xstar;
                    };
                    pplan = pplan->next;
                };
            };
        };
        if (best_star == task->dest) {  /*land */
            if ((tf_stars[best_star][player] == 0)
                && (best_plan->team != player)
                ) {
                trash1 = task->t;
                trash2 =
                    (best_plan->capacity - best_plan->inhabitants) / 3;
                to_land = MIN(trash1, trash2);
                if ((to_land > 0)) {
                    if (best_plan->inhabitants == 0) {
                        best_plan->team = ENEMY;
                        best_plan->esee_team = ENEMY;
                        col_stars[best_star][ENEMY] =
                            col_stars[best_star][ENEMY] + 1;
                    };
                    best_plan->inhabitants =
                        best_plan->inhabitants + to_land;
                    best_plan->iu = best_plan->iu + to_land;
                    task->t = task->t - to_land;
                    send4transports(slist, task);
                };
            };
        } else {                /*move */
            if ((task->t >= 10) && (sec_star > 0)) {
                get_tf(ENEMY, &new_tf, task->dest);
                tf[ENEMY][new_tf].t = task->t / 2;
                task->t = task->t - tf[ENEMY][new_tf].t;
                if ((task->c > 0) && (!underdefended(task->dest))) {
                    tf[ENEMY][new_tf].c = 1;
                    task->c = task->c - 1;
                };
                send2t_tf(&tf[ENEMY][new_tf], slist, best_star);
                best_star = sec_star;
            };
            get_tf(ENEMY, &new_tf, task->dest);
            tf[ENEMY][new_tf].t = task->t;
            task->t = 0;
            if ((task->c > 0) && (!underdefended(task->dest))) {
                tf[ENEMY][new_tf].c = 1;
                task->c = task->c - 1;
            };
            send2t_tf(&tf[ENEMY][new_tf], slist, best_star);
        };
    };
}

// Assembly:
cmpl $0x0, 0x14(%rsi)
jle 0x5522
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq %rsi, 0x20(%rsp)
leaq 0xc(%rsp), %rax
andl $0x0, (%rax)
leaq 0x1c(%rsp), %rax
movl $0xffffd8f0, (%rax)     # imm = 0xFFFFD8F0
xorl %r12d, %r12d
movl $0xffffd508, %r13d      # imm = 0xFFFFD508
pushq $0x1
popq %rbp
xorl %r15d, %r15d
cmpq $0x16, %rbp
je 0x5384
movss (%rbx,%rbp,4), %xmm0
ucomiss 0x3d35(%rip), %xmm0     # 0x9030
ja 0x530a
movq 0x20(%rsp), %rax
movl 0x20(%rax), %eax
cmpq %rax, %rbp
jne 0x537c
imulq $0x18, %rbp, %rax
leaq 0xb17b(%rip), %rcx      # 0x10490
leaq (%rcx,%rax), %r14
addq $0x8, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x537c
movss (%rbx,%rbp,4), %xmm0
movq %r14, %rdi
callq 0x5034
movl %eax, 0x18(%rsp)
movl %ebp, 0x14(%rsp)
movl %ebp, %ecx
cmpl 0x1c(%rsp), %eax
jle 0x536b
leaq 0xc(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x760f
leaq 0x1c(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x760f
movl 0x18(%rsp), %eax
movl 0x14(%rsp), %ecx
movq %r14, %r12
cmpl %r13d, %eax
cmovgl %eax, %r13d
cmovgl %ecx, %r15d
addq $0x38, %r14
jmp 0x531d
incq %rbp
jmp 0x52e5
movslq 0xc(%rsp), %rcx
movq 0x20(%rsp), %r13
movl 0x20(%r13), %edx
cmpl %edx, %ecx
jne 0x5422
leaq 0x987f(%rip), %rax      # 0xec20
cmpl $0x0, 0x4(%rax,%rcx,8)
jne 0x5514
cmpl $0x1, 0xc(%r12)
je 0x5514
movl 0x14(%r13), %esi
movl 0x4(%r12), %eax
movl 0x10(%r12), %edi
subl %edi, %eax
pushq $0x3
popq %r8
cltd
idivl %r8d
cmpl %eax, %esi
cmovll %esi, %eax
testl %eax, %eax
jle 0x5514
testl %edi, %edi
jne 0x5400
andl $0x0, 0xc(%r12)
andl $0x0, 0x28(%r12)
leaq 0x98dc(%rip), %rdx      # 0xecd0
incl (%rdx,%rcx,8)
movl 0x10(%r12), %edi
movl 0x14(%r13), %esi
addl %eax, %edi
movl %edi, 0x10(%r12)
addl %eax, 0x14(%r12)
subl %eax, %esi
movl %esi, 0x14(%r13)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x52a3
jmp 0x5514
cmpl $0xa, 0x14(%r13)
jl 0x54a8
testl %r15d, %r15d
jle 0x54a8
leaq 0x10(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x2990
movl 0x14(%r13), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movslq (%r14), %rcx
imulq $0x34, %rcx, %rdx
leaq 0xa53b(%rip), %r14      # 0xf990
movl %eax, 0x14(%r14,%rdx)
subl %eax, 0x14(%r13)
cmpl $0x0, 0x18(%r13)
jle 0x5488
movl 0x20(%r13), %edi
callq 0x570f
movslq 0x10(%rsp), %rcx
testl %eax, %eax
jne 0x5488
imulq $0x34, %rcx, %rax
movl $0x1, 0x18(%r14,%rax)
decl 0x18(%r13)
imulq $0x34, %rcx, %rdi
addq 0x8b15(%rip), %rdi      # 0xdfa8
movl 0xc(%rsp), %edx
movq %rbx, %rsi
callq 0x5777
movl %r15d, 0xc(%rsp)
movl 0x20(%r13), %edx
leaq 0x10(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x2990
movl 0x14(%r13), %eax
movslq (%r14), %rcx
imulq $0x34, %rcx, %rdx
leaq 0xa4c7(%rip), %r14      # 0xf990
movl %eax, 0x14(%r14,%rdx)
andl $0x0, 0x14(%r13)
cmpl $0x0, 0x18(%r13)
jle 0x54fd
movl 0x20(%r13), %edi
callq 0x570f
movslq 0x10(%rsp), %rcx
testl %eax, %eax
jne 0x54fd
imulq $0x34, %rcx, %rax
movl $0x1, 0x18(%r14,%rax)
decl 0x18(%r13)
imulq $0x34, %rcx, %rdi
addq 0x8aa0(%rip), %rdi      # 0xdfa8
movl 0xc(%rsp), %edx
movq %rbx, %rsi
callq 0x5777
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq