// File: /workspace/github_c_makefile_star2_O3/nimble-code[P]Uno/Src/uno_fcts.c
// Function: handle_fct
void
handle_fct(char *p_in)
{	static BFct *f;
	static Arc *a;
	int id;
	char *t;
	char p[512];

	if (strlen(p_in) >= 512)
	{	fprintf(stderr, "uno:global: very long fct name <%s>\n", p_in);
		exit(1);
	}
	strcpy(p, p_in);	/* p_in could be a constant string */

	t = strchr(p, '\r');
	if (t) *t = '\0';
	t = strchr(p, '\n');
	if (t) *t = '\0';

	if (0) { printf("'%s' (%d)\n", p, (int) strlen(p)); fflush(stdout); }

	switch (*p) {
	case ':':	/* reminder of fct name - already created */
		t = strchr(p+2, '\t');
		if (!t) goto bad1;
		*t = '\0';
		f = find_function(p+2);
		if (!f)
		{
bad1:			fprintf(stderr, "uno:global: fct reminder invalid '%s'\n", p);
			exit(1);
		}
		*t = '\t';
		oid = 0;
		break;

	case '{':
		if (sscanf(p, "{%d}", &id) != 1)
bad:			fprintf(stderr, "uno:global: bad fct delimiter: '%s'\n", p);
		else
			a = add_arc(f, oid, id);	/* uno can't tell that f was initialized */
		break;

	case '<':
		if (sscanf(p, "<%d>", &id) != 1)
			goto bad;
		else
			oid = id;
		break;

	case '>':
		if (sscanf(p, ">%d>", &id) != 1)
			goto bad;
		else
		{	a = add_arc(f, oid, id);
			oid = id;
		}
		break;

	case '[':
		t = strrchr(p, ']');
		if (!t) goto bad;
		*t = '\0';
		if (t > p+1)
		{	if (!a)
			{	fprintf(stderr, "uno:global: zero arc error\n");
				exit(1);
			}
			add_label(f, a, p+1);
		}
		*t = ']';
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
callq 0x1080
cmpq $0x200, %rax            # imm = 0x200
jae 0x3232
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1050
movq %r14, %rdi
movl $0xd, %esi
callq 0x1090
testq %rax, %rax
je 0x2f99
movb $0x0, (%rax)
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0x1090
testq %rax, %rax
je 0x2fb0
movb $0x0, (%rax)
movzbl 0x10(%rsp), %eax
cmpl $0x3d, %eax
jle 0x3018
cmpl $0x3e, %eax
je 0x304c
cmpl $0x5b, %eax
je 0x3099
cmpl $0x7b, %eax
jne 0x3204
leaq 0x27bf(%rip), %rsi      # 0x579b
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x1, %eax
jne 0x31d4
movq 0x52b3(%rip), %rdi      # 0x82b0
movl 0x52bd(%rip), %esi      # 0x82c0
movl 0xc(%rsp), %edx
callq 0x3249
movq %rax, 0x52a5(%rip)      # 0x82b8
jmp 0x3204
cmpl $0x3a, %eax
je 0x30f3
cmpl $0x3c, %eax
jne 0x3204
leaq 0x2794(%rip), %rsi      # 0x57c5
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x1, %eax
je 0x308a
jmp 0x31d4
leaq 0x22c9(%rip), %rsi      # 0x531c
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x1, %eax
jne 0x31d4
movq 0x523c(%rip), %rdi      # 0x82b0
movl 0x5246(%rip), %esi      # 0x82c0
movl 0xc(%rsp), %edx
callq 0x3249
movq %rax, 0x522e(%rip)      # 0x82b8
movl 0xc(%rsp), %eax
movl %eax, 0x522c(%rip)      # 0x82c0
jmp 0x3204
leaq 0x10(%rsp), %rdi
movl $0x5d, %esi
callq 0x10b0
testq %rax, %rax
je 0x31d4
movq %rax, %rbx
movb $0x0, (%rax)
leaq 0x11(%rsp), %r14
cmpq %r14, %rax
jbe 0x3201
movq 0x51ec(%rip), %r12      # 0x82b8
testq %r12, %r12
je 0x3244
movq 0x51d4(%rip), %r13      # 0x82b0
movq %r14, %rdi
movl $0x9, %esi
callq 0x1090
testq %rax, %rax
je 0x313e
movb $0x20, (%rax)
jmp 0x30dc
leaq 0x12(%rsp), %r14
movq %r14, %rdi
movl $0x9, %esi
callq 0x1090
testq %rax, %rax
je 0x323a
movq %rax, %rbx
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x2b3a
movq %rax, 0x518d(%rip)      # 0x82b0
testq %rax, %rax
je 0x323a
movb $0x9, (%rbx)
movl $0x0, 0x5187(%rip)      # 0x82c0
jmp 0x3204
movl $0x10, %edi
callq 0x151c
movq %rax, %r15
movq %r14, %rdi
callq 0x2a76
movq %rax, (%r15)
movq (%r13), %rdi
leaq 0x26b9(%rip), %rsi      # 0x581a
callq 0x10f0
testl %eax, %eax
je 0x31f3
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq %r15, 0x8(%rax)
movq %r14, %rdi
callq 0x1080
cmpq $0x3, %rax
jb 0x3201
movzbl 0x12(%rsp), %esi
cmpl $0x20, %esi
je 0x31a0
cmpl $0x9, %esi
jne 0x3215
movl $0x9, %esi
leaq 0x13(%rsp), %rdi
callq 0x1090
testq %rax, %rax
je 0x3215
movb $0x0, (%rax)
movzbl 0x11(%rsp), %ecx
addl $-0x43, %ecx
cmpl $0x27, %ecx
ja 0x3215
movabsq $0xe180048813, %rdx     # imm = 0xE180048813
btq %rcx, %rdx
jae 0x3215
movb $0x20, (%rax)
jmp 0x3201
movq 0x4e15(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x25bb(%rip), %rsi      # 0x57a0
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x3204
movq 0x8(%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, 0x8(%r12)
movb $0x5d, (%rbx)
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x4dd4(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x2a69(%rip), %rsi      # 0x5c8f
movq %r14, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x3201
movq %rbx, %rdi
callq 0x13c7
leaq 0x10(%rsp), %rdi
callq 0x13a3
callq 0x137e