// File: eschwabe[P]interview-practice/src/allsubsets.cpp
// Function: GetSubsets(std::set<int, std::less<int>, std::allocator<int>> const&, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>*)
void GetSubsets(const set<int>& s, vector<set<int>>* out) {
    if(s.size() == 0 || out == nullptr) {
        return;
    }
    for(auto v : s) {
        for(auto pset : vector<set<int>>{*out}) {
            set<int> tmp(pset);
            tmp.insert(v);
            out->push_back(tmp);
        }
        out->push_back(set<int>{v});
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x17d0
cmpq $0x0, %rax
je 0x12c9
cmpq $0x0, -0x10(%rbp)
jne 0x12ce
jmp 0x1547
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17f0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1820
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1850
testb $0x1, %al
jne 0x1306
jmp 0x1547
leaq -0x20(%rbp), %rdi
callq 0x1880
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x18b0
leaq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x19a0
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rdi
callq 0x19d0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1a00
testb $0x1, %al
jne 0x1362
leaq -0x50(%rbp), %rdi
callq 0x1b90
jmp 0x1462
leaq -0x58(%rbp), %rdi
callq 0x1a40
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
callq 0x1a60
jmp 0x137c
leaq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1a60
jmp 0x1391
leaq -0xd0(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1a90
movb %dl, -0x131(%rbp)
movq %rax, -0x130(%rbp)
jmp 0x13b0
movb -0x131(%rbp), %al
movq -0x130(%rbp), %rcx
movq %rcx, -0xe0(%rbp)
movb %al, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1ae0
jmp 0x13dc
leaq -0xd0(%rbp), %rdi
callq 0x1b50
leaq -0x90(%rbp), %rdi
callq 0x1b50
leaq -0x58(%rbp), %rdi
callq 0x1b70
jmp 0x1343
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x1454
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x1448
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x1b50
leaq -0x90(%rbp), %rdi
callq 0x1b50
leaq -0x50(%rbp), %rdi
callq 0x1b90
jmp 0x1550
movq -0x10(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x124(%rbp)
leaq -0x124(%rbp), %rax
movq %rax, -0x120(%rbp)
movq $0x1, -0x118(%rbp)
leaq -0x126(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x1c20
movq -0x140(%rbp), %r8
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
leaq -0x110(%rbp), %rdi
leaq -0x125(%rbp), %rcx
callq 0x1c40
jmp 0x14cc
movq -0x148(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1bf0
jmp 0x14e1
leaq -0x110(%rbp), %rdi
callq 0x1b50
leaq -0x126(%rbp), %rdi
callq 0x1d10
leaq -0x20(%rbp), %rdi
callq 0x1d30
jmp 0x12f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x1539
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x1b50
leaq -0x126(%rbp), %rdi
callq 0x1d10
jmp 0x1550
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x1150
nopl (%rax)