#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 */
char **name;
int /*<<< orphan*/ printf(char *, char *, int);
void print_stupid(int *ages, char **names, int count) {
  int *age = ages;
  char **name = name;
  for (name = names, age = ages; (age - ages) < count; name++, age++) {
    printf("%s lived %d years so far.\n", *name, *age);
  }
}


x86 assembly (clang, -O0):
<print_stupid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jge    1195 <print_stupid+0x85>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1143 <print_stupid+0x33>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stupid>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1162 <print_stupid+0x52>
mov    %rsi,%r14
mov    %rdi,%r12
movslq %edx,%r13
mov    $0x4,%ebx
lea    0xece(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x8(%r14,%rbx,2),%rsi
mov    -0x4(%r12,%rbx,1),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
sar    $0x2,%rax
add    $0x4,%rbx
cmp    %r13,%rax
jl     1140 <print_stupid+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s lived %d years so far.\0A\00"
@name = global i8** null
define void @print_stupid(i32* %0, i8** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8**
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
store i32* %9, i32** %7
%10 = load i8**, i8*** %8
store i8** %10, i8*** %8
%11 = load i8**, i8*** %5
store i8** %11, i8*** %8
%12 = load i32*, i32** %4
store i32* %12, i32** %7
br label %13
13: ; preds = %29, %3
%14 = load i32*, i32** %7
%15 = load i32*, i32** %4
%16 = ptrtoint i32* %14 to i64
%17 = ptrtoint i32* %15 to i64
%18 = sub i64 %16, %17
%19 = sdiv exact i64 %18, 4
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %19, %21
br i1 %22, label %23, label %34
23: ; preds = %13
%24 = load i8**, i8*** %8
%25 = load i8*, i8** %24
%26 = load i32*, i32** %7
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %25, i32 %27)
br label %29
29: ; preds = %23
%30 = load i8**, i8*** %8
%31 = getelementptr inbounds i8*, i8** %30, i32 1
store i8** %31, i8*** %8
%32 = load i32*, i32** %7
%33 = getelementptr inbounds i32, i32* %32, i32 1
store i32* %33, i32** %7
br label %13
34: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s lived %d years so far.\0A\00"
@name = global i8** null
define void @print_stupid(i32* %0, i8** nocapture %1, i32 %2) {
%4 = ptrtoint i32* %0 to i64
%5 = sext i32 %2 to i64
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %19
7: ; preds = %3, %7
%8 = phi i8** [ %13, %7 ], [ %1, %3 ]
%9 = phi i32* [ %14, %7 ], [ %0, %3 ]
%10 = load i8*, i8** %8
%11 = load i32, i32* %9
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
%13 = getelementptr inbounds i8*, i8** %8, i64 1
%14 = getelementptr inbounds i32, i32* %9, i64 1
%15 = ptrtoint i32* %14 to i64
%16 = sub i64 %15, %4
%17 = ashr exact i64 %16, 2
%18 = icmp slt i64 %17, %5
br i1 %18, label %7, label %19
19: ; preds = %7, %3
ret void
}