// File: /workspace/github_c_makefile_star2_O0/cinemast[P]sudoku/sudoku.c
// Function: position2
static
void
position2 (int el)
{
    int digit, digit2, i, mask, mask2, posn, count, idx;

    /* Calculate positions of each digit within block */
    for (digit = 1; digit <= 9; ++digit) {
        mask = DIGIT_STATE(digit);
        posn_digit[digit] = count = posn = 0;
        for (i = 0; i < 9; ++i) {
            if (0 == (mask & board[idx_block(el, i)])) {
                ++count;
                posn |= DIGIT_STATE(i);
            }
        }
        if (2 == count) {
            posn_digit[digit] = posn;
        }
    }
    /* Find pairs of matching positions, and mask */
    for (digit = 1; digit < 9; ++digit) {
        if (0 != posn_digit[digit]) {
            for (digit2 = digit + 1; digit2 <= 9; ++digit2) {
                if (posn_digit[digit] == posn_digit[digit2]) {
                    mask = STATE_MASK
                           ^ (DIGIT_STATE(digit) | DIGIT_STATE(digit2));
                    mask2 = DIGIT_STATE(digit);
                    for (i = 0; i < 9; ++i) {
                        idx = idx_block(el, i);
                        if (0 == (mask2 & board[idx])) {
                            assert(0 == (DIGIT_STATE(digit2) & board[idx]));
                            board[idx] |= mask;
                        }
                    }
                    posn_digit[digit] = posn_digit[digit2] = 0;
                    break;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl $0x1, -0x8(%rbp)
cmpl $0x9, -0x8(%rbp)
jg 0x7034
movl -0x8(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0xbceb(%rip), %rax      # 0x12c90
movl $0x0, (%rax,%rcx,4)
movl $0x0, -0x10(%rbp)
cmpl $0x9, -0x10(%rbp)
jge 0x7009
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x4(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x2990
movl -0x28(%rbp), %ecx
movslq %eax, %rdx
leaq 0xb4d9(%rip), %rax      # 0x124b0
andl (%rax,%rdx,4), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6ffc
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x10(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x6ffe
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x6fb3
movl $0x2, %eax
cmpl -0x20(%rbp), %eax
jne 0x7024
movl -0x1c(%rbp), %edx
movslq -0x8(%rbp), %rcx
leaq 0xbc6f(%rip), %rax      # 0x12c90
movl %edx, (%rax,%rcx,4)
jmp 0x7026
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x6f72
movl $0x1, -0x8(%rbp)
cmpl $0x9, -0x8(%rbp)
jge 0x71b3
movslq -0x8(%rbp), %rdx
xorl %eax, %eax
leaq 0xbc3e(%rip), %rcx      # 0x12c90
cmpl (%rcx,%rdx,4), %eax
je 0x71a3
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x9, -0xc(%rbp)
jg 0x71a1
movslq -0x8(%rbp), %rcx
leaq 0xbc17(%rip), %rax      # 0x12c90
movl (%rax,%rcx,4), %eax
movslq -0xc(%rbp), %rdx
leaq 0xbc09(%rip), %rcx      # 0x12c90
cmpl (%rcx,%rdx,4), %eax
jne 0x7191
movl -0x8(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %eax
shll %cl, %eax
movl -0xc(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
xorl $0xff80, %eax           # imm = 0xFF80
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x9, -0x10(%rbp)
jge 0x716b
movl -0x4(%rbp), %edi
movl -0x10(%rbp), %esi
callq 0x2990
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0xb3bd(%rip), %rax      # 0x124b0
andl (%rax,%rdx,4), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x715b
movl -0xc(%rbp), %ecx
addl $0x6, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movslq -0x24(%rbp), %rdx
leaq 0xb39a(%rip), %rax      # 0x124b0
andl (%rax,%rdx,4), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x7121
jmp 0x7140
leaq 0x63a5(%rip), %rdi      # 0xd4cd
leaq 0x5bc2(%rip), %rsi      # 0xccf1
movl $0x4f1, %edx            # imm = 0x4F1
leaq 0x63ba(%rip), %rcx      # 0xd4f5
callq 0x2150
movl -0x14(%rbp), %edx
movslq -0x24(%rbp), %rcx
leaq 0xb362(%rip), %rax      # 0x124b0
orl (%rax,%rcx,4), %edx
leaq 0xb358(%rip), %rax      # 0x124b0
movl %edx, (%rax,%rcx,4)
jmp 0x715d
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x70cd
movslq -0xc(%rbp), %rcx
leaq 0xbb1a(%rip), %rax      # 0x12c90
movl $0x0, (%rax,%rcx,4)
movslq -0x8(%rbp), %rcx
leaq 0xbb08(%rip), %rax      # 0x12c90
movl $0x0, (%rax,%rcx,4)
jmp 0x71a1
jmp 0x7193
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7064
jmp 0x71a3
jmp 0x71a5
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x703b
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)