// File: /workspace/github_cpp_makefile_star2_O2/xdsopl[P]FEC/./bose_chaudhuri_hocquenghem.hh
// Function: BoseChaudhuriHocquenghem<6, 1, 5, GF::Types<4, 19, unsigned char>>::BoseChaudhuriHocquenghem(std::initializer_list<int>)
BoseChaudhuriHocquenghem(std::initializer_list<int> minimal_polynomials)
	{
		// $generator(x) = \prod_i(minpoly_i(x))$
		int generator_degree = 1;
		generator[0] = ValueType(1);
		for (int i = 1; i <= NP; ++i)
			generator[i] = ValueType(0);
		for (auto m: minimal_polynomials) {
			assert(0 < m && m < 1<<(GF::M+1));
			int m_degree = GF::M;
			while (!(m>>m_degree))
				--m_degree;
			assert(generator_degree + m_degree <= NP + 1);
			for (int i = generator_degree; i >= 0; --i) {
				if (!generator[i])
					continue;
				generator[i] = ValueType(m&1);
				for (int j = 1; j <= m_degree; ++j)
					generator[i+j] += ValueType((m>>j)&1);
			}
			generator_degree += m_degree;
		}
		assert(generator_degree == NP + 1);
#ifndef NDEBUG
		IndexType root(FCR), pe(1);
		for (int i = 0; i < NR; ++i) {
			ValueType tmp(generator[NP]);
			for (int j = 1; j <= NP; ++j)
				tmp = fma(root, tmp, generator[NP-j]);
			assert(!tmp);
			root *= pe;
		}
		std::cout << "generator =";
		for (int i = 0; i <= NP; ++i)
			std::cout << " " << (int)generator[i];
		std::cout << std::endl;
#endif
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x10(%rsp)
movb $0x1, (%rdi)
pushq $0x1
popq %rax
movq 0x10(%rsp), %rcx
cmpq $0xb, %rax
je 0x28a3
movb $0x0, (%rcx,%rax)
incq %rax
jmp 0x2894
leaq (%rsi,%rdx,4), %rax
movq %rax, 0x20(%rsp)
pushq $0x1
popq %r15
leaq 0xe(%rsp), %r12
cmpq 0x20(%rsp), %rsi
je 0x298e
movq %rsi, 0x30(%rsp)
movl (%rsi), %r14d
leal -0x1(%r14), %eax
cmpl $0x1e, %eax
ja 0x2a72
pushq $0x5
popq %r13
decq %r13
movl %r14d, %eax
movl %r13d, %ecx
shrl %cl, %eax
testl %eax, %eax
je 0x28d9
movl %r15d, %eax
addq %r13, %rax
movq %rax, 0x28(%rsp)
cmpl $0xb, %eax
jg 0x2a59
movl %r14d, %eax
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x18(%rsp)
testl %r15d, %r15d
js 0x2978
movl %r15d, %ebx
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax,%rbx)
je 0x2973
movq %rbx, %rbp
movl %r15d, 0x1c(%rsp)
movq 0x10(%rsp), %r15
addq %r15, %rbp
leaq 0xf(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x6750
movb 0xf(%rsp), %al
movb %al, (%r15,%rbx)
movl 0x1c(%rsp), %r15d
pushq $0x1
popq %rbx
cmpq %r13, %rbx
jg 0x2973
xorl %esi, %esi
btl %ebx, %r14d
setb %sil
movq %r12, %rdi
callq 0x6750
leaq (%rbx,%rbp), %rdi
movzbl 0xe(%rsp), %esi
callq 0x6778
incq %rbx
jmp 0x2949
decl %r15d
jmp 0x2908
movq 0x30(%rsp), %rsi
addq $0x4, %rsi
movq 0x28(%rsp), %rax
movl %eax, %r15d
jmp 0x28b5
cmpl $0xb, %r15d
jne 0x2aa8
leaq 0xd(%rsp), %r14
movb $0x1, (%r14)
xorl %r15d, %r15d
pushq $0xa
popq %r12
pushq $0x1
popq %rbp
cmpl $0x6, %r15d
je 0x29f8
movq 0x10(%rsp), %rax
movb 0xa(%rax), %al
movq %r12, %rcx
movq %r12, %rbx
subq $0x1, %rbx
jb 0x29e1
movq 0x10(%rsp), %rdx
movzbl -0x1(%rdx,%rcx), %edx
movzbl 0xd(%rsp), %edi
movzbl %al, %esi
callq 0x67d8
movq %rbx, %rcx
jmp 0x29bf
testb %al, %al
jne 0x2a8b
movq %r14, %rdi
movl %ebp, %esi
callq 0x688a
incl %r15d
jmp 0x29ab
movq 0xd15d9(%rip), %r14     # 0xd3fd8
leaq 0x9a9d(%rip), %rsi      # 0xc4a3
movq %r14, %rdi
callq 0x2160
xorl %ebx, %ebx
leaq 0xa1b0(%rip), %r15      # 0xcbc7
cmpq $0xb, %rbx
je 0x2a3e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2160
movq 0x10(%rsp), %rcx
movzbl (%rcx,%rbx), %esi
movq %rax, %rdi
callq 0x21e0
incq %rbx
jmp 0x2a17
movq 0xd1593(%rip), %rdi     # 0xd3fd8
callq 0x20a0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x99fd(%rip), %rdi      # 0xc45d
leaq 0x991e(%rip), %rsi      # 0xc385
leaq 0x9937(%rip), %rcx      # 0xc3a5
pushq $0x24
jmp 0x2aa2
leaq 0x98f2(%rip), %rdi      # 0xc36b
leaq 0x9905(%rip), %rsi      # 0xc385
leaq 0x991e(%rip), %rcx      # 0xc3a5
pushq $0x20
jmp 0x2aa2
leaq 0x9a0c(%rip), %rdi      # 0xc49e
leaq 0x98ec(%rip), %rsi      # 0xc385
leaq 0x9905(%rip), %rcx      # 0xc3a5
pushq $0x35
popq %rdx
callq 0x20d0
leaq 0x99d4(%rip), %rdi      # 0xc483
leaq 0x98cf(%rip), %rsi      # 0xc385
leaq 0x98e8(%rip), %rcx      # 0xc3a5
pushq $0x2e
jmp 0x2aa2