#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 *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int, int *);
int main() {
  int *size = (int *)malloc(sizeof(int));
  int *ar;
  int a1[7] = {3, 24, 50, 79, 88, 150, 345};
  int t1 = 200;
  ar = twoSum(a1, 7, t1, size);
  printf("[%d, %d]\n", ar[0], ar[1]);
  int a2[7] = {2, 3, 4};
  int t2 = 6;
  ar = twoSum(a2, 3, t2, size);
  printf("[%d, %d]\n", ar[0], ar[1]);
  int a3[26020] = {0};
  a3[13010] = 2;
  a3[13011] = 3;
  for (int i = 13012; i < 26020; i++) {
    a3[i] = 9;
  }
  int t3 = 5;
  ar = twoSum(a3, 26020, t3, size);
  printf("[%d, %d]\n", ar[0], ar[1]);
  free(size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x19710,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe81(%rip),%eax
mov    %eax,-0x28(%rbp)
movl   $0xc8,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x7,%esi
call   1070 <twoSum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    0xe46(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe43(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe40(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe3e(%rip),%eax
mov    %eax,-0x48(%rbp)
movl   $0x6,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x3,%esi
call   1070 <twoSum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
lea    -0x19700(%rbp),%rdi
xor    %esi,%esi
mov    $0x19690,%edx
call   1050 <memset@plt>
movl   $0x2,-0xcbb8(%rbp)
movl   $0x3,-0xcbb4(%rbp)
movl   $0x32d4,-0x19704(%rbp)
cmpl   $0x65a4,-0x19704(%rbp)
jge    129d <main+0x14d>
movslq -0x19704(%rbp),%rax
movl   $0x9,-0x19700(%rbp,%rax,4)
mov    -0x19704(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19704(%rbp)
jmp    1267 <main+0x117>
movl   $0x5,-0x19708(%rbp)
lea    -0x19700(%rbp),%rdi
mov    -0x19708(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x65a4,%esi
call   1070 <twoSum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xd62(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x19710,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x196d0,%rsp
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
movups 0xeac(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x7,%esi
mov    $0xc8,%edx
mov    %rax,%rcx
call   1070 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xea8(%rip),%r14
mov    %r14,%rdi
call   1040 <printf@plt>
movups 0xe89(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xe71(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
mov    %r15,%rcx
call   1070 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x40(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x19690,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movabs $0x300000002,%rax
mov    %rax,0xcb88(%rsp)
movaps 0xdef(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movaps %xmm0,0xcb90(%rsp,%rbx,4)
movaps %xmm0,0xcba0(%rsp,%rbx,4)
movaps %xmm0,0xcbb0(%rsp,%rbx,4)
movaps %xmm0,0xcbc0(%rsp,%rbx,4)
movaps %xmm0,0xcbd0(%rsp,%rbx,4)
movaps %xmm0,0xcbe0(%rsp,%rbx,4)
movaps %xmm0,0xcbf0(%rsp,%rbx,4)
movaps %xmm0,0xcc00(%rsp,%rbx,4)
movaps %xmm0,0xcc10(%rsp,%rbx,4)
movaps %xmm0,0xcc20(%rsp,%rbx,4)
movaps %xmm0,0xcc30(%rsp,%rbx,4)
movaps %xmm0,0xcc40(%rsp,%rbx,4)
add    $0x30,%rbx
cmp    $0x32d0,%rbx
jne    1220 <main+0xd0>
lea    0x40(%rsp),%rdi
mov    $0x65a4,%esi
mov    $0x5,%edx
mov    %r15,%rcx
call   1070 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xd9c(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x196d0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a1 = [7 x i32] [i32 3, i32 24, i32 50, i32 79, i32 88, i32 150, i32 345]
@.str = [10 x i8] c"[%d, %d]\0A\00"
@__const.main.a2 = [7 x i32] [i32 2, i32 3, i32 4, i32 0, i32 0, i32 0, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [7 x i32]
%5 = alloca i32
%6 = alloca [7 x i32]
%7 = alloca i32
%8 = alloca [26020 x i32]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i64 @malloc(i32 4)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %2
%13 = bitcast [7 x i32]* %4 to i8*
store i32 200, i32* %5
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%15 = load i32, i32* %5
%16 = load i32*, i32** %2
%17 = call i32* @twoSum(i32* %14, i32 7, i32 %15, i32* %16)
store i32* %17, i32** %3
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %23)
%25 = bitcast [7 x i32]* %6 to i8*
store i32 6, i32* %7
%26 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%27 = load i32, i32* %7
%28 = load i32*, i32** %2
%29 = call i32* @twoSum(i32* %26, i32 3, i32 %27, i32* %28)
store i32* %29, i32** %3
%30 = load i32*, i32** %3
%31 = getelementptr inbounds i32, i32* %30, i64 0
%32 = load i32, i32* %31
%33 = load i32*, i32** %3
%34 = getelementptr inbounds i32, i32* %33, i64 1
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %35)
%37 = bitcast [26020 x i32]* %8 to i8*
%38 = getelementptr inbounds [26020 x i32], [26020 x i32]* %8, i64 0, i64 13010
store i32 2, i32* %38
%39 = getelementptr inbounds [26020 x i32], [26020 x i32]* %8, i64 0, i64 13011
store i32 3, i32* %39
store i32 13012, i32* %9
br label %40
40: ; preds = %47, %0
%41 = load i32, i32* %9
%42 = icmp slt i32 %41, 26020
br i1 %42, label %43, label %50
43: ; preds = %40
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [26020 x i32], [26020 x i32]* %8, i64 0, i64 %45
store i32 9, i32* %46
br label %47
47: ; preds = %43
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
store i32 %49, i32* %9
br label %40
50: ; preds = %40
store i32 5, i32* %10
%51 = getelementptr inbounds [26020 x i32], [26020 x i32]* %8, i64 0, i64 0
%52 = load i32, i32* %10
%53 = load i32*, i32** %2
%54 = call i32* @twoSum(i32* %51, i32 26020, i32 %52, i32* %53)
store i32* %54, i32** %3
%55 = load i32*, i32** %3
%56 = getelementptr inbounds i32, i32* %55, i64 0
%57 = load i32, i32* %56
%58 = load i32*, i32** %3
%59 = getelementptr inbounds i32, i32* %58, i64 1
%60 = load i32, i32* %59
%61 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %57, i32 %60)
%62 = load i32*, i32** %2
%63 = call i32 @free(i32* %62)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [7 x i32] [i32 3, i32 24, i32 50, i32 79, i32 88, i32 150, i32 345]
@.str = [10 x i8] c"[%d, %d]\0A\00"
@__const.main.a2 = [7 x i32] [i32 2, i32 3, i32 4, i32 0, i32 0, i32 0, i32 0]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [7 x i32]
%3 = alloca [26020 x i32]
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
%6 = bitcast [7 x i32]* %1 to i8*
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = call i32* @twoSum(i32* %7, i32 7, i32 200, i32* %5)
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
%13 = bitcast [7 x i32]* %2 to i8*
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%15 = call i32* @twoSum(i32* %14, i32 3, i32 6, i32* %5)
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %15, i64 1
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18)
%20 = bitcast [26020 x i32]* %3 to i8*
%21 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 13010
store i32 2, i32* %21
%22 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 13011
store i32 3, i32* %22
br label %23
23: ; preds = %23, %0
%24 = phi i64 [ 0, %0 ], [ %55, %23 ]
%25 = add nuw nsw i64 %24, 13012
%26 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 %25
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %27
%28 = getelementptr inbounds i32, i32* %26, i64 4
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %29
%30 = add nuw nsw i64 %24, 13020
%31 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 %30
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %32
%33 = getelementptr inbounds i32, i32* %31, i64 4
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %34
%35 = add nuw nsw i64 %24, 13028
%36 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 %35
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %37
%38 = getelementptr inbounds i32, i32* %36, i64 4
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %39
%40 = add nuw nsw i64 %24, 13036
%41 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 %40
%42 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %42
%43 = getelementptr inbounds i32, i32* %41, i64 4
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %44
%45 = add nuw nsw i64 %24, 13044
%46 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 %45
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %47
%48 = getelementptr inbounds i32, i32* %46, i64 4
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %49
%50 = add nuw nsw i64 %24, 13052
%51 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 %50
%52 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %52
%53 = getelementptr inbounds i32, i32* %51, i64 4
%54 = bitcast i32* %53 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %54
%55 = add nuw nsw i64 %24, 48
%56 = icmp eq i64 %55, 13008
br i1 %56, label %57, label %23
57: ; preds = %23
%58 = getelementptr inbounds [26020 x i32], [26020 x i32]* %3, i64 0, i64 0
%59 = call i32* @twoSum(i32* %58, i32 26020, i32 5, i32* %5)
%60 = load i32, i32* %59
%61 = getelementptr inbounds i32, i32* %59, i64 1
%62 = load i32, i32* %61
%63 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %60, i32 %62)
%64 = call i32 @free(i32* %5)
ret i32 0
}