// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
callq 0x2d6c
cmpl $0x1, %eax
jg 0x2cbf
leaq 0xce25(%rip), %rax      # 0xf4a4
movq %rax, 0x50(%rsp)
leaq 0xce1d(%rip), %rax      # 0xf4a8
movq %rax, 0x48(%rsp)
leaq 0xce09(%rip), %rdx      # 0xf4a0
leaq 0xce26(%rip), %rax      # 0xf4c4
movq %rax, 0x40(%rsp)
leaq 0xce3e(%rip), %rax      # 0xf4e8
movq %rax, 0x38(%rsp)
xorl %ecx, %ecx
movl $0x1, %esi
movl $0x2, %edi
movl $0xaaaaaaab, %ebx       # imm = 0xAAAAAAAB
xorps %xmm0, %xmm0
leaq 0xcda6(%rip), %r11      # 0xf470
movq %rdx, %r12
movq %rdx, %r13
xorl %r14d, %r14d
movl %r14d, %eax
imulq %rbx, %rax
shrq $0x21, %rax
addl %eax, %eax
leal (%rax,%rax,8), %eax
movq %rdi, 0x58(%rsp)
leal (%rdi,%rax), %r9d
movq %rsi, 0x60(%rsp)
addl %eax, %esi
movl %esi, 0x2c(%rsp)
movq %rcx, 0x68(%rsp)
addl %ecx, %eax
movq %rax, 0x70(%rsp)
movaps %xmm0, 0xcd76(%rip)     # 0xf480
movaps %xmm0, 0xcd5f(%rip)     # 0xf470
movl $0x0, 0xcd75(%rip)      # 0xf490
leaq (%r14,%r14,8), %r15
xorl %ecx, %ecx
movslq %ecx, %rax
addq %r15, %rax
movl (%rdx,%rax,4), %esi
xorl %edi, %edi
movl $0x7, %r8d
xorl %r10d, %r10d
btl %r8d, %esi
jae 0x2740
incl %r10d
jmp 0x2744
incl (%rdi,%r11)
addq $0x4, %rdi
incl %r8d
cmpq $0x24, %rdi
jne 0x2735
leaq 0xce98(%rip), %rax      # 0xf5f0
movl %r10d, (%rax,%rcx,4)
incq %rcx
cmpq $0x9, %rcx
jne 0x2721
movq %r14, 0x20(%rsp)
movl $0x1, %eax
movq %rax, (%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
xorl %r8d, %r8d
leaq 0xce64(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%r8,4)
jne 0x2858
leaq 0x1(%r8), %rax
movq %rax, 0x8(%rsp)
movslq %r8d, %r11
addq %r15, %r11
movq 0x10(%rsp), %r10
movq %r8, %rax
xorl %ebp, %ebp
movq (%rsp), %rcx
movq %r11, 0x18(%rsp)
movl (%rdx,%r11,4), %esi
movslq %ecx, %r14
addq %r15, %r14
movl (%rdx,%r14,4), %r14d
xorl %esi, %r14d
testl $0xff80, %r14d          # imm = 0xFF80
jne 0x2841
movq %r9, %r11
notl %esi
andl $0xff80, %esi           # imm = 0xFF80
testq %r8, %r8
je 0x27f3
xorl %r14d, %r14d
orl %esi, (%r13,%r14,4)
incq %r14
cmpq %r14, %r8
jne 0x27e6
movq %r15, %r9
cmpq %rcx, 0x8(%rsp)
jae 0x280c
xorl %r14d, %r14d
orl %esi, (%rdi,%r14,4)
incq %r14
cmpq %r14, %rbp
jne 0x2800
movq %r10, %r14
movq %rax, %r15
cmpq $0x7, %rcx
ja 0x2828
orl %esi, (%r14)
incq %r15
addq $0x4, %r14
cmpq $0x7, %r15
jb 0x2818
leaq 0xcdc1(%rip), %rsi      # 0xf5f0
movl $0xffffffff, (%rsi,%rcx,4) # imm = 0xFFFFFFFF
movq %r9, %r15
movq %r11, %r9
movq 0x18(%rsp), %r11
incq %rcx
incq %rbp
incq %rax
addq $0x4, %r10
cmpq $0x9, %rcx
jne 0x27b9
incq %r8
incq (%rsp)
addq $0x4, %rdi
addq $0x4, 0x10(%rsp)
cmpq $0x8, %r8
jne 0x2785
movaps %xmm0, 0xcc06(%rip)     # 0xf480
movaps %xmm0, 0xcbef(%rip)     # 0xf470
movl $0x0, 0xcc05(%rip)      # 0xf490
xorl %eax, %eax
leaq 0xcbdc(%rip), %r10      # 0xf470
movq 0x20(%rsp), %r11
movq %rax, %rcx
movabsq $0x900000000, %rsi      # imm = 0x900000000
imulq %rsi, %rcx
sarq $0x20, %rcx
addq %r11, %rcx
movl (%rdx,%rcx,4), %ecx
xorl %esi, %esi
movl $0x7, %edi
xorl %r8d, %r8d
btl %edi, %ecx
jae 0x28c8
incl %r8d
jmp 0x28cc
incl (%rsi,%r10)
addq $0x4, %rsi
incl %edi
cmpq $0x24, %rsi
jne 0x28be
leaq 0xcd11(%rip), %rcx      # 0xf5f0
movl %r8d, (%rcx,%rax,4)
incq %rax
cmpq $0x9, %rax
jne 0x2899
movl $0x1, %eax
movq %rax, (%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0xccdc(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%rsi,4)
jne 0x29f6
leaq 0x1(%rsi), %rax
movq %rax, 0x18(%rsp)
movq %rsi, %r11
movabsq $0x900000000, %rax      # imm = 0x900000000
imulq %rax, %r11
sarq $0x20, %r11
addq 0x20(%rsp), %r11
movq 0x10(%rsp), %r10
movq %rsi, %r8
xorl %ebp, %ebp
movq (%rsp), %rax
movl (%rdx,%r11,4), %ecx
movq %rax, %r14
movabsq $0x900000000, %r15      # imm = 0x900000000
imulq %r15, %r14
sarq $0x20, %r14
addq 0x20(%rsp), %r14
movl (%rdx,%r14,4), %r14d
xorl %ecx, %r14d
testl $0xff80, %r14d          # imm = 0xFF80
jne 0x29df
notl %ecx
andl $0xff80, %ecx           # imm = 0xFF80
testq %rsi, %rsi
je 0x299a
xorl %r14d, %r14d
orl %ecx, (%r12,%r14)
addq $0x24, %r14
cmpq %r14, %rdi
jne 0x298d
movq %rbp, %r14
movq 0x8(%rsp), %r15
cmpq %rax, 0x18(%rsp)
jae 0x29b5
orl %ecx, (%r15)
addq $0x24, %r15
decq %r14
jne 0x29a9
movq %r10, %r14
movq %r8, %r15
cmpq $0x7, %rax
ja 0x29d1
orl %ecx, (%r14)
incq %r15
addq $0x24, %r14
cmpq $0x7, %r15
jb 0x29c1
leaq 0xcc18(%rip), %rcx      # 0xf5f0
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
incq %rax
incq %rbp
incq %r8
addq $0x24, %r10
cmpq $0x9, %rax
jne 0x294f
incq %rsi
incq (%rsp)
addq $0x24, %rdi
addq $0x24, 0x8(%rsp)
addq $0x24, 0x10(%rsp)
cmpq $0x8, %rsi
jne 0x290d
movaps %xmm0, 0xca62(%rip)     # 0xf480
movaps %xmm0, 0xca4b(%rip)     # 0xf470
movl $0x0, 0xca61(%rip)      # 0xf490
movq 0x20(%rsp), %rcx
movl %ecx, %eax
imulq %rbx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %esi
movl %ecx, %eax
movq %rsi, (%rsp)
subl %esi, %eax
leal (%rax,%rax,2), %eax
movl %eax, 0x8(%rsp)
xorl %esi, %esi
leaq 0xca17(%rip), %r10      # 0xf470
movslq %esi, %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdi
shrq $0x3f, %rdi
shrq $0x20, %rcx
addl %edi, %ecx
movq (%rsp), %rdi
addl %ecx, %edi
leal (%rdi,%rdi,8), %edi
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
addl 0x8(%rsp), %eax
addl %edi, %eax
cltq
movl (%rdx,%rax,4), %edi
xorl %r8d, %r8d
movl $0x7, %eax
xorl %ecx, %ecx
btl %eax, %edi
jae 0x2a9c
incl %ecx
jmp 0x2aa0
incl (%r8,%r10)
addq $0x4, %r8
incl %eax
cmpq $0x24, %r8
jne 0x2a93
leaq 0xcb3d(%rip), %rax      # 0xf5f0
movl %ecx, (%rax,%rsi,4)
incq %rsi
cmpq $0x9, %rsi
jne 0x2a59
movl $0x1, %eax
movq %rax, 0x30(%rsp)
movl $0x2, 0x28(%rsp)
xorl %r8d, %r8d
movq (%rsp), %r10
leaq 0xcb11(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%r8,4)
jne 0x2c46
leaq 0x1(%r8), %rax
movq %rax, 0x10(%rsp)
movslq %r8d, %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rcx
addl %esi, %ecx
leal (%rcx,%r10), %esi
leal (%rsi,%rsi,8), %esi
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
addl 0x8(%rsp), %eax
addl %esi, %eax
cltq
movq %rax, 0x18(%rsp)
movl 0x28(%rsp), %edi
movl %r8d, %r14d
xorl %ebp, %ebp
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rax
movl (%rdx,%rax,4), %r11d
movslq %esi, %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %r15
shrq $0x3f, %r15
shrq $0x20, %rcx
addl %r15d, %ecx
leal (%rcx,%r10), %r15d
leal (%r15,%r15,8), %r15d
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
addl 0x8(%rsp), %eax
addl %r15d, %eax
cltq
movl (%rdx,%rax,4), %eax
xorl %r11d, %eax
testl $0xff80, %eax           # imm = 0xFF80
jne 0x2c31
notl %r11d
andl $0xff80, %r11d          # imm = 0xFF80
testq %r8, %r8
je 0x2bb3
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %r15d
imulq %rbx, %r15
shrq $0x21, %r15
leal (%r15,%r15,2), %r15d
leal (%rax,%r15,2), %r15d
movslq %r15d, %r15
orl %r11d, (%rdx,%r15,4)
incq %rcx
incl %eax
cmpq %rcx, %r8
jne 0x2b8f
cmpq %rsi, 0x10(%rsp)
jae 0x2bec
xorl %r15d, %r15d
movq 0x30(%rsp), %rax
movl 0x2c(%rsp), %ecx
movl %eax, %r10d
imulq %rbx, %r10
shrq $0x21, %r10
leal (%r10,%r10,2), %r10d
leal (%rcx,%r10,2), %r10d
movslq %r10d, %r10
orl %r11d, (%rdx,%r10,4)
incl %ecx
incl %eax
incq %r15
cmpq %r15, %rbp
jne 0x2bc6
movl %edi, %r15d
movl %r14d, %eax
cmpq $0x7, %rsi
ja 0x2c1f
movl %r15d, %ecx
imulq %rbx, %rcx
shrq $0x21, %rcx
leal (%rcx,%rcx,2), %ecx
leal (%r9,%rax), %r10d
leal (%r10,%rcx,2), %ecx
movslq %ecx, %rcx
orl %r11d, (%rdx,%rcx,4)
incl %eax
incl %r15d
cmpl $0x7, %eax
jb 0x2bf8
leaq 0xc9ca(%rip), %rax      # 0xf5f0
movl $0xffffffff, (%rax,%rsi,4) # imm = 0xFFFFFFFF
movq (%rsp), %r10
incq %rsi
incq %rbp
incl %r14d
incl %edi
cmpq $0x9, %rsi
jne 0x2b31
incq %r8
incq 0x30(%rsp)
incl 0x2c(%rsp)
incl 0x28(%rsp)
cmpq $0x8, %r8
jne 0x2ad8
movq 0x20(%rsp), %r14
incq %r14
addq $0x24, %r13
addq $0x24, 0x50(%rsp)
addq $0x24, 0x48(%rsp)
addq $0x4, %r12
addq $0x4, 0x40(%rsp)
addq $0x4, 0x38(%rsp)
movq 0x68(%rsp), %rcx
addl $0x3, %ecx
movq 0x60(%rsp), %rsi
addl $0x3, %esi
movq 0x58(%rsp), %rdi
addl $0x3, %edi
cmpq $0x9, %r14
leaq 0xc7c5(%rip), %r11      # 0xf470
jne 0x26d3
movl $0x1, %ebp
callq 0x2d6c
movl %eax, %ebx
jmp 0x2cc3
movl %eax, %ebx
xorl %ebp, %ebp
cmpl $0x1, %ebx
jg 0x2ceb
xorl %ebx, %ebx
movl %ebx, %edi
callq 0x2ece
movl %ebx, %edi
callq 0x3080
incl %ebx
cmpl $0x9, %ebx
jne 0x2cca
movl $0x1, %ebp
callq 0x2d6c
movl %eax, %ebx
testl %ebx, %ebx
jle 0x2d52
movl %ebx, %r14d
leaq 0xb507(%rip), %r15      # 0xe200
leaq 0x5d5(%rip), %rcx       # 0x32d5
movl $0x4, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2070
cmpl $0x1, %ebx
movl $0x1, %ebx
je 0x2d52
xorl %ebx, %ebx
movl $0x1, %eax
movslq %ebx, %rcx
movl (%r15,%rcx,4), %edx
movl (%r15,%rax,4), %esi
movl %esi, %edi
xorl %edx, %edi
testb $0x7f, %dil
je 0x2d3a
movl %eax, %ebx
jmp 0x2d48
testl $0xf0000, %edi          # imm = 0xF0000
jne 0x2d48
orl %edx, %esi
movl %esi, (%r15,%rcx,4)
incq %rax
cmpq %rax, %r14
jne 0x2d21
incl %ebx
testl %ebp, %ebp
je 0x2d5b
callq 0x32e2
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq