// File: /workspace/github_cpp_makefile_star2_O1/EverybodyHops[P]Permutations/./permutations.hpp
// Function: ortho_transposition<char>::get_permutation()
vector<T> get_permutation() override{
        int len = this->ordered_element.size();
        bool *can_put = new bool[len];
        for(int i = 0; i < this->ordered_element.size(); i++){
            can_put[i] = true;
        }

        vector<int> m_num = this->media_num->get_num();
        m_num.push_back(0);
        m_num.push_back(0);
        vector<int> carry = this->media_num->get_carry();
        carry.push_back(1);

        vector<T> res(len);
        int direct, temp;
        for(int i = 0; i < this->ordered_element.size(); i++){
            temp = m_num[i];
            if(carry[i] % 2 == 0){
                direct = (m_num[i + 1] + m_num[i + 2]) % 2;
            }else{
                direct = m_num[i + 1] % 2;
            }
            for(int j = start[direct]; j != end[direct]; j += step[direct]){
                if(can_put[j]){
                    if(temp == 0){
                        res[j] = this->ordered_element[this->ordered_element.size() - 1 - i];
                        can_put[j] = false;
                        break; 
                    }else{
                        temp -= 1;
                    }
                }
            }
        }

        delete[] can_put;
        return res;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, -0x68(%rbp)
movq 0x18(%rsi), %r13
movq 0x10(%rsi), %rbx
movq %r13, %rax
subq %rbx, %rax
movslq %eax, %r12
testq %r12, %r12
movq $-0x1, %rdi
cmovnsq %r12, %rdi
callq 0x2030
movq %rax, %r15
subq %rbx, %r13
je 0x4ada
cmpq $0x1, %r13
adcq $0x0, %r13
movq %r15, %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0x2070
movq 0x8(%r14), %rsi
leaq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0x22dc
movl $0x0, -0x48(%rbp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x4b0f
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x58(%rbp)
movq -0x68(%rbp), %rbx
jmp 0x4b20
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x2e12
movq -0x68(%rbp), %rbx
movl $0x0, -0x48(%rbp)
movq -0x58(%rbp), %rsi
cmpq -0x50(%rbp), %rsi
je 0x4b41
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x58(%rbp)
jmp 0x4b4e
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x2e12
movq 0x8(%r14), %rsi
leaq -0x48(%rbp), %rdi
callq 0x22fa
movl $0x1, -0x2c(%rbp)
movq -0x40(%rbp), %rsi
cmpq -0x38(%rbp), %rsi
je 0x4b7c
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x40(%rbp)
jmp 0x4b89
leaq -0x48(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x2e12
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5854
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rdx
subq %rcx, %rdx
je 0x4c32
xorl %eax, %eax
movq -0x60(%rbp), %r9
movl 0x4(%r9,%rax,4), %esi
movq -0x48(%rbp), %rdi
testb $0x1, (%rdi,%rax,4)
jne 0x4bc3
addl 0x8(%r9,%rax,4), %esi
movl %esi, %edi
shrl $0x1f, %edi
addl %esi, %edi
andl $-0x2, %edi
subl %edi, %esi
movslq %esi, %rsi
movl 0x28(%r14,%rsi,4), %edi
movl 0x30(%r14,%rsi,4), %r8d
cmpl %r8d, %edi
je 0x4c1b
movl (%r9,%rax,4), %r9d
movslq %edi, %r10
cmpb $0x1, (%r15,%r10)
jne 0x4bf7
testl %r9d, %r9d
je 0x4c03
decl %r9d
addl 0x38(%r14,%rsi,4), %edi
cmpl %r8d, %edi
jne 0x4be5
jmp 0x4c1b
movq %rax, %rsi
notq %rsi
addq %rdx, %rcx
movb (%rsi,%rcx), %cl
movq (%rbx), %rdx
movb %cl, (%rdx,%r10)
movb $0x0, (%r15,%r10)
incq %rax
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
ja 0x4bab
movq %r15, %rdi
callq 0x2100
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4c48
callq 0x20c0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4c56
callq 0x20c0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4c6e
jmp 0x4c81
jmp 0x4c81
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4c84
callq 0x20c0
jmp 0x4c84
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4c92
callq 0x20c0
movq %rbx, %rdi
callq 0x2140