#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 strlen(char *);
void printMenuOptions(char *options[], int numberOfOptions) {
  for (int i = 0; i < numberOfOptions; i++) {
    printf("   |   %s", options[i]);
    for (int j = 0; j < 69 - strlen(options[i]); j++)
      printf(" ");
    printf("|\n");
  }
}


x86 assembly (clang, -O0):
<printMenuOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c6 <printMenuOptions+0xa6>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%eax
mov    $0x45,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11aa <printMenuOptions+0x8a>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <printMenuOptions+0x43>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <printMenuOptions+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMenuOptions>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11d4 <printMenuOptions+0x94>
mov    %rdi,%r13
mov    %esi,%r12d
lea    0xea0(%rip),%r14
lea    0xea3(%rip),%r15
xor    %ebx,%ebx
jmp    1181 <printMenuOptions+0x41>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0x1,%rbx
cmp    %r12,%rbx
je     11d4 <printMenuOptions+0x94>
mov    0x0(%r13,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x0(%r13,%rbx,8),%rdi
call   1050 <strlen@plt>
cmp    $0x44,%eax
jg     1170 <printMenuOptions+0x30>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0x0(%r13,%rbx,8),%rdi
call   1050 <strlen@plt>
mov    $0x45,%ecx
sub    %eax,%ecx
cmp    %ecx,%ebp
jl     11b0 <printMenuOptions+0x70>
jmp    1170 <printMenuOptions+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c" | %s\00"
@str = [2 x i8] c"|\00"
define void @printMenuOptions(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %15, %2
ret void
7: ; preds = %4, %15
%8 = phi i64 [ 0, %4 ], [ %17, %15 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %9
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp slt i32 %13, 69
br i1 %14, label %19, label %15
15: ; preds = %19, %7
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%17 = add nuw nsw i64 %8, 1
%18 = icmp eq i64 %17, %5
br i1 %18, label %6, label %7
19: ; preds = %7, %19
%20 = phi i32 [ %22, %19 ], [ 0, %7 ]
%21 = tail call i32 @putchar(i32 32)
%22 = add nuw nsw i32 %20, 1
%23 = load i8*, i8** %9
%24 = tail call i32 @strlen(i8* %23)
%25 = sub nsw i32 69, %24
%26 = icmp slt i32 %22, %25
br i1 %26, label %19, label %15
}