// File: /workspace/github_c_makefile_star2_O1/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), %r14
testq %r14, %r14
je 0x15c98
movq %rdi, %rbx
leaq 0x240d9(%rip), %r15     # 0x39a58
cmpl $0x0, (%r15)
je 0x15a64
leaq 0x24038(%rip), %rax     # 0x399c8
movl $0x1, (%rax)
leaq 0x2180b(%rip), %r15     # 0x371a8
movq (%r15), %rdi
movl $0x5b, %esi
callq 0x4130
testq %rax, %rax
je 0x15b95
leaq 0x242ca(%rip), %rax     # 0x39c84
cmpl $0x0, (%rax)
je 0x15b95
movq 0x30(%r14), %rdi
callq 0x630c
leaq 0xfbd8(%rip), %rsi      # 0x255ab
movq %rax, %rdi
callq 0x41b0
testl %eax, %eax
je 0x15a04
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
leaq 0x117be(%rip), %rsi     # 0x271b1
movq %rax, %rdi
callq 0x42c0
testq %rax, %rax
je 0x15b71
movq (%r15), %r14
leaq 0x117b6(%rip), %rsi     # 0x271c4
movq %r14, %rdi
callq 0x42c0
testq %rax, %rax
je 0x15b95
leaq 0xe88b(%rip), %rsi      # 0x242b1
movq %r14, %rdi
callq 0x42c0
testq %rax, %rax
je 0x15b95
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
leaq 0x28ba5(%rip), %r14     # 0x3e5f0
leaq 0x11779(%rip), %rsi     # 0x271cb
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4290
jmp 0x15c26
movl %esi, %ebp
leaq 0x1179f(%rip), %rdi     # 0x2720c
callq 0x12436
movq 0x30(%rbx), %rax
cmpl $0x1, (%rax)
jne 0x15b4c
cmpl $0x2d, 0x1c(%rax)
jne 0x15b4c
leaq 0x21708(%rip), %r12     # 0x37198
movq (%r12), %r14
movq 0x30(%rax), %rdi
callq 0x630c
movq %r14, %rdi
movq %rax, %rsi
callq 0x41b0
testl %eax, %eax
jne 0x15b4c
movq (%r12), %rdi
callq 0x4110
movq %rax, %r14
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
movq %rax, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0x15b4c
leaq 0x23eeb(%rip), %rax     # 0x399c8
movl $0x1, (%rax)
decl %ebp
movl %ebp, 0x2e221(%rip)     # 0x43d0c
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
leaq 0x21881(%rip), %rdi     # 0x37380
movq %rax, %rsi
callq 0x40b0
leaq 0x2169a(%rip), %rax     # 0x371a8
movq (%rax), %r15
leaq 0xe7a9(%rip), %rsi      # 0x242c1
movq %r15, %rdi
callq 0x41b0
testl %eax, %eax
je 0x15c2e
movq (%r12), %rcx
leaq 0x28abd(%rip), %r14     # 0x3e5f0
leaq 0x116a9(%rip), %rsi     # 0x271e3
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4290
jmp 0x15c26
callq 0x13dc2
movl $0x0, 0x2e1b1(%rip)     # 0x43d0c
cmpl $0x0, (%r15)
jne 0x15c3b
leaq 0x23e5c(%rip), %rax     # 0x399c8
jmp 0x15c35
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
leaq 0xfa20(%rip), %rsi      # 0x255a5
movq %rax, %rdi
callq 0x41b0
testl %eax, %eax
je 0x15a04
movq (%r15), %r15
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
leaq 0x28a44(%rip), %r14     # 0x3e5f0
leaq 0x11630(%rip), %rsi     # 0x271e3
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4290
leaq 0x23e56(%rip), %rax     # 0x39a20
cmpl $0x0, (%rax)
je 0x15c26
leaq 0x28a1a(%rip), %r14     # 0x3e5f0
leaq 0x11611(%rip), %rsi     # 0x271ee
movq %r14, %rdi
callq 0x42c0
testq %rax, %rax
jne 0x15c26
leaq 0x289ff(%rip), %r14     # 0x3e5f0
leaq 0x115fe(%rip), %rsi     # 0x271f6
movq %r14, %rdi
callq 0x42c0
testq %rax, %rax
jne 0x15c26
leaq 0x289e4(%rip), %r15     # 0x3e5f0
leaq 0x115f1(%rip), %rsi     # 0x27204
movq %r15, %rdi
callq 0x42c0
leaq 0x7(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
callq 0xebec
leaq 0x3055b(%rip), %rax     # 0x46190
movl $0x0, (%rax)
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x630c
leaq 0x21731(%rip), %r14     # 0x37380
movq %r14, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x2eaef(%rip), %rdi     # 0x44750
movq %r14, %rsi
callq 0x40b0
leaq 0x23d58(%rip), %rax     # 0x399c8
cmpl $0x0, (%rax)
je 0x15c98
leaq 0x23de8(%rip), %rax     # 0x39a64
cmpl $0x0, (%rax)
je 0x15c98
movl 0x10(%rbx), %edi
leaq 0x216f5(%rip), %rsi     # 0x37380
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f2da
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)