// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1d8, %rsp            # imm = 0x1D8
movq %rcx, 0x88(%rsp)
movq %rdx, 0x90(%rsp)
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rdi, 0x10(%rsp)
movq %rcx, 0x28(%rdi)
leal -0x1(%r8), %eax
movslq %eax, %rbx
movq (%rsi), %rdx
movq %rsi, 0x18(%rsp)
movq 0x8(%rsi), %rax
movq %rax, %rcx
subq %rdx, %rcx
sarq $0x3, %rcx
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rsi, %rcx
cmpq %rbx, %rcx
jbe 0xc2a9
leaq 0x40(%rsp), %r15
movslq %r8d, %r14
imulq $0x38, %r14, %r13
incl %r8d
movq %rbx, 0x98(%rsp)
incq %rbx
movq %rax, %rcx
subq %rdx, %rcx
sarq $0x3, %rcx
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rsi, %rcx
cmpq %rbx, %rcx
movq %r8, 0x80(%rsp)
movq %r14, 0x78(%rsp)
movq %r13, 0x70(%rsp)
jbe 0xc284
movl %r8d, 0xc(%rsp)
movq %r15, %rbp
leaq (%rdx,%r13), %rsi
imulq $0x38, 0x98(%rsp), %r12
addq %r12, %rdx
leaq 0x120(%rsp), %rdi
callq 0x53ed
movq 0x18(%rsp), %rax
movq (%rax), %rax
leaq (%rax,%r13), %rsi
addq %rax, %r12
leaq 0xa0(%rsp), %rdi
movq %r12, %rdx
callq 0x53ed
movq 0x90(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xf016
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0xc031
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0xc04e
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq 0x20(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x68a4
movq %rbp, %r15
movl 0x138(%rsp), %eax
movl %eax, 0x38(%rsp)
leaq 0x140(%rsp), %r12
movl 0x10(%r12), %eax
movl %eax, 0x10(%rbp)
movups (%r12), %xmm0
movups %xmm0, (%rbp)
movl 0xc(%rsp), %eax
movl %eax, 0x58(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x68a4
movl 0x170(%rsp), %eax
movl %eax, 0x1a8(%rsp)
movl 0x48(%r12), %ecx
leaq 0x1b0(%rsp), %rdx
movl %ecx, 0x10(%rdx)
movups 0x38(%r12), %xmm0
movups %xmm0, (%rdx)
movq %rbx, %rdx
movl %edx, 0x1c8(%rsp)
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl 0x38(%rsp), %ecx
movl %ecx, 0xb8(%rsp)
movl 0x10(%r15), %ecx
leaq 0xc0(%rsp), %rbp
movl %ecx, 0x10(%rbp)
movaps (%r15), %xmm0
movaps %xmm0, (%rbp)
movl 0x58(%rsp), %ecx
movl %ecx, 0xd8(%rsp)
movaps 0x190(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movq 0x1a0(%rsp), %rcx
movq %rcx, 0xf0(%rsp)
movl %eax, 0xf8(%rsp)
movl 0x48(%r12), %eax
movl %eax, 0x50(%rbp)
movups 0x38(%r12), %xmm0
movups %xmm0, 0x40(%rbp)
movl %edx, 0x118(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x68a4
movl 0xb8(%rsp), %eax
movl %eax, 0x48(%rsp)
movl 0x10(%rbp), %eax
movl %eax, 0x20(%r15)
movups (%rbp), %xmm0
movups %xmm0, 0x10(%r15)
movl 0xd8(%rsp), %eax
movl %eax, 0x68(%rsp)
movq 0x88(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xf16a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xc1d8
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0xc1f5
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0xc212
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0xc22f
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0xc24c
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
incq %r14
movq 0x18(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rax
movq %rax, %rcx
subq %rdx, %rcx
sarq $0x3, %rcx
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rsi, %rcx
addq $0x38, %r13
incl 0xc(%rsp)
cmpq %r14, %rcx
ja 0xbfc0
movq 0x78(%rsp), %r14
incq %r14
movq 0x70(%rsp), %r13
addq $0x38, %r13
movq 0x80(%rsp), %r8
incl %r8d
cmpq %rbx, %rcx
ja 0xbf7d
movq 0x10(%rsp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc307
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xc2e1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
jmp 0xc2e1
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xcc10
jmp 0xc326
movq %rax, %rbx
jmp 0xc333
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xcb7c
jmp 0xc326
movq %rax, %rbx
jmp 0xc326
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xc326
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq 0x120(%rsp), %rdi
callq 0xcb7c
movq 0x10(%rsp), %rdi
callq 0xd360
movq %rbx, %rdi
callq 0x2240