int main(void) {
  printf("\nDas Prorgramm erzeuge ein Array mit zufaelligen Zahlen aus dem "
         "Bereich von a bis b und werte es aus.\n");
  char menue[][20] = {"int-Array", "double-Array", "Programm beenden"};
  switch (waehle_aus_menue(3, 20, menue)) {
  case 1:
    erzeuge_zufall_int_array();
    break;
  case 2:
    erzeuge_zufall_double_array();
    break;
  default:
    puts("\nDas Programm wird beendet. See You!\n");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x45(%rbp)
call   1050 <printf@plt>
mov    -0x45(%rbp),%al
movups 0xf42(%rip),%xmm0
movups %xmm0,-0x14(%rbp)
movaps 0xf2b(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movaps 0xf10(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    $0x3,%edi
mov    $0x14,%esi
lea    -0x40(%rbp),%rdx
call   1040 <waehle_aus_menue@plt>
mov    %eax,%ecx
mov    %ecx,-0x44(%rbp)
sub    $0x1,%eax
je     11d6 <main+0x86>
jmp    11c5 <main+0x75>
mov    -0x44(%rbp),%eax
sub    $0x2,%eax
je     11e2 <main+0x92>
jmp    11ee <main+0x9e>
mov    $0x0,%al
call   1070 <erzeuge_zufall_int_array@plt>
jmp    11fc <main+0xac>
mov    $0x0,%al
call   1060 <erzeuge_zufall_double_array@plt>
jmp    11fc <main+0xac>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
movups 0xed5(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe85(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x3,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <waehle_aus_menue@plt>
cmp    $0x2,%eax
je     11a6 <main+0x66>
cmp    $0x1,%eax
jne    11af <main+0x6f>
xor    %eax,%eax
call   1060 <erzeuge_zufall_int_array@plt>
jmp    11bd <main+0x7d>
xor    %eax,%eax
call   1050 <erzeuge_zufall_double_array@plt>
jmp    11bd <main+0x7d>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [103 x i8] c"\0ADas Prorgramm erzeuge ein Array mit zufaelligen Zahlen aus dem Bereich von a bis b und werte es aus.\0A\00"
@__const.main.menue = [3 x [20 x i8]] [[20 x i8] c"int-Array\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"double-Array\00\00\00\00\00\00\00\00", [20 x i8] c"Programm beenden\00\00\00\00"]
@.str.1 = [38 x i8] c"\0ADas Programm wird beendet. See You!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [20 x i8]]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [3 x [20 x i8]]* %2 to i8*
%5 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 0
%6 = call i32 (i32, i32, [20 x i8]*, ...) bitcast (i32 (...)* @waehle_aus_menue to i32 (i32, i32, [20 x i8]*, ...)*)(i32 3, i32 20, [20 x i8]* %5)
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %9
]
7: ; preds = %0
%8 = call i32 (...) @erzeuge_zufall_int_array()
br label %13
9: ; preds = %0
%10 = call i32 (...) @erzeuge_zufall_double_array()
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@__const.main.menue = [3 x [20 x i8]] [[20 x i8] c"int-Array\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"double-Array\00\00\00\00\00\00\00\00", [20 x i8] c"Programm beenden\00\00\00\00"]
@.str.1 = [38 x i8] c"\0ADas Programm wird beendet. See You!\0A\00"
@str = [102 x i8] c"\0ADas Prorgramm erzeuge ein Array mit zufaelligen Zahlen aus dem Bereich von a bis b und werte es aus.\00"
define i32 @main() {
%1 = alloca [3 x [20 x i8]]
%2 = tail call i32 bitcast (i32 (...)* @puts to i32 (i8*)*)(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %1, i64 0, i64 0
%5 = call i32 (i32, i32, [20 x i8]*, ...) bitcast (i32 (...)* @waehle_aus_menue to i32 (i32, i32, [20 x i8]*, ...)*)(i32 3, i32 20, [20 x i8]* %4)
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 (...) @erzeuge_zufall_int_array()
br label %12
8: ; preds = %0
%9 = call i32 (...) @erzeuge_zufall_double_array()
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6
ret i32 0
}