#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 *, char);
void imprime(char **mapa) {
  int x, y;
  for (y = 0; y < 30; y++) {
    for (x = 0; x < 80; x++) {
      switch (mapa[y][x]) {
      case 'T':
        printf("%c", 6);
        break;
      case 'X':
        printf("%c", 1);
        break;
      case '#':
        printf("%c", 219);
        break;
      case 'R':
        printf("%c", 176);
        break;
      case 'C':
        printf("%c", 178);
        break;
      case 'P':
        printf("%c", 219);
        break;
      case ' ':
        printf("%c", 177);
        break;
      default:
        printf("%c", mapa[y][x]);
      }
    }
  }
}


x86 assembly (clang, -O0):
<imprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    1258 <imprime+0x148>
movl   $0x0,-0xc(%rbp)
cmpl   $0x50,-0xc(%rbp)
jge    1245 <imprime+0x135>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x38,%eax
ja     1212 <imprime+0x102>
mov    -0x18(%rbp),%rax
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf65(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
lea    0xf4f(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
lea    0xf39(%rip),%rdi
mov    $0xffffffdb,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
lea    0xf23(%rip),%rdi
mov    $0xffffffb0,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
lea    0xf0d(%rip),%rdi
mov    $0xffffffb2,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
lea    0xef7(%rip),%rdi
mov    $0xffffffdb,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
lea    0xee1(%rip),%rdi
mov    $0xffffffb1,%esi
call   1030 <printf@plt>
jmp    1232 <imprime+0x122>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
lea    0xebb(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
jmp    1237 <imprime+0x127>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <imprime+0x24>
jmp    124a <imprime+0x13a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <imprime+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r15
xor    %r13d,%r13d
lea    0xfbe(%rip),%r14
lea    0xed3(%rip),%r12
jmp    113a <imprime+0x2a>
nop
add    $0x1,%r13
cmp    $0x1e,%r13
je     1184 <imprime+0x74>
xor    %ebx,%ebx
jmp    1155 <imprime+0x45>
mov    %ecx,%eax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x50,%rbx
je     1130 <imprime+0x20>
mov    (%r15,%r13,8),%rax
movsbl (%rax,%rbx,1),%ecx
lea    -0x20(%rcx),%edx
cmp    $0x38,%edx
ja     113e <imprime+0x2e>
mov    $0x6,%al
movslq (%r12,%rdx,4),%rdx
add    %r12,%rdx
jmp    *%rdx
mov    $0xdb,%al
jmp    1140 <imprime+0x30>
mov    $0xb1,%al
jmp    1140 <imprime+0x30>
mov    $0xb0,%al
jmp    1140 <imprime+0x30>
mov    $0xb2,%al
jmp    1140 <imprime+0x30>
mov    $0x1,%al
jmp    1140 <imprime+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @imprime(i8** nocapture %0) {
br label %2
2: ; preds = %1, %23
%3 = phi i64 [ 0, %1 ], [ %24, %23 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
br label %5
5: ; preds = %2, %18
%6 = phi i64 [ 0, %2 ], [ %21, %18 ]
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 %6
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
switch i32 %10, label %17 [
i32 84, label %18
i32 88, label %11
i32 35, label %12
i32 82, label %13
i32 67, label %14
i32 80, label %15
i32 32, label %16
]
11: ; preds = %5
br label %18
12: ; preds = %5
br label %18
13: ; preds = %5
br label %18
14: ; preds = %5
br label %18
15: ; preds = %5
br label %18
16: ; preds = %5
br label %18
17: ; preds = %5
br label %18
18: ; preds = %5, %11, %12, %13, %14, %15, %16, %17
%19 = phi i8 [ 1, %11 ], [ -37, %12 ], [ -80, %13 ], [ -78, %14 ], [ -37, %15 ], [ -79, %16 ], [ %9, %17 ], [ 6, %5 ]
%20 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %19)
%21 = add nuw nsw i64 %6, 1
%22 = icmp eq i64 %21, 80
br i1 %22, label %23, label %5
23: ; preds = %18
%24 = add nuw nsw i64 %3, 1
%25 = icmp eq i64 %24, 30
br i1 %25, label %26, label %2
26: ; preds = %23
ret void
}