// File: /workspace/github_cpp_makefile_star2_O1/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)
xorl %eax, %eax
movq %rax, 0x10(%r12)
leaq 0x48(%rsp), %r13
movq %rax, (%r13)
movl $0x1f, %ebp
movl $0x1, %eax
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6577
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x6582
movq %r12, %rdi
movq %r13, %rdx
callq 0x4bce
addq $-0x1, %rbp
jb 0x6551
movslq %r14d, %r12
testl %r15d, %r15d
jle 0x65c5
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 0x65aa
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x3d17
leaq (%r12,%r12,2), %r12
shlq $0x2, %r12
testl %r15d, %r15d
je 0x6621
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 0x660b
movq %r13, %rdi
movq %r15, %rsi
callq 0x2240
movq 0x8(%rbx), %rax
movq %rax, %rcx
subq %r15, %rcx
addq %rcx, %r13
cmpq %r13, %rax
je 0x6621
movq %r13, 0x8(%rbx)
addq (%rbx), %r12
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x49cc
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 0x3b58
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x66a6
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 0x670d
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 0x66f0
testq %rdi, %rdi
je 0x671f
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6735
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 0x6768
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x6768
jmp 0x6765
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x6786
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x6786
jmp 0x6783
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x679c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2270