#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 printBoard(char board[7][6]) {
  for (int y = 6 - 1; y >= 0; y--) {
    printf("# %i ", y + 1);
    for (int x = 0; x < 7; x++) {
      printf("%c", board[x][y]);
    }
    printf(" #\n");
  }
  printf("#   1234567 #\n");
  printf("#############\n");
}


x86 assembly (clang, -O0):
<printBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11a1 <printBoard+0x91>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jge    1185 <printBoard+0x75>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <printBoard+0x38>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printBoard+0x13>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBoard>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
lea    0xebe(%rip),%r14
lea    0xec8(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    0x6(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xb(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x11(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x17(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x1d(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x23(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x29(%r12,%rbx,1),%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0xfffffffffffffffa,%rbx
jne    1150 <printBoard+0x20>
lea    0xe43(%rip),%rdi
call   1040 <puts@plt>
lea    0xe45(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"# %i \00"
@str = [14 x i8] c"# 1234567 #\00"
@str.5 = [14 x i8] c"#############\00"
@str.6 = [3 x i8] c" #\00"
define void @printBoard([6 x i8]* nocapture %0) {
br label %5
2: ; preds = %5
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
ret void
5: ; preds = %1, %5
%6 = phi i64 [ 5, %1 ], [ %39, %5 ]
%7 = trunc i64 %6 to i32
%8 = add i32 %7, 1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 0, i64 %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 1, i64 %6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i32 @putchar(i32 %16)
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 2, i64 %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = tail call i32 @putchar(i32 %20)
%22 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 3, i64 %6
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = tail call i32 @putchar(i32 %24)
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 4, i64 %6
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = tail call i32 @putchar(i32 %28)
%30 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 5, i64 %6
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = tail call i32 @putchar(i32 %32)
%34 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 6, i64 %6
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = tail call i32 @putchar(i32 %36)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.6, i64 0, i64 0))
%39 = add nsw i64 %6, -1
%40 = icmp eq i64 %6, 0
br i1 %40, label %2, label %5
}