#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*/ convert(char **, int *, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int my_array[5];
  char *array[5] = {"15", "10", "12", "2", "1"};
  convert(array, my_array, 5);
  print_array(my_array, 5);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    0xe9a(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe80(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe77(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x5,%edx
call   1030 <convert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <print_array@plt>
lea    0xe4e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rax
mov    %rax,(%rsp)
lea    0xebc(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xeb3(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xea8(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe9e(%rip),%rax
mov    %rax,0x20(%rsp)
mov    %rsp,%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <convert@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"15\00"
@.str.1 = [3 x i8] c"10\00"
@.str.2 = [3 x i8] c"12\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x i8*]
store i32 0, i32* %1
%4 = bitcast [5 x i8*]* %3 to i8*
%5 = bitcast i8* %4 to [5 x i8*]*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%13 = call i32 @convert(i8** %11, i32* %12, i32 5)
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%15 = call i32 @print_array(i32* %14, i32 5)
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"15\00"
@.str.1 = [3 x i8] c"10\00"
@.str.2 = [3 x i8] c"12\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [2 x i8] c"1\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i8*]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i8*]* %2 to i8*
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%11 = call i32 @convert(i8** %5, i32* %10, i32 5)
%12 = call i32 @print_array(i32* %10, i32 5)
%13 = call i32 @putchar(i32 10)
ret i32 0
}