#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, char *);
void schreibe_menue(int menuelaenge, int textlaenge,
                    char menue[menuelaenge][textlaenge]) {
  for (int i = 0; i < menuelaenge; i++)
    printf("\n(%d)  %s", i + 1, menue[i]);
}


x86 assembly (clang, -O0):
<schreibe_menue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116f <schreibe_menue+0x5f>
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <schreibe_menue+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schreibe_menue>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
jle    1149 <schreibe_menue+0x39>
mov    %rdx,%r14
mov    %esi,%r12d
mov    %edi,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
add    %r12,%r14
cmp    %rbx,%r13
jne    1130 <schreibe_menue+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0A(%d) %s\00"
define void @schreibe_menue(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
store i32 0, i32* %7
br label %12
12: ; preds = %25, %3
%13 = load i32, i32* %7
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
%19 = load i8*, i8** %6
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = mul nsw i64 %21, %11
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18, i8* %23)
br label %25
25: ; preds = %16
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %12
28: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0A(%d) %s\00"
define void @schreibe_menue(i32 %0, i32 %1, i8* %2) {
%4 = zext i32 %1 to i64
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = zext i32 %0 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %11, %9 ]
%11 = add nuw nsw i64 %10, 1
%12 = mul nuw nsw i64 %10, %4
%13 = getelementptr inbounds i8, i8* %2, i64 %12
%14 = trunc i64 %11 to i32
%15 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %13)
%16 = icmp eq i64 %11, %7
br i1 %16, label %8, label %9
}