// File: patmorin[P]rotate/permtest.cpp
// Function: main
int main(int argc, char *argv[]) {
	Index n;
    if (argc != 2) usage(argv[0]);
    std::istringstream is_n(argv[1]);
    is_n >> n;

	while (n > 0) {
		Index k = 0, cum = 1;
		while (3*cum-1 <= n) {
			k++;
			cum *= 3;
		}
		Index m = cum-1;
		std::cout << "n = " << n << ", k = " << k << ", cum = " << cum
			<< ", m = " << m << std::endl;

		n -= m;

		Index sum = 0;
		auto start = std::chrono::high_resolution_clock::now();
		for (Index i = 0; i < m; i++) {
			sum += outshuffle_perm1(i, m);
		}
		auto stop =  std::chrono::high_resolution_clock::now();
		std::chrono::duration<double> elapsed = stop - start;
		std::cout << "outshuffle1: " << elapsed.count() << " " << sum << std::endl;

		sum = 0;
		start = std::chrono::high_resolution_clock::now();
		for (Index i = 0; i < m; i++) {
			sum += outshuffle_perm2(i, m);
		}
		stop =  std::chrono::high_resolution_clock::now();
		elapsed = stop - start;
		std::cout << "outshuffle2: " << elapsed.count() << " " << sum << std::endl;

		sum = 0;
		start = std::chrono::high_resolution_clock::now();
		for (Index i = 0; i < m; i++) {
			sum += outshuffle_perm3(i, m);
		}
		stop =  std::chrono::high_resolution_clock::now();
		elapsed = stop - start;
		std::cout << "outshuffle3: " << elapsed.count() << " " << sum << std::endl;

		sum = 0;
		start = std::chrono::high_resolution_clock::now();
		for (Index i = 0; i < m; i++) {
			sum += inshuffle_perm1(i, m);
		}
		stop =  std::chrono::high_resolution_clock::now();
		elapsed = stop - start;
		std::cout << "inshuffle1: " << elapsed.count() << " " << sum << std::endl;

		sum = 0;
		start = std::chrono::high_resolution_clock::now();
		for (Index i = 0; i < m; i++) {
			sum += inshuffle_perm2(i, m);
		}
		stop =  std::chrono::high_resolution_clock::now();
		elapsed = stop - start;
		std::cout << "inshuffle2: " << elapsed.count() << " " << sum << std::endl;

		sum = 0;
		start = std::chrono::high_resolution_clock::now();
		for (Index i = 0; i < m; i++) {
			sum += inshuffle_perm3(i, m);
		}
		stop =  std::chrono::high_resolution_clock::now();
		elapsed = stop - start;
		std::cout << "inshuffle3: " << elapsed.count() << " " << sum << std::endl;

		if (m < 50) {
			for (Index i = 0; i < m-1; i++) {
				std::cout << inshuffle_perm1(i, m) << ",";
			}
			std::cout << inshuffle_perm1(m-1, m) << std::endl;

			for (Index i = 0; i < m-1; i++) {
				std::cout << inshuffle_perm2(i, m) << ",";
			}
			std::cout << inshuffle_perm2(m-1, m) << std::endl;

			for (Index i = 0; i < m-1; i++) {
				std::cout << inshuffle_perm3(i, m) << ",";
			}
			std::cout << inshuffle_perm3(m-1, m) << std::endl;
		}
	}
}

