// File: /workspace/github_cpp_makefile_star2_O3/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: get_equivalent_seq(std::vector<xpair, std::allocator<xpair>>&, int, int)
void get_equivalent_seq(vector<xpair> &seq, int gap, int start)
{

	vector<ROW> m;
	bitset<SIZE> tmp;
	for (int i = 0; i < SIZE; i++)
	{
		tmp = 0;
		tmp[SIZE - 1 - i]=1;
		m.push_back(tmp);
	}
	for(int i = start + gap - 1; i >= start; i--)
	{
		m[seq[i].dst] ^= m[seq[i].src];
	}

	vector<xpair> seq_here(strgy3(m));
 	seq.erase(seq.begin() + start, seq.begin() + start + gap);
 	seq.insert(seq.begin() + start, seq_here.begin(), seq_here.end());
 	int tab[SIZE] = {0};
 	build_table(m, tab);
 	update_seq(seq, tab, start + seq_here.size());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movl $0x1f, %r13d
leaq 0x48(%rsp), %rbp
movl $0x1, %eax
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6585
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x6590
movq %r12, %rdi
movq %rbp, %rdx
callq 0x4bd0
addq $-0x1, %r13
jb 0x655e
movslq %r14d, %r12
testl %r15d, %r15d
jle 0x65d3
leal (%r14,%r15), %ecx
movq (%rbx), %rdx
movq (%rsp), %rax
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rsi
leaq (%rdx,%rsi,4), %rdx
addq $-0x8, %rdx
movslq -0x4(%rdx), %rsi
movslq (%rdx), %rdi
movq (%rax,%rsi,8), %rsi
xorq %rsi, (%rax,%rdi,8)
decq %rcx
addq $-0xc, %rdx
cmpq %r12, %rcx
jg 0x65b8
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x3d0c
leaq (%r12,%r12,2), %r12
shlq $0x2, %r12
testl %r15d, %r15d
je 0x6637
movq (%rbx), %r13
addq %r12, %r13
movslq %r15d, %rax
leaq (%rax,%rax,2), %rax
leaq (,%rax,4), %r15
addq %r13, %r15
movq 0x8(%rbx), %rdx
subq %r15, %rdx
je 0x6622
movq %r13, %rdi
movq %r15, %rsi
callq 0x2240
movq 0x8(%rbx), %rax
movq %rax, %rcx
jmp 0x6628
movq %r15, %rax
movq %r15, %rcx
subq %r15, %rax
addq %rax, %r13
cmpq %r13, %rcx
je 0x6637
movq %r13, 0x8(%rbx)
addq (%rbx), %r12
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x49f2
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x2ea0
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3b4d
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x66bc
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
subq %rdi, %rax
shrq $0x2, %rax
imull $0xaaaaaaab, %eax, %edx # imm = 0xAAAAAAAB
addl %r14d, %edx
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rax
movslq %edx, %rdx
subq %rdx, %rax
jbe 0x6723
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,4), %rcx
addq $0x4, %rcx
movslq -0x4(%rcx), %rdx
movl 0x50(%rsp,%rdx,4), %edx
movl %edx, -0x4(%rcx)
movslq (%rcx), %rdx
movl 0x50(%rsp,%rdx,4), %edx
movl %edx, (%rcx)
addq $0xc, %rcx
decq %rax
jne 0x6706
testq %rdi, %rdi
je 0x6735
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x674b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x677e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x677e
jmp 0x677b
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x679c
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x679c
jmp 0x6799
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x67b2
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2270