// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
callq 0x1080
cmpq $0x200, %rax            # imm = 0x200
jae 0x2fbd
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1050
pushq $0xd
popq %rsi
movq %r14, %rdi
callq 0x1090
testq %rax, %rax
je 0x2d3a
movb $0x0, (%rax)
leaq 0x10(%rsp), %rdi
pushq $0xa
popq %rsi
callq 0x1090
testq %rax, %rax
je 0x2d4f
movb $0x0, (%rax)
movzbl 0x10(%rsp), %eax
cmpl $0x7b, %eax
je 0x2e8e
cmpl $0x3c, %eax
je 0x2dbf
cmpl $0x3e, %eax
je 0x2e41
cmpl $0x5b, %eax
je 0x2de5
cmpl $0x3a, %eax
jne 0x2f8e
leaq 0x12(%rsp), %r14
pushq $0x9
popq %rsi
movq %r14, %rdi
callq 0x1090
testq %rax, %rax
je 0x2fd3
movq %rax, %rbx
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x2882
movq %rax, 0x5509(%rip)      # 0x82b0
testq %rax, %rax
je 0x2fd3
movb $0x9, (%rbx)
andl $0x0, 0x5506(%rip)      # 0x82c0
jmp 0x2f8e
leaq 0x29ff(%rip), %rsi      # 0x57c5
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x1, %eax
je 0x2e7f
jmp 0x2f26
leaq 0x10(%rsp), %rdi
pushq $0x5d
popq %rsi
callq 0x10b0
testq %rax, %rax
je 0x2f26
movq %rax, %rbx
movb $0x0, (%rax)
leaq 0x11(%rsp), %r14
cmpq %r14, %rax
jbe 0x2f8b
movq 0x54a2(%rip), %r12      # 0x82b8
testq %r12, %r12
je 0x2ff8
movq 0x548a(%rip), %r13      # 0x82b0
pushq $0x9
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x1090
testq %rax, %rax
je 0x2ecd
movb $0x20, (%rax)
jmp 0x2e29
leaq 0x24d4(%rip), %rsi      # 0x531c
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x1, %eax
jne 0x2f26
movq 0x5447(%rip), %rdi      # 0x82b0
movl 0x5451(%rip), %esi      # 0x82c0
movl 0xc(%rsp), %edx
callq 0x3016
movq %rax, 0x5439(%rip)      # 0x82b8
movl 0xc(%rsp), %eax
movl %eax, 0x5437(%rip)      # 0x82c0
jmp 0x2f8e
leaq 0x2906(%rip), %rsi      # 0x579b
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1120
cmpl $0x1, %eax
jne 0x2f26
movq 0x53fe(%rip), %rdi      # 0x82b0
movl 0x5408(%rip), %esi      # 0x82c0
movl 0xc(%rsp), %edx
callq 0x3016
movq %rax, 0x53f0(%rip)      # 0x82b8
jmp 0x2f8e
pushq $0x10
popq %rdi
callq 0x129c
movq %rax, %r15
movq %r14, %rdi
callq 0x27a1
movq %rax, (%r15)
movq (%r13), %rdi
leaq 0x292c(%rip), %rsi      # 0x581a
callq 0x10f0
testl %eax, %eax
je 0x2f45
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq %r15, 0x8(%rax)
movq %r14, %rdi
callq 0x1080
cmpq $0x3, %rax
jb 0x2f8b
movzbl 0x12(%rsp), %eax
cmpl $0x20, %eax
je 0x2f55
cmpl $0x9, %eax
je 0x2f57
jmp 0x2fa0
movq 0x50c3(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x2869(%rip), %rsi      # 0x57a0
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x2f8e
movq 0x8(%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, 0x8(%r12)
jmp 0x2f8b
movl %eax, %ebp
leaq 0x13(%rsp), %rdi
movl %ebp, %esi
callq 0x1090
testq %rax, %rax
je 0x2fa0
movb $0x0, (%rax)
movzbl 0x11(%rsp), %ecx
addl $-0x43, %ecx
cmpl $0x27, %ecx
ja 0x2fa0
movabsq $0xe180048813, %rdx     # imm = 0xE180048813
btq %rcx, %rdx
jae 0x2fa0
movb $0x20, (%rax)
movb $0x5d, (%rbx)
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5049(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x2cde(%rip), %rsi      # 0x5c8f
movq %r14, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x2f8b
movq 0x502c(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x2781(%rip), %rsi      # 0x574f
movq %rbx, %rdx
jmp 0x2fe9
movq 0x5016(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x2790(%rip), %rsi      # 0x5774
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x1160
movq 0x4ff1(%rip), %rax      # 0x7ff0
movq (%rax), %rcx
leaq 0x27c1(%rip), %rdi      # 0x57ca
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x1170
jmp 0x2ff0