#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 getch();
int /*<<< orphan*/ printf(char *);
void apuestaUsuario(int *a) {
  printf("Que quieres? Piedra (p), Papel (a) o Tijeras (t): \n");
  if (getch() == 112)
    *a = 0;
  else if (getch() == 97)
    *a = 1;
  else if (getch() == 116)
    *a = 2;
}


x86 assembly (clang, -O0):
<apuestaUsuario>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
cmp    $0x70,%eax
jne    1157 <apuestaUsuario+0x37>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    119a <apuestaUsuario+0x7a>
mov    $0x0,%al
call   1040 <getch@plt>
cmp    $0x61,%eax
jne    1176 <apuestaUsuario+0x56>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
jmp    1195 <apuestaUsuario+0x75>
mov    $0x0,%al
call   1040 <getch@plt>
cmp    $0x74,%eax
jne    1190 <apuestaUsuario+0x70>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
jmp    1195 <apuestaUsuario+0x75>
jmp    119a <apuestaUsuario+0x7a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apuestaUsuario>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x70,%eax
je     1162 <apuestaUsuario+0x42>
xor    %eax,%eax
call   1040 <getch@plt>
mov    $0x1,%ebp
cmp    $0x61,%eax
je     1162 <apuestaUsuario+0x42>
xor    %eax,%eax
call   1040 <getch@plt>
mov    $0x2,%ebp
cmp    $0x74,%eax
jne    1164 <apuestaUsuario+0x44>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Que quieres? Piedra (p), Papel (a) o Tijeras (t): \0A\00"
define void @apuestaUsuario(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getch()
%5 = icmp eq i32 %4, 112
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32*, i32** %2
store i32 0, i32* %7
br label %20
8: ; preds = %1
%9 = call i32 (...) @getch()
%10 = icmp eq i32 %9, 97
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32*, i32** %2
store i32 1, i32* %12
br label %19
13: ; preds = %8
%14 = call i32 (...) @getch()
%15 = icmp eq i32 %14, 116
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %2
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
br label %19
19: ; preds = %18, %11
br label %20
20: ; preds = %19, %6
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"Que quieres? Piedra (p), Papel (a) o Tijeras (t): \00"
define void @apuestaUsuario(i32* nocapture writeonly %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @getch()
%4 = icmp eq i32 %3, 112
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = tail call i32 (...) @getch()
%7 = icmp eq i32 %6, 97
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i32 (...) @getch()
%10 = icmp eq i32 %9, 116
br i1 %10, label %11, label %13
11: ; preds = %8, %5, %1
%12 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 2, %8 ]
store i32 %12, i32* %0
br label %13
13: ; preds = %11, %8
ret void
}