#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 */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum_hash(int *, int, int);
int main() {
  int nums[] = {-1, -2, -3, -4, -5};
  int numsSize = sizeof(nums) / sizeof(int);
  int target = -8;
  int *ans = twoSum_hash(nums, numsSize, target);
  printf("%d,%d\n", ans[0], ans[1]);
  free(ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0xfffffff8,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1050 <twoSum_hash@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
mov    $0xfffffff8,%edx
call   1050 <twoSum_hash@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [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 [5 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
%6 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
store i32 -8, i32* %4
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32* @twoSum_hash(i32* %7, i32 %8, i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%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** %5
%19 = call i32 @free(i32* %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [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 [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum_hash(i32* %3, i32 5, i32 -8)
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = call i32 @free(i32* %4)
ret i32 0
}