// File: /workspace/github_c_makefile_star2_O2/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 0x7f59(%rip), %r15      # 0xf990
leaq (%r15,%rax), %r14
addq $0x57c, %r14            # imm = 0x57C
movl 0x20(%r14), %edx
pushq $0x1
popq %rdi
callq 0x2990
movslq 0x20(%r14), %rax
leaq 0x71c7(%rip), %rcx      # 0xec20
incl 0x4(%rcx,%rax,8)
leaq 0x24e0(%rip), %rdi      # 0x9f44
xorl %eax, %eax
callq 0x2030
leaq 0x8e42(%rip), %rax      # 0x108b4
movl (%rax), %esi
pushq $0x8
popq %rdi
callq 0x4dbd
leaq 0x30(%rsp), %rbx
leaq 0x14(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x6dae
leaq 0xc(%rsp), %rdx
leaq 0xb(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rcx
callq 0x6fc3
movb (%r13), %al
cmpb $0x20, %al
jne 0x7ad7
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
movups 0x10(%r14), %xmm0
movups %xmm0, 0x58c(%r15,%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
jmp 0x7bed
leaq 0x30(%rsp), %r12
leaq 0x14(%rsp), %r13
leaq 0xc(%rsp), %rbp
leaq 0xb(%rsp), %rbx
cmpb $0x42, %al
je 0x7b8d
movzbl %al, %eax
cmpl $0x43, %eax
je 0x7b37
cmpl $0x53, %eax
je 0x7b62
cmpl $0x54, %eax
jne 0x7bb8
movl 0x14(%r14), %eax
movl 0xc(%rsp), %ecx
cmpl %ecx, %eax
jge 0x7b1b
movl %eax, 0xc(%rsp)
movl %eax, %ecx
subl %ecx, %eax
movl %eax, 0x14(%r14)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x590(%r15,%rax)
jmp 0x7bd0
movl 0x18(%r14), %eax
movl 0xc(%rsp), %ecx
cmpl %ecx, %eax
jge 0x7b49
movl %eax, 0xc(%rsp)
movl %eax, %ecx
subl %ecx, %eax
movl %eax, 0x18(%r14)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x594(%r15,%rax)
jmp 0x7bd0
movl 0x10(%r14), %eax
movl 0xc(%rsp), %ecx
cmpl %ecx, %eax
jge 0x7b74
movl %eax, 0xc(%rsp)
movl %eax, %ecx
subl %ecx, %eax
movl %eax, 0x10(%r14)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x58c(%r15,%rax)
jmp 0x7bd0
movl 0x1c(%r14), %eax
movl 0xc(%rsp), %ecx
cmpl %ecx, %eax
jge 0x7b9f
movl %eax, 0xc(%rsp)
movl %eax, %ecx
subl %ecx, %eax
movl %eax, 0x1c(%r14)
movslq 0x10(%rsp), %rax
imulq $0x34, %rax, %rax
addl %ecx, 0x598(%r15,%rax)
jmp 0x7bd0
callq 0x6fb8
movsbl 0xb(%rsp), %esi
leaq 0x2383(%rip), %rdi      # 0x9f4c
xorl %eax, %eax
callq 0x2030
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x6fc3
movb 0xb(%rsp), %al
cmpb $0x20, %al
jne 0x7aeb
movl (%r14), %ebx
movl 0x4(%r14), %ebp
pushq $0x1
popq %r12
movl %r12d, %edi
movq 0x18(%rsp), %r14
movl %r14d, %esi
callq 0x35b4
movl 0x10(%rsp), %esi
movl %r12d, %edi
callq 0x35b4
movl %ebx, %edi
movl %ebp, %esi
callq 0x7107
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