// File: jkunlin[P]maxclique/main.cpp
// Function: expand(bool, bool const* const*, Vertices&)
void expand(bool MCR, const bool * const * conn, Vertices &V) {
	int min_k;
	Vertices temp;
	size_t i;
	while(!V.empty()) {
		min_k = maxclique.size() > tmpclique.size() ? maxclique.size() - tmpclique.size() : -1;
		if(V.get_color_num() > min_k) {
			i = V.pop();
			tmpclique.push_back(i);
			temp.cut_vertex_from(conn, V, i);
			if(!temp.empty()) {
		//		temp.set_degrees(conn);
		//		MCR ? temp.MCR_sort(conn) : temp.degree_sort();
		//		temp.colo_sort(conn, min_k);
				num++;
				expand(MCR, conn, temp);
			}
			else if (tmpclique.size() > maxclique.size()) {
				std::cout<<"step = "<<num<<" current max size: "<<tmpclique.size()<<std::endl;
				maxclique = tmpclique;
			}
			tmpclique.pop_back();
		}
		else {
			return;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x75f0
movq -0x18(%rbp), %rdi
callq 0x76b0
movb %al, -0x55(%rbp)
jmp 0x72f6
movb -0x55(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x7304
jmp 0x751e
leaq 0xbf1d(%rip), %rdi      # 0x13228
callq 0x3de0
movq %rax, -0x60(%rbp)
leaq 0xbf25(%rip), %rdi      # 0x13240
callq 0x3de0
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jbe 0x7358
leaq 0xbef5(%rip), %rdi      # 0x13228
callq 0x3de0
movq %rax, -0x70(%rbp)
leaq 0xbefd(%rip), %rdi      # 0x13240
callq 0x3de0
movq %rax, %rcx
movq -0x70(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x68(%rbp)
jmp 0x7365
movq $-0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x7365
movq -0x68(%rbp), %rax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x76d0
movl %eax, -0x74(%rbp)
jmp 0x737a
movl -0x74(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jle 0x7510
movq -0x18(%rbp), %rdi
callq 0x7700
movq %rax, -0x80(%rbp)
jmp 0x7395
movq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x50(%rbp)
leaq 0xbe96(%rip), %rdi      # 0x13240
leaq -0x50(%rbp), %rsi
callq 0x36a0
jmp 0x73b5
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x40(%rbp), %ecx
leaq -0x38(%rbp), %rdi
callq 0x2610
jmp 0x73cb
leaq -0x38(%rbp), %rdi
callq 0x76b0
movb %al, -0x81(%rbp)
jmp 0x73dc
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x742b
jmp 0x73e8
movl 0xbe6a(%rip), %eax      # 0x13258
incl %eax
movl %eax, 0xbe62(%rip)      # 0x13258
movq -0x10(%rbp), %rsi
movzbl -0x1(%rbp), %edi
andl $0x1, %edi
leaq -0x38(%rbp), %rdx
callq 0x72c0
jmp 0x740c
jmp 0x7502
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7690
jmp 0x7537
leaq 0xbe0e(%rip), %rdi      # 0x13240
callq 0x3de0
movq %rax, -0x90(%rbp)
leaq 0xbde3(%rip), %rdi      # 0x13228
callq 0x3de0
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jbe 0x7500
movq 0xbb74(%rip), %rdi      # 0x12fd8
leaq 0x4cde(%rip), %rsi      # 0xc149
callq 0x21f0
movq %rax, -0x98(%rbp)
jmp 0x7479
movq -0x98(%rbp), %rdi
movl 0xbdd2(%rip), %esi      # 0x13258
callq 0x22e0
movq %rax, -0xa0(%rbp)
jmp 0x7494
movq -0xa0(%rbp), %rdi
leaq 0x4caf(%rip), %rsi      # 0xc151
callq 0x21f0
movq %rax, -0xa8(%rbp)
jmp 0x74b0
leaq 0xbd89(%rip), %rdi      # 0x13240
callq 0x3de0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x2070
movq %rax, -0xb0(%rbp)
jmp 0x74d4
movq -0xb0(%rbp), %rdi
movq 0xbae6(%rip), %rsi      # 0x12fc8
callq 0x2230
jmp 0x74e9
leaq 0xbd38(%rip), %rdi      # 0x13228
leaq 0xbd49(%rip), %rsi      # 0x13240
callq 0x7740
jmp 0x74fe
jmp 0x7500
jmp 0x7502
leaq 0xbd37(%rip), %rdi      # 0x13240
callq 0x7990
jmp 0x7519
movl $0x1, -0x54(%rbp)
jmp 0x7525
jmp 0x72e8
movl $0x0, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7690
addq $0xb0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x22f0