#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*/ findSubsetWithGivenSum(int *, int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  int A[] = {-4, 1, 10, 2, 9, 3, 7, 4, 6, 5, 1, -5};
  printf("Notation: [<summand> @ i=<position in array>].\n");
  printf("Possible subsets of {-4, 1, 10, 2, 9, 3, 7, 4, 6, 5, 1, -5} that sum "
         "up to 10:\n");
  findSubsetWithGivenSum(A, 14, 10);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xe,%esi
mov    $0xa,%edx
call   1060 <findSubsetWithGivenSum@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0xe,%esi
mov    $0xa,%edx
call   1050 <findSubsetWithGivenSum@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [12 x i32] [i32 -4, i32 1, i32 10, i32 2, i32 9, i32 3, i32 7, i32 4, i32 6, i32 5, i32 1, i32 -5]
@.str = [48 x i8] c"Notation: [<summand> @ i=<position in array>].\0A\00"
@.str.1 = [80 x i8] c"Possible subsets of {-4, 1, 10, 2, 9, 3, 7, 4, 6, 5, 1, -5} that sum up to 10:\0A\00"
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%6 = call i32 @findSubsetWithGivenSum(i32* %5, i32 14, i32 10)
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [12 x i32] [i32 -4, i32 1, i32 10, i32 2, i32 9, i32 3, i32 7, i32 4, i32 6, i32 5, i32 1, i32 -5]
@str = [47 x i8] c"Notation: [<summand> @ i=<position in array>].\00"
@str.2 = [79 x i8] c"Possible subsets of {-4, 1, 10, 2, 9, 3, 7, 4, 6, 5, 1, -5} that sum up to 10:\00"
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.2, i64 0, i64 0))
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%6 = call i32 @findSubsetWithGivenSum(i32* %5, i32 14, i32 10)
%7 = call i32 (...) @getchar()
ret i32 0
}