// File: manschga[P]M5GB/M5GB.cpp
// Function: Add_field_eq(std::vector<polynomial, std::allocator<polynomial>>&, int)
void Add_field_eq(vector<polynomial>& system,int n)
{
  //assume field_eq are not in system yet!
  for (int i = 0; i < n; ++i)
    {
      //add x_i^p - x_i
      vector<int> x_p(n,0);
      x_p[i] = p;
      monomial one(0,1,p); //one-polynomial
      monomial mon_xp = one.Multiply(x_p);//multiply with x^p
      monomial minus_one(0,p-1,p); //-1-polynomial
      vector<int> x_1(n,0);//or n+1?
      x_1[i] = 1;
      monomial mon_x1 = minus_one.Multiply(x_1);

      //cout << "field_eq_i: "<< polynomial({mon_xp,mon_x1}) << endl;
      system.emplace_back(polynomial({mon_xp,mon_x1}));
    }
  //reverse(system.begin(),system.end());
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1551e
movslq -0xc(%rbp), %rax
movq %rax, -0x128(%rbp)
movl $0x0, -0x2c(%rbp)
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x5f30
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rcx
leaq -0x28(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x5f50
jmp 0x15244
leaq -0x2d(%rbp), %rdi
callq 0x3d50
movl 0x2afc9(%rip), %eax     # 0x4021c
movl %eax, -0x12c(%rbp)
movslq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3280
movl -0x12c(%rbp), %ecx
movl %ecx, (%rax)
movl 0x2afa8(%rip), %ecx     # 0x4021c
xorl %eax, %eax
movl %eax, %esi
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
callq 0x25de0
jmp 0x15288
leaq -0x50(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xd2a0
movq %rdx, -0x140(%rbp)
movq %rax, -0x138(%rbp)
jmp 0x152a5
movq -0x140(%rbp), %rax
movq -0x138(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movl 0x2af5b(%rip), %ecx     # 0x4021c
movl %ecx, %edx
decl %edx
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x25de0
jmp 0x152d4
movslq -0xc(%rbp), %rax
movq %rax, -0x150(%rbp)
movl $0x0, -0x8c(%rbp)
leaq -0x8d(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x5f30
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rcx
leaq -0x88(%rbp), %rdi
leaq -0x8c(%rbp), %rdx
callq 0x5f50
jmp 0x1531f
leaq -0x8d(%rbp), %rdi
callq 0x3d50
movslq -0x10(%rbp), %rsi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x3280
movq -0x168(%rbp), %rsi
movl $0x1, (%rax)
leaq -0x70(%rbp), %rdi
callq 0xd2a0
movq %rdx, -0x160(%rbp)
movq %rax, -0x158(%rbp)
jmp 0x15368
movq -0x160(%rbp), %rax
movq -0x158(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x178(%rbp)
movups -0x60(%rbp), %xmm0
movaps %xmm0, -0x110(%rbp)
movups -0xa0(%rbp), %xmm0
movups %xmm0, -0x100(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq $0x2, -0xe0(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0xe930
movq -0x170(%rbp), %rcx
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0xeaa0
jmp 0x153f7
leaq -0xc0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x25f60
jmp 0x1540c
movq -0x178(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x179e0
jmp 0x15421
leaq -0xc0(%rbp), %rdi
callq 0x44a0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0x111(%rbp), %rdi
callq 0x46a0
leaq -0x88(%rbp), %rdi
callq 0x3b70
leaq -0x28(%rbp), %rdi
callq 0x3b70
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x151f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2d(%rbp), %rdi
callq 0x3d50
jmp 0x15527
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x15513
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x8d(%rbp), %rdi
callq 0x3d50
jmp 0x15513
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x15507
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x154fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x154ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x44a0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0x111(%rbp), %rdi
callq 0x46a0
leaq -0x88(%rbp), %rdi
callq 0x3b70
leaq -0x28(%rbp), %rdi
callq 0x3b70
jmp 0x15527
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2300