#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[][26], int n) {
  printf("  ");
  for (char i = 'a'; i != 'a' + n; i++) {
    printf("%c", i);
  }
  printf("\n");
  int s = 'a';
  for (int row = 0; row != n; row++) {
    printf("%c ", s);
    s++;
    for (int col = 0; col != n; col++) {
      printf("%c", board[row][col]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x61,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x61,%ecx
cmp    %ecx,%eax
je     1162 <printBoard+0x52>
movsbl -0xd(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xd(%rbp),%al
add    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    1131 <printBoard+0x21>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x61,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1206 <printBoard+0xf6>
mov    -0x14(%rbp),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11ea <printBoard+0xda>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x1a,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ab <printBoard+0x9b>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117e <printBoard+0x6e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBoard>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r13
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
je     11fa <printBoard+0xda>
lea    0x61(%r14),%r15d
mov    $0x61,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%bpl
movsbl %bpl,%ebp
cmp    %ebp,%r15d
jne    1160 <printBoard+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
je     11eb <printBoard+0xcb>
mov    %r14d,%ebp
mov    $0x61,%r15d
lea    0xe70(%rip),%r14
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x0(%r13,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <printBoard+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    $0x1a,%r13
cmp    %rbp,%r12
jne    11a0 <printBoard+0x80>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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