#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 get_byte();
int /*<<< orphan*/ printf(char *);
int main_menu(void) {
  int key;
  printf("\n\n");
  printf("-------------------------------------------------\n");
  printf("                    MAIN MENU                    \n");
  printf("-------------------------------------------------\n");
  printf(" 0. Smart Robot B'D DIO 00                       \n");
  printf(" 1. Smart Robot B'D DIO 01                       \n");
  printf(" 2. Smart Robot B'D DIO 02                       \n");
  printf(" 3. Smart Robot B'D DIO 03                       \n");
  printf(" 4. Smart Robot B'D DIO 04                       \n");
  printf(" 5. Smart Robot B'D DIO 05                       \n");
  printf(" 6. Smart Robot B'D DIO 06                       \n");
  printf(" 7. Smart Robot B'D DIO 07                       \n");
  printf(" 8. Smart Robot B'D DIO 08                       \n");
  printf(" 9. Smart Robot B'D DIO 09                       \n");
  printf("-------------------------------------------------\n");
  printf(" q. Smart Robot B'D FirmwareQUIT                 \n");
  printf("-------------------------------------------------\n");
  printf("\n\n");
  printf("SELECT THE COMMAND NUMBER : ");
  key = get_byte();
  return key;
}


x86 assembly (clang, -O0):
<main_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa6(%rip),%rdi
call   1030 <printf@plt>
lea    0xfcd(%rip),%rdi
call   1030 <printf@plt>
lea    0xff4(%rip),%rdi
call   1030 <printf@plt>
lea    0x101b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1042(%rip),%rdi
call   1030 <printf@plt>
lea    0x1069(%rip),%rdi
call   1030 <printf@plt>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
lea    0x1084(%rip),%rdi
call   1030 <printf@plt>
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
lea    0x1093(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_byte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_menu>:
push   %r14
push   %rbx
push   %rax
lea    0x116c(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x112b(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf54(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa0(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc6(%rip),%rdi
call   1030 <puts@plt>
lea    0xfec(%rip),%rdi
call   1030 <puts@plt>
lea    0x1012(%rip),%rdi
call   1030 <puts@plt>
lea    0x1038(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x1056(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xdf7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <get_byte@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [51 x i8] c"-------------------------------------------------\0A\00"
@.str.2 = [51 x i8] c" MAIN MENU \0A\00"
@.str.3 = [51 x i8] c" 0. Smart Robot B'D DIO 00 \0A\00"
@.str.4 = [51 x i8] c" 1. Smart Robot B'D DIO 01 \0A\00"
@.str.5 = [51 x i8] c" 2. Smart Robot B'D DIO 02 \0A\00"
@.str.6 = [51 x i8] c" 3. Smart Robot B'D DIO 03 \0A\00"
@.str.7 = [51 x i8] c" 4. Smart Robot B'D DIO 04 \0A\00"
@.str.8 = [51 x i8] c" 5. Smart Robot B'D DIO 05 \0A\00"
@.str.9 = [51 x i8] c" 6. Smart Robot B'D DIO 06 \0A\00"
@.str.10 = [51 x i8] c" 7. Smart Robot B'D DIO 07 \0A\00"
@.str.11 = [51 x i8] c" 8. Smart Robot B'D DIO 08 \0A\00"
@.str.12 = [51 x i8] c" 9. Smart Robot B'D DIO 09 \0A\00"
@.str.13 = [51 x i8] c" q. Smart Robot B'D FirmwareQUIT \0A\00"
@.str.14 = [29 x i8] c"SELECT THE COMMAND NUMBER : \00"
define i32 @main_menu() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.12, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.13, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0))
%21 = call i32 (...) @get_byte()
store i32 %21, i32* %1
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str.14 = [29 x i8] c"SELECT THE COMMAND NUMBER : \00"
@str.16 = [50 x i8] c" MAIN MENU \00"
@str.18 = [50 x i8] c" 0. Smart Robot B'D DIO 00 \00"
@str.19 = [50 x i8] c" 1. Smart Robot B'D DIO 01 \00"
@str.20 = [50 x i8] c" 2. Smart Robot B'D DIO 02 \00"
@str.21 = [50 x i8] c" 3. Smart Robot B'D DIO 03 \00"
@str.22 = [50 x i8] c" 4. Smart Robot B'D DIO 04 \00"
@str.23 = [50 x i8] c" 5. Smart Robot B'D DIO 05 \00"
@str.24 = [50 x i8] c" 6. Smart Robot B'D DIO 06 \00"
@str.25 = [50 x i8] c" 7. Smart Robot B'D DIO 07 \00"
@str.26 = [50 x i8] c" 8. Smart Robot B'D DIO 08 \00"
@str.27 = [50 x i8] c" 9. Smart Robot B'D DIO 09 \00"
@str.29 = [50 x i8] c" q. Smart Robot B'D FirmwareQUIT \00"
@str.30 = [50 x i8] c"-------------------------------------------------\00"
@str.31 = [2 x i8] c"\0A\00"
define i32 @main_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.31, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.30, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.16, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.30, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.18, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.19, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.20, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.21, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.22, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.23, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.24, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.25, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.26, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.27, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.30, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.29, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.30, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.31, i64 0, i64 0))
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0))
%20 = tail call i32 (...) @get_byte()
ret i32 %20
}