// File: /workspace/github_c_makefile_star2_O1/beejjorgensen[P]conquest/conqs1.c
// Function: set_des
void set_des(int tf_num, boolean *Err0r)
{
    boolean error;
    int st_num, min_eta;
    char istar;
    float r;
    int dst;
    int from_star;
    if ((tf[player][tf_num].eta != 0)) {        /*cancel */
        tf[player][tf_num].eta = 0;
        from_star =
            board[tf[player][tf_num].x][tf[player][tf_num].y].star - 'A' +
            1;
        tf[player][tf_num].dest = from_star;
        tf_stars[from_star][player]++;
        printw("(Cancelling previous orders)");
        point(1, y_cursor + 1);
    };
    error = true;
    printw(" to star:");
    point(10, y_cursor);
    get_char(&istar);
    st_num = istar - 'A' + 1;
    if ((st_num < 0) || (st_num > nstars)) {
        error_message();
        printw("  !illegal star");
    } else {
        r = sqrt((float) (((stars[st_num].x - tf[1][tf_num].x) *
                           (stars[st_num].x - tf[1][tf_num].x)) +
                          ((stars[st_num].y - tf[1][tf_num].y) *
                           (stars[st_num].y - tf[1][tf_num].y))));
        point(1, y_cursor + 1);
        printw("   distance:%5.1f", r);
        dst = r - 0.049 + 1;
        if ((dst > range[player]) &&
            ((tf[1][tf_num].b != 0) ||
             (tf[1][tf_num].c != 0) || (tf[1][tf_num].t != 0))) {
            error_message();
            printw("  !maximum range is %2d", range[player]);
        } else if (r < 0.5) {
            point(1, y_cursor + 1);
            printw("Tf remains at star");
        } else {
            min_eta = ((dst - 1) / vel[player]) + 1;
            point(1, y_cursor + 1);
            printw("eta in %2d turns", min_eta);
            tf_stars[tf[player][tf_num].dest][player]--;
            tf[player][tf_num].dest = st_num;
            tf[player][tf_num].eta = min_eta;
            tf[player][tf_num].origeta = tf[player][tf_num].eta;
            tf[player][tf_num].xf = tf[player][tf_num].x;
            tf[player][tf_num].yf = tf[player][tf_num].y;
            error = false;
        }
    }
    *Err0r = error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movslq %edi, %rax
imulq $0x34, %rax, %rax
leaq 0x7aa5(%rip), %rcx      # 0xe9a0
leaq (%rcx,%rax), %r15
addq $0x57c, %r15            # imm = 0x57C
cmpl $0x0, 0x24(%r15)
je 0x6f6d
movl $0x0, 0x24(%r15)
movslq (%r15), %rax
movslq 0x4(%r15), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x6, %rax
addq 0x607d(%rip), %rax      # 0xcfa8
leaq (%rcx,%rcx,2), %rcx
movslq 0x4(%rax,%rcx,4), %rax
leaq -0x40(%rax), %rcx
movl %ecx, 0x20(%r15)
leaq 0x6ced(%rip), %rcx      # 0xdc30
incl -0x1fc(%rcx,%rax,8)
leaq 0x2bff(%rip), %rdi      # 0x9b50
xorl %eax, %eax
callq 0x2030
leaq 0x8965(%rip), %rax      # 0xf8c4
movl (%rax), %esi
incl %esi
movl $0x1, %edi
callq 0x4f69
leaq 0x2bf9(%rip), %rdi      # 0x9b6d
xorl %eax, %eax
callq 0x2030
leaq 0x8942(%rip), %r12      # 0xf8c4
movl (%r12), %esi
movl $0xa, %edi
callq 0x4f69
leaq 0xf(%rsp), %r14
movq %r14, %rdi
callq 0x7187
movsbl (%r14), %r14d
leal -0x56(%r14), %eax
cmpb $-0x17, %al
ja 0x6fc1
callq 0x73e3
leaq 0x2bc2(%rip), %rdi      # 0x9b77
xorl %eax, %eax
callq 0x2030
jmp 0x7086
addl $-0x40, %r14d
movl %r14d, %eax
leaq (%rax,%rax,2), %rax
leaq 0x84cd(%rip), %rcx      # 0xf4a0
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %eax
subl (%r15), %edx
imull %edx, %edx
subl 0x4(%r15), %eax
imull %eax, %eax
addl %edx, %eax
cvtsi2ss %eax, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x6ffb
sqrtss %xmm0, %xmm0
jmp 0x7000
callq 0x2140
movss %xmm0, 0x8(%rsp)
movl (%r12), %esi
incl %esi
movl $0x1, %edi
callq 0x4f69
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x2b5b(%rip), %rdi      # 0x9b87
movb $0x1, %al
callq 0x2030
movsd 0x10(%rsp), %xmm0
addsd 0x2b07(%rip), %xmm0     # 0x9b48
addsd 0x26b7(%rip), %xmm0     # 0x9700
cvttsd2si %xmm0, %eax
leaq 0x866c(%rip), %r13      # 0xf6c0
cmpl %eax, 0x4(%r13)
jge 0x709e
cmpl $0x0, 0x1c(%r15)
jne 0x706f
cmpl $0x0, 0x18(%r15)
jne 0x706f
cmpl $0x0, 0x14(%r15)
je 0x709e
callq 0x73e3
movl 0x4(%r13), %esi
leaq 0x2b1a(%rip), %rdi      # 0x9b99
xorl %eax, %eax
callq 0x2030
movl $0x1, %r12d
movl %r12d, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movss 0x21ba(%rip), %xmm0     # 0x9260
ucomiss 0x8(%rsp), %xmm0
jbe 0x70d3
movl (%r12), %esi
incl %esi
movl $0x1, %r12d
movl $0x1, %edi
callq 0x4f69
leaq 0x2ae7(%rip), %rdi      # 0x9bb1
xorl %eax, %eax
callq 0x2030
jmp 0x708c
decl %eax
leaq 0x85dc(%rip), %rcx      # 0xf6b8
cltd
idivl 0x4(%rcx)
movl %eax, %ebp
incl %ebp
movl (%r12), %esi
incl %esi
movl $0x1, %edi
callq 0x4f69
leaq 0x2ac9(%rip), %rdi      # 0x9bc4
xorl %r12d, %r12d
movl %ebp, %esi
xorl %eax, %eax
callq 0x2030
movslq 0x20(%r15), %rax
leaq 0x6b1e(%rip), %rcx      # 0xdc30
decl 0x4(%rcx,%rax,8)
movl %r14d, 0x20(%r15)
movl %ebp, 0x24(%r15)
movl %ebp, 0x28(%r15)
movq (%r15), %rax
movq %rax, 0x8(%r15)
jmp 0x708c
nop