#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 maskColExceptBox(struct Board *board, int box, int col, unsigned int mask) {
  int row, change;
  change = 0;
  for (row = 0; row < 9; row++) {
    if ((row / 3) != (box / 3)) {
      change |= recursiveMask(board, row, col, mask);
    }
  }
  return change;
}


x86 assembly (clang, -O0):
<maskColExceptBox>:
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    118e <maskColExceptBox+0x7e>
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    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     117b <maskColExceptBox+0x6b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <recursiveMask@plt>
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1180 <maskColExceptBox+0x70>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <maskColExceptBox+0x23>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maskColExceptBox>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r12d
mov    %esi,%r15d
mov    %rdi,%r13
lea    0x2(%r15),%eax
xor    %ebp,%ebp
cmp    $0x5,%eax
jb     117b <maskColExceptBox+0x6b>
mov    %r13,%rdi
xor    %esi,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
mov    %r13,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    %r13,%rdi
mov    $0x2,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     %ebx,%ebp
lea    -0x3(%r15),%eax
cmp    $0x3,%eax
jb     11ce <maskColExceptBox+0xbe>
mov    %r13,%rdi
mov    $0x3,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    %r13,%rdi
mov    $0x4,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
mov    $0x5,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     0x4(%rsp),%ebp
or     %ebx,%ebp
add    $0xfffffffa,%r15d
cmp    $0x3,%r15d
jb     1215 <maskColExceptBox+0x105>
mov    %r13,%rdi
mov    $0x6,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%r15d
mov    %r13,%rdi
mov    $0x7,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    %r13,%rdi
mov    $0x8,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     %r15d,%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 @maskColExceptBox(%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 = sdiv 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* %9
%23 = load i32, i32* %7
%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 @maskColExceptBox(%struct.Board* %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %1, 2
%6 = icmp ult i32 %5, 5
br i1 %6, label %15, label %7
7: ; preds = %4
%8 = tail call i32 @recursiveMask(%struct.Board* %0, i32 0, i32 %2, i32 %3)
%9 = tail call i32 @recursiveMask(%struct.Board* %0, i32 1, i32 %2, 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 = add i32 %1, -3
%14 = icmp ult i32 %13, 3
br i1 %14, label %25, label %15
15: ; preds = %4, %7
%16 = phi i32 [ %12, %7 ], [ 0, %4 ]
%17 = tail call i32 @recursiveMask(%struct.Board* %0, i32 3, i32 %2, i32 %3)
%18 = or i32 %17, %16
%19 = tail call i32 @recursiveMask(%struct.Board* %0, i32 4, i32 %2, i32 %3)
%20 = or i32 %19, %18
%21 = tail call i32 @recursiveMask(%struct.Board* %0, i32 5, i32 %2, i32 %3)
%22 = or i32 %21, %20
%23 = add i32 %1, -6
%24 = icmp ult i32 %23, 3
br i1 %24, label %33, label %25
25: ; preds = %7, %15
%26 = phi i32 [ %22, %15 ], [ %12, %7 ]
%27 = tail call i32 @recursiveMask(%struct.Board* %0, i32 6, i32 %2, i32 %3)
%28 = or i32 %27, %26
%29 = tail call i32 @recursiveMask(%struct.Board* %0, i32 7, i32 %2, i32 %3)
%30 = or i32 %29, %28
%31 = tail call i32 @recursiveMask(%struct.Board* %0, i32 8, i32 %2, i32 %3)
%32 = or i32 %31, %30
br label %33
33: ; preds = %15, %25
%34 = phi i32 [ %32, %25 ], [ %22, %15 ]
ret i32 %34
}