#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 *, char *, int);
int cur_print(int *cur_age, char **cur_name) {
  int j = 0;
  for (j = 0; cur_age[j] != '\0'; j++) {
    printf("%s is %d years old.\n", cur_name[j], cur_age[j]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<cur_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1171 <cur_print+0x61>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <cur_print+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cur_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%edx
test   %edx,%edx
je     1149 <cur_print+0x39>
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebx,%ebx
lea    0xed3(%rip),%r15
nopl   (%rax)
mov    (%r14,%rbx,2),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x4(%r12,%rbx,1),%edx
add    $0x4,%rbx
test   %edx,%edx
jne    1130 <cur_print+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s is %d years old.\0A\00"
define i32 @cur_print(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
%5 = alloca i32
store i32* %0, i32** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32*, i32** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %6
%14 = load i8**, i8*** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = load i32*, i32** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %23)
br label %25
25: ; preds = %13
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s is %d years old.\0A\00"
define i32 @cur_print(i32* nocapture %0, i8** nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = phi i32 [ %13, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %6
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %7)
%11 = add nuw i64 %6, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret i32 0
}