// File: xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: get_table(std::vector<xpair, std::allocator<xpair>>, int**, int, int)
int** get_table(vector<xpair> seq, int ** table, int osize, int nsize)
{
	if(table != NULL)
	{
		for(int i = 0; i < osize; i++)
			delete[] table[i];
		delete[] table;
	}
	table = new int*[nsize];
	for(int i = 0; i < nsize; i++)
		table[i] = new int[nsize];

	int s = seq.size();
	for(int i = 0; i < s; i++)
	{
		table[i][i] = 1;
		for(int j = i + 1; j < s; j++)
		{
			if(exchange(seq[i], seq[j]))
				table[i][j] = 1;
			else
			{
				for(int k = j; k < s; k++)
					table[i][k] = 0;
				break;
			}
		}
		for(int j = i - 1; j >= 0; j--)
		{
			if(exchange(seq[i], seq[j]))
				table[i][j] = 1;
			else
			{
				for(int k = j; k >= 0; k--)
					table[i][k] = 0;
				break;
			}
		}
	}
	return table;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movl %edx, 0xb4(%rsp)
movl %ecx, 0xb0(%rsp)
cmpq $0x0, 0xb8(%rsp)
je 0x8f9d
movl $0x0, 0xac(%rsp)
movl 0xac(%rsp), %eax
cmpl 0xb4(%rsp), %eax
jge 0x8f7e
movq 0xb8(%rsp), %rax
movslq 0xac(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x8f69
movq 0x10(%rsp), %rdi
callq 0x21b0
jmp 0x8f6b
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x8f30
movq 0xb8(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x8f9b
movq 0x8(%rsp), %rdi
callq 0x21b0
jmp 0x8f9d
movslq 0xb0(%rsp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, 0xb8(%rsp)
movl $0x0, 0xa8(%rsp)
movl 0xa8(%rsp), %eax
cmpl 0xb0(%rsp), %eax
jge 0x903c
movslq 0xb0(%rsp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rdx
movq 0xb8(%rsp), %rax
movslq 0xa8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0xa8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa8(%rsp)
jmp 0x8fd9
movq 0x18(%rsp), %rdi
callq 0x3280
movl %eax, 0xa4(%rsp)
movl $0x0, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jge 0x92fe
movq 0xb8(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xa0(%rsp), %rcx
movl $0x1, (%rax,%rcx,4)
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jge 0x91d7
movq 0x18(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x3430
movq 0x18(%rsp), %rdi
movq (%rax), %rcx
movq %rcx, 0x90(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x98(%rsp)
movslq 0x9c(%rsp), %rsi
callq 0x3430
movq (%rax), %rcx
movq %rcx, 0x84(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x8c(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x74(%rsp)
movl 0x98(%rsp), %eax
movl %eax, 0x7c(%rsp)
movq 0x74(%rsp), %rdi
movb 0x7c(%rsp), %al
movq 0x84(%rsp), %rcx
movq %rcx, 0x64(%rsp)
movl 0x8c(%rsp), %ecx
movl %ecx, 0x6c(%rsp)
movq 0x64(%rsp), %rdx
movzbl %al, %esi
movzbl 0x6c(%rsp), %ecx
callq 0x8e60
testb $0x1, %al
jne 0x9153
jmp 0x9178
movq 0xb8(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x9c(%rsp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x91bf
movl 0x9c(%rsp), %eax
movl %eax, 0x60(%rsp)
movl 0x60(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jge 0x91bd
movq 0xb8(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x60(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x9183
jmp 0x91d7
jmp 0x91c1
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x90a0
movl 0xa0(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
jl 0x92e6
movq 0x18(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x3430
movq 0x18(%rsp), %rdi
movq (%rax), %rcx
movq %rcx, 0x50(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x58(%rsp)
movslq 0x5c(%rsp), %rsi
callq 0x3430
movq (%rax), %rcx
movq %rcx, 0x44(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x4c(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x34(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0x3c(%rsp)
movq 0x34(%rsp), %rdi
movb 0x3c(%rsp), %al
movq 0x44(%rsp), %rcx
movq %rcx, 0x24(%rsp)
movl 0x4c(%rsp), %ecx
movl %ecx, 0x2c(%rsp)
movq 0x24(%rsp), %rdx
movzbl %al, %esi
movzbl 0x2c(%rsp), %ecx
callq 0x8e60
testb $0x1, %al
jne 0x9274
jmp 0x9296
movq 0xb8(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x5c(%rsp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x92d4
movl 0x5c(%rsp), %eax
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
jl 0x92d2
movq 0xb8(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x20(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x929e
jmp 0x92e6
jmp 0x92d6
movl 0x5c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x91e5
jmp 0x92e8
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x9058
movq 0xb8(%rsp), %rax
addq $0xc8, %rsp
retq
nop