#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 prtbrd(char b[64]) {
  int i, j;
  printf("   1 2 3 4 5 6 7 8\n");
  for (i = 0; i < 8; i++) {
    printf(" %u", i + 1);
    for (j = 0; j < 8; j++) {
      putchar(' ');
      putchar(b[i * 8 + j]);
    }
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<prtbrd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    11b9 <prtbrd+0x99>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11a1 <prtbrd+0x81>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <prtbrd+0x46>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <prtbrd+0x21>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtbrd>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb2(%rip),%r14
xor    %ebx,%ebx
lea    0x1(%rbx),%r15
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl (%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x1(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x2(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x3(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x4(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x5(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x6(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x7(%r12,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rbx
cmp    $0x8,%r15
jne    1150 <prtbrd+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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