#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*/ avslutt();
int /*<<< orphan*/ init();
int meny();
int /*<<< orphan*/ registrer_deltaker();
int /*<<< orphan*/ registrer_sluttid();
int /*<<< orphan*/ registrer_starttid();
int /*<<< orphan*/ slett_deltaker();
int /*<<< orphan*/ vis_deltakerliste();
int /*<<< orphan*/ vis_resultatliste();
int main(int argc, char *argv[]) {
  int valg = 0;
  init();
  do {
    valg = meny();
    if (valg == 1)
      registrer_deltaker();
    if (valg == 2)
      slett_deltaker();
    if (valg == 3)
      registrer_starttid();
    if (valg == 4)
      registrer_sluttid();
    if (valg == 5)
      vis_deltakerliste();
    if (valg == 6)
      vis_resultatliste();
  } while (valg != 0);
  avslutt();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1070 <init@plt>
mov    $0x0,%al
call   1050 <meny@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11cf <main+0x3f>
mov    $0x0,%al
call   1060 <registrer_deltaker@plt>
cmpl   $0x2,-0x14(%rbp)
jne    11e0 <main+0x50>
mov    $0x0,%al
call   1090 <slett_deltaker@plt>
cmpl   $0x3,-0x14(%rbp)
jne    11f1 <main+0x61>
mov    $0x0,%al
call   1080 <registrer_starttid@plt>
cmpl   $0x4,-0x14(%rbp)
jne    1202 <main+0x72>
mov    $0x0,%al
call   1040 <registrer_sluttid@plt>
cmpl   $0x5,-0x14(%rbp)
jne    1213 <main+0x83>
mov    $0x0,%al
call   10a0 <vis_deltakerliste@plt>
cmpl   $0x6,-0x14(%rbp)
jne    1224 <main+0x94>
mov    $0x0,%al
call   1030 <vis_resultatliste@plt>
jmp    1229 <main+0x99>
cmpl   $0x0,-0x14(%rbp)
jne    11b4 <main+0x24>
mov    $0x0,%al
call   10b0 <avslutt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <init@plt>
lea    0xe61(%rip),%rbx
jmp    11b0 <main+0x20>
xor    %eax,%eax
call   1030 <vis_resultatliste@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <meny@plt>
cmp    $0x6,%eax
ja     11b0 <main+0x20>
mov    %eax,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1060 <registrer_deltaker@plt>
jmp    11b0 <main+0x20>
xor    %eax,%eax
call   1090 <slett_deltaker@plt>
jmp    11b0 <main+0x20>
xor    %eax,%eax
call   1080 <registrer_starttid@plt>
jmp    11b0 <main+0x20>
xor    %eax,%eax
call   1040 <registrer_sluttid@plt>
jmp    11b0 <main+0x20>
xor    %eax,%eax
call   10a0 <vis_deltakerliste@plt>
jmp    11b0 <main+0x20>
xor    %eax,%eax
call   10b0 <avslutt@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @init()
br label %8
8: ; preds = %40, %2
%9 = call i32 (...) @meny()
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @registrer_deltaker()
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @slett_deltaker()
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 (...) @registrer_starttid()
br label %24
24: ; preds = %22, %19
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 4
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (...) @registrer_sluttid()
br label %29
29: ; preds = %27, %24
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, 5
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (...) @vis_deltakerliste()
br label %34
34: ; preds = %32, %29
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 6
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 (...) @vis_resultatliste()
br label %39
39: ; preds = %37, %34
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 0
br i1 %42, label %8, label %43
43: ; preds = %40
%44 = call i32 (...) @avslutt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
br label %4
4: ; preds = %6, %2
%5 = tail call i32 (...) @meny()
switch i32 %5, label %6 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 0, label %19
]
6: ; preds = %4, %7, %9, %11, %13, %15, %17
br label %4
7: ; preds = %4
%8 = tail call i32 (...) @registrer_deltaker()
br label %6
9: ; preds = %4
%10 = tail call i32 (...) @slett_deltaker()
br label %6
11: ; preds = %4
%12 = tail call i32 (...) @registrer_starttid()
br label %6
13: ; preds = %4
%14 = tail call i32 (...) @registrer_sluttid()
br label %6
15: ; preds = %4
%16 = tail call i32 (...) @vis_deltakerliste()
br label %6
17: ; preds = %4
%18 = tail call i32 (...) @vis_resultatliste()
br label %6
19: ; preds = %4
%20 = tail call i32 (...) @avslutt()
ret i32 0
}