// File: EverybodyHops[P]Permutations/test.cpp
// Function: main
int main(){
    vector<int> now_per = {8,3,6,7,4,5,2,1};
    //vector<int> now_per = {1,2,3,4,5,6,7,8};
    dic_order<int> a(now_per);
    a.print_media_carry();
    a.pre_n(2020);
    a.print_media_num();
    print_vector<int>(a.get_permutation());
    a.next_n(2020);
    a.print_media_num();
    print_vector<int>(a.get_permutation());

    increase_carry_order<int> b(now_per);
    b.print_media_carry();
    b.pre_n(2020);
    b.print_media_num();
    print_vector<int>(b.get_permutation());
    b.next_n(2020);
    b.print_media_num();
    print_vector<int>(b.get_permutation());

    decrease_carry_order<int> c(now_per);
    c.print_media_carry();
    c.pre_n(2020);
    c.print_media_num();
    print_vector<int>(c.get_permutation());
    c.next_n(2020);
    c.print_media_num();
    print_vector<int>(c.get_permutation());

    ortho_transposition<int> d(now_per);
    d.print_media_carry();
    d.pre_n(2020);
    d.print_media_num();
    print_vector<int>(d.get_permutation());
    d.next_n(2020);
    d.print_media_num();
    print_vector<int>(d.get_permutation());
    
    vector<char> cp = {'a', 'b', 'c', 'd'};
    ortho_transposition<char> e(cp);
    print_vector<char>(e.get_permutation());
    int t = 1;
    while(e.next_one())
    {
        //e.print_media_num();
        print_vector<char>(e.get_permutation());
        t += 1;
    }
    cout << t << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x320, %rsp            # imm = 0x320
movl $0x0, -0x4(%rbp)
movups 0x84ef(%rip), %xmm0     # 0xd078
movaps %xmm0, -0x40(%rbp)
movups 0x84d4(%rip), %xmm0     # 0xd068
movaps %xmm0, -0x50(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x8, -0x28(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x3340
movq -0x308(%rbp), %rcx
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rdi
callq 0x5410
jmp 0x4bd2
leaq -0x51(%rbp), %rdi
callq 0x3440
leaq -0xa8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2f70
jmp 0x4bed
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5490
jmp 0x4c02
leaq -0xa8(%rbp), %rdi
callq 0x3090
leaq -0x90(%rbp), %rdi
callq 0x5720
jmp 0x4c1c
leaq -0x90(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5740
jmp 0x4c2f
leaq -0x90(%rbp), %rdi
callq 0x5770
jmp 0x4c3d
leaq -0xc0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x5860
jmp 0x4c52
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4c62
leaq -0xc0(%rbp), %rdi
callq 0x3090
leaq -0x90(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5ab0
jmp 0x4c81
leaq -0x90(%rbp), %rdi
callq 0x5770
jmp 0x4c8f
leaq -0xd8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x5860
jmp 0x4ca4
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4cb4
leaq -0xd8(%rbp), %rdi
callq 0x3090
leaq -0x118(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2f70
jmp 0x4cd2
leaq -0x100(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x5ae0
jmp 0x4ce7
leaq -0x118(%rbp), %rdi
callq 0x3090
leaq -0x100(%rbp), %rdi
callq 0x5720
jmp 0x4d01
leaq -0x100(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5740
jmp 0x4d14
leaq -0x100(%rbp), %rdi
callq 0x5770
jmp 0x4d22
leaq -0x130(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x5d50
jmp 0x4d37
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4d47
leaq -0x130(%rbp), %rdi
callq 0x3090
leaq -0x100(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5ab0
jmp 0x4d66
leaq -0x100(%rbp), %rdi
callq 0x5770
jmp 0x4d74
leaq -0x148(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x5d50
jmp 0x4d89
leaq -0x148(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4d99
leaq -0x148(%rbp), %rdi
callq 0x3090
leaq -0x188(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2f70
jmp 0x4db7
leaq -0x170(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x6040
jmp 0x4dcc
leaq -0x188(%rbp), %rdi
callq 0x3090
leaq -0x170(%rbp), %rdi
callq 0x5720
jmp 0x4de6
leaq -0x170(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5740
jmp 0x4df9
leaq -0x170(%rbp), %rdi
callq 0x5770
jmp 0x4e07
leaq -0x1a0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x6300
jmp 0x4e1c
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4e2c
leaq -0x1a0(%rbp), %rdi
callq 0x3090
leaq -0x170(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5ab0
jmp 0x4e4b
leaq -0x170(%rbp), %rdi
callq 0x5770
jmp 0x4e59
leaq -0x1b8(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x6300
jmp 0x4e6e
leaq -0x1b8(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4e7e
leaq -0x1b8(%rbp), %rdi
callq 0x3090
leaq -0x210(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2f70
jmp 0x4e9c
leaq -0x1f8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x6670
jmp 0x4eb1
leaq -0x210(%rbp), %rdi
callq 0x3090
leaq -0x1f8(%rbp), %rdi
callq 0x5720
jmp 0x4ecb
leaq -0x1f8(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5740
jmp 0x4ede
leaq -0x1f8(%rbp), %rdi
callq 0x5770
jmp 0x4eec
leaq -0x228(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x6a10
jmp 0x4f01
leaq -0x228(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4f11
leaq -0x228(%rbp), %rdi
callq 0x3090
leaq -0x1f8(%rbp), %rdi
movl $0x7e4, %esi            # imm = 0x7E4
callq 0x5ab0
jmp 0x4f30
leaq -0x1f8(%rbp), %rdi
callq 0x5770
jmp 0x4f3e
leaq -0x240(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x6a10
jmp 0x4f53
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
callq 0x5790
jmp 0x4f63
leaq -0x240(%rbp), %rdi
callq 0x3090
movb $0x61, -0x26c(%rbp)
movb $0x62, -0x26b(%rbp)
movb $0x63, -0x26a(%rbp)
movb $0x64, -0x269(%rbp)
leaq -0x26c(%rbp), %rax
movq %rax, -0x268(%rbp)
movq $0x4, -0x260(%rbp)
leaq -0x26d(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x21c0
movq -0x310(%rbp), %rcx
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
leaq -0x258(%rbp), %rdi
callq 0x6e00
jmp 0x4fda
leaq -0x26d(%rbp), %rdi
callq 0x2110
leaq -0x2c8(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x6e80
jmp 0x4ffb
leaq -0x2b0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x6f70
jmp 0x5010
leaq -0x2c8(%rbp), %rdi
callq 0x7320
leaq -0x2e0(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x7450
jmp 0x5031
leaq -0x2e0(%rbp), %rdi
xorl %esi, %esi
callq 0x7380
jmp 0x5041
leaq -0x2e0(%rbp), %rdi
callq 0x7320
movl $0x1, -0x2e4(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x7840
movb %al, -0x311(%rbp)
jmp 0x506b
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x507a
jmp 0x531d
leaq -0x300(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x7450
jmp 0x508f
leaq -0x300(%rbp), %rdi
xorl %esi, %esi
callq 0x7380
jmp 0x509f
leaq -0x300(%rbp), %rdi
callq 0x7320
movl -0x2e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2e4(%rbp)
jmp 0x5057
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x3440
jmp 0x53fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3090
jmp 0x53f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3090
jmp 0x53e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3090
jmp 0x53e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x3090
jmp 0x53e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3090
jmp 0x53da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x3090
jmp 0x53da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3090
jmp 0x53da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x3090
jmp 0x53ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3090
jmp 0x53ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x3090
jmp 0x53ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3090
jmp 0x53c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x3090
jmp 0x53c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x26d(%rbp), %rdi
callq 0x2110
jmp 0x53c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x7320
jmp 0x53b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x53aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x7320
jmp 0x53aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x7320
jmp 0x53aa
movl -0x2e4(%rbp), %esi
movq 0xdcae(%rip), %rdi      # 0x12fd8
callq 0x21a0
movq %rax, -0x320(%rbp)
jmp 0x5338
movq -0x320(%rbp), %rdi
movq 0xdc82(%rip), %rsi      # 0x12fc8
callq 0x2100
jmp 0x534d
leaq -0x2b0(%rbp), %rdi
callq 0x7870
leaq -0x258(%rbp), %rdi
callq 0x7320
leaq -0x1f8(%rbp), %rdi
callq 0x7890
leaq -0x170(%rbp), %rdi
callq 0x78b0
leaq -0x100(%rbp), %rdi
callq 0x78d0
leaq -0x90(%rbp), %rdi
callq 0x78f0
leaq -0x20(%rbp), %rdi
callq 0x3090
movl -0x4(%rbp), %eax
addq $0x320, %rsp            # imm = 0x320
popq %rbp
retq
leaq -0x2b0(%rbp), %rdi
callq 0x7870
leaq -0x258(%rbp), %rdi
callq 0x7320
leaq -0x1f8(%rbp), %rdi
callq 0x7890
leaq -0x170(%rbp), %rdi
callq 0x78b0
leaq -0x100(%rbp), %rdi
callq 0x78d0
leaq -0x90(%rbp), %rdi
callq 0x78f0
leaq -0x20(%rbp), %rdi
callq 0x3090
movq -0x60(%rbp), %rdi
callq 0x21b0
nopw %cs:(%rax,%rax)
nop