#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*/ _putchar(char);
void print_chessboard(char (*a)[8]) {
  int w, b;
  for (w = 0; w < 8; w++) {
    for (b = 0; b < 8; b++) {
      _putchar(a[w][b]);
    }
    _putchar('\n');
  }
}


x86 assembly (clang, -O0):
<print_chessboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1180 <print_chessboard+0x70>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1168 <print_chessboard+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <print_chessboard+0x24>
mov    $0xa,%edi
call   1030 <_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_chessboard+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_chessboard>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x1(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x2(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x3(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x4(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x5(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x6(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
movsbl 0x7(%r14,%rbx,8),%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
call   1030 <_putchar@plt>
add    $0x1,%rbx
cmp    $0x8,%rbx
jne    1120 <print_chessboard+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @print_chessboard([8 x i8]* %0) {
%2 = alloca [8 x i8]*
%3 = alloca i32
%4 = alloca i32
store [8 x i8]* %0, [8 x i8]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %27, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %30
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load [8 x i8]*, [8 x i8]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %16, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @_putchar(i8 signext %20)
br label %22
22: ; preds = %12
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %9
25: ; preds = %9
%26 = call i32 @_putchar(i8 signext 10)
br label %27
27: ; preds = %25
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %5
30: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @print_chessboard([8 x i8]* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %29, %2 ]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 0
%5 = load i8, i8* %4
%6 = tail call i32 @_putchar(i8 signext %5)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 1
%8 = load i8, i8* %7
%9 = tail call i32 @_putchar(i8 signext %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 2
%11 = load i8, i8* %10
%12 = tail call i32 @_putchar(i8 signext %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 3
%14 = load i8, i8* %13
%15 = tail call i32 @_putchar(i8 signext %14)
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 4
%17 = load i8, i8* %16
%18 = tail call i32 @_putchar(i8 signext %17)
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 5
%20 = load i8, i8* %19
%21 = tail call i32 @_putchar(i8 signext %20)
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 6
%23 = load i8, i8* %22
%24 = tail call i32 @_putchar(i8 signext %23)
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %3, i64 7
%26 = load i8, i8* %25
%27 = tail call i32 @_putchar(i8 signext %26)
%28 = tail call i32 @_putchar(i8 signext 10)
%29 = add nuw nsw i64 %3, 1
%30 = icmp eq i64 %29, 8
br i1 %30, label %31, label %2
31: ; preds = %2
ret void
}