#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 *);
int /*<<< orphan*/ scanf(char *, int *);
int imprimirMenu() {
  int opcion = -1;
  do {
    if (opcion != 1 || opcion != 2) {
      printf("\t>>>>>>>>>>>Debe elegir una opcion válida.\n");
    }
    printf("Elija una opcion de menu.\n\t 1. Jugar.\n\t 2. Salir.\n");
    scanf("%d", &opcion);
  } while (opcion != 1 || opcion != 2);
  return opcion;
}


x86 assembly (clang, -O0):
<imprimirMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1143 <imprimirMenu+0x23>
cmpl   $0x2,-0x4(%rbp)
je     114f <imprimirMenu+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jne    1184 <imprimirMenu+0x64>
cmpl   $0x2,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    112f <imprimirMenu+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirMenu>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xecc(%rip),%r14
lea    0xef1(%rip),%r15
lea    0xebb(%rip),%r12
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
jmp    1150 <imprimirMenu+0x30>

LLVM IR (-O0):
@.str = [45 x i8] c"\09>>>>>>>>>>>Debe elegir una opcion v\C3\A1lida.\0A\00"
@.str.1 = [51 x i8] c"Elija una opcion de menu.\0A\09 1. Jugar.\0A\09 2. Salir.\0A\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @imprimirMenu() {
%1 = alloca i32
store i32 -1, i32* %1
br label %2
2: ; preds = %19, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
br label %13
13: ; preds = %10
%14 = load i32, i32* %1
%15 = icmp ne i32 %14, 1
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %1
%18 = icmp ne i32 %17, 2
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ true, %13 ], [ %18, %16 ]
br i1 %20, label %2, label %21
21: ; preds = %19
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@str = [44 x i8] c"\09>>>>>>>>>>>Debe elegir una opcion v\C3\A1lida.\00"
@str.3 = [50 x i8] c"Elija una opcion de menu.\0A\09 1. Jugar.\0A\09 2. Salir.\00"
define i32 @imprimirMenu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.3, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
br label %3
}