#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 /*<<< orphan*/ otherLinesInBox(int, int *, int *);
int recursiveMask(struct Board *, int, int, unsigned int);
int maskBoxExceptRow(struct Board *board, int row, int box, unsigned int mask) {
  int row1, row2, i, change;
  change = 0;
  otherLinesInBox(row, &row1, &row2);
  for (i = 0; i < 3; i++) {
    change |= recursiveMask(board, row1, 3 * box + i, mask);
    change |= recursiveMask(board, row2, 3 * box + i, mask);
  }
  return change;
}


x86 assembly (clang, -O0):
<maskBoxExceptRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <otherLinesInBox@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    11a3 <maskBoxExceptRow+0x83>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
imul   $0x3,-0x10(%rbp),%edx
add    -0x20(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <recursiveMask@plt>
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
imul   $0x3,-0x10(%rbp),%edx
add    -0x20(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <recursiveMask@plt>
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1153 <maskBoxExceptRow+0x33>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maskBoxExceptRow>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%eax
mov    %rdi,%r13
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    %eax,%edi
call   1040 <otherLinesInBox@plt>
lea    (%r14,%r14,2),%ebp
mov    0x4(%rsp),%esi
mov    %r13,%rdi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%r12d
mov    (%rsp),%esi
mov    %r13,%rdi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebp
or     %r12d,%ebp
mov    0x4(%rsp),%esi
lea    (%r14,%r14,2),%ebx
add    $0x1,%ebx
mov    %r13,%rdi
mov    %ebx,%edx
mov    %r15d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%r12d
mov    (%rsp),%esi
mov    %r13,%rdi
mov    %ebx,%edx
mov    %r15d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%ebx
or     %r12d,%ebx
or     %ebp,%ebx
mov    0x4(%rsp),%esi
lea    (%r14,%r14,2),%ebp
add    $0x2,%ebp
mov    %r13,%rdi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1030 <recursiveMask@plt>
mov    %eax,%r14d
mov    (%rsp),%esi
mov    %r13,%rdi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1030 <recursiveMask@plt>
or     %r14d,%eax
or     %ebx,%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 @maskBoxExceptRow(%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
%11 = alloca i32
%12 = 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* %12
%13 = load i32, i32* %6
%14 = call i32 @otherLinesInBox(i32 %13, i32* %9, i32* %10)
store i32 0, i32* %11
br label %15
15: ; preds = %39, %4
%16 = load i32, i32* %11
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %42
18: ; preds = %15
%19 = load %struct.Board*, %struct.Board** %5
%20 = load i32, i32* %9
%21 = load i32, i32* %7
%22 = mul nsw i32 3, %21
%23 = load i32, i32* %11
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %8
%26 = call i32 @recursiveMask(%struct.Board* %19, i32 %20, i32 %24, i32 %25)
%27 = load i32, i32* %12
%28 = or i32 %27, %26
store i32 %28, i32* %12
%29 = load %struct.Board*, %struct.Board** %5
%30 = load i32, i32* %10
%31 = load i32, i32* %7
%32 = mul nsw i32 3, %31
%33 = load i32, i32* %11
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %8
%36 = call i32 @recursiveMask(%struct.Board* %29, i32 %30, i32 %34, i32 %35)
%37 = load i32, i32* %12
%38 = or i32 %37, %36
store i32 %38, i32* %12
br label %39
39: ; preds = %18
%40 = load i32, i32* %11
%41 = add nsw i32 %40, 1
store i32 %41, i32* %11
br label %15
42: ; preds = %15
%43 = load i32, i32* %12
ret i32 %43
}

LLVM IR (-O2):
%struct.Board = type { i32 }
define i32 @maskBoxExceptRow(%struct.Board* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = call i32 @otherLinesInBox(i32 %1, i32* %5, i32* %6)
%10 = mul nsw i32 %2, 3
%11 = load i32, i32* %5
%12 = call i32 @recursiveMask(%struct.Board* %0, i32 %11, i32 %10, i32 %3)
%13 = load i32, i32* %6
%14 = call i32 @recursiveMask(%struct.Board* %0, i32 %13, i32 %10, i32 %3)
%15 = or i32 %12, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %10, 1
%18 = call i32 @recursiveMask(%struct.Board* %0, i32 %16, i32 %17, i32 %3)
%19 = or i32 %18, %15
%20 = load i32, i32* %6
%21 = call i32 @recursiveMask(%struct.Board* %0, i32 %20, i32 %17, i32 %3)
%22 = or i32 %19, %21
%23 = load i32, i32* %5
%24 = add nsw i32 %10, 2
%25 = call i32 @recursiveMask(%struct.Board* %0, i32 %23, i32 %24, i32 %3)
%26 = or i32 %25, %22
%27 = load i32, i32* %6
%28 = call i32 @recursiveMask(%struct.Board* %0, i32 %27, i32 %24, i32 %3)
%29 = or i32 %26, %28
ret i32 %29
}