#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*/ printf(char *, int, int);
int *twoSum(int *, int, int);
int main() {
  int num[] = {2, 7, 11, 15}, num1[] = {-1, -2, -3, -4, -5}, *res;
  res = twoSum(num1, 5, -8);
  printf("%d %d\n", res[0], res[1]);
  res = twoSum(num, 4, 9);
  printf("%d %d\n", res[0], res[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
mov    $0xfffffff8,%edx
call   1040 <twoSum@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x9,%edx
call   1040 <twoSum@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xee9(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
mov    $0xfffffff8,%edx
call   1040 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x20(%rsp),%rdi
mov    $0x4,%esi
mov    $0x9,%edx
call   1040 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.num = [4 x i32] [i32 2, i32 7, i32 11, i32 15]
@__const.main.num1 = [5 x i32] [i32 -1, i32 -2, i32 -3, i32 -4, i32 -5]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32* @twoSum(i32* %5, i32 5, i32 -8)
%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 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%12 = call i32* @twoSum(i32* %11, i32 4, i32 9)
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %12, i64 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
ret i32 0
}