#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 *, ...);
void main() {
  int i, j;
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      if (0 == (i + j) % 2)
        printf("%c", 99);
      else
        printf(" ");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    11a7 <main+0x97>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    118b <main+0x7b>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    116a <main+0x5a>
lea    0xea7(%rip),%rdi
mov    $0x63,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1178 <main+0x68>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117d <main+0x6d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebx,%ebx
mov    $0x63,%r15d
mov    $0x20,%r12d
cs nopw 0x0(%rax,%rax,1)
test   $0x1,%bl
mov    $0x20,%ebp
cmove  %r15d,%ebp
mov    $0x63,%r14d
cmove  %r12d,%r14d
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
test   $0x1,%bl
mov    $0x20,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x8,%ebx
jne    1130 <main+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %26, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %29
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %21, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %11, %12
%14 = srem i32 %13, 2
%15 = icmp eq i32 0, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 99)
br label %20
18: ; preds = %10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %7
24: ; preds = %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %3
29: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 99, i32 32
%6 = tail call i32 @putchar(i32 %5)
%7 = add nuw nsw i32 %2, 1
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 99, i32 32
%11 = tail call i32 @putchar(i32 %10)
%12 = and i32 %2, 1
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 99, i32 32
%15 = tail call i32 @putchar(i32 %14)
%16 = and i32 %2, 1
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i32 32, i32 99
%19 = tail call i32 @putchar(i32 %18)
%20 = and i32 %2, 1
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i32 99, i32 32
%23 = tail call i32 @putchar(i32 %22)
%24 = and i32 %2, 1
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i32 32, i32 99
%27 = tail call i32 @putchar(i32 %26)
%28 = and i32 %2, 1
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32 99, i32 32
%31 = tail call i32 @putchar(i32 %30)
%32 = and i32 %2, 1
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i32 32, i32 99
%35 = tail call i32 @putchar(i32 %34)
%36 = tail call i32 @putchar(i32 10)
%37 = icmp eq i32 %7, 8
br i1 %37, label %38, label %1
38: ; preds = %1
ret void
}