#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 */
typedef int /*<<< orphan*/ ages;

/* Variables and functions */
int /*<<< orphan*/ print_1(int, int *, char **);
int /*<<< orphan*/ print_2(int, int *, char **);
int /*<<< orphan*/ print_3(int, int *, char **);
int /*<<< orphan*/ print_4(int, int *, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int ages[] = {23, 43, 12, 89, 2};
  char *names[] = {"Alan", "Frank", "Mary", "John", "Lisa"};
  int count = sizeof(ages) / sizeof(ages[0]);
  print_1(count, ages, names);
  printf("---\n");
  print_2(count, ages, names);
  printf("---\n");
  print_3(count, ages, names);
  printf("---\n");
  print_4(count, ages, names);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe7e(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    0xe68(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe62(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe5d(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe57(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe51(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x5,-0x64(%rbp)
mov    -0x64(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1030 <print_1@plt>
lea    0xe34(%rip),%rdi
call   1050 <printf@plt>
mov    -0x64(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1080 <print_2@plt>
lea    0xe18(%rip),%rdi
call   1050 <printf@plt>
mov    -0x64(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1040 <print_3@plt>
lea    0xdfc(%rip),%rdi
call   1050 <printf@plt>
mov    -0x64(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1070 <print_4@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0xeb1(%rip),%eax
mov    %eax,0x40(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xe9e(%rip),%rax
mov    %rax,(%rsp)
lea    0xe98(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe92(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe8b(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe84(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0x30(%rsp),%r15
mov    %rsp,%r14
mov    $0x5,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <print_1@plt>
lea    0xe65(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1070 <print_2@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <print_3@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1060 <print_4@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.ages = [5 x i32] [i32 23, i32 43, i32 12, i32 89, i32 2]
@.str = [5 x i8] c"Alan\00"
@.str.1 = [6 x i8] c"Frank\00"
@.str.2 = [5 x i8] c"Mary\00"
@.str.3 = [5 x i8] c"John\00"
@.str.4 = [5 x i8] c"Lisa\00"
@.str.5 = [5 x i8] c"---\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca [5 x i8*]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [5 x i32]* %6 to i8*
%10 = bitcast [5 x i8*]* %7 to i8*
%11 = bitcast i8* %10 to [5 x i8*]*
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %11, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %11, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %11, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %11, i32 0, i32 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %11, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8** %16
store i32 5, i32* %8
%17 = load i32, i32* %8
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
%20 = call i32 @print_1(i32 %17, i32* %18, i8** %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%22 = load i32, i32* %8
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%24 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
%25 = call i32 @print_2(i32 %22, i32* %23, i8** %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%27 = load i32, i32* %8
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%29 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
%30 = call i32 @print_3(i32 %27, i32* %28, i8** %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%32 = load i32, i32* %8
%33 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%34 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
%35 = call i32 @print_4(i32 %32, i32* %33, i8** %34)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ages = [5 x i32] [i32 23, i32 43, i32 12, i32 89, i32 2]
@.str = [5 x i8] c"Alan\00"
@.str.1 = [6 x i8] c"Frank\00"
@.str.2 = [5 x i8] c"Mary\00"
@.str.3 = [5 x i8] c"John\00"
@.str.4 = [5 x i8] c"Lisa\00"
@str.7 = [4 x i8] c"---\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = alloca [5 x i8*]
%5 = bitcast [5 x i32]* %3 to i8*
%6 = bitcast [5 x i8*]* %4 to i8*
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i64 0, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i64 0, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i64 0, i64 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %4, i64 0, i64 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%13 = call i32 @print_1(i32 5, i32* %12, i8** %7)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0))
%15 = call i32 @print_2(i32 5, i32* %12, i8** %7)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0))
%17 = call i32 @print_3(i32 5, i32* %12, i8** %7)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0))
%19 = call i32 @print_4(i32 5, i32* %12, i8** %7)
ret i32 0
}