// File: /workspace/github_c_makefile_star2_O0/beejjorgensen[P]conquest/conqpl.c
// Function: land
void land(void)
{
    char tfc, trc, planc;
    boolean see;
    int x, y, room_left, tfnum, transports, planet_num;
    int starnum, ind;
    char iline[81];
    boolean found;
    struct stplanet *pplanet;
    printw("and tf:");
    get_char(&tfc);
    cle3r_left();
    tfnum = tfc - 'A' + 1;
    if ((tfnum < 1) || (tfnum > 26)) {
        error_message();
        printw("  !illegal tf");
    } else if (tf[player][tfnum].dest == 0) {
        error_message();
        printw("  !nonexistent tf");
    } else if ((tf[player][tfnum].eta != 0)) {
        error_message();
        printw("  !tf is not in normal space  ");
    } else {
        starnum = tf[player][tfnum].dest;
        pplanet = stars[starnum].first_planet;
        if (pplanet == nil) {
            error_message();
            printw("  !no planets at this star    ");
        } else if (tf_stars[starnum][ENEMY] > 0) {
            error_message();
            printw("  !enemy ships present");
        } else {
            point(11, 18);
            printw(" planet ");
            if (pplanet->next == nil) {
                planet_num = pplanet->number;
                printw("%d", planet_num);
            } else {
                printw(":");
                get_char(&planc);
                planet_num = planc - '0';
                found = false;
                while ((pplanet != nil) && !found) {
                    if (pplanet->number == planet_num)
                        found = true;
                    else
                        pplanet = pplanet->next;
                };
                if (!found) {
                    planet_num = 0;
                    error_message();
                    printw(" !Not a habitable planet ");
                }
            };
            if (planet_num != 0) {
                if ((pplanet->team == ENEMY) || ((pplanet->team == player)
                                                 && (pplanet->conquered))) {
                    error_message();
                    printw("  !Enemy infested planet  !!  ");
                } else {        /*get the number of transports */
                    room_left = pplanet->capacity - pplanet->inhabitants;
                    point(1, 19);
                    printw(" transports:");
                    get_line(iline, &ind, false);
                    get_token(iline, &ind, &transports, &trc);
                    if (transports == 0)
                        transports = tf[player][tfnum].t;
                    if (transports < 1) {
                        error_message();
                        printw("  !illegal transports");
                    } else if (transports > tf[player][tfnum].t) {
                        error_message();
                        printw("  !only %2d transports in tf",
                               tf[player][tfnum].t);
                    } else if (transports > room_left) {
                        error_message();
                        printw("  !only room for %2d transports",
                               room_left);
                    } else {
                        pplanet->team = player;
                        if (pplanet->inhabitants == 0) {
                            col_stars[starnum][player]++;
                        };
                        pplanet->inhabitants =
                            pplanet->inhabitants + transports;
                        pplanet->iu = pplanet->iu + transports;
                        tf[player][tfnum].t =
                            tf[player][tfnum].t - transports;
                        x = tf[player][tfnum].x;
                        y = tf[player][tfnum].y;
                        if (board[x][y].enemy == ' ') {
                            board[x][y].enemy = '@';
                            update_board(x, y, left);
                        };
                        point(1, 20);
                        addch(starnum + 'A' - 1);
                        see = true;
                        if (((y_cursor > 21) && (x_cursor >= 50)) ||
                            (y_cursor > 24)) {
                            pause();
                            clear_field();
                            point(50, 1);
                        };
                        printw("%d:%2d                         ",
                               pplanet->number, pplanet->psee_capacity);
                        point(x_cursor + 5, y_cursor);
                        x_cursor = x_cursor - 5;
                        if (pplanet->psee_capacity == 0)
                            printw(" Decimated");
                        else if ((pplanet->team == none) && see)
                            printw(" No colony");
                        else if (pplanet->team == player) {
                            printw("(%2d,/%3d)", pplanet->inhabitants,
                                   pplanet->iu);
                            if (pplanet->conquered)
                                printw("Con");
                            else
                                printw("   ");
                            if (pplanet->mb != 0)
                                printw("%2dmb", pplanet->mb);
                            else
                                printw("    ");
                            if (pplanet->amb != 0)
                                printw("%2damb", pplanet->amb);
                        } else if ((pplanet->team == ENEMY) && see) {
                            printw("*EN*");
                            if (see && pplanet->conquered) {
                                printw("Conquered");
                            } else
                                printw("   ");
                            if (pplanet->under_attack) {
                                if (pplanet->mb != 0)
                                    printw("%2dmb", pplanet->mb);
                                else
                                    printw("    ");
                                if (pplanet->amb != 0)
                                    printw("%2damb", pplanet->amb);
                            };
                        };
                        point(x_cursor, y_cursor + 1);

                        zero_tf(player, tfnum);
                        pr3nt_tf(tfnum);
                    };
                };
            };
        };
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x56b2(%rip), %rdi      # 0xeb54
movb $0x0, %al
callq 0x2030
leaq -0x1(%rbp), %rdi
callq 0xa480
callq 0xa720
movsbl -0x1(%rbp), %eax
subl $0x41, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x1, -0x18(%rbp)
jl 0x94d0
cmpl $0x1a, -0x18(%rbp)
jle 0x94e8
callq 0xa7c0
leaq 0x5680(%rip), %rdi      # 0xeb5c
movb $0x0, %al
callq 0x2030
jmp 0x9c2e
movslq -0x18(%rbp), %rcx
leaq 0xa4ad(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
jne 0x951e
callq 0xa7c0
leaq 0x5658(%rip), %rdi      # 0xeb6a
movb $0x0, %al
callq 0x2030
jmp 0x9c2c
movslq -0x18(%rbp), %rcx
leaq 0xa477(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x24(%rax)
je 0x9554
callq 0xa7c0
leaq 0x5634(%rip), %rdi      # 0xeb7c
movb $0x0, %al
callq 0x2030
jmp 0x9c2a
movslq -0x18(%rbp), %rcx
leaq 0xa441(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0xaf23(%rip), %rax      # 0x144a0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x95b1
callq 0xa7c0
leaq 0x55f6(%rip), %rdi      # 0xeb9b
movb $0x0, %al
callq 0x2030
jmp 0x9c28
movslq -0x24(%rbp), %rcx
leaq 0x9674(%rip), %rax      # 0x12c30
cmpl $0x0, (%rax,%rcx,8)
jle 0x95da
callq 0xa7c0
leaq 0x55ec(%rip), %rdi      # 0xebba
movb $0x0, %al
callq 0x2030
jmp 0x9c26
movl $0xb, %edi
movl $0x12, %esi
callq 0x69f0
leaq 0x55f2(%rip), %rdi      # 0xebe2
movb $0x0, %al
callq 0x2030
movq -0x90(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x9627
movq -0x90(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
leaq 0x5350(%rip), %rdi      # 0xe96b
movb $0x0, %al
callq 0x2030
jmp 0x96d5
leaq 0x5511(%rip), %rdi      # 0xeb3f
movb $0x0, %al
callq 0x2030
leaq -0x3(%rbp), %rdi
callq 0xa480
movsbl -0x3(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x84(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x90(%rbp)
movb %al, -0x91(%rbp)
je 0x9676
cmpl $0x0, -0x84(%rbp)
setne %al
xorb $-0x1, %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x9682
jmp 0x96b0
movq -0x90(%rbp), %rax
movl (%rax), %eax
cmpl -0x20(%rbp), %eax
jne 0x969c
movl $0x1, -0x84(%rbp)
jmp 0x96ae
movq -0x90(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x9652
cmpl $0x0, -0x84(%rbp)
jne 0x96d3
movl $0x0, -0x20(%rbp)
callq 0xa7c0
leaq 0x5505(%rip), %rdi      # 0xebd1
movb $0x0, %al
callq 0x2030
jmp 0x96d5
cmpl $0x0, -0x20(%rbp)
je 0x9c24
movq -0x90(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x9706
movq -0x90(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jne 0x971e
movq -0x90(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x971e
callq 0xa7c0
leaq 0x54d9(%rip), %rdi      # 0xebeb
movb $0x0, %al
callq 0x2030
jmp 0x9c22
movq -0x90(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x90(%rbp), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0x14(%rbp)
movl $0x1, %edi
movl $0x13, %esi
callq 0x69f0
leaq 0x54bf(%rip), %rdi      # 0xec0a
movb $0x0, %al
callq 0x2030
leaq -0x80(%rbp), %rdi
leaq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0xa4b0
leaq -0x80(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq -0x2(%rbp), %rcx
callq 0xa7e0
cmpl $0x0, -0x1c(%rbp)
jne 0x979a
movslq -0x18(%rbp), %rcx
leaq 0xa219(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jge 0x97b8
callq 0xa7c0
leaq 0x546b(%rip), %rdi      # 0xec17
movb $0x0, %al
callq 0x2030
jmp 0x9c20
movl -0x1c(%rbp), %eax
movslq -0x18(%rbp), %rdx
leaq 0xa1da(%rip), %rcx      # 0x139a0
addq $0x57c, %rcx            # imm = 0x57C
imulq $0x34, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jle 0x980c
callq 0xa7c0
movslq -0x18(%rbp), %rcx
leaq 0xa1b7(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %esi
leaq 0x542d(%rip), %rdi      # 0xec2d
movb $0x0, %al
callq 0x2030
jmp 0x9c1e
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jle 0x982f
callq 0xa7c0
movl -0x14(%rbp), %esi
leaq 0x5427(%rip), %rdi      # 0xec4a
movb $0x0, %al
callq 0x2030
jmp 0x9c1c
movq -0x90(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x90(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x9867
movslq -0x24(%rbp), %rcx
leaq 0x948b(%rip), %rax      # 0x12ce0
movl 0x4(%rax,%rcx,8), %edx
addl $0x1, %edx
leaq 0x947d(%rip), %rax      # 0x12ce0
movl %edx, 0x4(%rax,%rcx,8)
movq -0x90(%rbp), %rax
movl 0x10(%rax), %ecx
addl -0x1c(%rbp), %ecx
movq -0x90(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x90(%rbp), %rax
movl 0x14(%rax), %ecx
addl -0x1c(%rbp), %ecx
movq -0x90(%rbp), %rax
movl %ecx, 0x14(%rax)
movslq -0x18(%rbp), %rcx
leaq 0xa100(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
subl -0x1c(%rbp), %ecx
movslq -0x18(%rbp), %rdx
leaq 0xa0e2(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movslq -0x18(%rbp), %rcx
leaq 0xa0c7(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0xc(%rbp)
movslq -0x18(%rbp), %rcx
leaq 0xa0aa(%rip), %rax      # 0x139a0
addq $0x57c, %rax            # imm = 0x57C
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x10(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x948c(%rip), %rax      # 0x12da0
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $0x20, (%rax)
jne 0x9964
movslq -0xc(%rbp), %rcx
leaq 0x9467(%rip), %rax      # 0x12da0
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl $0x40, (%rax)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movl $0x1, %edx
callq 0x34f0
movl $0x1, %edi
movl $0x14, %esi
callq 0x69f0
movq 0x8676(%rip), %rax      # 0x11ff0
movq (%rax), %rdi
movl -0x24(%rbp), %esi
addl $0x41, %esi
subl $0x1, %esi
callq 0x20a0
movl $0x1, -0x8(%rbp)
leaq 0xaf2b(%rip), %rax      # 0x148c4
cmpl $0x15, (%rax)
jle 0x99aa
leaq 0xaf1b(%rip), %rax      # 0x148c0
cmpl $0x32, (%rax)
jge 0x99b6
leaq 0xaf13(%rip), %rax      # 0x148c4
cmpl $0x18, (%rax)
jle 0x99cf
callq 0xac60
callq 0xa6a0
movl $0x32, %edi
movl $0x1, %esi
callq 0x69f0
movq -0x90(%rbp), %rax
movl (%rax), %esi
movq -0x90(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x4be0(%rip), %rdi      # 0xe5c9
movb $0x0, %al
callq 0x2030
leaq 0xaec9(%rip), %rax      # 0x148c0
movl (%rax), %edi
addl $0x5, %edi
leaq 0xaec1(%rip), %rax      # 0x148c4
movl (%rax), %esi
callq 0x69f0
leaq 0xaeaf(%rip), %rax      # 0x148c0
movl (%rax), %ecx
subl $0x5, %ecx
leaq 0xaea3(%rip), %rax      # 0x148c0
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x9a3f
leaq 0x4bb6(%rip), %rdi      # 0xe5e9
movb $0x0, %al
callq 0x2030
jmp 0x9bed
movq -0x90(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jne 0x9a65
cmpl $0x0, -0x8(%rbp)
je 0x9a65
leaq 0x4b9b(%rip), %rdi      # 0xe5f4
movb $0x0, %al
callq 0x2030
jmp 0x9beb
movq -0x90(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jne 0x9b22
movq -0x90(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x90(%rbp), %rax
movl 0x14(%rax), %edx
leaq 0x4b6e(%rip), %rdi      # 0xe5ff
movb $0x0, %al
callq 0x2030
movq -0x90(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x9ab5
leaq 0x4b5e(%rip), %rdi      # 0xe60a
movb $0x0, %al
callq 0x2030
jmp 0x9ac3
leaq 0x4c85(%rip), %rdi      # 0xe741
movb $0x0, %al
callq 0x2030
movq -0x90(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x9aea
movq -0x90(%rbp), %rax
movl 0x18(%rax), %esi
leaq 0x4b2d(%rip), %rdi      # 0xe60e
movb $0x0, %al
callq 0x2030
jmp 0x9af8
leaq 0x4c4f(%rip), %rdi      # 0xe740
movb $0x0, %al
callq 0x2030
movq -0x90(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x9b1d
movq -0x90(%rbp), %rax
movl 0x1c(%rax), %esi
leaq 0x4afe(%rip), %rdi      # 0xe614
movb $0x0, %al
callq 0x2030
jmp 0x9be9
movq -0x90(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x9be7
cmpl $0x0, -0x8(%rbp)
je 0x9be7
leaq 0x4ad7(%rip), %rdi      # 0xe61b
movb $0x0, %al
callq 0x2030
cmpl $0x0, -0x8(%rbp)
je 0x9b6e
movq -0x90(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x9b6e
leaq 0x4abb(%rip), %rdi      # 0xe620
movb $0x0, %al
callq 0x2030
jmp 0x9b7c
leaq 0x4bcc(%rip), %rdi      # 0xe741
movb $0x0, %al
callq 0x2030
movq -0x90(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x9be5
movq -0x90(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x9bb0
movq -0x90(%rbp), %rax
movl 0x18(%rax), %esi
leaq 0x4a67(%rip), %rdi      # 0xe60e
movb $0x0, %al
callq 0x2030
jmp 0x9bbe
leaq 0x4b89(%rip), %rdi      # 0xe740
movb $0x0, %al
callq 0x2030
movq -0x90(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x9be3
movq -0x90(%rbp), %rax
movl 0x1c(%rax), %esi
leaq 0x4a38(%rip), %rdi      # 0xe614
movb $0x0, %al
callq 0x2030
jmp 0x9be5
jmp 0x9be7
jmp 0x9be9
jmp 0x9beb
jmp 0x9bed
leaq 0xaccc(%rip), %rax      # 0x148c0
movl (%rax), %edi
leaq 0xacc7(%rip), %rax      # 0x148c4
movl (%rax), %esi
addl $0x1, %esi
callq 0x69f0
movl -0x18(%rbp), %esi
movl $0x1, %edi
callq 0x4280
movl -0x18(%rbp), %edi
callq 0xaca0
jmp 0x9c1e
jmp 0x9c20
jmp 0x9c22
jmp 0x9c24
jmp 0x9c26
jmp 0x9c28
jmp 0x9c2a
jmp 0x9c2c
jmp 0x9c2e
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)