// File: EverybodyHops[P]Permutations/./permutations.hpp
// Function: ortho_transposition<int>::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
subq $0xe0, %rsp
movq %rdi, -0xa0(%rbp)
movq %rdi, %rax
movq %rax, -0x98(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x90(%rbp)
addq $0x10, %rdi
callq 0x30f0
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rdi
movq $-0x1, %rax
cmpq $0x0, %rdi
cmovlq %rax, %rdi
callq 0x2030
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x90(%rbp), %rdi
movslq -0x24(%rbp), %rax
movq %rax, -0xa8(%rbp)
addq $0x10, %rdi
callq 0x30f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6aaf
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6a6e
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x2350
movq -0xb0(%rbp), %rdi
movl $0x0, -0x44(%rbp)
leaq -0x44(%rbp), %rsi
callq 0x31c0
jmp 0x6ae3
movl $0x0, -0x58(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x31c0
jmp 0x6af9
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x70(%rbp), %rdi
callq 0x23a0
jmp 0x6b0f
movl $0x1, -0x74(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x31c0
jmp 0x6b25
movb $0x0, -0x75(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x76(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x3340
movq -0xa0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x99f0
jmp 0x6b60
leaq -0x76(%rbp), %rdi
callq 0x3440
movl $0x0, -0x84(%rbp)
movq -0x90(%rbp), %rdi
movslq -0x84(%rbp), %rax
movq %rax, -0xc8(%rbp)
addq $0x10, %rdi
callq 0x30f0
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6d81
movslq -0x84(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3110
movl (%rax), %eax
movl %eax, -0x80(%rbp)
movslq -0x84(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x3110
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x6c62
movl -0x84(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x3110
movl (%rax), %eax
movl %eax, -0xcc(%rbp)
movl -0x84(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x3110
movq %rax, %rcx
movl -0xcc(%rbp), %eax
addl (%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x7c(%rbp)
jmp 0x6c84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x6ddf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x6dd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x76(%rbp), %rdi
callq 0x3440
jmp 0x6dd6
movl -0x84(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x3110
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x7c(%rbp)
movq -0x90(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movl 0x28(%rax,%rcx,4), %eax
movl %eax, -0x88(%rbp)
movq -0x90(%rbp), %rcx
movl -0x88(%rbp), %eax
movslq -0x7c(%rbp), %rdx
cmpl 0x30(%rcx,%rdx,4), %eax
je 0x6d6b
movq -0x20(%rbp), %rax
movslq -0x88(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x6d49
cmpl $0x0, -0x80(%rbp)
jne 0x6d3e
movq -0x90(%rbp), %rdi
movq %rdi, %rax
addq $0x10, %rax
movq %rax, -0xd8(%rbp)
addq $0x10, %rdi
callq 0x30f0
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
movslq -0x84(%rbp), %rax
subq %rax, %rsi
callq 0x3110
movq -0xa0(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xd0(%rbp)
movslq -0x88(%rbp), %rsi
callq 0x3110
movl -0xd0(%rbp), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movslq -0x88(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x6d6b
movl -0x80(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x6d49
jmp 0x6d4b
movq -0x90(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movl 0x38(%rax,%rcx,4), %eax
addl -0x88(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0x6c99
jmp 0x6d6d
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x6b73
movq -0x20(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, %rax
je 0x6d9e
movq -0xe0(%rbp), %rdi
callq 0x2130
movb $0x1, -0x75(%rbp)
testb $0x1, -0x75(%rbp)
jne 0x6db4
movq -0xa0(%rbp), %rdi
callq 0x3090
leaq -0x70(%rbp), %rdi
callq 0x3090
leaq -0x40(%rbp), %rdi
callq 0x3090
movq -0x98(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x3090
leaq -0x40(%rbp), %rdi
callq 0x3090
movq -0x50(%rbp), %rdi
callq 0x21b0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)