// File: /workspace/github_cpp_makefile_star2_O3/eschwabe[P]interview-practice/src/stringcombinations.cpp
// Function: combinations(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)
void combinations(string source, string str, size_t target_len) {
    if(str.size() == target_len) {
        cout << str << endl;
    }
    else {
        string tmpsource = source;
        while(tmpsource.size() > 0) {
            string tmpstr = str;
            tmpstr.push_back(tmpsource.at(0));
            tmpsource.erase(0, 1);
            combinations(tmpsource, tmpstr, target_len);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %rbx
movq %rsi, %r14
cmpq %rdx, 0x8(%rsi)
jne 0x12a6
movq (%r14), %rsi
movq 0x2d75(%rip), %rdi      # 0x3fd8
movq %rbx, %rdx
callq 0x10c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1050
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x165c
cmpq $0x0, 0x8(%r15)
je 0x13d0
leaq 0x78(%rsp), %r12
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r13
leaq 0x68(%rsp), %rbp
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x165c
cmpq $0x0, 0x10(%rsp)
je 0x13fe
movq 0x8(%rsp), %rax
movsbl (%rax), %esi
movq %r15, %rdi
callq 0x1080
movl $0x1, %edx
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x1040
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x165c
movq %r12, 0x68(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x165c
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x123c
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x138c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x13a8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x13c4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10b0
cmpq $0x0, 0x10(%rsp)
jne 0x12e5
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x13ec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x10b0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc35(%rip), %rdi       # 0x203a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x10d0
movq %rax, %rbx
jmp 0x1473
movq %rax, %rbx
jmp 0x1434
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1434
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1457
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x10b0
jmp 0x1457
jmp 0x1454
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1473
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x148f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x10f0