// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movq %rsi, %r13
movq 0x10(%rsi), %rax
movslq 0x1c(%rdi), %rcx
movq -0x8(%rax,%rcx,8), %rbx
leaq 0x44(%rsp), %r14
movq %r14, %rsi
callq 0x1bdde
movq %rax, %r15
leaq 0x2c(%rsp), %rsi
movq %rbx, %rdi
callq 0x1bdde
movq %rax, %r12
movslq (%r14), %rsi
testq %rsi, %rsi
je 0x1c7d3
movq %r15, 0x18(%rsp)
movl 0x2c(%rsp), %r15d
cmpl %r15d, %esi
jle 0x1c7f9
movq 0x18(%rsp), %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
movq $0x0, (%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x1cb56
movq %r15, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
movl $0x1, %r15d
movq $0x0, (%rsp)
xorl %r12d, %r12d
jmp 0x1cb56
movq %r13, 0x30(%rsp)
movl %ebp, 0xc(%rsp)
movslq %r15d, %r14
leaq 0x3b7(%rip), %rbx       # 0x1cbc3
movl $0x8, %edx
movq 0x18(%rsp), %rdi
movq %rsi, (%rsp)
movq %rbx, %rcx
callq 0x1080
movl $0x8, %edx
movq %r12, 0x10(%rsp)
movq %r12, %rdi
movq %r14, 0x38(%rsp)
movq %r14, %rsi
movq %rbx, %rcx
callq 0x1080
leal -0x1(%r15), %ebp
movl $0x1, %r14d
cmpl $0x2, %r15d
jl 0x1c872
movl %ebp, %r12d
movq 0x10(%rsp), %rdi
leaq 0x8(%rdi), %rbx
movq %rbx, %rsi
callq 0x1cbc3
cmpl $0x1, %eax
sbbl $-0x1, %r14d
movq %rbx, %rdi
decq %r12
jne 0x1c857
movslq %r14d, %rbx
leaq 0x4(,%rbx,4), %rdi
callq 0x1190
movq %rax, 0x20(%rsp)
movl %ebx, (%rax)
cmpl $0x2, %r15d
jl 0x1c8cc
movl %ebp, %r12d
movl $0x1, %r13d
xorl %ebp, %ebp
movq 0x10(%rsp), %r14
movq %r14, %rdi
addq $0x8, %r14
movq %r14, %rsi
callq 0x1cbc3
testl %eax, %eax
je 0x1c8c4
movslq %r13d, %r13
leal 0x1(%rbp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx,%r13,4)
incl %r13d
incq %rbp
cmpq %rbp, %r12
jne 0x1c89f
movq 0x20(%rsp), %r12
movl %r15d, (%r12,%rbx,4)
movl (%r12), %ebx
testl %ebx, %ebx
movq 0x10(%rsp), %r15
jle 0x1c90d
incq %rbx
xorl %eax, %eax
movl $0x1, %r14d
movl (%r12,%r14,4), %ebp
movl %ebp, %ecx
subl %eax, %ecx
cltq
leaq (%r15,%rax,8), %rdi
movslq %ecx, %rsi
callq 0x1a34b
incq %r14
movl %ebp, %eax
cmpq %r14, %rbx
jne 0x1c8ed
movq (%rsp), %r13
testl %r13d, %r13d
jle 0x1cb01
xorl %r14d, %r14d
movl $0x1, %r12d
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rbx
leaq (%r14,%rbp), %rsi
movq %rbx, %rdi
callq 0x1cbc3
testl %eax, %eax
jne 0x1c969
movq -0x8(%rbp,%r12,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 %r15d
cmpl %r13d, %r15d
jge 0x1c981
leaq 0x1(%r12), %rax
addq $0x8, %r14
cmpq 0x38(%rsp), %r12
movq %rax, %r12
jl 0x1c92b
cmpl %r13d, %r15d
setne %al
cmpl $0x0, 0xc(%rsp)
sete %cl
orb %al, %cl
jne 0x1cb09
xorl %r13d, %r13d
movb $0x1, %bl
movl $0x1, %r12d
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rdi
movq 0x10(%rsp), %rax
leaq (%rax,%r13,8), %rsi
callq 0x1cbc3
testl %eax, %eax
je 0x1c9cf
movb $0x1, %bl
jmp 0x1cae9
testb %bl, %bl
je 0x1cae1
movl %r14d, %edi
movl %ebp, %esi
callq 0x98f0
movl %eax, %ebx
movl %r14d, %edi
movl %ebp, %esi
callq 0x98f8
testl %ebx, %ebx
jle 0x1cad3
movl %eax, %ecx
subl %ebx, %ecx
leal 0x1(%rcx), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
addl %ebx, %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 0x4682(%rip), %xmm2     # 0x210a0
movd %edx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movl $0x4, %ecx
movdqa 0x467c(%rip), %xmm3     # 0x210b0
pcmpeqd %xmm6, %xmm6
movdqa 0x4680(%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 0x1ca40
negl %ecx
movd %ecx, %xmm2
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
por 0x460e(%rip), %xmm2     # 0x210a0
movdqa 0x3d86(%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 0x1cad8
movl $0x1, %eax
imull %eax, %r12d
xorl %r14d, %r14d
xorl %ebp, %ebp
incl %r15d
incl %r14d
xorl %ebx, %ebx
cmpl (%rsp), %r15d
jge 0x1cb0c
incl %ebp
incq %r13
cmpq 0x38(%rsp), %r13
jl 0x1c9aa
jmp 0x1cb0c
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x1cb0c
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
callq 0x1030
movq 0x20(%rsp), %rdi
callq 0x1030
movq (%rsp), %rsi
cmpl %esi, %r15d
jne 0x1cb38
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x1a34b
jmp 0x1cb4d
movq 0x18(%rsp), %rdi
callq 0x1030
movq $0x0, (%rsp)
xorl %r15d, %r15d
movl 0xc(%rsp), %ebp
movq 0x30(%rsp), %r13
testq %r15, %r15
je 0x1cbb2
movl $0x1, %eax
cmpq $0x1, %r15
je 0x1cbb4
movq (%rsp), %rax
testl %eax, %eax
jle 0x1cb95
movl %eax, %ebx
xorl %r14d, %r14d
movq (%r15,%r14,8), %rax
movq 0x18(%rax), %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x1c757
testl %eax, %eax
je 0x1cbaa
imull %eax, %r12d
incq %r14
cmpq %r14, %rbx
jne 0x1cb73
movq %r15, %rdi
callq 0x1030
testl %ebp, %ebp
movl $0x1, %eax
cmovnel %r12d, %eax
jmp 0x1cbb4
movq %r15, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq