// File: /workspace/github_c_makefile_star2_O1/beejjorgensen[P]conquest/conqtf.c
// Function: split_tf
void split_tf(int *Tf2num, int *New2tf)
{
    int tf_num, new_tf;
    char ships;
    int x, y, n_ships;
    int ind;
    char iline[81];
    new_tf = *New2tf;
    tf_num = *Tf2num;
    get_tf(player, &new_tf, tf[player][tf_num].dest);
    tf_stars[tf[player][tf_num].dest][player]++;
    printw(" ships:");
    point(8, y_cursor);
    get_line(iline, &ind, false);
    get_token(iline, &ind, &n_ships, &ships);
    if (ships == ' ') {         /*entire fleet */
        tf[player][new_tf].s = tf[player][tf_num].s;
        tf[player][new_tf].t = tf[player][tf_num].t;
        tf[player][new_tf].c = tf[player][tf_num].c;
        tf[player][new_tf].b = tf[player][tf_num].b;
        tf[player][tf_num].s = 0;
        tf[player][tf_num].t = 0;
        tf[player][tf_num].c = 0;
        tf[player][tf_num].b = 0;
    } else {
        do {
            switch (ships) {
            case 'T':
                if (tf[player][tf_num].t < n_ships)
                    n_ships = tf[player][tf_num].t;
                tf[player][tf_num].t = tf[player][tf_num].t - n_ships;
                tf[player][new_tf].t = tf[player][new_tf].t + n_ships;
                break;
            case 'S':
                if (tf[player][tf_num].s < n_ships)
                    n_ships = tf[player][tf_num].s;
                tf[player][tf_num].s = tf[player][tf_num].s - n_ships;
                tf[player][new_tf].s = tf[player][new_tf].s + n_ships;
                break;
            case 'C':
                if (tf[player][tf_num].c < n_ships)
                    n_ships = tf[player][tf_num].c;
                tf[player][tf_num].c = tf[player][tf_num].c - n_ships;
                tf[player][new_tf].c = tf[player][new_tf].c + n_ships;
                break;
            case 'B':
                if (tf[player][tf_num].b < n_ships)
                    n_ships = tf[player][tf_num].b;
                tf[player][tf_num].b = tf[player][tf_num].b - n_ships;
                tf[player][new_tf].b = tf[player][new_tf].b + n_ships;
                break;
            default:
                error_message();
                printw("  ! Illegal field %c", ships);
            };                  /*switch ( */
            get_token(iline, &ind, &n_ships, &ships);
        }
        while (ships != ' ');
    };
    x = tf[player][tf_num].x;
    y = tf[player][tf_num].y;
    zero_tf(player, tf_num);
    zero_tf(player, new_tf);
    on_board(x, y);
    *Tf2num = tf_num;
    *New2tf = new_tf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x28(%rsp)
movl (%rsi), %eax
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
movq %rdi, 0x20(%rsp)
movslq (%rdi), %rax
movq %rax, 0x18(%rsp)
imulq $0x34, %rax, %rax
leaq 0x6a0e(%rip), %r13      # 0xe9a0
leaq (%rax,%r13), %r15
addq $0x57c, %r15            # imm = 0x57C
movl 0x20(%r15), %edx
movl $0x1, %edi
callq 0x2a18
movslq 0x20(%r15), %rax
leaq 0x5c7a(%rip), %rcx      # 0xdc30
incl 0x4(%rcx,%rax,8)
leaq 0x1f73(%rip), %rdi      # 0x9f34
xorl %eax, %eax
callq 0x2030
leaq 0x78f5(%rip), %rax      # 0xf8c4
movl (%rax), %esi
movl $0x8, %edi
callq 0x4f69
leaq 0x30(%rsp), %rbx
leaq 0x14(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x71a2
leaq 0xc(%rsp), %rdx
leaq 0xb(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x73f2
cmpb $0x20, (%r12)
jne 0x8057
movl 0x10(%r15), %eax
movslq 0x10(%rsp), %rcx
imulq $0x34, %rcx, %rcx
movl %eax, 0x58c(%r13,%rcx)
movl 0x14(%r15), %eax
movl %eax, 0x590(%r13,%rcx)
movl 0x18(%r15), %eax
movl %eax, 0x594(%r13,%rcx)
movl 0x1c(%r15), %eax
movl %eax, 0x598(%r13,%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
jmp 0x8173
movq %r13, %r14
leaq 0x30(%rsp), %r12
leaq 0x14(%rsp), %r13
leaq 0xc(%rsp), %rbp
leaq 0xb(%rsp), %rbx
movzbl 0xb(%rsp), %eax
cmpl $0x52, %eax
jg 0x80b4
cmpl $0x42, %eax
je 0x8103
cmpl $0x43, %eax
jne 0x80e9
movl 0x18(%r15), %eax
cmpl 0xc(%rsp), %eax
jge 0x8094
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x18(%r15)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x594(%r14,%rax)
jmp 0x8157
cmpl $0x53, %eax
je 0x812e
cmpl $0x54, %eax
jne 0x80e9
movl 0x14(%r15), %eax
cmpl 0xc(%rsp), %eax
jge 0x80cc
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x14(%r15)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x590(%r14,%rax)
jmp 0x8157
callq 0x73e3
movsbl 0xb(%rsp), %esi
leaq 0x1e42(%rip), %rdi      # 0x9f3c
xorl %eax, %eax
callq 0x2030
jmp 0x8157
movl 0x1c(%r15), %eax
cmpl 0xc(%rsp), %eax
jge 0x8111
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x1c(%r15)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x598(%r14,%rax)
jmp 0x8157
movl 0x10(%r15), %eax
cmpl 0xc(%rsp), %eax
jge 0x813c
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x10(%r15)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x58c(%r14,%rax)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x73f2
cmpb $0x20, 0xb(%rsp)
jne 0x806e
movl (%r15), %ebx
movl 0x4(%r15), %ebp
movl $0x1, %edi
movq 0x18(%rsp), %r14
movl %r14d, %esi
callq 0x3695
movl 0x10(%rsp), %esi
movl $0x1, %edi
callq 0x3695
movl %ebx, %edi
movl %ebp, %esi
callq 0x7580
movq 0x20(%rsp), %rax
movl %r14d, (%rax)
movl 0x10(%rsp), %eax
movq 0x28(%rsp), %rcx
movl %eax, (%rcx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq