#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 *, ...);
int main(void) {
  char checker_board[8][8];
  int i, j;
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      if ((j + i) % 2 == 0)
        checker_board[i][j] = 'B';
      else
        checker_board[i][j] = 'R';
    }
  }
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      printf("%-3c", checker_board[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x8,-0x54(%rbp)
jge    11b1 <main+0xa1>
movl   $0x0,-0x58(%rbp)
cmpl   $0x8,-0x58(%rbp)
jge    119e <main+0x8e>
mov    -0x58(%rbp),%eax
add    -0x54(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1174 <main+0x64>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
movb   $0x42,(%rax,%rcx,1)
jmp    118b <main+0x7b>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
movb   $0x52,(%rax,%rcx,1)
jmp    1190 <main+0x80>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1137 <main+0x27>
jmp    11a3 <main+0x93>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x54(%rbp)
cmpl   $0x8,-0x54(%rbp)
jge    1222 <main+0x112>
movl   $0x0,-0x58(%rbp)
cmpl   $0x8,-0x58(%rbp)
jge    1206 <main+0xf6>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11c9 <main+0xb9>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11b8 <main+0xa8>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
mov    $0x42,%al
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
nop
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x7(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x6(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x5(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x4(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x3(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x2(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x1(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x8,%rbx
je     11e3 <main+0xc3>
movzbl (%rsp,%rbx,8),%eax
add    $0x1,%rbx
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%-3c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x [8 x i8]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %37, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %40
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %33, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %36
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %2, i64 0, i64 %20
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %21, i64 0, i64 %23
store i8 66, i8* %24
br label %32
25: ; preds = %12
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %2, i64 0, i64 %27
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %28, i64 0, i64 %30
store i8 82, i8* %31
br label %32
32: ; preds = %25, %18
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %9
36: ; preds = %9
br label %37
37: ; preds = %36
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %5
40: ; preds = %5
store i32 0, i32* %3
br label %41
41: ; preds = %63, %40
%42 = load i32, i32* %3
%43 = icmp slt i32 %42, 8
br i1 %43, label %44, label %66
44: ; preds = %41
store i32 0, i32* %4
br label %45
45: ; preds = %58, %44
%46 = load i32, i32* %4
%47 = icmp slt i32 %46, 8
br i1 %47, label %48, label %61
48: ; preds = %45
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %2, i64 0, i64 %50
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [8 x i8], [8 x i8]* %51, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %48
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %45
61: ; preds = %45
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %63
63: ; preds = %61
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %41
66: ; preds = %41
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%-3c\00"
define i32 @main() {
%1 = alloca [8 x [8 x i8]]
%2 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [8 x [8 x i8]]* %1 to <16 x i8>*
store <16 x i8> <i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66>, <16 x i8>* %3
%4 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 2, i64 0
%5 = bitcast i8* %4 to <16 x i8>*
store <16 x i8> <i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66>, <16 x i8>* %5
%6 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 4, i64 0
%7 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> <i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66>, <16 x i8>* %7
%8 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 6, i64 0
%9 = bitcast i8* %8 to <16 x i8>*
store <16 x i8> <i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66, i8 82, i8 66>, <16 x i8>* %9
br label %10
10: ; preds = %46, %0
%11 = phi i8 [ 66, %0 ], [ %48, %46 ]
%12 = phi i64 [ 0, %0 ], [ %44, %46 ]
%13 = sext i8 %11 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 5
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 6
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %12, i64 7
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = tail call i32 @putchar(i32 10)
%44 = add nuw nsw i64 %12, 1
%45 = icmp eq i64 %44, 8
br i1 %45, label %49, label %46
46: ; preds = %10
%47 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 %44, i64 0
%48 = load i8, i8* %47
br label %10
49: ; preds = %10
ret i32 0
}