// Assembly:
subq $0x4f8, %rsp            # imm = 0x4F8
movl $0x0, 0x4f4(%rsp)
movl %edi, 0x4f0(%rsp)
movq %rsi, 0x4e8(%rsp)
cmpl $0x2, 0x4f0(%rsp)
je 0x12fb
movq 0x4e8(%rsp), %rax
movq (%rax), %rdi
callq 0x1270
movq 0x4e8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x1f0(%rsp)
leaq 0x33f(%rsp), %rdi
movq %rdi, 0x1f8(%rsp)
callq 0x1110
movq 0x1f0(%rsp), %rsi
movq 0x1f8(%rsp), %rdx
leaq 0x340(%rsp), %rdi
callq 0x10c0
jmp 0x1343
leaq 0x360(%rsp), %rdi
leaq 0x340(%rsp), %rsi
movl $0x8, %edx
callq 0x10f0
jmp 0x135f
leaq 0x340(%rsp), %rdi
callq 0x1060
leaq 0x33f(%rsp), %rdi
callq 0x10a0
leaq 0x360(%rsp), %rdi
leaq 0x4e0(%rsp), %rsi
callq 0x10d0
jmp 0x1390
jmp 0x1392
cmpq $0x0, 0x4e0(%rsp)
jbe 0x21e2
movq $0x0, 0x320(%rsp)
movq $0x1, 0x318(%rsp)
imulq $0x3, 0x318(%rsp), %rax
subq $0x1, %rax
cmpq 0x4e0(%rsp), %rax
ja 0x146a
movq 0x320(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x320(%rsp)
imulq $0x3, 0x318(%rsp), %rax
movq %rax, 0x318(%rsp)
jmp 0x13b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x1432
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x340(%rsp), %rdi
callq 0x1060
leaq 0x33f(%rsp), %rdi
callq 0x10a0
jmp 0x21fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x360(%rsp), %rdi
callq 0x1050
jmp 0x21fe
movq 0x318(%rsp), %rax
decq %rax
movq %rax, 0x310(%rsp)
movq 0x3b4c(%rip), %rdi      # 0x4fd0
leaq 0x1b92(%rip), %rsi      # 0x301d
callq 0x1080
movq %rax, 0x1e8(%rsp)
jmp 0x149a
movq 0x1e8(%rsp), %rdi
movq 0x4e0(%rsp), %rsi
callq 0x1040
movq %rax, 0x1e0(%rsp)
jmp 0x14b9
movq 0x1e0(%rsp), %rdi
leaq 0x1b5a(%rip), %rsi      # 0x3022
callq 0x1080
movq %rax, 0x1d8(%rsp)
jmp 0x14d7
movq 0x1d8(%rsp), %rdi
movq 0x320(%rsp), %rsi
callq 0x1040
movq %rax, 0x1d0(%rsp)
jmp 0x14f6
movq 0x1d0(%rsp), %rdi
leaq 0x1b24(%rip), %rsi      # 0x3029
callq 0x1080
movq %rax, 0x1c8(%rsp)
jmp 0x1514
movq 0x1c8(%rsp), %rdi
movq 0x318(%rsp), %rsi
callq 0x1040
movq %rax, 0x1c0(%rsp)
jmp 0x1533
movq 0x1c0(%rsp), %rdi
leaq 0x1af0(%rip), %rsi      # 0x3032
callq 0x1080
movq %rax, 0x1b8(%rsp)
jmp 0x1551
movq 0x1b8(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x1040
movq %rax, 0x1b0(%rsp)
jmp 0x1570
movq 0x1b0(%rsp), %rdi
movq 0x3a41(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x1586
movq 0x310(%rsp), %rcx
movq 0x4e0(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x4e0(%rsp)
movq $0x0, 0x308(%rsp)
callq 0x1030
movq %rax, 0x300(%rsp)
movq $0x0, 0x2f8(%rsp)
movq 0x2f8(%rsp), %rax
cmpq 0x310(%rsp), %rax
jae 0x1625
movq 0x2f8(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x2210
movq %rax, 0x1a8(%rsp)
jmp 0x15f7
movq 0x1a8(%rsp), %rax
addq 0x308(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x2f8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2f8(%rsp)
jmp 0x15c6
callq 0x1030
movq %rax, 0x2f0(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x2260
movq %rax, 0x1a0(%rsp)
jmp 0x1651
movq 0x1a0(%rsp), %rax
movq %rax, 0x2e0(%rsp)
leaq 0x2e8(%rsp), %rdi
leaq 0x2e0(%rsp), %rsi
callq 0x22b0
jmp 0x1678
movq 0x3951(%rip), %rdi      # 0x4fd0
leaq 0x19b3(%rip), %rsi      # 0x3039
callq 0x1080
movq %rax, 0x198(%rsp)
jmp 0x1695
leaq 0x2e8(%rsp), %rdi
callq 0x22f0
vmovsd %xmm0, 0x190(%rsp)
jmp 0x16ad
vmovsd 0x190(%rsp), %xmm0
movq 0x198(%rsp), %rdi
callq 0x1120
movq %rax, 0x188(%rsp)
jmp 0x16cd
movq 0x188(%rsp), %rdi
leaq 0x1992(%rip), %rsi      # 0x306e
callq 0x1080
movq %rax, 0x180(%rsp)
jmp 0x16eb
movq 0x180(%rsp), %rdi
movq 0x308(%rsp), %rsi
callq 0x1040
movq %rax, 0x178(%rsp)
jmp 0x170a
movq 0x178(%rsp), %rdi
movq 0x38a7(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x1720
movq $0x0, 0x308(%rsp)
callq 0x1030
movq %rax, 0x2d8(%rsp)
movq 0x2d8(%rsp), %rax
movq %rax, 0x300(%rsp)
movq $0x0, 0x2d0(%rsp)
movq 0x2d0(%rsp), %rax
cmpq 0x310(%rsp), %rax
jae 0x17b4
movq 0x2d0(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x2300
movq %rax, 0x170(%rsp)
jmp 0x1786
movq 0x170(%rsp), %rax
addq 0x308(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x2d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2d0(%rsp)
jmp 0x1755
callq 0x1030
movq %rax, 0x2c8(%rsp)
movq 0x2c8(%rsp), %rax
movq %rax, 0x2f0(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x2260
movq %rax, 0x168(%rsp)
jmp 0x17f0
movq 0x168(%rsp), %rax
movq %rax, 0x2b8(%rsp)
leaq 0x2c0(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x22b0
jmp 0x1817
movq 0x2c0(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x37a2(%rip), %rdi      # 0x4fd0
leaq 0x1812(%rip), %rsi      # 0x3047
callq 0x1080
movq %rax, 0x160(%rsp)
jmp 0x1844
leaq 0x2e8(%rsp), %rdi
callq 0x22f0
vmovsd %xmm0, 0x158(%rsp)
jmp 0x185c
vmovsd 0x158(%rsp), %xmm0
movq 0x160(%rsp), %rdi
callq 0x1120
movq %rax, 0x150(%rsp)
jmp 0x187c
movq 0x150(%rsp), %rdi
leaq 0x17e3(%rip), %rsi      # 0x306e
callq 0x1080
movq %rax, 0x148(%rsp)
jmp 0x189a
movq 0x148(%rsp), %rdi
movq 0x308(%rsp), %rsi
callq 0x1040
movq %rax, 0x140(%rsp)
jmp 0x18b9
movq 0x140(%rsp), %rdi
movq 0x36f8(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x18cf
movq $0x0, 0x308(%rsp)
callq 0x1030
movq %rax, 0x2b0(%rsp)
movq 0x2b0(%rsp), %rax
movq %rax, 0x300(%rsp)
movq $0x0, 0x2a8(%rsp)
movq 0x2a8(%rsp), %rax
cmpq 0x310(%rsp), %rax
jae 0x1963
movq 0x2a8(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x2350
movq %rax, 0x138(%rsp)
jmp 0x1935
movq 0x138(%rsp), %rax
addq 0x308(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x2a8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2a8(%rsp)
jmp 0x1904
callq 0x1030
movq %rax, 0x2a0(%rsp)
movq 0x2a0(%rsp), %rax
movq %rax, 0x2f0(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x2260
movq %rax, 0x130(%rsp)
jmp 0x199f
movq 0x130(%rsp), %rax
movq %rax, 0x290(%rsp)
leaq 0x298(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x22b0
jmp 0x19c6
movq 0x298(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x35f3(%rip), %rdi      # 0x4fd0
leaq 0x1671(%rip), %rsi      # 0x3055
callq 0x1080
movq %rax, 0x128(%rsp)
jmp 0x19f3
leaq 0x2e8(%rsp), %rdi
callq 0x22f0
vmovsd %xmm0, 0x120(%rsp)
jmp 0x1a0b
vmovsd 0x120(%rsp), %xmm0
movq 0x128(%rsp), %rdi
callq 0x1120
movq %rax, 0x118(%rsp)
jmp 0x1a2b
movq 0x118(%rsp), %rdi
leaq 0x1634(%rip), %rsi      # 0x306e
callq 0x1080
movq %rax, 0x110(%rsp)
jmp 0x1a49
movq 0x110(%rsp), %rdi
movq 0x308(%rsp), %rsi
callq 0x1040
movq %rax, 0x108(%rsp)
jmp 0x1a68
movq 0x108(%rsp), %rdi
movq 0x3549(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x1a7e
movq $0x0, 0x308(%rsp)
callq 0x1030
movq %rax, 0x288(%rsp)
movq 0x288(%rsp), %rax
movq %rax, 0x300(%rsp)
movq $0x0, 0x280(%rsp)
movq 0x280(%rsp), %rax
cmpq 0x310(%rsp), %rax
jae 0x1b12
movq 0x280(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x23b0
movq %rax, 0x100(%rsp)
jmp 0x1ae4
movq 0x100(%rsp), %rax
addq 0x308(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x280(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x280(%rsp)
jmp 0x1ab3
callq 0x1030
movq %rax, 0x278(%rsp)
movq 0x278(%rsp), %rax
movq %rax, 0x2f0(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x2260
movq %rax, 0xf8(%rsp)
jmp 0x1b4e
movq 0xf8(%rsp), %rax
movq %rax, 0x268(%rsp)
leaq 0x270(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x22b0
jmp 0x1b75
movq 0x270(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x3444(%rip), %rdi      # 0x4fd0
leaq 0x14d0(%rip), %rsi      # 0x3063
callq 0x1080
movq %rax, 0xf0(%rsp)
jmp 0x1ba2
leaq 0x2e8(%rsp), %rdi
callq 0x22f0
vmovsd %xmm0, 0xe8(%rsp)
jmp 0x1bba
vmovsd 0xe8(%rsp), %xmm0
movq 0xf0(%rsp), %rdi
callq 0x1120
movq %rax, 0xe0(%rsp)
jmp 0x1bda
movq 0xe0(%rsp), %rdi
leaq 0x1485(%rip), %rsi      # 0x306e
callq 0x1080
movq %rax, 0xd8(%rsp)
jmp 0x1bf8
movq 0xd8(%rsp), %rdi
movq 0x308(%rsp), %rsi
callq 0x1040
movq %rax, 0xd0(%rsp)
jmp 0x1c17
movq 0xd0(%rsp), %rdi
movq 0x339a(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x1c2d
movq $0x0, 0x308(%rsp)
callq 0x1030
movq %rax, 0x260(%rsp)
movq 0x260(%rsp), %rax
movq %rax, 0x300(%rsp)
movq $0x0, 0x258(%rsp)
movq 0x258(%rsp), %rax
cmpq 0x310(%rsp), %rax
jae 0x1cc1
movq 0x258(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x23e0
movq %rax, 0xc8(%rsp)
jmp 0x1c93
movq 0xc8(%rsp), %rax
addq 0x308(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x258(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x258(%rsp)
jmp 0x1c62
callq 0x1030
movq %rax, 0x250(%rsp)
movq 0x250(%rsp), %rax
movq %rax, 0x2f0(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x2260
movq %rax, 0xc0(%rsp)
jmp 0x1cfd
movq 0xc0(%rsp), %rax
movq %rax, 0x240(%rsp)
leaq 0x248(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x22b0
jmp 0x1d24
movq 0x248(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x3295(%rip), %rdi      # 0x4fd0
leaq 0x132e(%rip), %rsi      # 0x3070
callq 0x1080
movq %rax, 0xb8(%rsp)
jmp 0x1d51
leaq 0x2e8(%rsp), %rdi
callq 0x22f0
vmovsd %xmm0, 0xb0(%rsp)
jmp 0x1d69
vmovsd 0xb0(%rsp), %xmm0
movq 0xb8(%rsp), %rdi
callq 0x1120
movq %rax, 0xa8(%rsp)
jmp 0x1d89
movq 0xa8(%rsp), %rdi
leaq 0x12d6(%rip), %rsi      # 0x306e
callq 0x1080
movq %rax, 0xa0(%rsp)
jmp 0x1da7
movq 0xa0(%rsp), %rdi
movq 0x308(%rsp), %rsi
callq 0x1040
movq %rax, 0x98(%rsp)
jmp 0x1dc6
movq 0x98(%rsp), %rdi
movq 0x31eb(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x1ddc
movq $0x0, 0x308(%rsp)
callq 0x1030
movq %rax, 0x238(%rsp)
movq 0x238(%rsp), %rax
movq %rax, 0x300(%rsp)
movq $0x0, 0x230(%rsp)
movq 0x230(%rsp), %rax
cmpq 0x310(%rsp), %rax
jae 0x1e70
movq 0x230(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x2430
movq %rax, 0x90(%rsp)
jmp 0x1e42
movq 0x90(%rsp), %rax
addq 0x308(%rsp), %rax
movq %rax, 0x308(%rsp)
movq 0x230(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x230(%rsp)
jmp 0x1e11
callq 0x1030
movq %rax, 0x228(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x2f0(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x2260
movq %rax, 0x88(%rsp)
jmp 0x1eac
movq 0x88(%rsp), %rax
movq %rax, 0x218(%rsp)
leaq 0x220(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0x22b0
jmp 0x1ed3
movq 0x220(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x30e6(%rip), %rdi      # 0x4fd0
leaq 0x118c(%rip), %rsi      # 0x307d
callq 0x1080
movq %rax, 0x80(%rsp)
jmp 0x1f00
leaq 0x2e8(%rsp), %rdi
callq 0x22f0
vmovsd %xmm0, 0x78(%rsp)
jmp 0x1f15
vmovsd 0x78(%rsp), %xmm0
movq 0x80(%rsp), %rdi
callq 0x1120
movq %rax, 0x70(%rsp)
jmp 0x1f2f
movq 0x70(%rsp), %rdi
leaq 0x1133(%rip), %rsi      # 0x306e
callq 0x1080
movq %rax, 0x68(%rsp)
jmp 0x1f47
movq 0x68(%rsp), %rdi
movq 0x308(%rsp), %rsi
callq 0x1040
movq %rax, 0x60(%rsp)
jmp 0x1f60
movq 0x60(%rsp), %rdi
movq 0x3054(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x1f73
cmpq $0x32, 0x310(%rsp)
jae 0x21dd
movq $0x0, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x310(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x2006
movq 0x210(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x23b0
movq %rax, 0x58(%rsp)
jmp 0x1fc3
movq 0x58(%rsp), %rsi
movq 0x3001(%rip), %rdi      # 0x4fd0
callq 0x1040
movq %rax, 0x50(%rsp)
jmp 0x1fdb
movq 0x50(%rsp), %rdi
leaq 0x10a3(%rip), %rsi      # 0x308a
callq 0x1080
jmp 0x1fee
jmp 0x1ff0
movq 0x210(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x210(%rsp)
jmp 0x1f8e
movq 0x310(%rsp), %rsi
movq %rsi, %rdi
decq %rdi
callq 0x23b0
movq %rax, 0x48(%rsp)
jmp 0x2020
movq 0x48(%rsp), %rsi
movq 0x2fa4(%rip), %rdi      # 0x4fd0
callq 0x1040
movq %rax, 0x40(%rsp)
jmp 0x2038
movq 0x40(%rsp), %rdi
movq 0x2f7c(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x204b
movq $0x0, 0x208(%rsp)
movq 0x208(%rsp), %rax
movq 0x310(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x20cf
movq 0x208(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x23e0
movq %rax, 0x38(%rsp)
jmp 0x208c
movq 0x38(%rsp), %rsi
movq 0x2f38(%rip), %rdi      # 0x4fd0
callq 0x1040
movq %rax, 0x30(%rsp)
jmp 0x20a4
movq 0x30(%rsp), %rdi
leaq 0xfda(%rip), %rsi       # 0x308a
callq 0x1080
jmp 0x20b7
jmp 0x20b9
movq 0x208(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x208(%rsp)
jmp 0x2057
movq 0x310(%rsp), %rsi
movq %rsi, %rdi
decq %rdi
callq 0x23e0
movq %rax, 0x28(%rsp)
jmp 0x20e9
movq 0x28(%rsp), %rsi
movq 0x2edb(%rip), %rdi      # 0x4fd0
callq 0x1040
movq %rax, 0x20(%rsp)
jmp 0x2101
movq 0x20(%rsp), %rdi
movq 0x2eb3(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x2114
movq $0x0, 0x200(%rsp)
movq 0x200(%rsp), %rax
movq 0x310(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x2198
movq 0x200(%rsp), %rdi
movq 0x310(%rsp), %rsi
callq 0x2430
movq %rax, 0x18(%rsp)
jmp 0x2155
movq 0x18(%rsp), %rsi
movq 0x2e6f(%rip), %rdi      # 0x4fd0
callq 0x1040
movq %rax, 0x10(%rsp)
jmp 0x216d
movq 0x10(%rsp), %rdi
leaq 0xf11(%rip), %rsi       # 0x308a
callq 0x1080
jmp 0x2180
jmp 0x2182
movq 0x200(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x200(%rsp)
jmp 0x2120
movq 0x310(%rsp), %rsi
movq %rsi, %rdi
decq %rdi
callq 0x2430
movq %rax, 0x8(%rsp)
jmp 0x21b2
movq 0x8(%rsp), %rsi
movq 0x2e12(%rip), %rdi      # 0x4fd0
callq 0x1040
movq %rax, (%rsp)
jmp 0x21c9
movq (%rsp), %rdi
movq 0x2dec(%rip), %rsi      # 0x4fc0
callq 0x1090
jmp 0x21db
jmp 0x21dd
jmp 0x1392
leaq 0x360(%rsp), %rdi
callq 0x1050
movl 0x4f4(%rsp), %eax
addq $0x4f8, %rsp            # imm = 0x4F8
retq
movq 0x330(%rsp), %rdi
callq 0x1100
nopl (%rax,%rax)