#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 */
scalar_t__ add_person(int *, int);
int /*<<< orphan*/ print_list(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test(int *);
int main() {
  int ages_list[128] = {};
  int sample_input[12] = {23, 33, 45, 24, 15, 76, 82, 43, 51, 43, 45, -12};
  printf("Original list: ");
  for (int i = 0; i < 12; i++) {
    printf(" %d", sample_input[i]);
  }
  printf("\n");
  for (int i = 0; i < 12; i++) {
    if (add_person(ages_list, sample_input[i]) != 0) {
      printf("Ignoring invalid input: %d\n", sample_input[i]);
    }
  }
  print_list(ages_list);
  test(ages_list);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1060 <memset@plt>
lea    -0x240(%rbp),%rdi
lea    0xe6d(%rip),%rsi
mov    $0x30,%edx
call   1070 <memcpy@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x244(%rbp)
cmpl   $0xc,-0x244(%rbp)
jge    11f2 <main+0x92>
movslq -0x244(%rbp),%rax
mov    -0x240(%rbp,%rax,4),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x244(%rbp)
jmp    11b5 <main+0x55>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x248(%rbp)
cmpl   $0xc,-0x248(%rbp)
jge    1270 <main+0x110>
lea    -0x210(%rbp),%rdi
movslq -0x248(%rbp),%rax
mov    -0x240(%rbp,%rax,4),%esi
call   1050 <add_person@plt>
cmp    $0x0,%rax
je     1257 <main+0xf7>
movslq -0x248(%rbp),%rax
mov    -0x240(%rbp,%rax,4),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    125c <main+0xfc>
mov    -0x248(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x248(%rbp)
jmp    120a <main+0xaa>
lea    -0x210(%rbp),%rdi
call   1030 <print_list@plt>
lea    -0x210(%rbp),%rdi
call   1080 <test@plt>
xor    %eax,%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rsp,%r14
mov    $0x200,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7f(%rip),%rbx
mov    %rbx,%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x18,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x52,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x33,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffff4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x17,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     1274 <main+0x114>
lea    0xdac(%rip),%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x21,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     1299 <main+0x139>
lea    0xd87(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x2d,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     12be <main+0x15e>
lea    0xd62(%rip),%rdi
mov    $0x2d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x18,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     12e3 <main+0x183>
lea    0xd3d(%rip),%rdi
mov    $0x18,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0xf,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     1308 <main+0x1a8>
lea    0xd18(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x4c,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     132d <main+0x1cd>
lea    0xcf3(%rip),%rdi
mov    $0x4c,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x52,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     1352 <main+0x1f2>
lea    0xcce(%rip),%rdi
mov    $0x52,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x2b,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     1377 <main+0x217>
lea    0xca9(%rip),%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x33,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     139c <main+0x23c>
lea    0xc84(%rip),%rdi
mov    $0x33,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x2b,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     13c1 <main+0x261>
lea    0xc5f(%rip),%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0x2d,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     13e6 <main+0x286>
lea    0xc3a(%rip),%rdi
mov    $0x2d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
mov    $0xfffffff4,%esi
call   1060 <add_person@plt>
test   %rax,%rax
je     140b <main+0x2ab>
lea    0xc15(%rip),%rdi
mov    $0xfffffff4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <print_list@plt>
mov    %rbx,%rdi
call   1080 <test@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.sample_input = [12 x i32] [i32 23, i32 33, i32 45, i32 24, i32 15, i32 76, i32 82, i32 43, i32 51, i32 43, i32 45, i32 -12]
@.str = [16 x i8] c"Original list: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [28 x i8] c"Ignoring invalid input: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i32]
%3 = alloca [12 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [128 x i32]* %2 to i8*
%7 = bitcast [12 x i32]* %3 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 12
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %9
21: ; preds = %9
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %23
23: ; preds = %41, %21
%24 = load i32, i32* %5
%25 = icmp slt i32 %24, 12
br i1 %25, label %26, label %44
26: ; preds = %23
%27 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 0
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = call i64 @add_person(i32* %27, i32 %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %26
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %34, %26
br label %41
41: ; preds = %40
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %23
44: ; preds = %23
%45 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 0
%46 = call i32 @print_list(i32* %45)
%47 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 0
%48 = call i32 @test(i32* %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Original list: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.3 = [28 x i8] c"Ignoring invalid input: %d\0A\00"
define i32 @main() {
%1 = alloca [128 x i32]
%2 = bitcast [128 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 23)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 33)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 45)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 24)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 15)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 76)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 82)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 43)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 51)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 43)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 45)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 -12)
%16 = tail call i32 @putchar(i32 10)
%17 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 0
%18 = call i64 @add_person(i32* %17, i32 23)
%19 = icmp eq i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 23)
br label %22
22: ; preds = %0, %20
%23 = call i64 @add_person(i32* %17, i32 33)
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 33)
br label %27
27: ; preds = %25, %22
%28 = call i64 @add_person(i32* %17, i32 45)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 45)
br label %32
32: ; preds = %30, %27
%33 = call i64 @add_person(i32* %17, i32 24)
%34 = icmp eq i64 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 24)
br label %37
37: ; preds = %35, %32
%38 = call i64 @add_person(i32* %17, i32 15)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 15)
br label %42
42: ; preds = %40, %37
%43 = call i64 @add_person(i32* %17, i32 76)
%44 = icmp eq i64 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 76)
br label %47
47: ; preds = %45, %42
%48 = call i64 @add_person(i32* %17, i32 82)
%49 = icmp eq i64 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 82)
br label %52
52: ; preds = %50, %47
%53 = call i64 @add_person(i32* %17, i32 43)
%54 = icmp eq i64 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 43)
br label %57
57: ; preds = %55, %52
%58 = call i64 @add_person(i32* %17, i32 51)
%59 = icmp eq i64 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 51)
br label %62
62: ; preds = %60, %57
%63 = call i64 @add_person(i32* %17, i32 43)
%64 = icmp eq i64 %63, 0
br i1 %64, label %67, label %65
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 43)
br label %67
67: ; preds = %65, %62
%68 = call i64 @add_person(i32* %17, i32 45)
%69 = icmp eq i64 %68, 0
br i1 %69, label %72, label %70
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 45)
br label %72
72: ; preds = %70, %67
%73 = call i64 @add_person(i32* %17, i32 -12)
%74 = icmp eq i64 %73, 0
br i1 %74, label %77, label %75
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 -12)
br label %77
77: ; preds = %75, %72
%78 = call i32 @print_list(i32* %17)
%79 = call i32 @test(i32* %17)
ret i32 0
}