// File: xdsopl[P]FEC/./reed_solomon.hh
// Function: ReedSolomon<4, 0, GF::Types<4, 19, unsigned char>>::ReedSolomon()
ReedSolomon()
	{
		// $generator = \prod_{i=0}^{NR}(x-pe^{FCR+i})$
		ValueType tmp[NR+1];
		IndexType root(FCR), pe(1);
		for (int i = 0; i < NR; ++i) {
			tmp[i] = ValueType(1);
			for (int j = i; j > 0; --j)
				tmp[j] = fma(root, tmp[j], tmp[j-1]);
			tmp[0] *= root;
			root *= pe;
		}
		tmp[NR] = ValueType(1);
#ifndef NDEBUG
		std::cout << "generator = ";
		for (int i = NR; i > 0; --i) {
			if (!tmp[i])
				continue;
			if (tmp[i] != ValueType(1))
				std::cout << (int)tmp[i] << "*";
			std::cout << "x";
			if (i != 1)
				std::cout << "^" << i;
			std::cout << " + ";
		}
		std::cout << (int)tmp[0] << std::endl;
#endif
		for (int i = 0; i <= NR; ++i)
			generator[i] = index(tmp[i]);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %rax, %rcx
addq $0x5, %rcx
movq %rcx, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0xcad0
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
addq $0x1, %rax
cmpq %rcx, %rax
movq %rax, -0x40(%rbp)
jne 0x4973
leaq -0xd(%rbp), %rax
movq %rax, %rcx
addq $0x5, %rcx
movq %rcx, -0x68(%rbp)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0xbc20
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
addq $0x1, %rax
cmpq %rcx, %rax
movq %rax, -0x60(%rbp)
jne 0x49a8
leaq -0xe(%rbp), %rdi
xorl %esi, %esi
callq 0xbd80
leaq -0xf(%rbp), %rdi
movl $0x1, %esi
callq 0xbd80
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x4aa1
leaq -0x15(%rbp), %rdi
movl $0x1, %esi
callq 0xbc30
movslq -0x14(%rbp), %rax
movb -0x15(%rbp), %cl
movb %cl, -0xd(%rbp,%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x4a67
movb -0xe(%rbp), %al
movb %al, -0x1e(%rbp)
movslq -0x1c(%rbp), %rax
movb -0xd(%rbp,%rax), %al
movb %al, -0x1f(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
cltq
movb -0xd(%rbp,%rax), %al
movb %al, -0x20(%rbp)
movb -0x1e(%rbp), %cl
movb -0x1f(%rbp), %al
movzbl %cl, %edi
movzbl %al, %esi
movzbl -0x20(%rbp), %edx
callq 0xbde0
movb %al, -0x1d(%rbp)
movslq -0x1c(%rbp), %rax
movb -0x1d(%rbp), %cl
movb %cl, -0xd(%rbp,%rax)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4a13
movb -0xe(%rbp), %al
movb %al, -0x21(%rbp)
leaq -0xd(%rbp), %rdi
movzbl -0x21(%rbp), %esi
callq 0xdee0
movb %al, -0x22(%rbp)
movb -0xf(%rbp), %al
movb %al, -0x23(%rbp)
leaq -0xe(%rbp), %rdi
movzbl -0x23(%rbp), %esi
callq 0xbef0
movb %al, -0x24(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x49ea
leaq -0x25(%rbp), %rdi
movl $0x1, %esi
callq 0xbc30
movb -0x25(%rbp), %al
movb %al, -0x9(%rbp)
movq 0xdd51c(%rip), %rdi     # 0xe1fd8
leaq 0x1583d(%rip), %rsi     # 0x1a300
callq 0x21b0
movl $0x4, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x4ba5
movslq -0x2c(%rbp), %rax
leaq -0xd(%rbp), %rdi
addq %rax, %rdi
callq 0xbce0
testb $0x1, %al
jne 0x4af2
jmp 0x4b97
movslq -0x2c(%rbp), %rax
movb -0xd(%rbp,%rax), %al
movb %al, -0x2d(%rbp)
leaq -0x2e(%rbp), %rdi
movl $0x1, %esi
callq 0xbc30
movb -0x2d(%rbp), %al
movzbl %al, %edi
movzbl -0x2e(%rbp), %esi
callq 0xc6b0
testb $0x1, %al
jne 0x4b20
jmp 0x4b4d
movslq -0x2c(%rbp), %rax
leaq -0xd(%rbp), %rdi
addq %rax, %rdi
callq 0xbfc0
movl %eax, %esi
movq 0xdd49f(%rip), %rdi     # 0xe1fd8
callq 0x22b0
movq %rax, %rdi
leaq 0x1534f(%rip), %rsi     # 0x19e97
callq 0x21b0
movq 0xdd484(%rip), %rdi     # 0xe1fd8
leaq 0x1533e(%rip), %rsi     # 0x19e99
callq 0x21b0
cmpl $0x1, -0x2c(%rbp)
je 0x4b84
movq 0xdd46b(%rip), %rdi     # 0xe1fd8
leaq 0x15327(%rip), %rsi     # 0x19e9b
callq 0x21b0
movq %rax, %rdi
movl -0x2c(%rbp), %esi
callq 0x22b0
movq 0xdd44d(%rip), %rdi     # 0xe1fd8
leaq 0x1530b(%rip), %rsi     # 0x19e9d
callq 0x21b0
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4acf
leaq -0xd(%rbp), %rdi
callq 0xbfc0
movl %eax, %esi
movq 0xdd421(%rip), %rdi     # 0xe1fd8
callq 0x22b0
movq %rax, %rdi
movq 0xdd402(%rip), %rsi     # 0xe1fc8
callq 0x21e0
movl $0x0, -0x34(%rbp)
cmpl $0x4, -0x34(%rbp)
jg 0x4c0a
movslq -0x34(%rbp), %rax
movb -0xd(%rbp,%rax), %al
movb %al, -0x36(%rbp)
movzbl -0x36(%rbp), %edi
callq 0xc200
movb %al, %cl
movq -0x50(%rbp), %rax
movb %cl, -0x35(%rbp)
movslq -0x34(%rbp), %rcx
movb -0x35(%rbp), %dl
movb %dl, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4bd2
addq $0x70, %rsp
popq %rbp
retq