#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 *initialize_vectors(int);
int *tranlaste_arguments_to_vector(int integers_amount, char *argv[]) {
  int *arguments_vector = initialize_vectors(integers_amount);
  int argument_counter = 2;
  int vector_counter = 0;
  int current_value = 0;
  while (vector_counter < integers_amount) {
    current_value = atoi(argv[argument_counter]);
    arguments_vector[vector_counter] = current_value;
    vector_counter++;
    argument_counter++;
  }
  return arguments_vector;
}


x86 assembly (clang, -O0):
<tranlaste_arguments_to_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <initialize_vectors@plt>
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1195 <tranlaste_arguments_to_vector+0x75>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1150 <tranlaste_arguments_to_vector+0x30>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tranlaste_arguments_to_vector>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <initialize_vectors@plt>
mov    %rax,%r15
test   %ebp,%ebp
jle    1157 <tranlaste_arguments_to_vector+0x37>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x10(%r14,%rbx,8),%rdi
call   1030 <atoi@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <tranlaste_arguments_to_vector+0x20>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @tranlaste_arguments_to_vector(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = load i32, i32* %3
%10 = call i32* @initialize_vectors(i32 %9)
store i32* %10, i32** %5
store i32 2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %11
11: ; preds = %15, %2
%12 = load i32, i32* %7
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = load i8**, i8*** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %8
%22 = load i32, i32* %8
%23 = load i32*, i32** %5
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %11
31: ; preds = %11
%32 = load i32*, i32** %5
ret i32* %32
}

LLVM IR (-O2):
define i32* @tranlaste_arguments_to_vector(i32 %0, i8** nocapture %1) {
%3 = tail call i32* @initialize_vectors(i32 %0)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 2, %5 ], [ %15, %7 ]
%9 = phi i64 [ 0, %5 ], [ %14, %7 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %8
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = getelementptr inbounds i32, i32* %3, i64 %9
store i32 %12, i32* %13
%14 = add nuw nsw i64 %9, 1
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %14, %6
br i1 %16, label %17, label %7
17: ; preds = %7, %2
ret i32* %3
}