// File: /workspace/github_c_makefile_star2_O0/cinemast[P]sudoku/sudoku.c
// Function: singles
static
int
singles (int el, int (*idx_fn)(int, int), int hintcode)
{
    int i;

    count_set_digits(el, idx_fn);

    for (i = 0; i < 9; ++i) {
        int c = i;
        if (0 == counts[c]) {
            /* No allowed position left for digit 'c+1' in the element. */
            int nd = 0;
            int j;
            for (j = 0; j < 9; ++j) {
                if (DIGIT((*idx_fn)(el, j)) == c + 1) {
                    /* The element already contains this digit */
                    ++nd;
                    break;
                }
            }
            if (nd == 0) {
                /* Contradiction found, this element can't have this  digit. */
                break;
            }
        }
        if (1 == counts[c] &&
            idx_possible < 81) {
            /* One allowed position left for digit 'c+1' in the element. */
            int j;
            for (j = 0; j < 9; ++j) {
                /* Let's find the place. */
                int idx = (*idx_fn)(el, j);
                if (!DISALLOWED(idx, c + 1)) {
                    possible[idx_possible++] = SET_INDEX(idx)
                                               | SET_DIGIT(c + 1)
                                               | hintcode;
                    /* We have found that single position, safe to break. */
                    break;
                }
            }
        }
        if (8 == digits[i] &&
            idx_possible < 81) {
            /* 8 digits are masked at this position - just one remaining */
            int idx = (*idx_fn)(el, i);
            int sta = (STATE_MASK & ~STATE(idx));
            int d = 0;
            /* Let's find the appropriate digit */
            for (sta >>= STATE_SHIFT + 1; 0 != sta; sta >>= 1) {
                ++d;
            }
            assert (0 < d && d < 10 && !DISALLOWED(idx, d));
            if (0 < d && d < 10) {
                /* It seems to be an appropriate digit */
                possible[idx_possible++] = SET_INDEX(idx)
                                            | SET_DIGIT(d)
                                            | hintcode;
            }
        }
    }
    return -(i < 9);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x2710
movl $0x0, -0x18(%rbp)
cmpl $0x9, -0x18(%rbp)
jge 0x59be
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rdx
xorl %eax, %eax
leaq 0xccee(%rip), %rcx      # 0x12480
cmpl (%rcx,%rdx,4), %eax
jne 0x57fb
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x9, -0x24(%rbp)
jge 0x57ee
movq -0x10(%rbp), %rax
movl -0x4(%rbp), %edi
movl -0x24(%rbp), %esi
callq *%rax
movslq %eax, %rcx
leaq 0xccef(%rip), %rax      # 0x124b0
movl (%rax,%rcx,4), %eax
andl $0xf0000, %eax          # imm = 0xF0000
sarl $0x10, %eax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x57e1
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x57ee
jmp 0x57e3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x57a5
cmpl $0x0, -0x20(%rbp)
jne 0x57f9
jmp 0x59be
jmp 0x57fb
movslq -0x1c(%rbp), %rdx
movl $0x1, %eax
leaq 0xcc75(%rip), %rcx      # 0x12480
cmpl (%rcx,%rdx,4), %eax
jne 0x58a4
cmpl $0x51, 0xcc55(%rip)     # 0x12470
jge 0x58a4
movl $0x0, -0x28(%rbp)
cmpl $0x9, -0x28(%rbp)
jge 0x58a2
movq -0x10(%rbp), %rax
movl -0x4(%rbp), %edi
movl -0x28(%rbp), %esi
callq *%rax
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rcx
leaq 0xcc68(%rip), %rax      # 0x124b0
movl (%rax,%rcx,4), %eax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
addl $0x6, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x5895
movl -0x2c(%rbp), %edx
movl -0x1c(%rbp), %eax
addl $0x1, %eax
shll $0x10, %eax
orl %eax, %edx
orl -0x14(%rbp), %edx
movl 0xcbf5(%rip), %eax      # 0x12470
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xcbea(%rip)      # 0x12470
movslq %eax, %rcx
leaq 0xb980(%rip), %rax      # 0x11210
movl %edx, (%rax,%rcx,4)
jmp 0x58a2
jmp 0x5897
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x5828
jmp 0x58a4
movslq -0x18(%rbp), %rdx
movl $0x8, %eax
leaq 0xcd4c(%rip), %rcx      # 0x12600
cmpl (%rcx,%rdx,4), %eax
jne 0x59ae
cmpl $0x51, 0xcbac(%rip)     # 0x12470
jge 0x59ae
movq -0x10(%rbp), %rax
movl -0x4(%rbp), %edi
movl -0x18(%rbp), %esi
callq *%rax
movl %eax, -0x30(%rbp)
movslq -0x30(%rbp), %rcx
leaq 0xcbcc(%rip), %rax      # 0x124b0
movl (%rax,%rcx,4), %eax
andl $0xff80, %eax           # imm = 0xFF80
xorl $-0x1, %eax
andl $0xff80, %eax           # imm = 0xFF80
movl %eax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
sarl $0x7, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl -0x34(%rbp), %eax
je 0x5921
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
sarl %eax
movl %eax, -0x34(%rbp)
jmp 0x5907
xorl %eax, %eax
cmpl -0x38(%rbp), %eax
jge 0x5954
cmpl $0xa, -0x38(%rbp)
jge 0x5954
movslq -0x30(%rbp), %rcx
leaq 0xcb77(%rip), %rax      # 0x124b0
movl (%rax,%rcx,4), %eax
movl -0x38(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x5954
jmp 0x5973
leaq 0x7641(%rip), %rdi      # 0xcf9c
leaq 0x738f(%rip), %rsi      # 0xccf1
movl $0x411, %edx            # imm = 0x411
leaq 0x7655(%rip), %rcx      # 0xcfc3
callq 0x2150
xorl %eax, %eax
cmpl -0x38(%rbp), %eax
jge 0x59ac
cmpl $0xa, -0x38(%rbp)
jge 0x59ac
movl -0x30(%rbp), %edx
movl -0x38(%rbp), %eax
shll $0x10, %eax
orl %eax, %edx
orl -0x14(%rbp), %edx
movl 0xcadc(%rip), %eax      # 0x12470
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xcad1(%rip)      # 0x12470
movslq %eax, %rcx
leaq 0xb867(%rip), %rax      # 0x11210
movl %edx, (%rax,%rcx,4)
jmp 0x59ae
jmp 0x59b0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5775
cmpl $0x9, -0x18(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
subl %ecx, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)