// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %r13
subq 0x10(%rsi), %r13
movslq %r13d, %r12
testq %r12, %r12
pushq $-0x1
popq %rdi
cmovnsq %r12, %rdi
callq 0x1030
movq %rax, %r15
xorl %eax, %eax
cmpq %rax, %r13
je 0x323f
movb $0x1, (%r15,%rax)
incq %rax
jmp 0x3230
movq 0x8(%r14), %rsi
leaq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0x129c
leaq -0x48(%rbp), %rsi
andl $0x0, (%rsi)
movq %r13, %rdi
callq 0x1bfa
leaq -0x48(%rbp), %rsi
andl $0x0, (%rsi)
leaq -0x60(%rbp), %rdi
callq 0x1bfa
movq 0x8(%r14), %rsi
leaq -0x48(%rbp), %rdi
callq 0x12ba
leaq -0x2c(%rbp), %rsi
movl $0x1, (%rsi)
leaq -0x48(%rbp), %rdi
callq 0x1bfa
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4106
xorl %ecx, %ecx
pushq $0x2
popq %rsi
movq 0x10(%r14), %rdi
movq 0x18(%r14), %r8
subq %rdi, %r8
cmpq %rcx, %r8
jbe 0x3318
movq -0x60(%rbp), %rdx
movl 0x4(%rdx,%rcx,4), %eax
movq -0x48(%rbp), %r9
testb $0x1, (%r9,%rcx,4)
jne 0x32c9
addl 0x8(%rdx,%rcx,4), %eax
movl (%rdx,%rcx,4), %r9d
cltd
idivl %esi
movslq %edx, %rax
movl 0x28(%r14,%rax,4), %edx
movl 0x30(%r14,%rax,4), %r10d
cmpl %r10d, %edx
je 0x3313
movslq %edx, %r11
cmpb $0x1, (%r15,%r11)
jne 0x32f4
testl %r9d, %r9d
je 0x32fb
decl %r9d
addl 0x38(%r14,%rax,4), %edx
jmp 0x32dd
movq %rcx, %rax
notq %rax
addq %r8, %rdi
movb (%rax,%rdi), %al
movq (%rbx), %rdx
movb %al, (%rdx,%r11)
movb $0x0, (%r15,%r11)
incq %rcx
jmp 0x32a2
movq %r15, %rdi
callq 0x10e0
leaq -0x48(%rbp), %rdi
callq 0x1a6e
leaq -0x60(%rbp), %rdi
callq 0x1a6e
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3346
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x1a6e
jmp 0x335b
jmp 0x3358
jmp 0x3358
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x1a6e
movq %rbx, %rdi
callq 0x1120