#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 draw(int erros) {
  printf("\n");
  printf(" +-----+   \n");
  printf(" |     |   \n");
  switch (erros) {
  case 0:
    printf(" |        \n");
    printf(" |     \n");
    printf(" |      \n");
    break;
  case 1:
    printf(" |     o   \n");
    printf(" |     \n");
    printf(" |     \n");
    break;
  case 2:
    printf(" |     o   \n");
    printf(" |     O \n");
    printf(" |      \n");
    break;
  case 3:
    printf(" |     o   \n");
    printf(" |    /O \n");
    printf(" |     \n");
    break;
  case 4:
    printf(" |     o   \n");
    printf(" |    /O\\ \n");
    printf(" |      \n");
    break;
  case 5:
    printf(" |     o   \n");
    printf(" |    /O\\ \n");
    printf(" |    /  \n");
    break;
  case 6:
    printf(" |     o   \n");
    printf(" |    /O\\ \n");
    printf(" |    / \\ \n");
    break;
  }
  printf(" |         \n");
  printf("/ \\      \n");
  printf("\n\n");
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xf92(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     127e <draw+0x16e>
mov    -0x10(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    127e <draw+0x16e>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    127e <draw+0x16e>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    127e <draw+0x16e>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    127e <draw+0x16e>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    127e <draw+0x16e>
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    127e <draw+0x16e>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
cmp    $0x6,%ebx
ja     118f <draw+0x6f>
movslq %ebx,%rax
lea    0xf35(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
lea    0xf43(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
lea    0xf51(%rip),%rcx
movslq (%rcx,%rax,4),%r14
add    %rcx,%r14
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [13 x i8] c" +-----+ \0A\00"
@.str.2 = [13 x i8] c" | | \0A\00"
@.str.3 = [12 x i8] c" | \0A\00"
@.str.4 = [9 x i8] c" | \0A\00"
@.str.5 = [10 x i8] c" | \0A\00"
@.str.6 = [13 x i8] c" | o \0A\00"
@.str.7 = [11 x i8] c" | O \0A\00"
@.str.8 = [11 x i8] c" | /O \0A\00"
@.str.9 = [12 x i8] c" | /O\\ \0A\00"
@.str.10 = [11 x i8] c" | / \0A\00"
@.str.11 = [12 x i8] c" | / \\ \0A\00"
@.str.12 = [13 x i8] c" | \0A\00"
@.str.13 = [11 x i8] c"/ \\ \0A\00"
@.str.14 = [3 x i8] c"\0A\0A\00"
define void @draw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
switch i32 %6, label %35 [
i32 0, label %7
i32 1, label %11
i32 2, label %15
i32 3, label %19
i32 4, label %23
i32 5, label %27
i32 6, label %31
]
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %35
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %35
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %35
19: ; preds = %1
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %35
23: ; preds = %1
%24 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %35
27: ; preds = %1
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br label %35
31: ; preds = %1
%32 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%34 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
br label %35
35: ; preds = %1, %31, %27, %23, %19, %15, %11, %7
%36 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%37 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c" +-----+ \00"
@str.15 = [12 x i8] c" | | \00"
@str.18 = [11 x i8] c" | / \\ \00"
@str.19 = [12 x i8] c" | \00"
@str.20 = [10 x i8] c"/ \\ \00"
@str.21 = [2 x i8] c"\0A\00"
@str.24 = [10 x i8] c" | / \00"
@str.26 = [11 x i8] c" | /O\\ \00"
@str.29 = [10 x i8] c" | /O \00"
@str.32 = [10 x i8] c" | O \00"
@str.34 = [12 x i8] c" | o \00"
@str.37 = [11 x i8] c" | \00"
@str.38 = [8 x i8] c" | \00"
@str.39 = [9 x i8] c" | \00"
@reltable.draw = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.37 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.34 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.34 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.34 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.34 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.34 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.34 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw to i64)) to i32)]
@reltable.draw.42 = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.38 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.38 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.32 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.29 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.26 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.26 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.26 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.42 to i64)) to i32)]
@reltable.draw.43 = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.39 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.38 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.39 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.38 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.39 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.24 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.18 to i64), i64 ptrtoint ([7 x i32]* @reltable.draw.43 to i64)) to i32)]
define void @draw(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0))
%5 = icmp ult i32 %0, 7
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = sext i32 %0 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.draw to i8*), i64 %8)
%10 = sext i32 %0 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.draw.42 to i8*), i64 %11)
%13 = sext i32 %0 to i64
%14 = shl i64 %13, 2
%15 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.draw.43 to i8*), i64 %14)
%16 = tail call i32 @puts(i8* dereferenceable(1) %9)
%17 = tail call i32 @puts(i8* dereferenceable(1) %12)
%18 = tail call i32 @puts(i8* dereferenceable(1) %15)
br label %19
19: ; preds = %1, %6
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.19, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.20, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.21, i64 0, i64 0))
ret void
}