#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int meny() {
  int v = 0;
abc:
  printf("\n\n == SkiData == \n\n");
  printf(" 0 - avslutt \n");
  printf(" 1 - registrer deltaker \n");
  printf(" 2 - slett deltaker \n");
  printf(" 3 - registrer start-tid for en deltaker \n");
  printf(" 4 - registrer slutt-tid for en deltaker \n");
  printf(" 5 - vis deltakerliste \n");
  printf(" 6 - vis resultatliste \n\n");
  printf(" Velg: ");
  scanf("%1d", &v);
  if (v < 0 || v > 6)
    goto abc;
  return v;
}


x86 assembly (clang, -O0):
<meny>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jl     11bf <meny+0x9f>
cmpl   $0x6,-0x4(%rbp)
jle    11c4 <meny+0xa4>
jmp    112f <meny+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meny>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xf3b(%rip),%rbp
lea    0xf5e(%rip),%r14
lea    0xf6f(%rip),%r15
lea    0xea1(%rip),%r12
lea    0xea2(%rip),%r13
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x6,%eax
ja     1170 <meny+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0A\0A == SkiData == \0A\0A\00"
@.str.1 = [15 x i8] c" 0 - avslutt \0A\00"
@.str.2 = [26 x i8] c" 1 - registrer deltaker \0A\00"
@.str.3 = [22 x i8] c" 2 - slett deltaker \0A\00"
@.str.4 = [43 x i8] c" 3 - registrer start-tid for en deltaker \0A\00"
@.str.5 = [43 x i8] c" 4 - registrer slutt-tid for en deltaker \0A\00"
@.str.6 = [25 x i8] c" 5 - vis deltakerliste \0A\00"
@.str.7 = [26 x i8] c" 6 - vis resultatliste \0A\0A\00"
@.str.8 = [8 x i8] c" Velg: \00"
@.str.9 = [4 x i8] c"%1d\00"
define i32 @meny() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %18, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = load i32, i32* %1
%17 = icmp sgt i32 %16, 6
br i1 %17, label %18, label %19
18: ; preds = %15, %2
br label %2
19: ; preds = %15
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str.8 = [8 x i8] c" Velg: \00"
@.str.9 = [4 x i8] c"%1d\00"
@str = [19 x i8] c"\0A\0A == SkiData == \0A\00"
@str.10 = [14 x i8] c" 0 - avslutt \00"
@str.11 = [25 x i8] c" 1 - registrer deltaker \00"
@str.12 = [21 x i8] c" 2 - slett deltaker \00"
@str.13 = [42 x i8] c" 3 - registrer start-tid for en deltaker \00"
@str.14 = [42 x i8] c" 4 - registrer slutt-tid for en deltaker \00"
@str.15 = [24 x i8] c" 5 - vis deltakerliste \00"
@str.16 = [25 x i8] c" 6 - vis resultatliste \0A\00"
define i32 @meny() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.13, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.15, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.16, i64 0, i64 0))
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = icmp ugt i32 %14, 6
br i1 %15, label %3, label %16
16: ; preds = %3
ret i32 %14
}