#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*/ arr_init(char *, int *);
int /*<<< orphan*/ input_to_array(char *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ sum(int *, int *);
int main(int argc, char *argv[]) {
  int *arr1 = (int *)malloc(50 * sizeof(int));
  int *sum_arr = (int *)malloc(52 * sizeof(int));
  arr_init(argv[1], sum_arr);
  int i;
  for (i = 2; i < 101; i++) {
    input_to_array(argv[i], arr1);
    sum(arr1, sum_arr);
  }
  print(sum_arr, 52);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0xd0,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <arr_init@plt>
movl   $0x2,-0x24(%rbp)
cmpl   $0x65,-0x24(%rbp)
jge    11d4 <main+0x84>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <input_to_array@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <sum@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119a <main+0x4a>
mov    -0x20(%rbp),%rdi
mov    $0x34,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    $0xd0,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    0x8(%r14),%rdi
mov    %rax,%rsi
call   1070 <arr_init@plt>
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
mov    %r12,%rsi
call   1050 <input_to_array@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <sum@plt>
add    $0x1,%rbx
cmp    $0x65,%rbx
jne    1190 <main+0x40>
mov    %r15,%rdi
mov    $0x34,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 @malloc(i32 200)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %6
%11 = call i64 @malloc(i32 208)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %7
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i32*, i32** %7
%17 = call i32 @arr_init(i8* %15, i32* %16)
store i32 2, i32* %8
br label %18
18: ; preds = %32, %2
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 101
br i1 %20, label %21, label %35
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = load i32*, i32** %6
%28 = call i32 @input_to_array(i8* %26, i32* %27)
%29 = load i32*, i32** %6
%30 = load i32*, i32** %7
%31 = call i32 @sum(i32* %29, i32* %30)
br label %32
32: ; preds = %21
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %18
35: ; preds = %18
%36 = load i32*, i32** %7
%37 = call i32 @print(i32* %36, i32 52)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @malloc(i32 200)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @malloc(i32 208)
%6 = inttoptr i64 %5 to i32*
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @arr_init(i8* %8, i32* %6)
br label %10
10: ; preds = %2, %10
%11 = phi i64 [ 2, %2 ], [ %16, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @input_to_array(i8* %13, i32* %4)
%15 = tail call i32 @sum(i32* %4, i32* %6)
%16 = add nuw nsw i64 %11, 1
%17 = icmp eq i64 %16, 101
br i1 %17, label %18, label %10
18: ; preds = %10
%19 = tail call i32 @print(i32* %6, i32 52)
ret i32 0
}