#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*/ imprimirSprite(int);
int /*<<< orphan*/ printf(char *);
void impresionMapa(int nivel[14][212], int j, int posicioHorizontalMario,
                   int posicionVerticalMario,
                   int posicionHorizontalMarioRelativa) {
  int i, p;
  for (i = 0; i < 14; ++i) {
    for (p = 0; p < j; ++p) {
      if (p != posicionHorizontalMarioRelativa || i != posicionVerticalMario)
        imprimirSprite(nivel[i][p + posicioHorizontalMario - 2]);
      else
        printf("\x1b[31m"
               "$"
               "\x1b[0m");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<impresionMapa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xe,-0x1c(%rbp)
jge    11d9 <impresionMapa+0xb9>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bf <impresionMapa+0x9f>
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1175 <impresionMapa+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     11a0 <impresionMapa+0x80>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x350,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <imprimirSprite@plt>
jmp    11ac <impresionMapa+0x8c>
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
jmp    11b1 <impresionMapa+0x91>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1151 <impresionMapa+0x31>
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1140 <impresionMapa+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impresionMapa>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r13d
mov    %rdi,0x10(%rsp)
add    $0xfffffffe,%r13d
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %esi,0xc(%rsp)
mov    %esi,%r14d
xor    %r15d,%r15d
jmp    1174 <impresionMapa+0x44>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
cmp    $0xe,%r15
je     11bb <impresionMapa+0x8b>
cmpl   $0x0,0xc(%rsp)
jle    1160 <impresionMapa+0x30>
xor    %r12d,%r12d
jmp    11a3 <impresionMapa+0x73>
lea    (%r12,%r13,1),%eax
cltq
imul   $0x350,%r15,%rcx
add    0x10(%rsp),%rcx
mov    (%rcx,%rax,4),%edi
call   1040 <imprimirSprite@plt>
add    $0x1,%r12
cmp    %r12,%r14
je     1160 <impresionMapa+0x30>
cmp    %r12,%rbx
jne    1180 <impresionMapa+0x50>
cmp    %rbp,%r15
jne    1180 <impresionMapa+0x50>
lea    0xe4c(%rip),%rdi
call   1050 <printf@plt>
jmp    119a <impresionMapa+0x6a>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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