// File: xdsopl[P]FEC/tables_generator.cc
// Function: TablesGenerator<4, 19, unsigned char>::generate(char const*)
static void generate(const char *type)
	{
		TYPE log[Q], exp[Q];
		log[exp[N] = 0] = N;
		TYPE a = 1;
		for (int i = 0; i < N; ++i, a = next(a))
			log[exp[i] = a] = i;
		assert(1 == a);
		TYPE Artin_Schreier_imap[Q];
		for (int i = 0; i < Q; ++i)
			Artin_Schreier_imap[i] = 0;
		for (int x = 2; x < N; x += 2) {
			int xxx = exp[(2*log[x])%N]^x;
			if (xxx == N)
				continue;
			assert(xxx);
			assert(!Artin_Schreier_imap[xxx]);
			Artin_Schreier_imap[xxx] = x;
		}
		std::cout << "template <>" << std::endl;
		std::cout << "struct Tables<" << M << ", " << POLY << ", " << type << ">\n{\n";
		print(log, "log", type, Q);
		print(exp, "exp", type, Q);
		print(Artin_Schreier_imap, "Artin_Schreier_imap", type, Q);
		std::cout << "};\n" << std::endl;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x21(%rbp)
movb $0xf, -0x20(%rbp)
movb $0x1, -0x31(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0xf, -0x38(%rbp)
jge 0x12e3
movl -0x38(%rbp), %eax
movb %al, %cl
movb -0x31(%rbp), %al
movslq -0x38(%rbp), %rdx
movb %al, -0x30(%rbp,%rdx)
movzbl %al, %eax
movb %cl, -0x20(%rbp,%rax)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movzbl -0x31(%rbp), %edi
callq 0x1da0
movb %al, -0x31(%rbp)
jmp 0x12af
movzbl -0x31(%rbp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x12f2
jmp 0x1311
leaq 0x1d78(%rip), %rdi      # 0x3071
leaq 0x1d78(%rip), %rsi      # 0x3078
movl $0x1a, %edx
leaq 0x1d80(%rip), %rcx      # 0x308c
callq 0x1030
movl $0x0, -0x54(%rbp)
cmpl $0x10, -0x54(%rbp)
jge 0x1332
movslq -0x54(%rbp), %rax
movb $0x0, -0x50(%rbp,%rax)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1318
movl $0x2, -0x58(%rbp)
cmpl $0xf, -0x58(%rbp)
jge 0x13e3
movslq -0x58(%rbp), %rax
movzbl -0x20(%rbp,%rax), %eax
shll %eax
movl $0xf, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movzbl -0x30(%rbp,%rax), %eax
xorl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $0xf, -0x5c(%rbp)
jne 0x136c
jmp 0x13d5
cmpl $0x0, -0x5c(%rbp)
je 0x1374
jmp 0x1393
leaq 0x1d84(%rip), %rdi      # 0x30ff
leaq 0x1cf6(%rip), %rsi      # 0x3078
movl $0x22, %edx
leaq 0x1cfe(%rip), %rcx      # 0x308c
callq 0x1030
movslq -0x5c(%rbp), %rax
cmpb $0x0, -0x50(%rbp,%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x13a7
jmp 0x13a9
jmp 0x13c8
leaq 0x1d53(%rip), %rdi      # 0x3103
leaq 0x1cc1(%rip), %rsi      # 0x3078
movl $0x23, %edx
leaq 0x1cc9(%rip), %rcx      # 0x308c
callq 0x1030
movl -0x58(%rbp), %eax
movb %al, %cl
movslq -0x5c(%rbp), %rax
movb %cl, -0x50(%rbp,%rax)
movl -0x58(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x58(%rbp)
jmp 0x1339
movq 0x3bee(%rip), %rdi      # 0x4fd8
leaq 0x1d2c(%rip), %rsi      # 0x311d
callq 0x1050
movq %rax, %rdi
movq 0x3bc8(%rip), %rsi      # 0x4fc8
callq 0x1060
movq 0x3bcc(%rip), %rdi      # 0x4fd8
leaq 0x1d16(%rip), %rsi      # 0x3129
callq 0x1050
movq %rax, %rdi
movl $0x4, %esi
callq 0x1080
movq %rax, %rdi
leaq 0x1d09(%rip), %rsi      # 0x3138
callq 0x1050
movq %rax, %rdi
movl $0x13, %esi
callq 0x1080
movq %rax, %rdi
leaq 0x1ced(%rip), %rsi      # 0x3138
callq 0x1050
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x1050
movq %rax, %rdi
leaq 0x1cd5(%rip), %rsi      # 0x313b
callq 0x1050
leaq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x1cc6(%rip), %rsi      # 0x3140
movl $0x10, %ecx
callq 0x1de0
leaq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x1cb1(%rip), %rsi      # 0x3144
movl $0x10, %ecx
callq 0x1de0
leaq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x1c9c(%rip), %rsi      # 0x3148
movl $0x10, %ecx
callq 0x1de0
movq 0x3b1b(%rip), %rdi      # 0x4fd8
leaq 0x1c98(%rip), %rsi      # 0x315c
callq 0x1050
movq %rax, %rdi
movq 0x3af5(%rip), %rsi      # 0x4fc8
callq 0x1060
addq $0x60, %rsp
popq %rbp
retq
nop