#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
int menu() {
  int aux = -1;
  while (aux < 0 || aux > 5) {
    system("cls");
    printf("\n\t  MENU PRINCIPAL - SELECCIONE UNA OPCION");
    printf("\n\t==========================================\n");
    printf("\t1.- SUMAR DOS NUMEROS\n\n");
    printf("\t2.- RESTAR DOS NUMEROS\n\n");
    printf("\t3.- MULTIPLICAR DOS NUMEROS\n\n");
    printf("\t4.- DIVIDIR DOS NUMEROS\n\n");
    printf("\t5.- FIN...!!!\n\n");
    printf("\t");
    fflush(stdin);
    scanf("%d", &aux);
  }
  return (aux);
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1168 <menu+0x28>
cmpl   $0x5,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1178 <menu+0x38>
jmp    1207 <menu+0xc7>
lea    0xe81(%rip),%rdi
call   1030 <system@plt>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
call   1040 <printf@plt>
lea    0xefc(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xee4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
jmp    114f <menu+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xf16(%rip),%rbp
lea    0xf2d(%rip),%r14
lea    0xf40(%rip),%r15
mov    0x2e59(%rip),%rbx
lea    0xe99(%rip),%r12
lea    0x4(%rsp),%r13
nopl   0x0(%rax,%rax,1)
lea    0xe59(%rip),%rdi
call   1050 <system@plt>
lea    0xe51(%rip),%rdi
call   1060 <printf@plt>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1070 <fflush@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
ja     11a0 <menu+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [43 x i8] c"\0A\09 MENU PRINCIPAL - SELECCIONE UNA OPCION\00"
@.str.2 = [46 x i8] c"\0A\09==========================================\0A\00"
@.str.3 = [25 x i8] c"\091.- SUMAR DOS NUMEROS\0A\0A\00"
@.str.4 = [26 x i8] c"\092.- RESTAR DOS NUMEROS\0A\0A\00"
@.str.5 = [31 x i8] c"\093.- MULTIPLICAR DOS NUMEROS\0A\0A\00"
@.str.6 = [27 x i8] c"\094.- DIVIDIR DOS NUMEROS\0A\0A\00"
@.str.7 = [17 x i8] c"\095.- FIN...!!!\0A\0A\00"
@.str.8 = [2 x i8] c"\09\00"
@stdin = global i32 0
@.str.9 = [3 x i8] c"%d\00"
define i32 @menu() {
%1 = alloca i32
store i32 -1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 5
br label %8
8: ; preds = %5, %2
%9 = phi i1 [ true, %2 ], [ %7, %5 ]
br i1 %9, label %10, label %23
10: ; preds = %8
%11 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stdin
%21 = call i32 @fflush(i32 %20)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
br label %2
23: ; preds = %8
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [43 x i8] c"\0A\09 MENU PRINCIPAL - SELECCIONE UNA OPCION\00"
@stdin = global i32 0
@.str.9 = [3 x i8] c"%d\00"
@str = [45 x i8] c"\0A\09==========================================\00"
@str.10 = [24 x i8] c"\091.- SUMAR DOS NUMEROS\0A\00"
@str.11 = [25 x i8] c"\092.- RESTAR DOS NUMEROS\0A\00"
@str.12 = [30 x i8] c"\093.- MULTIPLICAR DOS NUMEROS\0A\00"
@str.13 = [26 x i8] c"\094.- DIVIDIR DOS NUMEROS\0A\00"
@str.14 = [16 x i8] c"\095.- FIN...!!!\0A\00"
define i32 @menu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.12, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.14, i64 0, i64 0))
%12 = call i32 @putchar(i32 9)
%13 = load i32, i32* @stdin
%14 = call i32 @fflush(i32 %13)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
%17 = icmp ugt i32 %16, 5
br i1 %17, label %3, label %18
18: ; preds = %3
ret i32 %16
}