#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct Board {
  int dummy;
};

/* Variables and functions */
int recursiveMask(struct Board *, int, int, unsigned int);
int maskRowExceptBox(struct Board *board, int box, int row, unsigned int mask) {
  int col, change;
  change = 0;
  for (col = 0; col < 9; col++) {
    if ((col / 3) != (box % 3)) {
      change |= recursiveMask(board, row, col, mask);
    }
  }
  return change;
}


x86 assembly (clang, -O0):
<maskRowExceptBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jge    118c <maskRowExceptBox+0x7c>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
cmp    %edx,%eax
je     1179 <maskRowExceptBox+0x69>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <recursiveMask@plt>
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    117e <maskRowExceptBox+0x6e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <maskRowExceptBox+0x23>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maskRowExceptBox>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rdi,%r12
movslq %esi,%r13
imul   $0x55555556,%r13,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r13d
je     118b <maskRowExceptBox+0x7b>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %edx,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x2,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     %ebx,%ebp
cmp    $0x1,%r13d
jne    118d <maskRowExceptBox+0x7d>
jmp    11dc <maskRowExceptBox+0xcc>
xor    %ebp,%ebp
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x3,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x4,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,0x4(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x5,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     0x4(%rsp),%ebp
or     %ebx,%ebp
cmp    $0x2,%r13d
je     1223 <maskRowExceptBox+0x113>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x6,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%r13d
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x7,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x8,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     %r13d,%ebp
or     %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Board = type { i32 }
define i32 @maskRowExceptBox(%struct.Board* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.Board*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.Board* %0, %struct.Board** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %10
store i32 0, i32* %9
br label %11
11: ; preds = %29, %4
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 9
br i1 %13, label %14, label %32
14: ; preds = %11
%15 = load i32, i32* %9
%16 = sdiv i32 %15, 3
%17 = load i32, i32* %6
%18 = srem i32 %17, 3
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %28
20: ; preds = %14
%21 = load %struct.Board*, %struct.Board** %5
%22 = load i32, i32* %7
%23 = load i32, i32* %9
%24 = load i32, i32* %8
%25 = call i32 @recursiveMask(%struct.Board* %21, i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %10
%27 = or i32 %26, %25
store i32 %27, i32* %10
br label %28
28: ; preds = %20, %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %11
32: ; preds = %11
%33 = load i32, i32* %10
ret i32 %33
}

LLVM IR (-O2):
%struct.Board = type { i32 }
define i32 @maskRowExceptBox(%struct.Board* %0, i32 %1, i32 %2, i32 %3) {
%5 = srem i32 %1, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 0, i32 %3)
%9 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 1, i32 %3)
%10 = or i32 %9, %8
%11 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 2, i32 %3)
%12 = or i32 %11, %10
%13 = icmp eq i32 %5, 1
br i1 %13, label %23, label %14
14: ; preds = %4, %7
%15 = phi i32 [ %12, %7 ], [ 0, %4 ]
%16 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 3, i32 %3)
%17 = or i32 %16, %15
%18 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 4, i32 %3)
%19 = or i32 %18, %17
%20 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 5, i32 %3)
%21 = or i32 %20, %19
%22 = icmp eq i32 %5, 2
br i1 %22, label %31, label %23
23: ; preds = %7, %14
%24 = phi i32 [ %21, %14 ], [ %12, %7 ]
%25 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 6, i32 %3)
%26 = or i32 %25, %24
%27 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 7, i32 %3)
%28 = or i32 %27, %26
%29 = tail call i32 @recursiveMask(%struct.Board* %0, i32 %2, i32 8, i32 %3)
%30 = or i32 %29, %28
br label %31
31: ; preds = %14, %23
%32 = phi i32 [ %30, %23 ], [ %21, %14 ]
ret i32 %32
}