#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*/ randDessert();
int /*<<< orphan*/ randForret();
int /*<<< orphan*/ randHovedret();
char *transDessert(int /*<<< orphan*/);
char *transForret(int /*<<< orphan*/);
char *transHovedret(int /*<<< orphan*/);
void maaltid() {
  int i;
  for (i = 0; i <= 24; i++) {
    printf("Menu: %2d ", i + 1);
    printf("Forret: %s ", transForret(randForret()));
    printf("Hovedret: %s ", transHovedret(randHovedret()));
    printf("Dessert: %s\n", transDessert(randDessert()));
  }
}


x86 assembly (clang, -O0):
<maaltid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x18,-0x4(%rbp)
jg     1208 <maaltid+0x98>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <randForret@plt>
mov    %eax,%edi
call   1050 <transForret@plt>
mov    %rax,%rsi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <randHovedret@plt>
mov    %eax,%edi
call   1080 <transHovedret@plt>
mov    %rax,%rsi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <randDessert@plt>
mov    %eax,%edi
call   1090 <transDessert@plt>
mov    %rax,%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117f <maaltid+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maaltid>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xe7b(%rip),%r14
lea    0xe7f(%rip),%r15
lea    0xe84(%rip),%r12
lea    0xe8b(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <randForret@plt>
mov    %eax,%edi
call   1050 <transForret@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <randHovedret@plt>
mov    %eax,%edi
call   1080 <transHovedret@plt>
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1070 <randDessert@plt>
mov    %eax,%edi
call   1090 <transDessert@plt>
mov    %r13,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x1a,%ebx
jne    11a0 <maaltid+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Menu: %2d \00"
@.str.1 = [12 x i8] c"Forret: %s \00"
@.str.2 = [14 x i8] c"Hovedret: %s \00"
@.str.3 = [13 x i8] c"Dessert: %s\0A\00"
define void @maaltid() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %18, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 24
br i1 %4, label %5, label %21
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @randForret()
%10 = call i8* @transForret(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @randHovedret()
%13 = call i8* @transHovedret(i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = call i32 (...) @randDessert()
%16 = call i8* @transDessert(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %5
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %2
21: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Menu: %2d \00"
@.str.1 = [12 x i8] c"Forret: %s \00"
@.str.2 = [14 x i8] c"Hovedret: %s \00"
@.str.3 = [13 x i8] c"Dessert: %s\0A\00"
define void @maaltid() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @randForret()
%6 = tail call i8* @transForret(i32 %5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = tail call i32 (...) @randHovedret()
%9 = tail call i8* @transHovedret(i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = tail call i32 (...) @randDessert()
%12 = tail call i8* @transDessert(i32 %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = icmp eq i32 %3, 25
br i1 %14, label %15, label %1
15: ; preds = %1
ret void
}