// File: EverybodyHops[P]Permutations/./permutations.hpp
// Function: increase_carry_order<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.insert(m_num.begin(), 0);

        vector<T> res(len);
        int temp;
        for(int i = m_num.size() - 1; i >= 0; i--){
            temp = m_num[i];
            for(int j = 0; j < len; j++){
                if(can_put[j]){
                    if(temp == 0){
                        res[j] = this->ordered_element[i];
                        can_put[j] = false;
                        break; 
                    }else{
                        temp -= 1;
                    }
                }
            }
        }
        delete[] can_put;
        reverse(res.begin(), res.end());
        return res;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x98(%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 -0x98(%rbp), %rdi
movslq -0x24(%rbp), %rax
movq %rax, -0xb0(%rbp)
addq $0x10, %rdi
callq 0x30f0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0x5def
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5dae
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x2350
movq -0xc0(%rbp), %rdi
callq 0x3290
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x9680
movq -0xc0(%rbp), %rdi
movl $0x0, -0x54(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x54(%rbp), %rdx
callq 0x9640
movq %rax, -0xb8(%rbp)
jmp 0x5e4b
movq -0xb8(%rbp), %rax
movq %rax, -0x70(%rbp)
movb $0x0, -0x71(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x72(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3340
movq -0xa8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
callq 0x99f0
jmp 0x5e91
leaq -0x72(%rbp), %rdi
callq 0x3440
leaq -0x40(%rbp), %rdi
callq 0x30f0
subq $0x1, %rax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
jl 0x5f85
movslq -0x7c(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3110
movl (%rax), %eax
movl %eax, -0x78(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x5f75
movq -0x20(%rbp), %rax
movslq -0x80(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x5f65
cmpl $0x0, -0x78(%rbp)
jne 0x5f5a
movq -0x98(%rbp), %rdi
addq $0x10, %rdi
movslq -0x7c(%rbp), %rsi
callq 0x3110
movq -0xa8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xd4(%rbp)
movslq -0x80(%rbp), %rsi
callq 0x3110
movl -0xd4(%rbp), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x5f75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x6028
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x72(%rbp), %rdi
callq 0x3440
jmp 0x6028
movl -0x78(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x5f65
jmp 0x5f67
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x5ecd
jmp 0x5f77
movl -0x7c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x5eaa
movq -0x20(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, %rax
je 0x5fa2
movq -0xe0(%rbp), %rdi
callq 0x2130
movq -0xa8(%rbp), %rdi
callq 0x3290
movq -0xa8(%rbp), %rdi
movq %rax, -0x88(%rbp)
callq 0x32c0
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x7fb0
jmp 0x5fdd
movb $0x1, -0x71(%rbp)
testb $0x1, -0x71(%rbp)
jne 0x600f
jmp 0x6003
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x3090
jmp 0x6028
movq -0xa8(%rbp), %rdi
callq 0x3090
leaq -0x40(%rbp), %rdi
callq 0x3090
movq -0xa0(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x3090
movq -0x60(%rbp), %rdi
callq 0x21b0
nopw (%rax,%rax)