// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1060
cmpq $0x200, %rax            # imm = 0x200
jb 0x3d46
movq 0x72d1(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x3baf(%rip), %rsi      # 0x78e4
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1140
leaq -0x220(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x1040
leaq -0x220(%rbp), %rdi
movl $0xd, %esi
callq 0x1070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3d79
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
leaq -0x220(%rbp), %rdi
movl $0xa, %esi
callq 0x1070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3d9c
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movsbl -0x220(%rbp), %eax
movl %eax, -0x224(%rbp)
subl $0x3a, %eax
je 0x3df7
jmp 0x3db0
movl -0x224(%rbp), %eax
subl $0x3c, %eax
je 0x3ee4
jmp 0x3dc1
movl -0x224(%rbp), %eax
subl $0x3e, %eax
je 0x3f12
jmp 0x3dd2
movl -0x224(%rbp), %eax
subl $0x5b, %eax
je 0x3f5f
jmp 0x3de3
movl -0x224(%rbp), %eax
subl $0x7b, %eax
je 0x3e82
jmp 0x3fec
leaq -0x220(%rbp), %rdi
addq $0x2, %rdi
movl $0x9, %esi
callq 0x1070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3e19
jmp 0x3e43
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
leaq -0x220(%rbp), %rdi
addq $0x2, %rdi
callq 0x3570
movq %rax, 0x75d1(%rip)      # 0xb408
cmpq $0x0, 0x75c9(%rip)      # 0xb408
jne 0x3e6c
jmp 0x3e43
movq 0x71ae(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x3aae(%rip), %rsi      # 0x7909
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1140
movq -0x18(%rbp), %rax
movb $0x9, (%rax)
movl $0x0, 0x759b(%rip)      # 0xb418
jmp 0x3fec
leaq -0x220(%rbp), %rdi
leaq 0x3aa0(%rip), %rsi      # 0x7930
leaq -0xc(%rbp), %rdx
movb $0x0, %al
callq 0x1100
cmpl $0x1, %eax
je 0x3ec3
jmp 0x3ea2
movq 0x714f(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x3a7b(%rip), %rsi      # 0x7935
movb $0x0, %al
callq 0x10d0
jmp 0x3edf
movq 0x753e(%rip), %rdi      # 0xb408
movl 0x7548(%rip), %esi      # 0xb418
movl -0xc(%rbp), %edx
callq 0x4000
movq %rax, 0x7531(%rip)      # 0xb410
jmp 0x3fec
leaq -0x220(%rbp), %rdi
leaq 0x3a68(%rip), %rsi      # 0x795a
leaq -0xc(%rbp), %rdx
movb $0x0, %al
callq 0x1100
cmpl $0x1, %eax
je 0x3f04
jmp 0x3ea2
movl -0xc(%rbp), %eax
movl %eax, 0x750b(%rip)      # 0xb418
jmp 0x3fec
leaq -0x220(%rbp), %rdi
leaq 0x344b(%rip), %rsi      # 0x736b
leaq -0xc(%rbp), %rdx
movb $0x0, %al
callq 0x1100
cmpl $0x1, %eax
je 0x3f35
jmp 0x3ea2
movq 0x74cc(%rip), %rdi      # 0xb408
movl 0x74d6(%rip), %esi      # 0xb418
movl -0xc(%rbp), %edx
callq 0x4000
movq %rax, 0x74bf(%rip)      # 0xb410
movl -0xc(%rbp), %eax
movl %eax, 0x74be(%rip)      # 0xb418
jmp 0x3fec
leaq -0x220(%rbp), %rdi
movl $0x5d, %esi
callq 0x1090
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3f80
jmp 0x3ea2
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
leaq -0x220(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x3fe5
cmpq $0x0, 0x746d(%rip)      # 0xb410
jne 0x3fc7
movq 0x704c(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x39a9(%rip), %rsi      # 0x795f
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1140
movq 0x743a(%rip), %rdi      # 0xb408
movq 0x743b(%rip), %rsi      # 0xb410
leaq -0x220(%rbp), %rdx
addq $0x1, %rdx
callq 0x4070
movq -0x18(%rbp), %rax
movb $0x5d, (%rax)
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)