#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, ...);
int /*<<< orphan*/ putchar(char);
void show(int n, int black, int white, int alpha, int beta, int passed) {
  int i;
  printf("%d (%d,%d)%s\n", n, alpha, beta, passed ? " pass" : "");
  for (i = 0; i < 4; i++) {
    printf(" %c", ".XO#"[(black >> i & 1) + 2 * (white >> i & 1)]);
    if (i & 1 == 1)
      putchar('\n');
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edi
lea    0xebe(%rip),%r8
lea    0xeb8(%rip),%rsi
cmp    $0x0,%edi
cmovne %rsi,%r8
lea    0xe9c(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    11e4 <show+0xc4>
mov    -0x8(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    -0xc(%rbp),%edx
mov    -0x1c(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0x1,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
movslq %eax,%rcx
lea    0xe6e(%rip),%rdi
lea    0xe6b(%rip),%rax
movsbl (%rax,%rcx,1),%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11d1 <show+0xb1>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11d6 <show+0xb6>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1175 <show+0x55>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%eax
mov    %edx,%ebx
mov    %esi,%ebp
test   %r9d,%r9d
lea    0xed5(%rip),%rdx
lea    0xecf(%rip),%r8
cmove  %rdx,%r8
movsbl %dil,%esi
lea    0xeb2(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%eax
and    $0x1,%eax
mov    %ebx,%ecx
and    $0x1,%ecx
lea    (%rax,%rcx,2),%eax
lea    0xeab(%rip),%r15
movsbl (%rax,%r15,1),%esi
lea    0xe9b(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%eax
shr    %eax
and    $0x1,%eax
mov    %ebx,%ecx
and    $0x2,%ecx
or     %eax,%ecx
movsbl (%rcx,%r15,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebp,%eax
shr    $0x2,%eax
and    $0x1,%eax
mov    %ebx,%ecx
shr    %ecx
and    $0x2,%ecx
or     %eax,%ecx
movsbl (%rcx,%r15,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
shr    $0x3,%ebp
and    $0x1,%ebp
shr    $0x2,%ebx
and    $0x2,%ebx
or     %ebp,%ebx
movsbl (%rbx,%r15,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d (%d,%d)%s\0A\00"
@.str.1 = [6 x i8] c" pass\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [5 x i8] c".XO#\00"
define void @show(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* %7
%15 = trunc i32 %14 to i8
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%22 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %15, i32 %16, i32 %17, i8* %21)
store i32 0, i32* %13
br label %23
23: ; preds = %47, %6
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 4
br i1 %25, label %26, label %50
26: ; preds = %23
%27 = load i32, i32* %8
%28 = load i32, i32* %13
%29 = ashr i32 %27, %28
%30 = and i32 %29, 1
%31 = load i32, i32* %9
%32 = load i32, i32* %13
%33 = ashr i32 %31, %32
%34 = and i32 %33, 1
%35 = mul nsw i32 2, %34
%36 = add nsw i32 %30, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [5 x i8], [5 x i8]* @.str.4, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %39)
%41 = load i32, i32* %13
%42 = and i32 %41, 1
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %26
%45 = call i32 @putchar(i8 signext 10)
br label %46
46: ; preds = %44, %26
br label %47
47: ; preds = %46
%48 = load i32, i32* %13
%49 = add nsw i32 %48, 1
store i32 %49, i32* %13
br label %23
50: ; preds = %23
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d (%d,%d)%s\0A\00"
@.str.1 = [6 x i8] c" pass\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [5 x i8] c".XO#\00"
define void @show(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = trunc i32 %0 to i8
%8 = icmp eq i32 %5, 0
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %7, i32 %3, i32 %4, i8* %9)
%11 = and i32 %1, 1
%12 = shl i32 %2, 1
%13 = and i32 %12, 2
%14 = or i32 %13, %11
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [5 x i8], [5 x i8]* @.str.4, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %17)
%19 = lshr i32 %1, 1
%20 = and i32 %19, 1
%21 = and i32 %2, 2
%22 = or i32 %21, %20
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds [5 x i8], [5 x i8]* @.str.4, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %25)
%27 = tail call i32 @putchar(i8 signext 10)
%28 = lshr i32 %1, 2
%29 = and i32 %28, 1
%30 = lshr i32 %2, 1
%31 = and i32 %30, 2
%32 = or i32 %31, %29
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds [5 x i8], [5 x i8]* @.str.4, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %35)
%37 = lshr i32 %1, 3
%38 = and i32 %37, 1
%39 = lshr i32 %2, 2
%40 = and i32 %39, 2
%41 = or i32 %40, %38
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [5 x i8], [5 x i8]* @.str.4, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8 signext %44)
%46 = tail call i32 @putchar(i8 signext 10)
ret void
}