#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_tablero(int *t, int *l, int start) {
  int stop = 70;
  if (*t == *l && !start) {
    if (*l - 1 >= 1)
      *l--;
    else
      *l = 1;
    printf("OUCH!!!");
  } else if (!start) {
    for (int i = 0; i < stop; i++) {
      if (*t == i + 1)
        printf("T");
      else if (*l == i + 1)
        printf("L");
      else
        printf(" ");
    }
  }
  if (start)
    printf("BANG!!!");
  printf("\n");
  for (int i = 0; i < 70; i++)
    printf("-");
  printf("\n");
}


x86 assembly (clang, -O0):
<print_tablero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x46,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1184 <print_tablero+0x74>
cmpl   $0x0,-0x14(%rbp)
jne    1184 <print_tablero+0x74>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cmp    $0x1,%eax
jl     1169 <print_tablero+0x59>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
jmp    1173 <print_tablero+0x63>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    1219 <print_tablero+0x109>
cmpl   $0x0,-0x14(%rbp)
jne    1214 <print_tablero+0x104>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    120f <print_tablero+0xff>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    11c6 <print_tablero+0xb6>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
jmp    11fc <print_tablero+0xec>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    11eb <print_tablero+0xdb>
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
jmp    11f7 <print_tablero+0xe7>
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
jmp    11fc <print_tablero+0xec>
jmp    1201 <print_tablero+0xf1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1195 <print_tablero+0x85>
jmp    1214 <print_tablero+0x104>
jmp    1219 <print_tablero+0x109>
cmpl   $0x0,-0x14(%rbp)
je     122f <print_tablero+0x11f>
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x46,-0x20(%rbp)
jge    1266 <print_tablero+0x156>
lea    0xdc5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1242 <print_tablero+0x132>
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tablero>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
mov    (%rdi),%eax
test   %edx,%edx
jne    115a <print_tablero+0x3a>
cmp    (%r15),%eax
jne    115a <print_tablero+0x3a>
cmp    $0x1,%eax
jg     1147 <print_tablero+0x27>
movl   $0x1,(%r15)
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
test   %r14d,%r14d
jne    115f <print_tablero+0x3f>
jmp    116b <print_tablero+0x4b>
test   %r14d,%r14d
je     11a3 <print_tablero+0x83>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x46,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1180 <print_tablero+0x60>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x54,%edi
cmp    %eax,%ebx
je     11c8 <print_tablero+0xa8>
mov    $0x4c,%edi
cmp    (%r15),%ebx
je     11c8 <print_tablero+0xa8>
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    $0x46,%ebx
je     1153 <print_tablero+0x33>
mov    0x0(%rbp),%eax
add    $0x1,%ebx
jmp    11b0 <print_tablero+0x90>

LLVM IR (-O0):
@.str = [8 x i8] c"OUCH!!!\00"
@.str.1 = [2 x i8] c"T\00"
@.str.2 = [2 x i8] c"L\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [8 x i8] c"BANG!!!\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [2 x i8] c"-\00"
define void @print_tablero(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 70, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = icmp eq i32 %11, %13
br i1 %14, label %15, label %31
15: ; preds = %3
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %15
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = sub nsw i32 %20, 1
%22 = icmp sge i32 %21, 1
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i32 -1
store i32* %25, i32** %5
%26 = load i32, i32* %24
br label %29
27: ; preds = %18
%28 = load i32*, i32** %5
store i32 1, i32* %28
br label %29
29: ; preds = %27, %23
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %64
31: ; preds = %15, %3
%32 = load i32, i32* %6
%33 = icmp ne i32 %32, 0
br i1 %33, label %63, label %34
34: ; preds = %31
store i32 0, i32* %8
br label %35
35: ; preds = %59, %34
%36 = load i32, i32* %8
%37 = load i32, i32* %7
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %62
39: ; preds = %35
%40 = load i32*, i32** %4
%41 = load i32, i32* %40
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
%44 = icmp eq i32 %41, %43
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %58
47: ; preds = %39
%48 = load i32*, i32** %5
%49 = load i32, i32* %48
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
%52 = icmp eq i32 %49, %51
br i1 %52, label %53, label %55
53: ; preds = %47
%54 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %57
55: ; preds = %47
%56 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %55, %53
br label %58
58: ; preds = %57, %45
br label %59
59: ; preds = %58
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 1
store i32 %61, i32* %8
br label %35
62: ; preds = %35
br label %63
63: ; preds = %62, %31
br label %64
64: ; preds = %63, %29
%65 = load i32, i32* %6
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %69
69: ; preds = %67, %64
%70 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %9
br label %71
71: ; preds = %76, %69
%72 = load i32, i32* %9
%73 = icmp slt i32 %72, 70
br i1 %73, label %74, label %79
74: ; preds = %71
%75 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %76
76: ; preds = %74
%77 = load i32, i32* %9
%78 = add nsw i32 %77, 1
store i32 %78, i32* %9
br label %71
79: ; preds = %71
%80 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"OUCH!!!\00"
@.str.4 = [8 x i8] c"BANG!!!\00"
define void @print_tablero(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = icmp ne i32 %4, %5
%7 = icmp ne i32 %2, 0
%8 = or i1 %7, %6
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = icmp sgt i32 %4, 1
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 1, i32* %1
br label %12
12: ; preds = %9, %11
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %30
14: ; preds = %3
br i1 %7, label %31, label %15
15: ; preds = %14, %28
%16 = phi i32 [ %29, %28 ], [ %4, %14 ]
%17 = phi i32 [ %18, %28 ], [ 0, %14 ]
%18 = add nuw nsw i32 %17, 1
%19 = icmp eq i32 %16, %18
br i1 %19, label %24, label %20
20: ; preds = %15
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, %18
%23 = select i1 %22, i32 76, i32 32
br label %24
24: ; preds = %20, %15
%25 = phi i32 [ 84, %15 ], [ %23, %20 ]
%26 = tail call i32 @putchar(i32 %25)
%27 = icmp eq i32 %18, 70
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = load i32, i32* %0
br label %15
30: ; preds = %24, %12
br i1 %7, label %31, label %33
31: ; preds = %14, %30
%32 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %30
%34 = tail call i32 @putchar(i32 10)
br label %37
35: ; preds = %37
%36 = tail call i32 @putchar(i32 10)
ret void
37: ; preds = %33, %37
%38 = phi i32 [ 0, %33 ], [ %40, %37 ]
%39 = tail call i32 @putchar(i32 45)
%40 = add nuw nsw i32 %38, 1
%41 = icmp eq i32 %40, 70
br i1 %41, label %35, label %37
}