// File: /workspace/github_c_makefile_star2_O3/nimble-code[P]Modex/Src/xtract.c
// Function: handle_fct
static void
handle_fct(treenode *node, int tabs)
{
	if (!node->lnode)
		return;

	if (allprocs)
	{	visu = 1;			// no output before first procedure
		if (strchr(wanttype, '[')	// more than one instantiation
		&&  extended
		&&  (strcmp(nmestr(((leafnode *)(node->lnode))->data.sval), "main") == 0
#ifdef SV_COMP
		 ||  strstr(nmestr(((leafnode *)(node->lnode))->data.sval), "__VERIFIER_atomic_") != NULL
#endif
		 ||  strcmp(nmestr(((leafnode *)(node->lnode))->data.sval), "modex_main") == 0)
		&&  strstr(wanttype, "active")	// active proctypes
		&&  strstr(wanttype, "proctype"))
		{	sprintf(tbuf, "\n\nactive proctype p_%s(",
				nmestr(((leafnode *)(node->lnode))->data.sval));
			vis_direct(tbuf);
		} else
		{	char *a = tbuf;
			sprintf(tbuf, "\n\n%s p_%s(", wanttype,
				nmestr(((leafnode *)(node->lnode))->data.sval));

			if (dynamic
			&&  !strstr(tbuf, "p_main(")
			&&  !strstr(tbuf, "p_modex_main(") )
			{	a = strstr(tbuf, "active ");
				if (a != NULL)
				{	a += strlen("active ");
				} else
				{	a = tbuf;
			}	}
			vis_direct(a);
		}

		nreturns = 0;
	} else
	{	vis_print("FctDecl:\n");	/* visu is 0 here */

		if (node->lnode->hdr.which == LEAF_T
		&&  node->lnode->hdr.type == TN_IDENT	/* fct-name */
		&& !strcmp(want, nmestr(((leafnode *)(node->lnode))->data.sval))
		&&  strlen(want) == strlen(nmestr(((leafnode *)(node->lnode))->data.sval)))
		{	visu = 1;
			taboffset = tabs-1;
			strcpy(fct_name, nmestr(((leafnode *)(node->lnode))->data.sval));
			if (strcmp(wanttype, "body") != 0)
			{	sprintf(tbuf, "\n\n%s p_%s(", wanttype, want);
				vis_direct(tbuf);
			}
			nreturns = 0;
		} else
		{	doreturn(2);	/* needed? */
			taboffset = 0;
			if (!allprocs) visu = 0;
		}
	}
	strcpy(fct_name, nmestr(((leafnode *)(node->lnode))->data.sval));
	strcpy(derproc, fct_name);
	if (visu && show_funcs)
		set_fbase(node->hdr.line, fct_name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x30(%rdi), %r12
testq %r12, %r12
je 0x15ddb
movq %rdi, %rbx
leaq 0x22faa(%rip), %r15     # 0x38a68
cmpl $0x0, (%r15)
je 0x15ba7
leaq 0x22f09(%rip), %rax     # 0x389d8
movl $0x1, (%rax)
leaq 0x206dc(%rip), %r14     # 0x361b8
movq (%r14), %r15
movq %r15, %rdi
movl $0x5b, %esi
callq 0x4130
testq %rax, %rax
je 0x15cdb
leaq 0x23198(%rip), %rax     # 0x38c94
cmpl $0x0, (%rax)
je 0x15cdb
movq 0x30(%r12), %rdi
callq 0x61c4
leaq 0xea95(%rip), %rsi      # 0x245ab
movq %rax, %rdi
callq 0x41c0
testl %eax, %eax
je 0x15b47
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
leaq 0x10678(%rip), %rsi     # 0x261ae
movq %rax, %rdi
callq 0x42d0
testq %rax, %rax
je 0x15cb4
movq (%r14), %r15
leaq 0x10670(%rip), %rsi     # 0x261c1
movq %r15, %rdi
callq 0x42d0
testq %rax, %rax
je 0x15cdb
leaq 0xd748(%rip), %rsi      # 0x232b1
movq %r15, %rdi
callq 0x42d0
testq %rax, %rax
je 0x15cdb
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
leaq 0x27a72(%rip), %r14     # 0x3d600
leaq 0x10633(%rip), %rsi     # 0x261c8
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x42a0
jmp 0x15d69
movl %esi, %ebp
leaq 0x10659(%rip), %rdi     # 0x26209
callq 0x12500
movq 0x30(%rbx), %rax
cmpl $0x1, (%rax)
jne 0x15c8f
cmpl $0x2d, 0x1c(%rax)
jne 0x15c8f
leaq 0x205d5(%rip), %r12     # 0x361a8
movq (%r12), %r14
movq 0x30(%rax), %rdi
callq 0x61c4
movq %r14, %rdi
movq %rax, %rsi
callq 0x41c0
testl %eax, %eax
jne 0x15c8f
movq (%r12), %rdi
callq 0x4110
movq %rax, %r14
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
movq %rax, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0x15c8f
leaq 0x22db8(%rip), %rax     # 0x389d8
movl $0x1, (%rax)
decl %ebp
movl %ebp, 0x2d0ee(%rip)     # 0x42d1c
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
leaq 0x2074e(%rip), %rdi     # 0x36390
movq %rax, %rsi
callq 0x40b0
leaq 0x20567(%rip), %rax     # 0x361b8
movq (%rax), %r15
leaq 0xd666(%rip), %rsi      # 0x232c1
movq %r15, %rdi
callq 0x41c0
testl %eax, %eax
je 0x15d71
movq (%r12), %rcx
leaq 0x2798a(%rip), %r14     # 0x3d600
leaq 0x10563(%rip), %rsi     # 0x261e0
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x42a0
jmp 0x15d69
callq 0x13ece
movl $0x0, 0x2d07e(%rip)     # 0x42d1c
cmpl $0x0, (%r15)
jne 0x15d7e
leaq 0x22d29(%rip), %rax     # 0x389d8
jmp 0x15d78
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
leaq 0xe8dd(%rip), %rsi      # 0x245a5
movq %rax, %rdi
callq 0x41c0
testl %eax, %eax
je 0x15b47
movq (%r14), %r15
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
leaq 0x27911(%rip), %r14     # 0x3d600
leaq 0x104ea(%rip), %rsi     # 0x261e0
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x42a0
leaq 0x22d23(%rip), %rax     # 0x38a30
cmpl $0x0, (%rax)
je 0x15d69
leaq 0x278e7(%rip), %r14     # 0x3d600
leaq 0x104cb(%rip), %rsi     # 0x261eb
movq %r14, %rdi
callq 0x42d0
testq %rax, %rax
jne 0x15d69
leaq 0x278cc(%rip), %r14     # 0x3d600
leaq 0x104b8(%rip), %rsi     # 0x261f3
movq %r14, %rdi
callq 0x42d0
testq %rax, %rax
jne 0x15d69
leaq 0x278b1(%rip), %r15     # 0x3d600
leaq 0x104ab(%rip), %rsi     # 0x26201
movq %r15, %rdi
callq 0x42d0
leaq 0x7(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
callq 0xeab6
leaq 0x2f428(%rip), %rax     # 0x451a0
movl $0x0, (%rax)
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x61c4
leaq 0x205fe(%rip), %r14     # 0x36390
movq %r14, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x2d9bc(%rip), %rdi     # 0x43760
movq %r14, %rsi
callq 0x40b0
leaq 0x22c25(%rip), %rax     # 0x389d8
cmpl $0x0, (%rax)
je 0x15ddb
leaq 0x22cb5(%rip), %rax     # 0x38a74
cmpl $0x0, (%rax)
je 0x15ddb
movl 0x10(%rbx), %edi
leaq 0x205c2(%rip), %rsi     # 0x36390
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1e8bd
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq