#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 getint();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int menu(void) {
  int option = 0;
  do {
    printf("\e[1;1H\e[2J");
    printf("\n\n\n");
    puts(" 1: Input signal parametrs from file");
    puts(" 2: Insert signal parametrs manually");
    puts(" 3: Display signal");
    puts(" 4: Print signal to file");
    puts(" 5: Generate signal");
    puts(" 6: Input results from file");
    puts(" 7: Plot the graphics in Maxima");
    puts(" 8: Exit");
    printf(">");
    option = getint();
  } while ((option < 0) || (option > 8));
  return option;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     11e6 <menu+0xb6>
cmpl   $0x8,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    113f <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
lea    0xf03(%rip),%rbx
lea    0xf0f(%rip),%rbp
lea    0xf21(%rip),%r14
lea    0xf2e(%rip),%r15
lea    0xf43(%rip),%r12
lea    0xf5c(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
lea    0xf47(%rip),%rdi
call   1040 <puts@plt>
lea    0xe6c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%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    %r12,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
mov    $0x3e,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getint@plt>
cmp    $0x8,%eax
ja     1180 <menu+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
@.str.1 = [4 x i8] c"\0A\0A\0A\00"
@.str.2 = [37 x i8] c" 1: Input signal parametrs from file\00"
@.str.3 = [37 x i8] c" 2: Insert signal parametrs manually\00"
@.str.4 = [19 x i8] c" 3: Display signal\00"
@.str.5 = [25 x i8] c" 4: Print signal to file\00"
@.str.6 = [20 x i8] c" 5: Generate signal\00"
@.str.7 = [28 x i8] c" 6: Input results from file\00"
@.str.8 = [32 x i8] c" 7: Plot the graphics in Maxima\00"
@.str.9 = [9 x i8] c" 8: Exit\00"
@.str.10 = [2 x i8] c">\00"
define i32 @menu() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %21, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 (...) @getint()
store i32 %14, i32* %1
br label %15
15: ; preds = %2
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = icmp sgt i32 %19, 8
br label %21
21: ; preds = %18, %15
%22 = phi i1 [ true, %15 ], [ %20, %18 ]
br i1 %22, label %2, label %23
23: ; preds = %21
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
@.str.2 = [37 x i8] c" 1: Input signal parametrs from file\00"
@.str.3 = [37 x i8] c" 2: Insert signal parametrs manually\00"
@.str.4 = [19 x i8] c" 3: Display signal\00"
@.str.5 = [25 x i8] c" 4: Print signal to file\00"
@.str.6 = [20 x i8] c" 5: Generate signal\00"
@.str.7 = [28 x i8] c" 6: Input results from file\00"
@.str.8 = [32 x i8] c" 7: Plot the graphics in Maxima\00"
@.str.9 = [9 x i8] c" 8: Exit\00"
@str = [3 x i8] c"\0A\0A\00"
define i32 @menu() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @putchar(i32 62)
%13 = tail call i32 (...) @getint()
%14 = icmp ugt i32 %13, 8
br i1 %14, label %1, label %15
15: ; preds = %1
ret i32 %13
}