#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*/ dfs(int *, int, int **, int *, int *, int, int **);
scalar_t__ malloc(int);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int **subsets(int *nums, int numsSize, int **columnSizes, int *returnSize) {
  int **ret = (int **)malloc(sizeof(int *) * 5000);
  *columnSizes = (int *)malloc(sizeof(int) * 5000);
  *returnSize = 0;
  int stack[numsSize];
  int top = 0;
  quickSort(nums, 0, numsSize - 1);
  dfs(nums, numsSize, columnSizes, returnSize, stack, top, ret);
  return ret;
}


x86 assembly (clang, -O0):
<subsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x9c40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x4e20,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <quickSort@plt>
mov    -0x48(%rbp),%r8
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x3c(%rbp),%r9d
mov    -0x28(%rbp),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
call   1050 <dfs@plt>
add    $0x10,%rsp
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsets>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rdx,-0x30(%rbp)
mov    %esi,%r15d
mov    %rdi,%r13
mov    $0x9c40,%edi
call   1030 <malloc@plt>
mov    %rax,%r12
mov    $0x4e20,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
movl   $0x0,(%r14)
mov    %r14,%rbx
mov    %r15d,%eax
mov    %rsp,%r14
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
lea    -0x1(%r15),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <quickSort@plt>
sub    $0x8,%rsp
mov    %r13,%rdi
mov    %r15d,%esi
mov    -0x30(%rbp),%rdx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %r9d,%r9d
push   %r12
call   1050 <dfs@plt>
add    $0x10,%rsp
mov    %r12,%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32** @subsets(i32* %0, i32 %1, i32** %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32*
%9 = alloca i32**
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32** %2, i32*** %7
store i32* %3, i32** %8
%13 = call i64 @malloc(i32 40000)
%14 = inttoptr i64 %13 to i32**
store i32** %14, i32*** %9
%15 = call i64 @malloc(i32 20000)
%16 = inttoptr i64 %15 to i32*
%17 = load i32**, i32*** %7
store i32* %16, i32** %17
%18 = load i32*, i32** %8
store i32 0, i32* %18
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %10
%22 = alloca i32, i64 %20
store i64 %20, i64* %11
store i32 0, i32* %12
%23 = load i32*, i32** %5
%24 = load i32, i32* %6
%25 = sub nsw i32 %24, 1
%26 = call i32 @quickSort(i32* %23, i32 0, i32 %25)
%27 = load i32*, i32** %5
%28 = load i32, i32* %6
%29 = load i32**, i32*** %7
%30 = load i32*, i32** %8
%31 = load i32, i32* %12
%32 = load i32**, i32*** %9
%33 = call i32 @dfs(i32* %27, i32 %28, i32** %29, i32* %30, i32* %22, i32 %31, i32** %32)
%34 = load i32**, i32*** %9
%35 = load i8*, i8** %10
ret i32** %34
}

LLVM IR (-O2):
define i32** @subsets(i32* %0, i32 %1, i32** %2, i32* %3) {
%5 = tail call i64 @malloc(i32 40000)
%6 = inttoptr i64 %5 to i32**
%7 = tail call i64 @malloc(i32 20000)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %2
store i32 0, i32* %3
%9 = zext i32 %1 to i64
%10 = alloca i32, i64 %9
%11 = add nsw i32 %1, -1
%12 = tail call i32 @quickSort(i32* %0, i32 0, i32 %11)
%13 = call i32 @dfs(i32* %0, i32 %1, i32** %2, i32* %3, i32* %10, i32 0, i32** %6)
ret i32** %6
}