// File: /workspace/github_cpp_makefile_star2_O2/xdsopl[P]FEC/testbench.cc
// Function: void test_bch<24, 1, 65343, 16, 65581, unsigned short>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, BoseChaudhuriHocquenghem<24, 1, 65343, GF::Types<16, 65581, unsigned short>>&, unsigned short*, unsigned short*, std::vector<unsigned char, std::allocator<unsigned char>>&)
void test_bch(std::string name, BoseChaudhuriHocquenghem<NR, FCR, K, GF::Types<M, P, TYPE>> &bch, TYPE *code, TYPE *target, std::vector<uint8_t> &data)
{
	std::cout << "testing: " << name << std::endl;

	{
		bch.encode(code);
		bool error = false;
		for (int i = 0; i < bch.N; ++i)
			error |= code[i] != target[i];
		if (error)
			std::cout << "encoder error!" << std::endl;
		assert(!error);
		//print_table(code + K, "parity", bch.NP);
		error = bch.decode(code);
		if (error)
			std::cout << "decoder error!" << std::endl;
		assert(!error);
		int pos = 0, cap = 0, corrupt = 0, erasures_count = 0;
		TYPE erasures[NR];
		// need one root per erasure
		for (int i = 0; pos < bch.N && cap+1 <= NR && i < NR/2; ++i, ++corrupt, ++pos, ++cap)
			code[erasures[erasures_count++] = pos] ^= 1;
		// need two roots per error
		for (int i = 0; pos < bch.N && cap+2 <= NR && i < NR/2; ++i, ++corrupt, ++pos, cap+=2)
			code[pos] ^= 1;
		int corrected = bch.decode(code, erasures, erasures_count);
		if (corrupt != corrected)
			std::cout << "decoder error: expected " << corrupt << " but got " << corrected << std::endl;
		assert(corrupt == corrected);
		TYPE syndromes[NR];
		if (corrected >= 0 && bch.compute_syndromes(code, syndromes)) {
			std::cout << "decoder error: result of correction is not a codeword!" << std::endl;
			assert(false);
		}
		error = false;
		for (int i = 0; i < bch.N; ++i)
			error |= code[i] != target[i];
		if (error)
			std::cout << "decoder error: code doesnt match target" << std::endl;
		assert(!error);
	}
	int blocks = (8 * data.size() + K - 1) / K;
	TYPE *coded = new TYPE[bch.N * blocks];
	{
		unsigned pos = 0;
		for (unsigned byte : data) {
			for (int bit = 0; bit < 8; ++bit) {
				coded[pos++] = (byte >> bit) & 1;
				if (pos % bch.N >= K)
					pos += bch.NP;
			}
		}
	}
	{
		auto start = std::chrono::system_clock::now();
		for (int i = 0; i < blocks; ++i)
			bch.encode(coded + i * bch.N);
		auto end = std::chrono::system_clock::now();
		auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
		int mbs = (data.size() + msec.count() / 2) / msec.count();
		int bytes = (bch.N * blocks) / 8;
		float redundancy = (100.0f*(bytes-data.size())) / data.size();
		std::cout << "encoding of " << data.size() << " random bytes into " << bytes << " codeword bytes (" << std::setprecision(1) << std::fixed << redundancy << "% redundancy) in " << blocks << " blocks took " << msec.count() << " milliseconds (" << mbs << "KB/s)." << std::endl;
	}
	std::random_device rd;
	std::default_random_engine generator(rd());
	std::uniform_int_distribution<int> pos_dist(0, bch.N-1);
	auto rnd_pos = std::bind(pos_dist, generator);
	std::vector<uint8_t> recovered(data.size());
	TYPE *tmp = new TYPE[bch.N * blocks];
	TYPE *erasures = new TYPE[NR * blocks];
	for (int places = 0; places <= NR; ++places) {
		for (int erasures_count = 0; erasures_count <= places; ++erasures_count) {
			for (int i = 0; i < bch.N * blocks; ++i)
				tmp[i] = coded[i];
			int corrupt = 0;
			for (int i = 0; i < blocks; ++i) {
				for (int j = 0; j < places; ++j) {
					erasures[i*NR + j] = rnd_pos();
					for (int k = 0; k < j;) {
						if (erasures[i*NR + k++] == erasures[i*NR + j]) {
							erasures[i*NR + j] = rnd_pos();
							k = 0;
						}
					}
					tmp[i * bch.N + erasures[i*NR + j]] ^= 1;
					++corrupt;
				}
			}
			int corrected = 0, wrong = 0;
			auto start = std::chrono::system_clock::now();
			for (int i = 0; i < blocks; ++i) {
				int result = bch.decode(tmp + i * bch.N, erasures + i * NR, erasures_count);
				if (places > NR/2 && places > erasures_count && result >= 0)
					for (int j = i * bch.N; j < (i + 1) * bch.N; ++j)
						wrong += coded[j] != tmp[j];
				corrected += result;
			}
			auto end = std::chrono::system_clock::now();
			auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
			int bytes = (bch.N * blocks) / 8;
			int mbs = (bytes + msec.count() / 2) / msec.count();
			std::cout << "decoding with " << places << " errors and " << erasures_count << " known erasures per block took " << msec.count() << " milliseconds (" << mbs << "KB/s).";
			if (corrupt != corrected || wrong)
				std::cout << " expected " << corrupt << " corrected errors but got " << corrected << " and " << wrong << " wrong corrections.";
			std::cout << std::endl;
			assert((places > NR/2 && places > erasures_count) || (corrupt == corrected && !wrong));
			int left = 0;
			for (int i = 0; i < bch.N * blocks; ++i)
				left += tmp[i] > 1;
			if (left)
				std::cout << "correction left GF(2) " << left << " times!" << std::endl;
			if (corrupt == corrected && !wrong) {
				unsigned acc = 0, bit = 0, pos = 0;
				for (uint8_t &byte: recovered) {
					while (bit < 8) {
						acc |= (unsigned)tmp[pos++] << bit++;
						if (pos % bch.N >= K)
							pos += bch.NP;
					}
					bit -= 8;
					byte = 255 & acc;
					acc >>= 8;
				}
				for (int i = 0; i < blocks; ++i) {
					TYPE syndromes[NR];
					if (bch.compute_syndromes(tmp + i * bch.N, syndromes)) {
						std::cout << "decoder error: result of correction is not a codeword!" << std::endl;
						assert(false);
					}
				}
				if (data != recovered) {
					std::cout << "decoder error: data could not be recovered from corruption!" << std::endl;
					assert(places > NR/2 && places > erasures_count);
				}
			}
		}
	}
	delete[] erasures;
	delete[] tmp;
	delete[] coded;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1448, %rsp           # imm = 0x1448
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movq 0xcf174(%rip), %rdi     # 0xd3fd8
leaq 0x7a94(%rip), %rsi      # 0xc8ff
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq %r13, %rdi
movq %r14, %rsi
callq 0x9da0
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0xffff, %rax           # imm = 0xFFFF
je 0x4ead
movzwl (%r14,%rax,2), %edx
cmpw (%rbx,%rax,2), %dx
setne %dl
orb %dl, %cl
incq %rax
jmp 0x4e92
testb $0x1, %cl
jne 0x5763
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x9e32
testl %eax, %eax
jne 0x579d
xorl %eax, %eax
cmpq $0xc, %rax
je 0x4ee7
movw %ax, 0xc0(%rsp,%rax,2)
xorb $0x1, (%r14,%rax,2)
incq %rax
jmp 0x4ecf
pushq $0xc
popq %rax
cmpq $0x12, %rax
je 0x4efa
xorb $0x1, (%r14,%rax,2)
incq %rax
jmp 0x4eea
leaq 0xc0(%rsp), %rdx
pushq $0xc
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
callq 0x9e32
cmpl $0x12, %eax
jne 0x57d7
leaq 0x90(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x9eec
testl %eax, %eax
jne 0x5837
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0xffff, %rax           # imm = 0xFFFF
je 0x4f53
movzwl (%r14,%rax,2), %edx
cmpw (%rbx,%rax,2), %dx
setne %dl
orb %dl, %cl
incq %rax
jmp 0x4f38
movq %r13, 0x38(%rsp)
testb $0x1, %cl
jne 0x5871
movq (%r12), %r15
movq %r12, 0x30(%rsp)
movq 0x8(%r12), %r13
movq %r13, %rax
subq %r15, %rax
leaq 0xff3e(,%rax,8), %rax
xorl %ebp, %ebp
movl $0xff3f, %ecx           # imm = 0xFF3F
xorl %edx, %edx
divq %rcx
movq %rax, %rbx
imull $0xffff, %ebx, %eax     # imm = 0xFFFF
movq %rax, 0x20(%rsp)
movslq %eax, %r12
addq %r12, %r12
testl %ebx, %ebx
pushq $-0x1
popq %r14
cmovsq %r14, %r12
movq %r12, %rdi
callq 0x2030
movq %rax, 0x10(%rsp)
movl $0xffff, %esi           # imm = 0xFFFF
movq 0x10(%rsp), %r9
cmpq %r13, %r15
je 0x5005
movzbl (%r15), %edi
xorl %r8d, %r8d
cmpl $0x8, %r8d
je 0x5000
xorl %eax, %eax
btl %r8d, %edi
setb %al
leal 0x1(%rbp), %ecx
movl %ebp, %edx
movw %ax, (%r9,%rdx,2)
movl %ecx, %eax
xorl %edx, %edx
divl %esi
cmpl $0xff3f, %edx           # imm = 0xFF3F
jb 0x4ff9
addl $0xc1, %ebp
movl %ebp, %ecx
incl %r8d
movl %ecx, %ebp
jmp 0x4fca
incq %r15
jmp 0x4fbe
callq 0x2040
movq %rax, %r15
xorl %r13d, %r13d
testl %ebx, %ebx
movl $0x0, %eax
cmovgl %ebx, %eax
movq %rax, 0x40(%rsp)
imulq $0x1fffe, %rax, %rax    # imm = 0x1FFFE
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rbp
cmpq %r13, 0x48(%rsp)
je 0x5051
movq 0x10(%rsp), %rax
leaq (%rax,%r13), %rsi
movq %rbp, %rdi
callq 0x9da0
addq $0x1fffe, %r13          # imm = 0x1FFFE
jmp 0x5030
callq 0x2040
movq %rax, %rcx
subq %r15, %rcx
movl $0xf4240, %esi          # imm = 0xF4240
movq %rcx, %rax
cqto
idivq %rsi
movq %rax, %r15
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
movl $0x1e8480, %edi         # imm = 0x1E8480
movq %rcx, %rax
cqto
idivq %rdi
addq %rsi, %rax
xorl %edx, %edx
divq %r15
movq %rax, (%rsp)
pushq $0x8
popq %rcx
movq 0x20(%rsp), %rax
cltd
idivl %ecx
movl %eax, %ebp
cltq
movq %rax, 0x58(%rsp)
subq %rsi, %rax
js 0x50b1
cvtsi2ss %rax, %xmm1
jmp 0x50c6
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
mulss 0x6f36(%rip), %xmm1     # 0xc004
testq %rsi, %rsi
js 0x50da
cvtsi2ss %rsi, %xmm0
jmp 0x50ef
movq %rsi, %rax
shrq %rax
andl $0x1, %esi
orq %rax, %rsi
cvtsi2ss %rsi, %xmm0
addss %xmm0, %xmm0
divss %xmm0, %xmm1
movss %xmm1, 0x18(%rsp)
movq 0xceed8(%rip), %rdi     # 0xd3fd8
leaq 0x7987(%rip), %rsi      # 0xca8e
callq 0x2160
movq 0x30(%rsp), %r13
movq 0x8(%r13), %rsi
subq (%r13), %rsi
movq %rax, %rdi
callq 0x20e0
leaq 0x7973(%rip), %rsi      # 0xca9b
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movl %ebp, %esi
callq 0x21e0
leaq 0x796e(%rip), %rsi      # 0xcaaf
movq %rax, %rdi
callq 0x2160
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x1, 0x8(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x18(%rax,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movss 0x18(%rsp), %xmm0
callq 0x2100
leaq 0x793f(%rip), %rsi      # 0xcac1
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movl %ebx, %esi
callq 0x21e0
leaq 0x7938(%rip), %rsi      # 0xcad3
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x2150
leaq 0x792c(%rip), %rsi      # 0xcae1
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x21e0
leaq 0x7921(%rip), %rsi      # 0xcaf1
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0xc0(%rsp), %r15
movq %r15, %rdi
callq 0x27a6
movq %r15, %rdi
callq 0x21b0
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %ecx
cmpl $0x1, %edx
adcl $0x0, %edx
movabsq $0xfffe00000000, %rax   # imm = 0xFFFE00000000
movq %rax, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
movq 0x8(%r13), %rsi
subq (%r13), %rsi
leaq 0x68(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x27fc
movq %r12, %rdi
callq 0x2030
movq %rax, (%rsp)
movabsq $0x1800000000, %rax     # imm = 0x1800000000
imulq %rax, %rbx
movq %rbx, %rax
sarq $0x1f, %rax
testq %rbx, %rbx
cmovnsq %rax, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, %rbp
xorl %ebx, %ebx
movq 0x20(%rsp), %rax
testl %eax, %eax
cmovlel %ebx, %eax
addl %eax, %eax
movq %rax, 0x20(%rsp)
pushq $0x1
popq %rax
movl %eax, 0x2c(%rsp)
movl $0x0, 0x8(%rsp)
cmpq $0x19, %rbx
je 0x56a7
xorl %eax, %eax
movl %eax, 0xc(%rsp)
cmpl 0x2c(%rsp), %eax
je 0x568f
xorl %eax, %eax
cmpq %rax, 0x20(%rsp)
je 0x52ca
movq 0x10(%rsp), %rcx
movzwl (%rcx,%rax), %ecx
movq (%rsp), %rdx
movw %cx, (%rdx,%rax)
addq $0x2, %rax
jmp 0x52ac
xorl %r15d, %r15d
xorl %eax, %eax
cmpq 0x40(%rsp), %rax
je 0x534a
imulq $0x30, %rax, %r13
addq %rbp, %r13
movq %rax, 0x18(%rsp)
imulq $0x1fffe, %rax, %r14    # imm = 0x1FFFE
addq (%rsp), %r14
xorl %r12d, %r12d
cmpq %rbx, %r12
je 0x533c
leaq 0x80(%rsp), %rdi
callq 0x6a80
movw %ax, (%r13,%r12,2)
xorl %ecx, %ecx
cmpq %rcx, %r12
jbe 0x532f
leal (%r15,%rcx), %edx
movslq %edx, %rdx
incq %rcx
cmpw %ax, (%rbp,%rdx,2)
jne 0x530a
leaq 0x80(%rsp), %rdi
callq 0x6a80
jmp 0x5302
movzwl %ax, %eax
xorb $0x1, (%r14,%rax,2)
incq %r12
jmp 0x52f0
movq 0x18(%rsp), %rax
incq %rax
addq $0x18, %r15
jmp 0x52cf
callq 0x2040
movq %rax, 0x60(%rsp)
movl 0xc(%rsp), %eax
movq %rax, 0x50(%rsp)
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpq 0x40(%rsp), %r13
je 0x5400
movl %r14d, 0x18(%rsp)
imulq $0xffff, %r13, %r14     # imm = 0xFFFF
movq (%rsp), %rax
leaq (%rax,%r14,2), %rsi
imulq $0x30, %r13, %rdx
addq %rbp, %rdx
movq 0x38(%rsp), %rdi
movl 0xc(%rsp), %ecx
callq 0x9e32
cmpq $0xd, %rbx
jb 0x53e9
cmpq 0x50(%rsp), %rbx
jbe 0x53e9
testl %eax, %eax
js 0x53e9
movl %r15d, %ecx
addq %rcx, %rcx
movq (%rsp), %rdx
addq %rcx, %rdx
addq 0x10(%rsp), %rcx
addl $0xffff, %r14d          # imm = 0xFFFF
xorl %esi, %esi
leal (%r15,%rsi), %edi
cmpl %edi, %r14d
jle 0x53e9
movzwl (%rcx,%rsi,2), %edi
xorl %r8d, %r8d
cmpw (%rdx,%rsi,2), %di
setne %r8b
addl %r8d, %r12d
incq %rsi
jmp 0x53c9
movl 0x18(%rsp), %r14d
addl %eax, %r14d
incq %r13
addq $0xffff, %r15           # imm = 0xFFFF
jmp 0x5369
callq 0x2040
movq %rax, %rcx
subq 0x60(%rsp), %rcx
movq %rcx, %rax
cqto
movl $0xf4240, %esi          # imm = 0xF4240
idivq %rsi
movq %rax, %r13
movq %rcx, %rax
cqto
movl $0x1e8480, %ecx         # imm = 0x1E8480
idivq %rcx
addq 0x58(%rsp), %rax
cqto
idivq %r13
movq %rax, %r15
movq 0xceb9a(%rip), %rdi     # 0xd3fd8
leaq 0x76b3(%rip), %rsi      # 0xcaf8
callq 0x2160
movq %rax, %rdi
movl %ebx, %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x76a9(%rip), %rsi      # 0xcb07
callq 0x2160
movq %rax, %rdi
movl 0xc(%rsp), %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x769b(%rip), %rsi      # 0xcb14
callq 0x2160
movq %rax, %rdi
movq %r13, %rsi
callq 0x2150
movq %rax, %rdi
leaq 0x764e(%rip), %rsi      # 0xcae1
callq 0x2160
movq %rax, %rdi
movl %r15d, %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x7644(%rip), %rsi      # 0xcaf1
callq 0x2160
movl 0x8(%rsp), %eax
xorl %r14d, %eax
orl %r12d, %eax
setne %r13b
je 0x5524
movq 0xceb0f(%rip), %rdi     # 0xd3fd8
leaq 0x7539(%rip), %rsi      # 0xca09
callq 0x2160
movq %rax, %rdi
movl 0x8(%rsp), %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x7649(%rip), %rsi      # 0xcb34
callq 0x2160
movq %rax, %rdi
movl %r14d, %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x7609(%rip), %rsi      # 0xcb0e
callq 0x2160
movq %rax, %rdi
movl %r12d, %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x7630(%rip), %rsi      # 0xcb4f
callq 0x2160
movq 0xceaad(%rip), %rdi     # 0xd3fd8
callq 0x20a0
cmpq $0xd, %rbx
setb %al
cmpq 0x50(%rsp), %rbx
setbe %r12b
orb %al, %r12b
testb %r13b, %r12b
jne 0x5725
xorl %eax, %eax
xorl %r15d, %r15d
cmpq %rax, 0x20(%rsp)
je 0x556b
movq (%rsp), %rcx
cmpw $0x2, (%rcx,%rax)
sbbl $-0x1, %r15d
addq $0x2, %rax
jmp 0x5551
testl %r15d, %r15d
je 0x55a5
movq 0xcea61(%rip), %rdi     # 0xd3fd8
leaq 0x7634(%rip), %rsi      # 0xcbb2
callq 0x2160
movq %rax, %rdi
movl %r15d, %esi
callq 0x21e0
movq %rax, %rdi
leaq 0x7631(%rip), %rsi      # 0xcbc9
callq 0x2160
movq %rax, %rdi
callq 0x20a0
testb %r13b, %r13b
jne 0x5684
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r8, %rdi
je 0x5612
xorl %ecx, %ecx
cmpl $0x8, %ecx
je 0x5606
leal 0x1(%r10), %esi
movl %r10d, %eax
movq (%rsp), %rdx
movzwl (%rdx,%rax,2), %r11d
shll %cl, %r11d
movl %esi, %eax
xorl %edx, %edx
movl $0xffff, %r14d          # imm = 0xFFFF
divl %r14d
cmpl $0xff3f, %edx           # imm = 0xFF3F
jb 0x55fc
addl $0xc1, %r10d
movl %r10d, %esi
incl %ecx
orl %r11d, %r9d
movl %esi, %r10d
jmp 0x55c5
movb %r9b, (%rdi)
shrl $0x8, %r9d
incq %rdi
jmp 0x55be
movq 0x48(%rsp), %r14
movq (%rsp), %r15
testq %r14, %r14
je 0x564d
movq 0x38(%rsp), %rdi
movq %r15, %rsi
leaq 0x90(%rsp), %rdx
callq 0x9eec
testl %eax, %eax
jne 0x56eb
addq $0x1fffe, %r15          # imm = 0x1FFFE
addq $-0x1fffe, %r14         # imm = 0xFFFE0002
jmp 0x561b
movq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6a89
testb %al, %al
je 0x5684
movq 0xce971(%rip), %rdi     # 0xd3fd8
leaq 0x7563(%rip), %rsi      # 0xcbd1
callq 0x2160
movq %rax, %rdi
callq 0x20a0
testb %r12b, %r12b
jne 0x5744
movl 0xc(%rsp), %eax
incl %eax
jmp 0x529c
incq %rbx
movl 0x8(%rsp), %eax
addl 0x40(%rsp), %eax
movl %eax, 0x8(%rsp)
incl 0x2c(%rsp)
jmp 0x5290
movq %rbp, %rdi
callq 0x21a0
movq (%rsp), %rdi
callq 0x21a0
movq 0x10(%rsp), %rdi
callq 0x21a0
leaq 0x68(%rsp), %rdi
callq 0x65dc
leaq 0xc0(%rsp), %rdi
callq 0x64da
addq $0x1448, %rsp           # imm = 0x1448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xce8e6(%rip), %rdi     # 0xd3fd8
leaq 0x7330(%rip), %rsi      # 0xca29
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0x7353(%rip), %rdi      # 0xca60
leaq 0x720b(%rip), %rsi      # 0xc91f
leaq 0x8b02(%rip), %rcx      # 0xe21d
movl $0x133, %edx            # imm = 0x133
callq 0x20d0
leaq 0x7437(%rip), %rdi      # 0xcb63
leaq 0x71ec(%rip), %rsi      # 0xc91f
leaq 0x8ae3(%rip), %rcx      # 0xe21d
movl $0x11d, %edx            # imm = 0x11D
callq 0x20d0
leaq 0x74c2(%rip), %rdi      # 0xcc0d
leaq 0x71cd(%rip), %rsi      # 0xc91f
leaq 0x8ac4(%rip), %rcx      # 0xe21d
movl $0x138, %edx            # imm = 0x138
callq 0x20d0
movq 0xce86e(%rip), %rdi     # 0xd3fd8
leaq 0x7198(%rip), %rsi      # 0xc909
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0x7193(%rip), %rdi      # 0xc918
leaq 0x7193(%rip), %rsi      # 0xc91f
leaq 0x8a8a(%rip), %rcx      # 0xe21d
movl $0xbe, %edx
callq 0x20d0
movq 0xce834(%rip), %rdi     # 0xd3fd8
leaq 0x7241(%rip), %rsi      # 0xc9ec
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0x7159(%rip), %rdi      # 0xc918
leaq 0x7159(%rip), %rsi      # 0xc91f
leaq 0x8a50(%rip), %rcx      # 0xe21d
movl $0xc3, %edx
callq 0x20d0
movl %eax, %ebp
movq 0xce7f8(%rip), %rdi     # 0xd3fd8
leaq 0x7214(%rip), %rsi      # 0xc9fb
callq 0x2160
pushq $0x12
popq %rsi
movq %rax, %rdi
callq 0x21e0
leaq 0x7347(%rip), %rsi      # 0xcb45
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movl %ebp, %esi
callq 0x21e0
movq %rax, %rdi
callq 0x20a0
leaq 0x71f5(%rip), %rdi      # 0xca14
leaq 0x70f9(%rip), %rsi      # 0xc91f
leaq 0x89f0(%rip), %rcx      # 0xe21d
movl $0xcf, %edx
callq 0x20d0
movq 0xce79a(%rip), %rdi     # 0xd3fd8
leaq 0x71e4(%rip), %rsi      # 0xca29
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0x7207(%rip), %rdi      # 0xca60
leaq 0x70bf(%rip), %rsi      # 0xc91f
leaq 0x89b6(%rip), %rcx      # 0xe21d
movl $0xd3, %edx
callq 0x20d0
movq 0xce760(%rip), %rdi     # 0xd3fd8
leaq 0x71e7(%rip), %rsi      # 0xca66
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0x7085(%rip), %rdi      # 0xc918
leaq 0x7085(%rip), %rsi      # 0xc91f
leaq 0x897c(%rip), %rcx      # 0xe21d
movl $0xda, %edx
callq 0x20d0
jmp 0x58c4
jmp 0x58c4
jmp 0x58b1
movq %rax, %rbx
jmp 0x58d1
jmp 0x58c4
jmp 0x58c4
jmp 0x58c4
jmp 0x58c4
jmp 0x58c4
jmp 0x58c4
jmp 0x58c4
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x65dc
leaq 0xc0(%rsp), %rdi
callq 0x64da
movq %rbx, %rdi
callq 0x21f0