#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*/ free(int *);
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int);
int main(int argc, char *argv[]) {
  int nums[] = {3, 2, 0};
  int *rtn_array = twoSum(nums, 3, 2);
  printf("%d %d\n", rtn_array[0], rtn_array[1]);
  if (rtn_array) {
    free(rtn_array);
  }
  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    0xeb3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1050 <twoSum@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x28(%rbp)
je     119e <main+0x6e>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0xecd(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xeba(%rip),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1050 <twoSum@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [3 x i32] [i32 3, i32 2, i32 0]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [3 x i32]* %6 to i8*
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%10 = call i32* @twoSum(i32* %9, i32 3, i32 2)
store i32* %10, i32** %7
%11 = load i32*, i32** %7
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16)
%18 = load i32*, i32** %7
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %2
%21 = load i32*, i32** %7
%22 = call i32 @free(i32* %21)
br label %23
23: ; preds = %20, %2
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [3 x i32] [i32 3, i32 2, i32 0]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32* @twoSum(i32* %5, i32 3, i32 2)
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = call i32 @free(i32* %6)
ret i32 0
}