// File: /workspace/github_c_makefile_star2_O0/cinemast[P]sudoku/sudoku.c
// Function: play_the_game
static
void
play_the_game (void)
{
    int ch = ' ';
    while ('q' != ch) {
        wrefresh(stdscr);
        ch = getkey();

        if (have_status) {
            clear_status();
        }
 
       switch (ch) {
            case '.':
                ch = '0';
                /* Drop thru' to digit handler */
            case '0':
                /* clear location, or add digit to board */
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9': /* clear location, or add digit to board */
                if (!IS_FIXED(INDEX(cury, curx))) {
                    num_hints = -1;
                    fillx(INDEX(cury, curx), ch - '0');
                    addch('0' == ch ? '.' : ch);
                    move_to(curx, cury);
                    if (have_hint) {
                        clear_hints();
                    }
                    req_hints = 0;
                } else {
                    beep();
                }
                break;
            case ' ':  /* move to next */
                move_next();
                break;
            case 'h':  /* move left */
            case VKEY_LEFT:
                if (0 < curx) {
                    move_to(curx - 1, cury);
                } else {
                      move_to(8, cury);
                }
                break;
            case 'j': /* move down */
            case VKEY_DOWN:
                if (cury < 8) {
                    move_to(curx, cury + 1);
                } else {
                    move_to(curx, 0);
                }
                break;
            case 'k': /* move up */
            case VKEY_UP:
                if (0 < cury) {
                    move_to(curx, cury - 1);
                } else {
                    move_to(curx, 8);
                }
                break;
            case 'l': /* move right */
            case VKEY_RIGHT:
                if (curx < 8) {
                    move_to(curx + 1, cury);
                } else {
                    move_to(0, cury);
                }
                break;
            case 'u': /* undo last move */
                if (idx_history <= 0
                    || history[idx_history - 1] & FIXED) {
                    assert(idx_history >= 0);
                    beep();
                } else {
                    int i;
                    /* Don't ignore last reference (if exists) */
                    for (i = --idx_history - 1; 0 <= i; --i) {
                        if (GET_INDEX(history[i])
                            == GET_INDEX(history[idx_history])) {
                            history[i] &= ~IGNORED;
                            break;
                        }
                    }
                    num_hints = -1;
                    if (have_hint) {
                        clear_hints();
                    }
                    req_hints = 0;
                    reapply();
                    render();
                    if (history[idx_history - 1] & FIXED) {
                        curx = cury = 8;
                        move_next();
                    } else {
                        move_to (COLUMN(GET_INDEX(history[idx_history])),
                                 ROW(GET_INDEX(history[idx_history])));
                    }
                }
                break;
            case 'c': /* clear board */
                completed = 0;
                num_hints = -1;
                if (have_hint) {
                    clear_hints();
                }
                reset();
                render();
                write_title(0);
                move_to(0, 0);
                break;
            case 'd': /* refresh screen */
                wrefresh(stdscr);
                redrawwin(stdscr);
                break;
            case 'f': /* fix squares (if possible) */
                if (0 == idx_history || 0 != (history[0] & FIXED)) {
                    break;
                }
                if (0 != fix()) {
                    set_status("There is an error - no solution possible!");
                    beep();
                }
                break;
            case 'n': /* load new board */
                if (have_hint) {
                    clear_hints();
                }
                reset();
                render();
                write_title(0);
                wrefresh(stdscr);
                load_board();
                break;
            case 'v': /* show solution */
                clear_moves();
                if (have_hint) {
                    clear_hints();
                }
                num_hints = -1;
                if (0 == solve()) {
                    completed = 1;
                } else {
                    beep_status_message("This board has no solution!");
                }
                render();
                move_to(curx, cury);
                break;

            case 'r': /* restart the same board */
                clear_moves();
                render();
                curx = 8;
                cury = 8;
                /* move_next() takes care of this... */
                move_next();
                break;

            case 'w': /* write default template */
                if (0 == opt_restrict) {
                    write_template();
                }
                break;
            case 'o': /* open saved board */
                if (0 == opt_restrict) {
                    open_board();
                }
                break;

            /* The main difficulty with saving a board is managing the
             * user interface.
             */
            case 's':
                if (0 == opt_restrict) {
                    save_board();
                }
                break;

            case 't':
                if (0 == opt_restrict) {
                    rename_board_title();
                }
                break;

            case '?': /* Request hint */
                request_hint();
                break;
            case 'q': /* quit */
                break;
            default:
                beep();
        }

        /* Check for a solution */
        if (0 == completed) {
            if (is_complete() && 0 == fix()) {
                time_t end_time;
                time( &end_time );
                end_time -= start_time;
                sprintf(statusline, "Well done"
                                    " - you've completed the puzzle!"
                                    " (%02d:%02d:%02d)",
                                    (int) (end_time/60/60),
                                    (int) (end_time/60)%60,
                                    (int) (end_time%60));
                beep();
                set_status(statusline);
                completed = 1;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x20, -0x4(%rbp)
movl $0x71, %eax
cmpl -0x4(%rbp), %eax
je 0x5744
movq 0xbea4(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2170
callq 0x8040
movl %eax, -0x4(%rbp)
cmpl $0x0, 0xd8b9(%rip)      # 0x12a04
je 0x5152
callq 0x7ce0
movl -0x4(%rbp), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x124, %eax            # imm = 0x124
ja 0x5676
movq -0x18(%rbp), %rax
leaq 0x5ef0(%rip), %rcx      # 0xb064
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x30, -0x4(%rbp)
imull $0x9, 0xd875(%rip), %eax # 0x12a00
addl 0xd86b(%rip), %eax      # 0x129fc
movslq %eax, %rcx
leaq 0xd315(%rip), %rax      # 0x124b0
movl (%rax,%rcx,4), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
jne 0x522d
movl $0xffffffff, 0xc1a6(%rip) # imm = 0xFFFFFFFF
imull $0x9, 0xd843(%rip), %edi # 0x12a00
addl 0xd839(%rip), %edi      # 0x129fc
movl -0x4(%rbp), %esi
subl $0x30, %esi
callq 0x81a0
movq 0xbe03(%rip), %rax      # 0x10fd8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x30, %eax
cmpl -0x4(%rbp), %eax
jne 0x51f0
movl $0x2e, %eax
movl %eax, -0x24(%rbp)
jmp 0x51f6
movl -0x4(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x22e0
movl 0xd7f4(%rip), %edi      # 0x129fc
movl 0xd7f2(%rip), %esi      # 0x12a00
callq 0x5d10
cmpl $0x0, 0xc13e(%rip)      # 0x11358
je 0x5221
callq 0x3190
movl $0x0, 0xc129(%rip)      # 0x11354
jmp 0x5232
callq 0x20c0
jmp 0x567b
callq 0x7f30
jmp 0x567b
xorl %eax, %eax
cmpl 0xd7b3(%rip), %eax      # 0x129fc
jge 0x5261
movl 0xd7ab(%rip), %edi      # 0x129fc
subl $0x1, %edi
movl 0xd7a6(%rip), %esi      # 0x12a00
callq 0x5d10
jmp 0x5271
movl 0xd799(%rip), %esi      # 0x12a00
movl $0x8, %edi
callq 0x5d10
jmp 0x567b
cmpl $0x8, 0xd783(%rip)      # 0x12a00
jge 0x5295
movl 0xd777(%rip), %edi      # 0x129fc
movl 0xd775(%rip), %esi      # 0x12a00
addl $0x1, %esi
callq 0x5d10
jmp 0x52a2
movl 0xd761(%rip), %edi      # 0x129fc
xorl %esi, %esi
callq 0x5d10
jmp 0x567b
xorl %eax, %eax
cmpl 0xd751(%rip), %eax      # 0x12a00
jge 0x52c7
movl 0xd745(%rip), %edi      # 0x129fc
movl 0xd743(%rip), %esi      # 0x12a00
subl $0x1, %esi
callq 0x5d10
jmp 0x52d7
movl 0xd72f(%rip), %edi      # 0x129fc
movl $0x8, %esi
callq 0x5d10
jmp 0x567b
cmpl $0x8, 0xd719(%rip)      # 0x129fc
jge 0x52fb
movl 0xd711(%rip), %edi      # 0x129fc
addl $0x1, %edi
movl 0xd70c(%rip), %esi      # 0x12a00
callq 0x5d10
jmp 0x5308
movl 0xd6ff(%rip), %esi      # 0x12a00
xorl %edi, %edi
callq 0x5d10
jmp 0x567b
cmpl $0x0, 0xd310(%rip)      # 0x12624
jle 0x5336
movl 0xd308(%rip), %eax      # 0x12624
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xd307(%rip), %rax      # 0x12630
movl (%rax,%rcx,4), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
je 0x536a
cmpl $0x0, 0xd2e7(%rip)      # 0x12624
jl 0x5341
jmp 0x5360
leaq 0x881a(%rip), %rdi      # 0xdb62
leaq 0x79a2(%rip), %rsi      # 0xccf1
movl $0xf05, %edx            # imm = 0xF05
leaq 0x8818(%rip), %rcx      # 0xdb73
callq 0x2150
callq 0x20c0
jmp 0x5486
movl 0xd2b4(%rip), %eax      # 0x12624
addl $-0x1, %eax
movl %eax, 0xd2ab(%rip)      # 0x12624
subl $0x1, %eax
movl %eax, -0x8(%rbp)
xorl %eax, %eax
cmpl -0x8(%rbp), %eax
jg 0x53dc
movslq -0x8(%rbp), %rcx
leaq 0xd29f(%rip), %rax      # 0x12630
movl (%rax,%rcx,4), %eax
andl $0x7f, %eax
movslq 0xd286(%rip), %rdx      # 0x12624
leaq 0xd28b(%rip), %rcx      # 0x12630
movl (%rcx,%rdx,4), %ecx
andl $0x7f, %ecx
cmpl %ecx, %eax
jne 0x53cf
movslq -0x8(%rbp), %rcx
leaq 0xd276(%rip), %rax      # 0x12630
movl (%rax,%rcx,4), %edx
andl $0xffbfffff, %edx       # imm = 0xFFBFFFFF
leaq 0xd266(%rip), %rax      # 0x12630
movl %edx, (%rax,%rcx,4)
jmp 0x53dc
jmp 0x53d1
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x537f
movl $0xffffffff, 0xbf76(%rip) # imm = 0xFFFFFFFF
cmpl $0x0, 0xbf6b(%rip)      # 0x11358
je 0x53f4
callq 0x3190
movl $0x0, 0xbf56(%rip)      # 0x11354
callq 0x2d20
callq 0x7d30
movl 0xd216(%rip), %eax      # 0x12624
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xd215(%rip), %rax      # 0x12630
movl (%rax,%rcx,4), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
je 0x5443
movl $0x8, 0xd5ce(%rip)      # 0x12a00
movl $0x8, 0xd5c0(%rip)      # 0x129fc
callq 0x7f30
jmp 0x5484
movslq 0xd1da(%rip), %rcx      # 0x12624
leaq 0xd1df(%rip), %rax      # 0x12630
movl (%rax,%rcx,4), %eax
andl $0x7f, %eax
movl $0x9, %ecx
cltd
idivl %ecx
movl %edx, %edi
movslq 0xd1bc(%rip), %rcx      # 0x12624
leaq 0xd1c1(%rip), %rax      # 0x12630
movl (%rax,%rcx,4), %eax
andl $0x7f, %eax
movl $0x9, %ecx
cltd
idivl %ecx
movl %eax, %esi
callq 0x5d10
jmp 0x5486
jmp 0x567b
movl $0x0, 0xd85b(%rip)      # 0x12cf0
movl $0xffffffff, 0xbebd(%rip) # imm = 0xFFFFFFFF
cmpl $0x0, 0xbeb2(%rip)      # 0x11358
je 0x54ad
callq 0x3190
callq 0x62e0
callq 0x7d30
xorl %eax, %eax
movl %eax, %edi
callq 0x74b0
xorl %esi, %esi
movl %esi, %edi
callq 0x5d10
jmp 0x567b
movq 0xbb03(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2170
movq 0xbaf4(%rip), %rax      # 0x10fd8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
movq 0xbae4(%rip), %rcx      # 0x10fd8
cmpq (%rcx), %rax
je 0x550f
movq 0xbad8(%rip), %rax      # 0x10fd8
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5519
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x34(%rbp)
jmp 0x5519
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %edx
xorl %esi, %esi
callq 0x2130
jmp 0x567b
xorl %eax, %eax
cmpl 0xd0f0(%rip), %eax      # 0x12624
je 0x5548
movl 0xd0f4(%rip), %ecx      # 0x12630
andl $0x100000, %ecx         # imm = 0x100000
xorl %eax, %eax
cmpl %ecx, %eax
je 0x554d
jmp 0x567b
callq 0x8280
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x556b
leaq 0x862b(%rip), %rdi      # 0xdb8c
callq 0x32f0
callq 0x20c0
jmp 0x567b
cmpl $0x0, 0xbde1(%rip)      # 0x11358
je 0x557e
callq 0x3190
callq 0x62e0
callq 0x7d30
xorl %eax, %eax
movl %eax, %edi
callq 0x74b0
movq 0xba40(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2170
callq 0x4fa0
jmp 0x567b
callq 0x6ab0
cmpl $0x0, 0xbda2(%rip)      # 0x11358
je 0x55bd
callq 0x3190
movl $0xffffffff, 0xbd95(%rip) # imm = 0xFFFFFFFF
callq 0x6860
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x55e0
movl $0x1, 0xd712(%rip)      # 0x12cf0
jmp 0x55ec
leaq 0x85cf(%rip), %rdi      # 0xdbb6
callq 0x8350
callq 0x7d30
movl 0xd405(%rip), %edi      # 0x129fc
movl 0xd403(%rip), %esi      # 0x12a00
callq 0x5d10
jmp 0x567b
callq 0x6ab0
callq 0x7d30
movl $0x8, 0xd3e4(%rip)      # 0x129fc
movl $0x8, 0xd3de(%rip)      # 0x12a00
callq 0x7f30
jmp 0x567b
xorl %eax, %eax
cmpl 0xcdbb(%rip), %eax      # 0x123ec
jne 0x5638
callq 0x8370
jmp 0x567b
xorl %eax, %eax
cmpl 0xcdaa(%rip), %eax      # 0x123ec
jne 0x5649
callq 0x8420
jmp 0x567b
xorl %eax, %eax
cmpl 0xcd99(%rip), %eax      # 0x123ec
jne 0x565a
callq 0x8500
jmp 0x567b
xorl %eax, %eax
cmpl 0xcd88(%rip), %eax      # 0x123ec
jne 0x566b
callq 0x8640
jmp 0x567b
callq 0x2e80
jmp 0x567b
jmp 0x567b
callq 0x20c0
xorl %eax, %eax
cmpl 0xd66d(%rip), %eax      # 0x12cf0
jne 0x573f
callq 0x7fd0
cmpl $0x0, %eax
je 0x573d
callq 0x8280
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x573d
leaq -0x10(%rbp), %rdi
callq 0x2230
movq 0xd630(%rip), %rcx      # 0x12ce8
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movl $0x3c, %ecx
cqto
idivq %rcx
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movl $0x3c, %ecx
cltd
idivl %ecx
movl %edx, %ecx
movq -0x10(%rbp), %rax
movl $0x3c, %esi
cqto
idivq %rsi
movq %rdx, %rax
movl -0x38(%rbp), %edx
movl %eax, %r8d
leaq 0xbc5c(%rip), %rdi      # 0x11370
leaq 0x84b7(%rip), %rsi      # 0xdbd2
movb $0x0, %al
callq 0x2300
callq 0x20c0
leaq 0xbc42(%rip), %rdi      # 0x11370
callq 0x32f0
movl $0x1, 0xd5b3(%rip)      # 0x12cf0
jmp 0x573f
jmp 0x511f
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)