#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 print_space(int s[][8 + 2]) {
  for (int i = 1; i < 8 + 2 + 2; i++) {
    printf("%c", '-');
  }
  printf("\n");
  for (int i = 1; i < 8 + 2; i++) {
    printf("%c", '|');
    for (int j = 1; j < 8 + 2; j++) {
      printf("%c", s[i][j] ? '#' : ' ');
    }
    printf("%c", '|');
    printf("\n");
  }
  for (int i = 1; i < 8 + 2 + 2; i++) {
    printf("%c", '-');
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    114e <print_space+0x3e>
lea    0xecc(%rip),%rdi
mov    $0x2d,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_space+0x13>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1202 <print_space+0xf2>
lea    0xe8c(%rip),%rdi
mov    $0x7c,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11d3 <print_space+0xc3>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    $0x20,%esi
mov    $0x23,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1187 <print_space+0x77>
lea    0xe26(%rip),%rdi
mov    $0x7c,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <print_space+0x53>
movl   $0x1,-0x18(%rbp)
cmpl   $0xc,-0x18(%rbp)
jge    1234 <print_space+0x124>
lea    0xde6(%rip),%rdi
mov    $0x2d,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1209 <print_space+0xf9>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_space>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4c,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x20(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x1c(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x18(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x14(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x10(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0xc(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x4(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
cmpl   $0x0,(%r14,%rbx,1)
setne  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x28,%rbx
cmp    $0x1b4,%rbx
jne    11a0 <print_space+0x90>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

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