#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 atoi(char *);
int /*<<< orphan*/ codelet_0001(int, int *, int, int *, int *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ init(int, int *);
int *malloc(int);
int /*<<< orphan*/ print(int, int *);
int main(int argc, char **argv) {
  int size;
  int *a, *b, *c;
  int x = ((long int)&argv[0]) % 37;
  if (argc != 2)
    size = 32;
  else
    size = atoi(argv[1]);
  a = malloc(size * sizeof(int));
  b = malloc(size * sizeof(int));
  c = malloc(size * sizeof(int));
  init(size, a);
  init(size, b);
  codelet_0001(size, a, x, b, c);
  print(size, c);
  free(a);
  free(b);
  free(c);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x25,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     119f <main+0x3f>
movl   $0x20,-0x14(%rbp)
jmp    11af <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1060 <init@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1060 <init@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <codelet_0001@plt>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1050 <print@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0x20,%ebx
cmp    $0x2,%edi
jne    1183 <main+0x23>
mov    0x8(%r14),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebx
movabs $0x3759f22983759f23,%rcx
f2 59 37
mov    %r14,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x3,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,8),%eax
lea    (%rdx,%rax,4),%eax
sub    %eax,%r14d
lea    0x0(,%rbx,4),%ebp
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,%r13
mov    %ebx,%edi
mov    %r15,%rsi
call   1060 <init@plt>
mov    %ebx,%edi
mov    %r12,%rsi
call   1060 <init@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %r12,%rcx
mov    %r13,%r8
call   1040 <codelet_0001@plt>
mov    %ebx,%edi
mov    %r13,%rsi
call   1050 <print@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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*
%9 = alloca i32*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = ptrtoint i8** %12 to i64
%14 = srem i64 %13, 37
%15 = trunc i64 %14 to i32
store i32 %15, i32* %10
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 32, i32* %6
br label %24
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %6
br label %24
24: ; preds = %19, %18
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = mul i64 %26, 4
%28 = trunc i64 %27 to i32
%29 = call i32* @malloc(i32 %28)
store i32* %29, i32** %7
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = mul i64 %31, 4
%33 = trunc i64 %32 to i32
%34 = call i32* @malloc(i32 %33)
store i32* %34, i32** %8
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 4
%38 = trunc i64 %37 to i32
%39 = call i32* @malloc(i32 %38)
store i32* %39, i32** %9
%40 = load i32, i32* %6
%41 = load i32*, i32** %7
%42 = call i32 @init(i32 %40, i32* %41)
%43 = load i32, i32* %6
%44 = load i32*, i32** %8
%45 = call i32 @init(i32 %43, i32* %44)
%46 = load i32, i32* %6
%47 = load i32*, i32** %7
%48 = load i32, i32* %10
%49 = load i32*, i32** %8
%50 = load i32*, i32** %9
%51 = call i32 @codelet_0001(i32 %46, i32* %47, i32 %48, i32* %49, i32* %50)
%52 = load i32, i32* %6
%53 = load i32*, i32** %9
%54 = call i32 @print(i32 %52, i32* %53)
%55 = load i32*, i32** %7
%56 = call i32 @free(i32* %55)
%57 = load i32*, i32** %8
%58 = call i32 @free(i32* %57)
%59 = load i32*, i32** %9
%60 = call i32 @free(i32* %59)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 32, %2 ]
%10 = ptrtoint i8** %1 to i64
%11 = srem i64 %10, 37
%12 = trunc i64 %11 to i32
%13 = shl i32 %9, 2
%14 = tail call i32* @malloc(i32 %13)
%15 = tail call i32* @malloc(i32 %13)
%16 = tail call i32* @malloc(i32 %13)
%17 = tail call i32 @init(i32 %9, i32* %14)
%18 = tail call i32 @init(i32 %9, i32* %15)
%19 = tail call i32 @codelet_0001(i32 %9, i32* %14, i32 %12, i32* %15, i32* %16)
%20 = tail call i32 @print(i32 %9, i32* %16)
%21 = tail call i32 @free(i32* %14)
%22 = tail call i32 @free(i32* %15)
%23 = tail call i32 @free(i32* %16)
ret i32 0
}