#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*/ exit(int /*<<< orphan*/);
int menu();
int /*<<< orphan*/ pnum(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  system("clear");
  int ret_option = 1;
start:
  while (ret_option != 0) {
    ret_option = menu();
    if (ret_option > 2) {
      printf("================================================================="
             "=\n");
      printf("Wrong option .. please try again\n");
      printf("================================================================="
             "=\n");
      goto start;
    }
    if (ret_option == 0)
      exit(0);
    pnum(ret_option);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <system@plt>
movl   $0x1,-0x8(%rbp)
jmp    1177 <main+0x27>
cmpl   $0x0,-0x8(%rbp)
je     11dc <main+0x8c>
mov    $0x0,%al
call   1040 <menu@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    11be <main+0x6e>
lea    0xe6a(%rip),%rdi
call   1060 <printf@plt>
lea    0xea2(%rip),%rdi
call   1060 <printf@plt>
lea    0xe52(%rip),%rdi
call   1060 <printf@plt>
jmp    1172 <main+0x22>
cmpl   $0x0,-0x8(%rbp)
jne    11cf <main+0x7f>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%edi
call   1030 <pnum@plt>
jmp    1177 <main+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
call   1060 <system@plt>
lea    0xec0(%rip),%rbx
lea    0xe98(%rip),%r14
jmp    1190 <main+0x40>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <menu@plt>
cmp    $0x2,%eax
jg     1170 <main+0x20>
test   %eax,%eax
je     11a9 <main+0x59>
mov    %eax,%edi
call   1030 <pnum@plt>
jmp    1190 <main+0x40>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [68 x i8] c"==================================================================\0A\00"
@.str.2 = [34 x i8] c"Wrong option .. please try again\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %4
4: ; preds = %12, %0
br label %5
5: ; preds = %21, %4
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = call i32 (...) @menu()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 2
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
br label %4
16: ; preds = %8
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %16
%22 = load i32, i32* %2
%23 = call i32 @pnum(i32 %22)
br label %5
24: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@str.3 = [33 x i8] c"Wrong option .. please try again\00"
@str.4 = [67 x i8] c"==================================================================\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %5, %0
%3 = tail call i32 (...) @menu()
%4 = icmp sgt i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %14, %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.4, i64 0, i64 0))
br label %2
9: ; preds = %2, %14
%10 = phi i32 [ %16, %14 ], [ %3, %2 ]
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %9
%15 = tail call i32 @pnum(i32 %10)
%16 = tail call i32 (...) @menu()
%17 = icmp sgt i32 %16, 2
br i1 %17, label %5, label %9
}