// File: /workspace/github_cpp_makefile_star2_O3/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 0x4b5a
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
movq 0x10(%r13), %rax
cmpq %rax, %rsi
je 0x4b92
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x58(%rbp)
movq -0x68(%rbp), %rbx
jmp 0x4bab
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x2e3c
movq -0x68(%rbp), %rbx
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rax
movl $0x0, -0x48(%rbp)
cmpq %rax, %rsi
je 0x4bc7
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x58(%rbp)
jmp 0x4bd4
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x2e3c
movq 0x8(%r14), %rsi
leaq -0x48(%rbp), %rdi
callq 0x22fa
movl $0x1, -0x2c(%rbp)
movq -0x40(%rbp), %rsi
cmpq -0x38(%rbp), %rsi
je 0x4c02
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x40(%rbp)
jmp 0x4c0f
leaq -0x48(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x2e3c
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x58ac
movq 0x10(%r14), %rax
movq 0x18(%r14), %rdx
movq %rdx, %rsi
subq %rax, %rsi
je 0x4cc4
xorl %ecx, %ecx
movq -0x60(%rbp), %r10
movl 0x4(%r10,%rcx,4), %edi
movq -0x48(%rbp), %r8
testb $0x1, (%r8,%rcx,4)
jne 0x4c4d
addl 0x8(%r10,%rcx,4), %edi
movl %edi, %r8d
shrl $0x1f, %r8d
addl %edi, %r8d
andl $-0x2, %r8d
subl %r8d, %edi
movslq %edi, %rdi
movl 0x28(%r14,%rdi,4), %r8d
movl 0x30(%r14,%rdi,4), %r9d
cmpl %r9d, %r8d
je 0x4cb2
movl (%r10,%rcx,4), %r10d
movslq %r8d, %r11
cmpb $0x1, (%r15,%r11)
jne 0x4c86
testl %r10d, %r10d
je 0x4c92
decl %r10d
addl 0x38(%r14,%rdi,4), %r8d
cmpl %r9d, %r8d
jne 0x4c74
jmp 0x4cb2
movq %rcx, %rdx
notq %rdx
addq %rsi, %rax
movb (%rdx,%rax), %al
movq (%rbx), %rdx
movb %al, (%rdx,%r11)
movb $0x0, (%r15,%r11)
movq 0x10(%r14), %rax
movq 0x18(%r14), %rdx
incq %rcx
movq %rdx, %rsi
subq %rax, %rsi
cmpq %rcx, %rsi
ja 0x4c34
movq %r15, %rdi
callq 0x2100
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4cda
callq 0x20c0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4ce8
callq 0x20c0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d00
jmp 0x4d13
jmp 0x4d13
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4d16
callq 0x20c0
jmp 0x4d16
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4d24
callq 0x20c0
movq %rbx, %rdi
callq 0x2140