// File: /workspace/github_cpp_makefile_star2_O1/manschga[P]M5GB/M5GB.cpp
// Function: Init_Spairs(std::vector<Lab_poly, std::allocator<Lab_poly>> const&, std::set<signature, std::less<signature>, std::allocator<signature>>&, std::multimap<signature, std::pair<Lab_poly, int>, std::less<signature>, std::allocator<std::pair<signature const, std::pair<Lab_poly, int>>>>&, int)
Spairs Init_Spairs(const vector<Lab_poly>& F, Signatures& Spol_sign, Spair_map& Spairs_map, int n)
{
  Spairs P = {};
  for (int i = n-1; i < F.size(); ++i)
    {
      for (int j = i+1; j < F.size(); ++j)
	{
	  pair<Lab_poly,Lab_poly> Spair = spair(F[j],F[i]);
	  Spol_sign.insert(spair(F[j],F[i]).first.Get_sign()); //not efficient, only inserted when signature not yet in
	  pair<pair<Lab_poly,int>,pair<Lab_poly,int>> spair_gen = make_pair(make_pair(Spair.first,j+1),make_pair(Spair.second,i+1));//check that, error source?
	  Spairs_map.insert(make_pair(Spair.first.Get_sign(),spair_gen.first));//
	  //Spairs_map.insert(make_pair(spair(F[j],F[i]).first.Get_sign(),spair(F[j],F[i]))); //not efficient, only inserted when signature not yet in
	  //P.insert(spair(F[j],F[i]));
	}
    }

#ifdef PRECISE_DEBUG
  for (auto it = P.begin(); it != P.end(); ++it)
    {
      cout << it->first.Get_sign() << "," <<  it->second.Get_sign() << endl;
    }
#endif
  return P;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rcx, 0x90(%rsp)
movq %rdx, 0x98(%rsp)
leaq 0x8(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, (%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rdi, 0x18(%rsp)
movq $0x0, 0x28(%rdi)
movq %r8, %rcx
leal -0x1(%r8), %eax
movslq %eax, %rdx
movq 0x8(%rsi), %rax
subq (%rsi), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %r8 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r8, %rax
cmpq %rdx, %rax
jbe 0xbdd8
leaq 0xd0(%rsp), %rbp
movslq %ecx, %rax
movq %rax, 0x28(%rsp)
imulq $0x38, %rax, %rax
movq %rax, 0x20(%rsp)
incl %ecx
movq %rcx, 0x10(%rsp)
leaq 0x178(%rsp), %r12
leaq 0x40(%rsp), %rbx
movq %rsi, 0x38(%rsp)
movq %rdx, %rax
leaq 0x1(%rdx), %rdi
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
subq %rdx, %rcx
sarq $0x3, %rcx
imulq %r8, %rcx
movq %rdi, 0x30(%rsp)
cmpq %rdi, %rcx
jbe 0xbda4
imulq $0x38, %rax, %r14
movq 0x10(%rsp), %rax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %r15
movq %r15, 0xa8(%rsp)
leaq (%rdx,%r13), %rsi
addq %r14, %rdx
movq %r12, %rdi
callq 0x4ee5
movq 0x38(%rsp), %rax
movq (%rax), %rdx
leaq (%rdx,%r13), %rsi
addq %r14, %rdx
leaq 0xb0(%rsp), %rdi
callq 0x4ee5
movq 0x98(%rsp), %rdi
movq %rbp, %rsi
callq 0xeaf6
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0xbaed
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xbb0a
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6314
movq %r13, 0xa0(%rsp)
movq %r14, %r13
movq %rbx, %r15
movq %r12, %rbx
leaq 0x198(%rsp), %r14
movq %rbp, %r12
movl 0x190(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0x10(%r14), %eax
leaq 0x60(%rsp), %rbp
movl %eax, 0x10(%rbp)
movups (%r14), %xmm0
movups %xmm0, (%rbp)
movl 0xc(%rsp), %eax
movl %eax, 0x78(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x6314
movl 0x1c8(%rsp), %eax
movl %eax, 0x148(%rsp)
movl 0x48(%r14), %ecx
leaq 0x150(%rsp), %rdx
movl %ecx, 0x10(%rdx)
movups 0x38(%r14), %xmm0
movups %xmm0, (%rdx)
movq 0x30(%rsp), %rdx
movl %edx, 0x168(%rsp)
movq 0x40(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, 0xb8(%rsp)
movl $0x0, %esi
movq %rsi, 0x50(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
movl 0x58(%rsp), %ecx
movl %ecx, 0xc8(%rsp)
movl 0x10(%rbp), %ecx
movl %ecx, 0x10(%r12)
movups (%rbp), %xmm0
movq %r12, %rbp
movups %xmm0, (%r12)
movl 0x78(%rsp), %ecx
movl %ecx, 0xe8(%rsp)
movq 0x130(%rsp), %rcx
movq %rcx, 0xf0(%rsp)
movq 0x138(%rsp), %rcx
movq %rcx, 0xf8(%rsp)
movq 0x140(%rsp), %rcx
movq %rcx, 0x100(%rsp)
movaps %xmm1, 0x130(%rsp)
movq %rsi, 0x140(%rsp)
movl %eax, 0x108(%rsp)
movl 0x48(%r14), %eax
movl %eax, 0x50(%r12)
movups 0x38(%r14), %xmm0
movups %xmm0, 0x40(%r12)
movl %edx, 0x128(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xbc6d
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq 0x198(%rsp), %rax
movups (%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x6314
movq %rbx, %r12
movl 0xc8(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x10(%rbp), %eax
leaq 0x60(%rsp), %rcx
movl %eax, 0x20(%rcx)
movups (%rbp), %xmm0
movups %xmm0, 0x10(%rcx)
movl 0xe8(%rsp), %eax
movl %eax, 0x88(%rsp)
movq 0x90(%rsp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0xec4a
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xbce8
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
movq %r13, %r14
je 0xbd08
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
movq 0xa0(%rsp), %r13
je 0xbd2d
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0xbd4a
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
movq 0xa8(%rsp), %r15
je 0xbd6f
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
incq %r15
movq 0x38(%rsp), %rsi
movq (%rsi), %rdx
movq 0x8(%rsi), %rax
subq %rdx, %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %r8 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r8, %rax
addq $0x38, %r13
incl 0xc(%rsp)
cmpq %r15, %rax
ja 0xba8d
movq 0x8(%rsi), %rax
subq (%rsi), %rax
sarq $0x3, %rax
imulq %r8, %rax
incq 0x28(%rsp)
addq $0x38, 0x20(%rsp)
movq 0x10(%rsp), %rcx
incl %ecx
movq %rcx, 0x10(%rsp)
movq 0x30(%rsp), %rdx
cmpq %rdx, %rax
ja 0xba4f
movq 0x18(%rsp), %rax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbe36
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xbe10
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
jmp 0xbe10
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xc78a
jmp 0xbe55
movq %rax, %rbx
jmp 0xbe62
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xc6f6
jmp 0xbe55
movq %rax, %rbx
jmp 0xbe55
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xbe55
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq 0x178(%rsp), %rdi
callq 0xc6f6
movq 0x18(%rsp), %rdi
callq 0xce88
movq %rbx, %rdi
callq 0x2240