// File: manschga[P]M5GB/poly.cpp
// Function: Create_poly_system(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
vector<polynomial> Create_poly_system(const string& input_file, int n, int p)
{
  vector<polynomial> system = {};
  vector<int> input_vec;
  string line;
  ifstream myfile (input_file);
  if (myfile.is_open())
  {
    while (getline (myfile,line))
    {
      input_vec = {};
      int i = 0;
      while (i < line.size())
	{
	  input_vec.emplace_back(line[i]-48); //from char to int
	  i = i+2;
	}
      input_vec.pop_back();
      system.emplace_back(poly_from_vec(input_vec,n,p));
      //cout << "test function:" << poly_from_vec(input_vec,n,p);
    }
    myfile.close();
  }
  else cout << "Unable to open file";
  return system;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x2b8(%rbp)
movq %rdi, %rax
movq %rax, -0x2b0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0xbd00
leaq -0x38(%rbp), %rdi
callq 0x61e0
leaq -0x58(%rbp), %rdi
callq 0x2280
movq -0x10(%rbp), %rsi
leaq -0x260(%rbp), %rdi
movl $0x8, %edx
callq 0x22c0
jmp 0x264aa
leaq -0x260(%rbp), %rdi
callq 0x22b0
movb %al, -0x2b9(%rbp)
jmp 0x264be
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0x264cd
jmp 0x26668
jmp 0x264cf
leaq -0x260(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2050
movq %rax, -0x2c8(%rbp)
jmp 0x264e8
movq -0x2c8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2250
movb %al, -0x2c9(%rbp)
jmp 0x26506
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0x26515
jmp 0x26658
leaq -0x280(%rbp), %rdi
callq 0x28580
movq -0x280(%rbp), %rsi
movq -0x278(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x285a0
jmp 0x2653a
movl $0x0, -0x284(%rbp)
movslq -0x284(%rbp), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x2130
movq %rax, %rcx
movq -0x2d8(%rbp), %rax
cmpq %rcx, %rax
jae 0x265e7
movslq -0x284(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x2350
movq %rax, -0x2e0(%rbp)
jmp 0x26583
movq -0x2e0(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x288(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x8770
jmp 0x265a8
movl -0x284(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x284(%rbp)
jmp 0x26544
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
jmp 0x266b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
jmp 0x266a9
leaq -0x38(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x285f0
movq -0x2e8(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
leaq -0x2a8(%rbp), %rdi
callq 0x26700
jmp 0x26612
movq -0x2b8(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x179e0
jmp 0x26627
leaq -0x2a8(%rbp), %rdi
callq 0x44a0
jmp 0x264cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x44a0
jmp 0x266a9
leaq -0x260(%rbp), %rdi
callq 0x2060
jmp 0x26666
jmp 0x2667f
movq 0x19969(%rip), %rdi     # 0x3ffd8
leaq 0x4dd4(%rip), %rsi      # 0x2b44a
callq 0x2190
jmp 0x2667d
jmp 0x2667f
movb $0x1, -0x19(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x2080
leaq -0x58(%rbp), %rdi
callq 0x2100
leaq -0x38(%rbp), %rdi
callq 0x3b70
testb $0x1, -0x19(%rbp)
jne 0x266e1
jmp 0x266d5
leaq -0x260(%rbp), %rdi
callq 0x2080
leaq -0x58(%rbp), %rdi
callq 0x2100
leaq -0x38(%rbp), %rdi
callq 0x3b70
movq -0x2b8(%rbp), %rdi
callq 0x3300
jmp 0x266f1
movq -0x2b8(%rbp), %rdi
callq 0x3300
movq -0x2b0(%rbp), %rax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x268(%rbp), %rdi
callq 0x2300
nopl (%rax)