// File: manschga[P]M5GB/poly.cpp
// Function: lcm(std::pair<int, std::vector<int, std::allocator<int>>>&, monomial const&, std::pair<int, std::vector<int, std::allocator<int>>>&, monomial const&)
void lcm(pair<int,vector<int>>& u, const monomial& LM_f, pair<int,vector<int>>& v, const monomial& LM_g)
{
  vector<int> term_f = table[LM_f.Get_term()].first;
  vector<int> term_g = table[LM_g.Get_term()].first;
  vector<int> term_u,term_v; //terms for u,v
  lcm(term_u,term_f,term_v,term_g);//get lcm on term level
  int c_u = Inverse(LM_f.Get_coeff(),LM_f.Get_p());//construct coeff of u,v
  int c_v = Inverse(LM_g.Get_coeff(),LM_g.Get_p());
  u = make_pair(c_u,term_u); //monomials in vector form
  v = make_pair(c_v,term_v);
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xda60
movq %rax, %rsi
leaq 0x1a122(%rip), %rdi     # 0x401e0
callq 0xd480
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x5ff0
movq -0x20(%rbp), %rdi
callq 0xda60
movq %rax, -0xf8(%rbp)
jmp 0x260e1
movq -0xf8(%rbp), %rsi
leaq 0x1a0f1(%rip), %rdi     # 0x401e0
callq 0xd480
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x5ff0
jmp 0x26102
leaq -0x78(%rbp), %rdi
callq 0x61e0
leaq -0x90(%rbp), %rdi
callq 0x61e0
leaq -0xa8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5ff0
jmp 0x26129
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0xa8(%rbp), %rcx
callq 0x5750
jmp 0x26146
leaq -0xa8(%rbp), %rdi
callq 0x3b70
movq -0x10(%rbp), %rdi
callq 0x3220
movl %eax, -0xfc(%rbp)
jmp 0x26163
movq -0x10(%rbp), %rdi
callq 0xcfa0
movl %eax, -0x100(%rbp)
jmp 0x26174
movl -0x100(%rbp), %esi
movl -0xfc(%rbp), %edi
callq 0x5000
movl %eax, -0x104(%rbp)
jmp 0x2618d
movl -0x104(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3220
movl %eax, -0x108(%rbp)
jmp 0x261aa
movq -0x20(%rbp), %rdi
callq 0xcfa0
movl %eax, -0x10c(%rbp)
jmp 0x261bb
movl -0x10c(%rbp), %esi
movl -0x108(%rbp), %edi
callq 0x5000
movl %eax, -0x110(%rbp)
jmp 0x261d4
movl -0x110(%rbp), %eax
movl %eax, -0xb0(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xac(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x28500
jmp 0x261f9
movq -0x8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movq %rsi, -0x118(%rbp)
callq 0x28540
movq -0x118(%rbp), %rdi
callq 0xbca0
leaq -0xf0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x28500
jmp 0x26238
movq -0x18(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x28540
leaq -0xf0(%rbp), %rdi
callq 0xbca0
leaq -0x90(%rbp), %rdi
callq 0x3b70
leaq -0x78(%rbp), %rdi
callq 0x3b70
leaq -0x50(%rbp), %rdi
callq 0x3b70
leaq -0x38(%rbp), %rdi
callq 0x3b70
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x262d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x262b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3b70
leaq -0x90(%rbp), %rdi
callq 0x3b70
leaq -0x78(%rbp), %rdi
callq 0x3b70
leaq -0x50(%rbp), %rdi
callq 0x3b70
leaq -0x38(%rbp), %rdi
callq 0x3b70
movq -0x58(%rbp), %rdi
callq 0x2300
nopl (%rax,%rax)