#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*/ GetUserInput(char *, int);
size_t atoi(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int MenuUser() {
  char choose[2];
  size_t sel = 1;
  do {
    printf("\n Please select option \n");
    printf(" Sign up to server --------------------> 1  \n");
    printf(" Login to server ----------------------> 2  \n");
    printf(" To Exit Press-------------------------> 0  \n");
    GetUserInput(choose, 2);
    sel = atoi(choose);
    system("clear");
  } while (sel < 0 || sel > 2);
  return sel;
}


x86 assembly (clang, -O0):
<MenuUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x1,-0x10(%rbp)
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xed8(%rip),%rdi
call   1050 <printf@plt>
lea    0xefa(%rip),%rdi
call   1050 <printf@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <GetUserInput@plt>
lea    -0x2(%rbp),%rdi
call   1060 <atoi@plt>
mov    %rax,-0x10(%rbp)
lea    0xf01(%rip),%rdi
call   1040 <system@plt>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jb     11c2 <MenuUser+0x82>
cmpq   $0x2,-0x10(%rbp)
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1150 <MenuUser+0x10>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MenuUser>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xecc(%rip),%r15
lea    0xef2(%rip),%r12
lea    0xf18(%rip),%r13
lea    0x6(%rsp),%rbx
lea    0xe94(%rip),%rbp
nopl   0x0(%rax)
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <GetUserInput@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %rax,%r14
mov    %rbp,%rdi
call   1050 <system@plt>
cmp    $0x2,%r14
ja     1170 <MenuUser+0x30>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A Please select option \0A\00"
@.str.1 = [46 x i8] c" Sign up to server --------------------> 1 \0A\00"
@.str.2 = [46 x i8] c" Login to server ----------------------> 2 \0A\00"
@.str.3 = [46 x i8] c" To Exit Press-------------------------> 0 \0A\00"
@.str.4 = [6 x i8] c"clear\00"
define i32 @MenuUser() {
%1 = alloca [2 x i8]
%2 = alloca i64
store i64 1, i64* %2
br label %3
3: ; preds = %19, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%9 = call i32 @GetUserInput(i8* %8, i32 2)
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%11 = call i64 @atoi(i8* %10)
store i64 %11, i64* %2
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %3
%14 = load i64, i64* %2
%15 = icmp ult i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i64, i64* %2
%18 = icmp ugt i64 %17, 2
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ true, %13 ], [ %18, %16 ]
br i1 %20, label %3, label %21
21: ; preds = %19
%22 = load i64, i64* %2
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
@.str.4 = [6 x i8] c"clear\00"
@str = [24 x i8] c"\0A Please select option \00"
@str.5 = [45 x i8] c" Sign up to server --------------------> 1 \00"
@str.6 = [45 x i8] c" Login to server ----------------------> 2 \00"
@str.7 = [45 x i8] c" To Exit Press-------------------------> 0 \00"
define i32 @MenuUser() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.5, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.6, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 @GetUserInput(i8* %2, i32 2)
%9 = call i64 @atoi(i8* %2)
%10 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp ugt i64 %9, 2
br i1 %11, label %3, label %12
12: ; preds = %3
%13 = trunc i64 %9 to i32
ret i32 %13
}