#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(int argc, char *argv[]) {
  int i, j;
  int color, length;
  char white[] = "white";
  char black[] = "black";
  length = 64;
  color = 1;
  for (i = 0; i < length / 8; ++i) {
    for (j = 0; j < 8; ++j) {
      if (color == 1)
        printf("%s ", white);
      else if (color == -1)
        printf("%s ", black);
      color = -color;
    }
    color = -color;
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x26(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x22(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0x2c(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0x28(%rbp)
movl   $0x40,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    120e <main+0xfe>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    11ea <main+0xda>
cmpl   $0x1,-0x1c(%rbp)
jne    11b3 <main+0xa3>
lea    -0x26(%rbp),%rsi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d4 <main+0xc4>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    11cf <main+0xbf>
lea    -0x2c(%rbp),%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d4 <main+0xc4>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1188 <main+0x78>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x53>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x65,0x14(%rsp)
movl   $0x74696877,0x10(%rsp)
74
movw   $0x6b,0xc(%rsp)
movl   $0x63616c62,0x8(%rsp)
63
mov    $0x1,%ebx
mov    $0x8,%r13d
lea    0x10(%rsp),%r14
lea    0xea9(%rip),%r12
lea    0x8(%rsp),%r15
jmp    11a0 <main+0x80>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebp,%ebx
add    $0xffffffff,%r13d
je     12dd <main+0x1bd>
mov    %r14,%rsi
cmp    $0x1,%ebx
je     11b0 <main+0x90>
cmp    $0xffffffff,%ebx
jne    11ba <main+0x9a>
mov    %r15,%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%ebp
neg    %ebp
mov    %r15,%rsi
cmp    $0xffffffff,%ebp
je     11ce <main+0xae>
cmp    $0x1,%ebp
jne    11d8 <main+0xb8>
mov    %r14,%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebx
je     1200 <main+0xe0>
cmp    $0xffffffff,%ebx
jne    1220 <main+0x100>
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    122d <main+0x10d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rsi
jmp    1230 <main+0x110>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rsi
cmp    $0xffffffff,%ebp
je     1230 <main+0x110>
cmp    $0x1,%ebp
jne    123a <main+0x11a>
mov    %r14,%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebx
je     1260 <main+0x140>
cmp    $0xffffffff,%ebx
jne    1280 <main+0x160>
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    128d <main+0x16d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rsi
jmp    1290 <main+0x170>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rsi
cmp    $0xffffffff,%ebp
je     1290 <main+0x170>
cmp    $0x1,%ebp
jne    129a <main+0x17a>
mov    %r14,%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebx
je     1170 <main+0x50>
cmp    $0xffffffff,%ebx
jne    12c0 <main+0x1a0>
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12d5 <main+0x1b5>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rsi
cmp    $0xffffffff,%ebp
je     1180 <main+0x60>
cmp    $0x1,%ebp
jne    118a <main+0x6a>
mov    %r14,%rsi
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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