// File: /workspace/github_c_makefile_star2_O3/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 $0x88, %rsp
callq 0x2dc5
movl %eax, %ebx
cmpl $0x1, %eax
jle 0x2690
movl %ebx, %eax
jmp 0x2d45
movl %ebx, 0x34(%rsp)
leaq 0xce09(%rip), %rax      # 0xf4a4
movq %rax, 0x60(%rsp)
leaq 0xce01(%rip), %rax      # 0xf4a8
movq %rax, 0x58(%rsp)
leaq 0xcded(%rip), %rdx      # 0xf4a0
leaq 0xce0a(%rip), %rax      # 0xf4c4
movq %rax, 0x50(%rsp)
leaq 0xce22(%rip), %rax      # 0xf4e8
movq %rax, 0x48(%rsp)
xorl %ecx, %ecx
movl $0x1, %esi
movl $0x2, %edi
movl $0xaaaaaaab, %r14d      # imm = 0xAAAAAAAB
xorps %xmm0, %xmm0
leaq 0xcd89(%rip), %r11      # 0xf470
movq %rdx, %r13
movq %rdx, %rbp
xorl %ebx, %ebx
movl %ebx, %eax
imulq %r14, %rax
shrq $0x21, %rax
addl %eax, %eax
leal (%rax,%rax,8), %eax
movq %rdi, 0x68(%rsp)
leal (%rdi,%rax), %r9d
movq %rsi, 0x70(%rsp)
addl %eax, %esi
movl %esi, 0x3c(%rsp)
movq %rcx, 0x78(%rsp)
addl %ecx, %eax
movq %rax, 0x80(%rsp)
movaps %xmm0, 0xcd58(%rip)     # 0xf480
movaps %xmm0, 0xcd41(%rip)     # 0xf470
movl $0x0, 0xcd57(%rip)      # 0xf490
leaq (%rbx,%rbx,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 0x275e
incl %r10d
jmp 0x2762
incl (%rdi,%r11)
addq $0x4, %rdi
incl %r8d
cmpq $0x24, %rdi
jne 0x2753
leaq 0xce7a(%rip), %rax      # 0xf5f0
movl %r10d, (%rax,%rcx,4)
incq %rcx
cmpq $0x9, %rcx
jne 0x273f
movq %rbx, 0x28(%rsp)
movl $0x1, %eax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
xorl %r8d, %r8d
leaq 0x1(%r8), %rax
movq %rax, 0x10(%rsp)
leaq 0xce3c(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%r8,4)
jne 0x2871
movslq %r8d, %r11
addq %r15, %r11
movq 0x8(%rsp), %r10
movq %r8, %rax
xorl %r12d, %r12d
movq 0x18(%rsp), %rcx
movq %r11, 0x20(%rsp)
movl (%rdx,%r11,4), %esi
movslq %ecx, %rbx
addq %r15, %rbx
movl (%rdx,%rbx,4), %ebx
xorl %esi, %ebx
testl $0xff80, %ebx           # imm = 0xFF80
jne 0x285a
movq %r9, %r11
notl %esi
andl $0xff80, %esi           # imm = 0xFF80
testq %r8, %r8
je 0x280f
xorl %ebx, %ebx
orl %esi, (%rbp,%rbx,4)
incq %rbx
cmpq %rbx, %r8
jne 0x2803
movq %r15, %r9
cmpq %rcx, 0x10(%rsp)
jae 0x2826
xorl %ebx, %ebx
orl %esi, (%rdi,%rbx,4)
incq %rbx
cmpq %rbx, %r12
jne 0x281b
movq %r10, %rbx
movq %rax, %r15
cmpq $0x7, %rcx
ja 0x2841
orl %esi, (%rbx)
incq %r15
addq $0x4, %rbx
cmpq $0x7, %r15
jb 0x2832
leaq 0xcda8(%rip), %rsi      # 0xf5f0
movl $0xffffffff, (%rsi,%rcx,4) # imm = 0xFFFFFFFF
movq %r9, %r15
movq %r11, %r9
movq 0x20(%rsp), %r11
incq %rcx
incq %r12
incq %rax
addq $0x4, %r10
cmpq $0x9, %rcx
jne 0x27da
incq 0x18(%rsp)
addq $0x4, %rdi
addq $0x4, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %r8
cmpq $0x8, %rax
jne 0x27a4
movaps %xmm0, 0xcbe7(%rip)     # 0xf480
movaps %xmm0, 0xcbd0(%rip)     # 0xf470
movl $0x0, 0xcbe6(%rip)      # 0xf490
xorl %eax, %eax
leaq 0xcbbd(%rip), %r10      # 0xf470
movq 0x28(%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 0x28e7
incl %r8d
jmp 0x28eb
incl (%rsi,%r10)
addq $0x4, %rsi
incl %edi
cmpq $0x24, %rsi
jne 0x28dd
leaq 0xccf2(%rip), %rcx      # 0xf5f0
movl %r8d, (%rcx,%rax,4)
incq %rax
cmpq $0x9, %rax
jne 0x28b8
movl $0x1, %eax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0x1(%rsi), %rax
movq %rax, 0x10(%rsp)
leaq 0xccb3(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%rsi,4)
jne 0x2a14
movq %rsi, %r11
movabsq $0x900000000, %rax      # imm = 0x900000000
imulq %rax, %r11
sarq $0x20, %r11
addq 0x28(%rsp), %r11
movq 0x8(%rsp), %r8
movq %rsi, %r10
xorl %r12d, %r12d
movq 0x18(%rsp), %rax
movl (%rdx,%r11,4), %ecx
movq %rax, %rbx
movabsq $0x900000000, %r15      # imm = 0x900000000
imulq %r15, %rbx
sarq $0x20, %rbx
addq 0x28(%rsp), %rbx
movl (%rdx,%rbx,4), %ebx
xorl %ecx, %ebx
testl $0xff80, %ebx           # imm = 0xFF80
jne 0x29fd
notl %ecx
andl $0xff80, %ecx           # imm = 0xFF80
testq %rsi, %rsi
je 0x29b9
xorl %ebx, %ebx
orl %ecx, (%r13,%rbx)
addq $0x24, %rbx
cmpq %rbx, %rdi
jne 0x29ab
movq %r12, %rbx
movq 0x20(%rsp), %r15
cmpq %rax, 0x10(%rsp)
jae 0x29d4
orl %ecx, (%r15)
addq $0x24, %r15
decq %rbx
jne 0x29c8
movq %r8, %rbx
movq %r10, %r15
cmpq $0x7, %rax
ja 0x29ef
orl %ecx, (%rbx)
incq %r15
addq $0x24, %rbx
cmpq $0x7, %r15
jb 0x29e0
leaq 0xcbfa(%rip), %rcx      # 0xf5f0
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
incq %rax
incq %r12
incq %r10
addq $0x24, %r8
cmpq $0x9, %rax
jne 0x2971
incq 0x18(%rsp)
addq $0x24, %rdi
addq $0x24, 0x20(%rsp)
addq $0x24, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %rsi
cmpq $0x8, %rax
jne 0x292d
movaps %xmm0, 0xca3e(%rip)     # 0xf480
movaps %xmm0, 0xca27(%rip)     # 0xf470
movl $0x0, 0xca3d(%rip)      # 0xf490
movq 0x28(%rsp), %rcx
movl %ecx, %eax
imulq %r14, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %esi
movl %ecx, %eax
movq %rsi, 0x8(%rsp)
subl %esi, %eax
leal (%rax,%rax,2), %eax
movl %eax, 0x10(%rsp)
xorl %esi, %esi
leaq 0xc9f2(%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 0x8(%rsp), %rdi
addl %ecx, %edi
leal (%rdi,%rdi,8), %edi
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
addl 0x10(%rsp), %eax
addl %edi, %eax
cltq
movl (%rdx,%rax,4), %edi
xorl %r8d, %r8d
movl $0x7, %eax
xorl %ecx, %ecx
btl %eax, %edi
jae 0x2ac2
incl %ecx
jmp 0x2ac6
incl (%r8,%r10)
addq $0x4, %r8
incl %eax
cmpq $0x24, %r8
jne 0x2ab9
leaq 0xcb17(%rip), %rax      # 0xf5f0
movl %ecx, (%rax,%rsi,4)
incq %rsi
cmpq $0x9, %rsi
jne 0x2a7e
movl $0x1, %eax
movq %rax, 0x40(%rsp)
movl $0x2, 0x38(%rsp)
xorl %r8d, %r8d
movq 0x8(%rsp), %r10
leaq 0x1(%r8), %rax
movq %rax, 0x18(%rsp)
leaq 0xcae1(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%r8,4)
jne 0x2c71
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 0x10(%rsp), %eax
addl %esi, %eax
cltq
movq %rax, 0x20(%rsp)
movl 0x38(%rsp), %edi
movl %r8d, %r15d
xorl %ebx, %ebx
movq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rax
movl (%rdx,%rax,4), %r12d
movslq %esi, %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %r11
shrq $0x3f, %r11
shrq $0x20, %rcx
addl %r11d, %ecx
leal (%rcx,%r10), %r11d
leal (%r11,%r11,8), %r11d
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
addl 0x10(%rsp), %eax
addl %r11d, %eax
cltq
movl (%rdx,%rax,4), %eax
xorl %r12d, %eax
testl $0xff80, %eax           # imm = 0xFF80
jne 0x2c5c
notl %r12d
andl $0xff80, %r12d          # imm = 0xFF80
testq %r8, %r8
je 0x2bdd
movq 0x80(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %r11d
imulq %r14, %r11
shrq $0x21, %r11
leal (%r11,%r11,2), %r11d
leal (%rax,%r11,2), %r11d
movslq %r11d, %r11
orl %r12d, (%rdx,%r11,4)
incq %rcx
incl %eax
cmpq %rcx, %r8
jne 0x2bb9
cmpq %rsi, 0x18(%rsp)
jae 0x2c16
xorl %r11d, %r11d
movq 0x40(%rsp), %rax
movl 0x3c(%rsp), %ecx
movl %eax, %r10d
imulq %r14, %r10
shrq $0x21, %r10
leal (%r10,%r10,2), %r10d
leal (%rcx,%r10,2), %r10d
movslq %r10d, %r10
orl %r12d, (%rdx,%r10,4)
incl %ecx
incl %eax
incq %r11
cmpq %r11, %rbx
jne 0x2bf0
movl %edi, %r11d
movl %r15d, %eax
cmpq $0x7, %rsi
ja 0x2c49
movl %r11d, %ecx
imulq %r14, %rcx
shrq $0x21, %rcx
leal (%rcx,%rcx,2), %ecx
leal (%r9,%rax), %r10d
leal (%r10,%rcx,2), %ecx
movslq %ecx, %rcx
orl %r12d, (%rdx,%rcx,4)
incl %eax
incl %r11d
cmpl $0x7, %eax
jb 0x2c22
leaq 0xc9a0(%rip), %rax      # 0xf5f0
movl $0xffffffff, (%rax,%rsi,4) # imm = 0xFFFFFFFF
movq 0x8(%rsp), %r10
incq %rsi
incq %rbx
incl %r15d
incl %edi
cmpq $0x9, %rsi
jne 0x2b58
incq 0x40(%rsp)
incl 0x3c(%rsp)
incl 0x38(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %r8
cmpq $0x8, %rax
jne 0x2aff
movq 0x28(%rsp), %rbx
incq %rbx
addq $0x24, %rbp
addq $0x24, 0x60(%rsp)
addq $0x24, 0x58(%rsp)
addq $0x4, %r13
addq $0x4, 0x50(%rsp)
addq $0x4, 0x48(%rsp)
movq 0x78(%rsp), %rcx
addl $0x3, %ecx
movq 0x70(%rsp), %rsi
addl $0x3, %esi
movq 0x68(%rsp), %rdi
addl $0x3, %edi
cmpq $0x9, %rbx
leaq 0xc795(%rip), %r11      # 0xf470
jne 0x26ef
callq 0x2dc5
cmpl $0x1, %eax
jg 0x2d41
xorl %ebp, %ebp
movl %ebp, %edi
callq 0x2f27
movl %ebp, %edi
callq 0x3069
incl %ebp
cmpl $0x9, %ebp
jne 0x2ced
callq 0x2dc5
movl %eax, %r15d
testl %eax, %eax
movl 0x34(%rsp), %ebx
jle 0x2dc0
movl %r15d, %r14d
leaq 0xb4e0(%rip), %rdi      # 0xe200
leaq 0x58c(%rip), %rcx       # 0x32b3
movl $0x4, %edx
movq %r14, %rsi
callq 0x2070
movl $0x1, %ebp
cmpl $0x1, %r15d
jne 0x2d63
jmp 0x2da2
movl 0x34(%rsp), %ebx
movl %eax, %r14d
leaq 0xb4b1(%rip), %rdi      # 0xe200
leaq 0x55d(%rip), %rcx       # 0x32b3
movl $0x4, %edx
movq %r14, %rsi
callq 0x2070
xorl %ebp, %ebp
movl $0x1, %eax
leaq 0xb48f(%rip), %rcx      # 0xe200
movslq %ebp, %rdx
movl (%rcx,%rdx,4), %esi
movl (%rcx,%rax,4), %edi
movl %edi, %r8d
xorl %esi, %r8d
testb $0x7f, %r8b
je 0x2d8a
movl %eax, %ebp
jmp 0x2d98
testl $0xf0000, %r8d          # imm = 0xF0000
jne 0x2d98
orl %esi, %edi
movl %edi, (%rcx,%rdx,4)
incq %rax
cmpq %rax, %r14
jne 0x2d71
incl %ebp
cmpl $0x1, %ebx
jg 0x2dac
callq 0x32c0
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, %ebp
jmp 0x2da7