// File: /workspace/github_c_makefile_star2_O0/cinemast[P]sudoku/sudoku.c
// Function: findhints
int
findhints (void)
{
    int i, n, mutated = 0;

    n = findmoves();
    if (n < 2) {
        /* Each call to pairs() can mutate the board state, making the
         * hints very, very cryptic... so later undo the mutations.
         */
        for (i = 0; i < 9; ++i) {
            count_set_digits(i, idx_row);
            pairs(i, idx_row);

            count_set_digits(i, idx_column);
            pairs(i, idx_column);

            count_set_digits(i, idx_block);
            pairs(i, idx_block);
        }
        mutated = 1;
        n = findmoves();
    }
    if (n < 2) {
        for (i = 0; i < 9; ++i) {
            block(i);
            common(i);
        }
        mutated = 1;
        n = findmoves();
    }

    /* Sort the possible moves, and allow just one hint per square */
    if (0 < n) {
        int i, j;

        qsort(possible, n, sizeof(int), cmpindex);
        for (i = 0, j = 1; j < n; ++j) {
            if (GET_INDEX(possible[i]) == GET_INDEX(possible[j])) {
                /* Let the user make mistakes - do not assume the
                 * board is in a consistent state.
                 */
                if (GET_DIGIT(possible[i]) == GET_DIGIT(possible[j])) {
                    possible[i] |= possible[j];
                }
            } else {
                i = j;
            }
        }
        n = i + 1;
    }

    /* Undo any mutations of the board state */
    if (mutated) {
        reapply();
    }
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0xc(%rbp)
callq 0x2660
movl %eax, -0x8(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x2522
movl $0x0, -0x4(%rbp)
cmpl $0x9, -0x4(%rbp)
jge 0x2513
movl -0x4(%rbp), %edi
leaq 0x2c8(%rip), %rsi       # 0x2780
callq 0x2710
movl -0x4(%rbp), %edi
leaq 0x2b9(%rip), %rsi       # 0x2780
callq 0x27a0
movl -0x4(%rbp), %edi
leaq 0x49a(%rip), %rsi       # 0x2970
callq 0x2710
movl -0x4(%rbp), %edi
leaq 0x48b(%rip), %rsi       # 0x2970
callq 0x27a0
movl -0x4(%rbp), %edi
leaq 0x49c(%rip), %rsi       # 0x2990
callq 0x2710
movl -0x4(%rbp), %edi
leaq 0x48d(%rip), %rsi       # 0x2990
callq 0x27a0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x24a8
movl $0x1, -0xc(%rbp)
callq 0x2660
movl %eax, -0x8(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x255f
movl $0x0, -0x4(%rbp)
cmpl $0x9, -0x4(%rbp)
jge 0x2550
movl -0x4(%rbp), %edi
callq 0x29f0
movl -0x4(%rbp), %edi
callq 0x2b70
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x252f
movl $0x1, -0xc(%rbp)
callq 0x2660
movl %eax, -0x8(%rbp)
xorl %eax, %eax
cmpl -0x8(%rbp), %eax
jge 0x263e
movslq -0x8(%rbp), %rsi
leaq 0xec9b(%rip), %rdi      # 0x11210
movl $0x4, %edx
leaq 0x76f(%rip), %rcx       # 0x2cf0
callq 0x2060
movl $0x0, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2635
movslq -0x10(%rbp), %rcx
leaq 0xec65(%rip), %rax      # 0x11210
movl (%rax,%rcx,4), %eax
andl $0x7f, %eax
movslq -0x14(%rbp), %rdx
leaq 0xec54(%rip), %rcx      # 0x11210
movl (%rcx,%rdx,4), %ecx
andl $0x7f, %ecx
cmpl %ecx, %eax
jne 0x261f
movslq -0x10(%rbp), %rcx
leaq 0xec3f(%rip), %rax      # 0x11210
movl (%rax,%rcx,4), %eax
andl $0xf0000, %eax          # imm = 0xF0000
sarl $0x10, %eax
movslq -0x14(%rbp), %rdx
leaq 0xec29(%rip), %rcx      # 0x11210
movl (%rcx,%rdx,4), %ecx
andl $0xf0000, %ecx          # imm = 0xF0000
sarl $0x10, %ecx
cmpl %ecx, %eax
jne 0x261d
movslq -0x14(%rbp), %rcx
leaq 0xec0e(%rip), %rax      # 0x11210
movl (%rax,%rcx,4), %edx
movslq -0x10(%rbp), %rcx
leaq 0xec00(%rip), %rax      # 0x11210
orl (%rax,%rcx,4), %edx
leaq 0xebf6(%rip), %rax      # 0x11210
movl %edx, (%rax,%rcx,4)
jmp 0x2625
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x2627
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2594
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x2649
callq 0x2d20
movl -0x8(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)