#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 /*<<< orphan*/ putchar(char);
void print_board(char b[7][6 + 1]) {
  int i, j;
  putchar(' ');
  for (i = 0; i < 7; i++)
    printf(" %d", b[i][6]);
  putchar('\n');
  for (j = 6 - 1; j >= 0; j--) {
    printf("%d ", j);
    for (i = 0; i < 7; i++)
      printf("%c ", b[i][j]);
    putchar('\n');
  }
  putchar(' ');
  for (i = 0; i < 7; i++)
    printf(" %d", i);
  putchar('\n');
  printf("----------------\n");
}


x86 assembly (clang, -O0):
<print_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1176 <print_board+0x56>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movsbl 0x6(%rax),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <print_board+0x1d>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x5,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     11fe <print_board+0xde>
mov    -0x10(%rbp),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    11e6 <print_board+0xc6>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a9 <print_board+0x89>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1187 <print_board+0x67>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1238 <print_board+0x118>
mov    -0xc(%rbp),%esi
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120f <print_board+0xef>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_board>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x6(%r12),%esi
lea    0xeae(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xd(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x14(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1b(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x22(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x29(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x30(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe37(%rip),%r14
lea    0xe34(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    0x5(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xc(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x13(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1a(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x21(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x28(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x2f(%r12,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0xfffffffffffffffa,%rbx
jne    11e0 <print_board+0xb0>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xd7a(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd0f(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%c \00"
@str = [17 x i8] c"----------------\00"
define void @print_board([7 x i8]* nocapture %0) {
%2 = tail call i32 @putchar(i8 signext 32)
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 0, i64 6
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 1, i64 6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 2, i64 6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 3, i64 6
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 4, i64 6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 5, i64 6
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 6, i64 6
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = tail call i32 @putchar(i8 signext 10)
br label %32
32: ; preds = %1, %32
%33 = phi i64 [ 5, %1 ], [ %65, %32 ]
%34 = trunc i64 %33 to i32
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 0, i64 %33
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 1, i64 %33
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 2, i64 %33
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 3, i64 %33
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 4, i64 %33
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 5, i64 %33
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 6, i64 %33
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = tail call i32 @putchar(i8 signext 10)
%65 = add nsw i64 %33, -1
%66 = icmp eq i64 %33, 0
br i1 %66, label %67, label %32
67: ; preds = %32
%68 = tail call i32 @putchar(i8 signext 32)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%76 = tail call i32 @putchar(i8 signext 10)
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}