#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*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int ages[] = {23, 43, 12, 89, 2};
  char names[][6] = {{"Alan"}, {"Frank"}, {"Mary"}, {"John"}, {"Lisa"}};
  int count = sizeof(ages) / sizeof(int);
  int i = 0;
  for (i = count - 1; i >= 0; i--) {
    printf("%s has %d years alive.\n", names[i], ages[i]);
  }
  printf("---\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x38(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0x34(%rbp)
movl   $0x5,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jl     11ce <main+0xbe>
movslq -0x58(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x6,%rax,%rax
add    %rax,%rsi
movslq -0x58(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x58(%rbp)
jmp    1191 <main+0x81>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee2(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x18(%rsp),%rsi
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x12(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x59,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x6(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2b,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x17,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.ages = [5 x i32] [i32 23, i32 43, i32 12, i32 89, i32 2]
@__const.main.names = [5 x [6 x i8]] [[6 x i8] c"Alan\00\00", [6 x i8] c"Frank\00", [6 x i8] c"Mary\00\00", [6 x i8] c"John\00\00", [6 x i8] c"Lisa\00\00"]
@.str = [24 x i8] c"%s has %d years alive.\0A\00"
@.str.1 = [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 [6 x i8]]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [5 x i32]* %6 to i8*
%11 = bitcast [5 x [6 x i8]]* %7 to i8*
store i32 5, i32* %8
store i32 0, i32* %9
%12 = load i32, i32* %8
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %9
br label %14
14: ; preds = %27, %2
%15 = load i32, i32* %9
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x [6 x i8]], [5 x [6 x i8]]* %7, i64 0, i64 %19
%21 = getelementptr inbounds [6 x i8], [6 x i8]* %20, i64 0, i64 0
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %21, i32 %25)
br label %27
27: ; preds = %17
%28 = load i32, i32* %9
%29 = add nsw i32 %28, -1
store i32 %29, i32* %9
br label %14
30: ; preds = %14
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.names = [5 x [6 x i8]] [[6 x i8] c"Alan\00\00", [6 x i8] c"Frank\00", [6 x i8] c"Mary\00\00", [6 x i8] c"John\00\00", [6 x i8] c"Lisa\00\00"]
@.str = [24 x i8] c"%s has %d years alive.\0A\00"
@str = [4 x i8] c"---\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x [6 x i8]]
%4 = getelementptr inbounds [5 x [6 x i8]], [5 x [6 x i8]]* %3, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [5 x [6 x i8]], [5 x [6 x i8]]* %3, i64 0, i64 4, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5, i32 2)
%7 = getelementptr inbounds [5 x [6 x i8]], [5 x [6 x i8]]* %3, i64 0, i64 3, i64 0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7, i32 89)
%9 = getelementptr inbounds [5 x [6 x i8]], [5 x [6 x i8]]* %3, i64 0, i64 2, i64 0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9, i32 12)
%11 = getelementptr inbounds [5 x [6 x i8]], [5 x [6 x i8]]* %3, i64 0, i64 1, i64 0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11, i32 43)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4, i32 23)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}