// File: /workspace/github_cpp_makefile_star2_O3/eschwabe[P]interview-practice/src/stringpermutations.cpp
// Function: GenerateStrings(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> GenerateStrings(string source, string target) {
    vector<string> results;
    if(source.size() == 0) {
        results.push_back(target);
    }
    for(size_t i = 0; i < source.size(); ++i) {
        string new_source(source);
        string new_target(target);
        new_source.erase(i, 1);
        new_target.push_back(source.at(i));
        vector<string> tmp_results = GenerateStrings(new_source, new_target);
        results.insert(results.end(), tmp_results.begin(), tmp_results.end());
    }
    return results;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
jne 0x24da
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a04
movq 0x8(%r15), %rdx
testq %rdx, %rdx
je 0x2640
xorl %r12d, %r12d
leaq 0x60(%rsp), %rbp
leaq 0x80(%rsp), %r13
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq (%r15), %rsi
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x2aac
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x2aac
movl $0x1, %edx
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x2040
movq 0x8(%r15), %rdx
cmpq %r12, %rdx
jbe 0x2655
movq (%r15), %rax
movsbl (%rax,%r12), %esi
movq %rsp, %rdi
callq 0x20e0
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x2aac
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2aac
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
callq 0x2491
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x25b9
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x25d5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x8(%rbx), %rsi
movq 0x80(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq %rbx, %rdi
callq 0x2d8c
movq %r13, %rdi
callq 0x2a42
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2614
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2630
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2120
incq %r12
movq 0x8(%r15), %rdx
cmpq %rdx, %r12
jb 0x24ea
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a00(%rip), %rdi      # 0x405c
movq %r12, %rsi
xorl %eax, %eax
callq 0x2160
jmp 0x2668
movq %rax, %r14
jmp 0x2707
movq %rax, %r14
jmp 0x26eb
jmp 0x26cd
jmp 0x26cd
movq %rax, %r14
jmp 0x269d
movq %rax, %r14
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x269d
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x26d0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2120
jmp 0x26d0
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x2a42
jmp 0x26d0
movq %rax, %r14
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x26eb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2707
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2120
movq %rbx, %rdi
callq 0x2a42
movq %r14, %rdi
callq 0x2190