// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/subtreeIsomorphismSampling.c
// Function: recursiveSubtreeIsomorphismSamplerWithSampledMaximumMatching
static int recursiveSubtreeIsomorphismSamplerWithSampledMaximumMatching(struct Vertex* parent, struct Graph* g, struct GraphPool* gp, int computeEstimate) {

	struct Vertex* parentImage = g->vertices[parent->visited - 1];

	int matchingSize;
	int n_matchings = 0;
	struct VertexList** maximumMatching = uniformBlockMaximumMatching(parent, parentImage, &matchingSize, &n_matchings, computeEstimate);

	// base case: if there are no children that need to be matched, although parent is not a leaf, we are happy
	if (maximumMatching == EMPTY_MATCHING) {
		return 1;
	}

	// is there a matching here covering all unmatched neighbors of parent?
	// if not, there is no subgraph iso here
	if (maximumMatching == NULL) {
		return 0;
	}

	// recurse to the matched vertices
	for (int i=0; i<matchingSize; ++i) {
		int embeddingWorked = recursiveSubtreeIsomorphismSamplerWithSampledMaximumMatching(maximumMatching[i]->endPoint, g, gp, computeEstimate);
		if (!embeddingWorked) {
			free(maximumMatching);
			return 0;
		} else {
			n_matchings *= embeddingWorked;
		}
	}

	// so far, we have been successful
	free(maximumMatching);
	if (computeEstimate) {
		return n_matchings;
	} else {
		return 1;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, 0x14(%rsp)
movq %rsi, %r12
movq 0x10(%rsi), %rax
movslq 0x1c(%rdi), %rcx
movq -0x8(%rax,%rcx,8), %rbx
leaq 0x44(%rsp), %r14
movq %r14, %rsi
callq 0x1beca
movq %rax, %r15
leaq 0x34(%rsp), %rsi
movq %rbx, %rdi
callq 0x1beca
movq %rax, %r13
movslq (%r14), %rsi
testq %rsi, %rsi
je 0x1c8ee
movq %r15, 0x18(%rsp)
movl 0x34(%rsp), %r15d
cmpl %r15d, %esi
jle 0x1c90d
movq 0x18(%rsp), %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
xorl %ecx, %ecx
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0x1cc9e
movq %r15, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
movl $0x1, %r13d
xorl %ecx, %ecx
xorl %ebp, %ebp
jmp 0x1cc9e
movq %r12, 0x38(%rsp)
movslq %r15d, %rbx
leaq 0x3f8(%rip), %r14       # 0x1cd14
movl $0x8, %edx
movq 0x18(%rsp), %rdi
movq %rsi, 0x8(%rsp)
movq %r14, %rcx
callq 0x1080
movl $0x8, %edx
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x1080
leal -0x1(%r15), %eax
movl $0x1, %ebp
movl %eax, %r14d
movq %r15, 0x20(%rsp)
cmpl $0x2, %r15d
jl 0x1c97d
movq %r13, %rdi
movq %r14, %r15
leaq 0x8(%rdi), %rbx
movq %rbx, %rsi
callq 0x1cd14
cmpl $0x1, %eax
sbbl $-0x1, %ebp
movq %rbx, %rdi
decq %r15
jne 0x1c963
movslq %ebp, %r15
leaq 0x4(,%r15,4), %rdi
callq 0x1190
movq %rax, 0x28(%rsp)
movl %r15d, (%rax)
cmpl $0x2, 0x20(%rsp)
jl 0x1c9d4
movl $0x1, %r12d
xorl %ebp, %ebp
movq %r13, %rbx
movq %rbx, %rdi
addq $0x8, %rbx
movq %rbx, %rsi
callq 0x1cd14
testl %eax, %eax
je 0x1c9cc
movslq %r12d, %r12
leal 0x1(%rbp), %eax
movq 0x28(%rsp), %rcx
movl %eax, (%rcx,%r12,4)
incl %r12d
incq %rbp
cmpq %rbp, %r14
jne 0x1c9a7
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %r12
movl %eax, (%r12,%r15,4)
movq %rax, %r15
movl (%r12), %ebx
testl %ebx, %ebx
jle 0x1ca1f
incq %rbx
xorl %eax, %eax
movl $0x1, %r14d
movl (%r12,%r14,4), %ebp
movl %ebp, %ecx
subl %eax, %ecx
cltq
leaq (,%rax,8), %rdi
addq %r13, %rdi
movslq %ecx, %rsi
callq 0x1a427
incq %r14
movl %ebp, %eax
cmpq %r14, %rbx
jne 0x1c9f8
movq 0x8(%rsp), %rcx
testl %ecx, %ecx
setle %al
testl %r15d, %r15d
setle %dl
xorl %r12d, %r12d
orb %al, %dl
movb %dl, 0x4(%rsp)
movl $0x0, %r14d
jne 0x1caa5
xorl %r15d, %r15d
movl $0x1, %ebp
xorl %r14d, %r14d
movslq %r14d, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rbx
leaq (%r15,%r13), %rsi
movq %rbx, %rdi
callq 0x1cd14
testl %eax, %eax
jne 0x1ca89
movq -0x8(%r13,%rbp,8), %rax
movq 0x18(%rax), %rax
movl 0x18(%rax), %ecx
incl %ecx
movq (%rbx), %rdx
movq 0x18(%rdx), %rdx
movl %ecx, 0x1c(%rdx)
movl $0x1, 0x1c(%rax)
incl %r14d
movq 0x8(%rsp), %rcx
cmpl %ecx, %r14d
jge 0x1caa5
leaq 0x1(%rbp), %rax
addq $0x8, %r15
cmpq 0x20(%rsp), %rbp
movq %rax, %rbp
jb 0x1ca4b
cmpl %ecx, %r14d
setne %cl
cmpl $0x0, 0x14(%rsp)
sete %al
orb %cl, %al
movb 0x4(%rsp), %cl
orb %al, %cl
testb %al, %al
cmovnel %r14d, %r12d
testb %cl, %cl
je 0x1cad3
xorb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
jmp 0x1cc56
xorl %r15d, %r15d
movb $0x1, %bpl
movl $0x1, 0x4(%rsp)
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
movslq %r12d, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rdi
leaq (,%r15,8), %rsi
addq %r13, %rsi
callq 0x1cd14
testl %eax, %eax
je 0x1cb16
movb $0x1, %bpl
movq 0x8(%rsp), %rax
jmp 0x1cc40
testb %bpl, %bpl
je 0x1cc34
movl %ebx, %edi
movl %r14d, %esi
callq 0x98e4
movl %eax, %ebp
movl %ebx, %edi
movl %r14d, %esi
callq 0x98ec
testl %ebp, %ebp
jle 0x1cc1f
movl %eax, %ecx
subl %ebp, %ecx
leal 0x1(%rcx), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
addl %ebp, %edx
subl %eax, %edx
leal 0x3(%rdx), %eax
andl $-0x4, %eax
decl %edx
movd %ecx, %xmm0
pshufd $0x0, %xmm0, %xmm2      # xmm2 = xmm0[0,0,0,0]
paddd 0x453a(%rip), %xmm2     # 0x210a0
movd %edx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movl $0x4, %ecx
movdqa 0x4534(%rip), %xmm3     # 0x210b0
movl 0x4(%rsp), %esi
pcmpeqd %xmm6, %xmm6
movdqa 0x4534(%rip), %xmm7     # 0x210c0
movdqa %xmm3, %xmm1
movdqa %xmm2, %xmm3
psubd %xmm6, %xmm3
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
pmuludq %xmm1, %xmm3
pshufd $0xe8, %xmm3, %xmm3     # xmm3 = xmm3[0,2,2,3]
pshufd $0xf5, %xmm1, %xmm5     # xmm5 = xmm1[1,1,3,3]
pmuludq %xmm4, %xmm5
pshufd $0xe8, %xmm5, %xmm4     # xmm4 = xmm5[0,2,2,3]
punpckldq %xmm4, %xmm3    # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
paddd %xmm7, %xmm2
movl %ecx, %edx
addl $-0x4, %ecx
addl %eax, %edx
addl $-0x4, %edx
cmpl $0x4, %edx
jne 0x1cb8c
negl %ecx
movd %ecx, %xmm2
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
por 0x44c2(%rip), %xmm2     # 0x210a0
movdqa 0x3c3a(%rip), %xmm4     # 0x20820
pxor %xmm4, %xmm0
pxor %xmm4, %xmm2
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm3, %xmm2
por %xmm1, %xmm2
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
pshufd $0xff, %xmm2, %xmm1     # xmm1 = xmm2[3,3,3,3]
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
pmuludq %xmm1, %xmm3
pmuludq %xmm2, %xmm0
pmuludq %xmm3, %xmm0
movd %xmm0, %eax
jmp 0x1cc28
movl $0x1, %eax
movl 0x4(%rsp), %esi
imull %eax, %esi
movl %esi, 0x4(%rsp)
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x8(%rsp), %rax
incl %r12d
incl %ebx
xorl %ebp, %ebp
cmpl %eax, %r12d
jge 0x1cc56
incl %r14d
incq %r15
cmpq 0x20(%rsp), %r15
jb 0x1cae9
movq %r13, %rdi
callq 0x1030
movq 0x28(%rsp), %rdi
callq 0x1030
movq 0x8(%rsp), %rsi
cmpl %esi, %r12d
jne 0x1cc86
movq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x1a427
movq 0x8(%rsp), %rcx
jmp 0x1cc95
movq 0x18(%rsp), %rdi
callq 0x1030
xorl %ecx, %ecx
xorl %r13d, %r13d
movq 0x38(%rsp), %r12
movl 0x4(%rsp), %ebp
testq %r13, %r13
je 0x1cd03
movl $0x1, %eax
cmpq $0x1, %r13
je 0x1cd05
testl %ecx, %ecx
jle 0x1ccec
movl %ecx, %r14d
xorl %r15d, %r15d
movq (%r13,%r15,8), %rax
movq 0x18(%rax), %rdi
movq %r12, %rsi
movl 0x14(%rsp), %edx
callq 0x1c877
movl %eax, %ebx
testl %eax, %eax
je 0x1ccd8
imull %ebx, %ebp
jmp 0x1cce0
movq %r13, %rdi
callq 0x1030
testl %ebx, %ebx
je 0x1cd03
incq %r15
cmpq %r15, %r14
jne 0x1ccb8
movq %r13, %rdi
callq 0x1030
cmpl $0x0, 0x14(%rsp)
movl $0x1, %eax
cmovnel %ebp, %eax
jmp 0x1cd05
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq