// File: /workspace/github_c_makefile_star2_O0/beejjorgensen[P]conquest/conqin.c
// Function: init_player
void init_player(void)
{
    char str, key;
    int star_number;
    int balance, cost, amt, ind;
    char iline[81];
    do {
        point(1, 18);
        printw("start at star?\n     ");
        get_char(&str);
        point(1, 19);
        star_number = str - 'A' + 1;
    }
    while (star_number < 1 || star_number > nstars);
    tf[player][1].x = stars[star_number].x;
    tf[player][1].y = stars[star_number].y;
    tf_stars[star_number][player] = 1;
    tf[player][1].dest = star_number;
    point(1, 20);
    printw("choose your initial fleet.");
    point(1, 21);
    printw("you have %d transports", initunit);
    point(1, 22);
    printw(" && %d units to spend", initmoney);
    point(1, 23);
    printw("on ships or research.");
    balance = initmoney;
    do {
        point(1, 19);
        pr3nt_tf(1);
        point(1, 18);
        printw("%3d?                          ", balance);
        point(6, 18);
        get_line(iline, &ind, false);
        do {
            get_token(iline, &ind, &amt, &key);
            switch (key) {
            case 'C':
                cost = amt * c_cost;
                if (cost <= balance) {
                    tf[player][1].c = tf[player][1].c + amt;
                }
                break;
            case 'S':
                cost = amt * s_cost;
                if (cost <= balance) {
                    tf[player][1].s = tf[player][1].s + amt;
                };
                break;
            case 'B':
                cost = amt * b_cost;
                if (cost <= balance) {
                    tf[player][1].b = tf[player][1].b + amt;
                };
                break;
            case 'H':
                help(0);
                cost = 0;
                break;
            case 'W':
            case 'V':
            case 'R':
                cost = amt;
                if (cost <= balance)
                    research(player, key, amt);
                break;
            case ' ':
                cost = 0;
                break;
            case '>':
                point(1, 18);
                printw(">?      ");
                point(3, 18);
                cost = 0;
                get_char(&key);
                switch (key) {
                case 'M':
                    printmap();
                    break;
                case 'R':
                    ressum();
                    break;
                default:
                    error_message();
                    printw(" !Only M,R during initialize");
                };              /*!= switch ( */
                break;
            default:
                error_message();
                printw(" !Illegal field %c", key);
            };                  /*switch ( */
            if (cost <= balance)
                balance = balance - cost;
            else {
                error_message();
                printw("  !can't afford %c", key);
            };
        }
        while (key != ' ');
    }
    while (balance > 0);
    stars[star_number].visit[player] = true;
    board[stars[star_number].x][stars[star_number].y].tf = 'a';
    board[stars[star_number].x][stars[star_number].y].enemy = ' ';
    on_board(stars[star_number].x, stars[star_number].y);
    point(33, 20);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x1, %edi
movl $0x12, %esi
callq 0x69f0
leaq 0x8d5f(%rip), %rdi      # 0xe730
movb $0x0, %al
callq 0x2030
leaq -0x1(%rbp), %rdi
callq 0xa480
movl $0x1, %edi
movl $0x13, %esi
callq 0x69f0
movsbl -0x1(%rbp), %eax
subl $0x41, %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movb $0x1, %al
cmpl $0x1, -0x8(%rbp)
movb %al, -0x71(%rbp)
jl 0x5a12
cmpl $0x15, -0x8(%rbp)
setg %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x59bb
movslq -0x8(%rbp), %rcx
leaq 0xea7c(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
leaq 0xdf6c(%rip), %rax      # 0x139a0
movl %ecx, 0x5b0(%rax)
movslq -0x8(%rbp), %rcx
leaq 0xea5b(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq 0xdf4a(%rip), %rax      # 0x139a0
movl %ecx, 0x5b4(%rax)
movslq -0x8(%rbp), %rcx
leaq 0xd1c9(%rip), %rax      # 0x12c30
movl $0x1, 0x4(%rax,%rcx,8)
movl -0x8(%rbp), %ecx
leaq 0xdf27(%rip), %rax      # 0x139a0
movl %ecx, 0x5d0(%rax)
movl $0x1, %edi
movl $0x14, %esi
callq 0x69f0
leaq 0x8cb0(%rip), %rdi      # 0xe745
movb $0x0, %al
callq 0x2030
movl $0x1, %edi
movl $0x15, %esi
callq 0x69f0
leaq 0x8cae(%rip), %rdi      # 0xe760
movl $0x23, %esi
movb $0x0, %al
callq 0x2030
movl $0x1, %edi
movl $0x16, %esi
callq 0x69f0
leaq 0x8ca3(%rip), %rdi      # 0xe777
movl $0x1e, %esi
movb $0x0, %al
callq 0x2030
movl $0x1, %edi
movl $0x17, %esi
callq 0x69f0
leaq 0x8c97(%rip), %rdi      # 0xe78d
movb $0x0, %al
callq 0x2030
movl $0x1e, -0xc(%rbp)
movl $0x1, %edi
movl $0x13, %esi
callq 0x69f0
movl $0x1, %edi
callq 0xaca0
movl $0x1, %edi
movl $0x12, %esi
callq 0x69f0
movl -0xc(%rbp), %esi
leaq 0x8c6d(%rip), %rdi      # 0xe7a3
movb $0x0, %al
callq 0x2030
movl $0x6, %edi
movl $0x12, %esi
callq 0x69f0
leaq -0x70(%rbp), %rdi
leaq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0xa4b0
leaq -0x70(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x2(%rbp), %rcx
callq 0xa7e0
movsbl -0x2(%rbp), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x80(%rbp)
subl $0x37, %eax
ja 0x5cf8
movq -0x80(%rbp), %rax
leaq 0x8ab3(%rip), %rcx      # 0xe644
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x14(%rbp), %eax
shll $0x4, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x5bc8
leaq 0xddee(%rip), %rax      # 0x139a0
movl 0x5c8(%rax), %ecx
addl -0x14(%rbp), %ecx
leaq 0xddde(%rip), %rax      # 0x139a0
movl %ecx, 0x5c8(%rax)
jmp 0x5d0f
imull $0x6, -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x5bf9
leaq 0xddbd(%rip), %rax      # 0x139a0
movl 0x5c0(%rax), %ecx
addl -0x14(%rbp), %ecx
leaq 0xddad(%rip), %rax      # 0x139a0
movl %ecx, 0x5c0(%rax)
jmp 0x5d0f
imull $0x46, -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x5c2a
leaq 0xdd8c(%rip), %rax      # 0x139a0
movl 0x5cc(%rax), %ecx
addl -0x14(%rbp), %ecx
leaq 0xdd7c(%rip), %rax      # 0x139a0
movl %ecx, 0x5cc(%rax)
jmp 0x5d0f
xorl %edi, %edi
callq 0xa970
movl $0x0, -0x10(%rbp)
jmp 0x5d0f
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x5c63
movb -0x2(%rbp), %al
movl -0x14(%rbp), %edx
movl $0x1, %edi
movsbl %al, %esi
callq 0xb670
jmp 0x5d0f
movl $0x0, -0x10(%rbp)
jmp 0x5d0f
movl $0x1, %edi
movl $0x12, %esi
movl %esi, -0x88(%rbp)
callq 0x69f0
leaq 0x8b32(%rip), %rdi      # 0xe7c2
xorl %eax, %eax
callq 0x2030
movl -0x88(%rbp), %esi
movl $0x3, %edi
callq 0x69f0
movl $0x0, -0x10(%rbp)
leaq -0x2(%rbp), %rdi
callq 0xa480
movsbl -0x2(%rbp), %eax
movl %eax, -0x84(%rbp)
subl $0x4d, %eax
je 0x5cd5
jmp 0x5cc8
movl -0x84(%rbp), %eax
subl $0x52, %eax
je 0x5cdc
jmp 0x5ce3
callq 0x8b40
jmp 0x5cf6
callq 0xb5d0
jmp 0x5cf6
callq 0xa7c0
leaq 0x8adc(%rip), %rdi      # 0xe7cb
movb $0x0, %al
callq 0x2030
jmp 0x5d0f
callq 0xa7c0
movsbl -0x2(%rbp), %esi
leaq 0x8ae0(%rip), %rdi      # 0xe7e8
movb $0x0, %al
callq 0x2030
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x5d22
movl -0xc(%rbp), %eax
subl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x5d39
callq 0xa7c0
movsbl -0x2(%rbp), %esi
leaq 0x8ac9(%rip), %rdi      # 0xe7fb
movb $0x0, %al
callq 0x2030
jmp 0x5d3b
movsbl -0x2(%rbp), %eax
cmpl $0x20, %eax
jne 0x5b5b
jmp 0x5d4a
cmpl $0x0, -0xc(%rbp)
jg 0x5b04
movslq -0x8(%rbp), %rcx
leaq 0xe741(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x14(%rax)
movslq -0x8(%rbp), %rcx
leaq 0xe728(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq (%rax), %rcx
leaq 0xd017(%rip), %rax      # 0x12da0
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rdx
leaq 0xe702(%rip), %rcx      # 0x144a0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl $0x61, 0x8(%rax)
movslq -0x8(%rbp), %rcx
leaq 0xe6de(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq (%rax), %rcx
leaq 0xcfcd(%rip), %rax      # 0x12da0
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rdx
leaq 0xe6b8(%rip), %rcx      # 0x144a0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl $0x20, (%rax)
movslq -0x8(%rbp), %rcx
leaq 0xe695(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
movslq -0x8(%rbp), %rcx
leaq 0xe681(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %esi
callq 0xaa50
movl $0x21, %edi
movl $0x14, %esi
callq 0x69f0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)