#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[] = {"Alan", "Frank", "Mary", "John", "Lisa"};
  int count = sizeof(ages) / sizeof(int);
  int i = 0;
  for (i = count; i >= 0; i--) {
    printf("%s has %d years alive.\n", names[i], ages[i]);
  }
  printf("---\n");
  int *cur_age = ages;
  char **cur_name = names;
  for (i = count; i >= 0; i--) {
    printf("%s has %d years old.\n", *(cur_name + i), *(cur_age + i));
  }
  printf("---\n");
  for (i = count; i >= 0; i--) {
    printf("%s has %d years old again.\n", cur_name[i], cur_age[i]);
  }
  printf("---\n");
  int new_count = count - 1;
  for (cur_name = names + new_count, cur_age = ages + new_count;
       cur_age == ages; cur_name--, cur_age--) {
    printf("%s lived %d years so far.\n", *cur_name, *cur_age);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xea5(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe9f(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe94(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe8e(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x5,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jl     11ea <main+0xca>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
movslq -0x68(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x68(%rbp)
jmp    11b3 <main+0x93>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jl     124b <main+0x12b>
mov    -0x78(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x70(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x68(%rbp)
jmp    120e <main+0xee>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jl     129c <main+0x17c>
mov    -0x78(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x70(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x68(%rbp)
jmp    125f <main+0x13f>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7c(%rbp)
lea    -0x60(%rbp),%rax
movslq -0x7c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
lea    -0x30(%rbp),%rax
movslq -0x7c(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
lea    -0x30(%rbp),%rcx
cmp    %rcx,%rax
jne    1322 <main+0x202>
mov    -0x78(%rbp),%rax
mov    (%rax),%rsi
mov    -0x70(%rbp),%rax
mov    (%rax),%edx
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x70(%rbp)
jmp    12d9 <main+0x1b9>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xee8(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%r12
mov    %rbp,%rdi
mov    %r12,%rsi
mov    $0x59,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe96(%rip),%r13
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe77(%rip),%r15
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x2b,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe59(%rip),%rsi
mov    %rbp,%rdi
mov    %rsi,%rbp
mov    $0x17,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe66(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x59,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x2b,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x17,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe2d(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe02(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0xdbb(%rip),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x59,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2b,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x17,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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 = [24 x i8] c"%s has %d years alive.\0A\00"
@.str.6 = [5 x i8] c"---\0A\00"
@.str.7 = [22 x i8] c"%s has %d years old.\0A\00"
@.str.8 = [28 x i8] c"%s has %d years old again.\0A\00"
@.str.9 = [27 x i8] c"%s lived %d years so far.\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
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8**
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [5 x i32]* %6 to i8*
%14 = bitcast [5 x i8*]* %7 to i8*
%15 = bitcast i8* %14 to [5 x i8*]*
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i32 0, i32 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8** %20
store i32 5, i32* %8
store i32 0, i32* %9
%21 = load i32, i32* %8
store i32 %21, i32* %9
br label %22
22: ; preds = %35, %2
%23 = load i32, i32* %9
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %38
25: ; preds = %22
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %29, i32 %33)
br label %35
35: ; preds = %25
%36 = load i32, i32* %9
%37 = add nsw i32 %36, -1
store i32 %37, i32* %9
br label %22
38: ; preds = %22
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
store i32* %40, i32** %10
%41 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
store i8** %41, i8*** %11
%42 = load i32, i32* %8
store i32 %42, i32* %9
br label %43
43: ; preds = %58, %38
%44 = load i32, i32* %9
%45 = icmp sge i32 %44, 0
br i1 %45, label %46, label %61
46: ; preds = %43
%47 = load i8**, i8*** %11
%48 = load i32, i32* %9
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = load i32*, i32** %10
%53 = load i32, i32* %9
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %51, i32 %56)
br label %58
58: ; preds = %46
%59 = load i32, i32* %9
%60 = add nsw i32 %59, -1
store i32 %60, i32* %9
br label %43
61: ; preds = %43
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%63 = load i32, i32* %8
store i32 %63, i32* %9
br label %64
64: ; preds = %79, %61
%65 = load i32, i32* %9
%66 = icmp sge i32 %65, 0
br i1 %66, label %67, label %82
67: ; preds = %64
%68 = load i8**, i8*** %11
%69 = load i32, i32* %9
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %68, i64 %70
%72 = load i8*, i8** %71
%73 = load i32*, i32** %10
%74 = load i32, i32* %9
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %73, i64 %75
%77 = load i32, i32* %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %72, i32 %77)
br label %79
79: ; preds = %67
%80 = load i32, i32* %9
%81 = add nsw i32 %80, -1
store i32 %81, i32* %9
br label %64
82: ; preds = %64
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%84 = load i32, i32* %8
%85 = sub nsw i32 %84, 1
store i32 %85, i32* %12
%86 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
%87 = load i32, i32* %12
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8*, i8** %86, i64 %88
store i8** %89, i8*** %11
%90 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%91 = load i32, i32* %12
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i32, i32* %90, i64 %92
store i32* %93, i32** %10
br label %94
94: ; preds = %104, %82
%95 = load i32*, i32** %10
%96 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%97 = icmp eq i32* %95, %96
br i1 %97, label %98, label %109
98: ; preds = %94
%99 = load i8**, i8*** %11
%100 = load i8*, i8** %99
%101 = load i32*, i32** %10
%102 = load i32, i32* %101
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %100, i32 %102)
br label %104
104: ; preds = %98
%105 = load i8**, i8*** %11
%106 = getelementptr inbounds i8*, i8** %105, i32 -1
store i8** %106, i8*** %11
%107 = load i32*, i32** %10
%108 = getelementptr inbounds i32, i32* %107, i32 -1
store i32* %108, i32** %10
br label %94
109: ; preds = %94
ret i32 0
}

LLVM IR (-O2):
@.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 = [24 x i8] c"%s has %d years alive.\0A\00"
@.str.7 = [22 x i8] c"%s has %d years old.\0A\00"
@.str.8 = [28 x i8] c"%s has %d years old again.\0A\00"
@str.11 = [4 x i8] c"---\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* poison, i32 undef)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 89)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 12)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 43)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 23)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* poison, i32 undef)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 2)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 89)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 43)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 23)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.11, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* poison, i32 undef)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 2)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 89)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 12)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 43)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 23)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.11, i64 0, i64 0))
ret i32 0
}