// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstUtilityExtractEnumTableFromString
struct fstETab *fstUtilityExtractEnumTableFromString(const char *s)
{
struct fstETab *et = NULL;
int num_spaces = 0;
int i;
int newlen;

if(s)
	{
	const char *csp = strchr(s, ' ');
	int cnt = atoi(csp+1);

	for(;;)
		{
		csp = strchr(csp+1, ' ');
		if(csp) { num_spaces++; } else { break; }
		}

	if(num_spaces == (2*cnt))
		{
		char *sp, *sp2;

		et = (struct fstETab*)calloc(1, sizeof(struct fstETab));
		et->elem_count = cnt;
		et->name = strdup(s);
		et->literal_arr = (char**)calloc(cnt, sizeof(char *));
		et->val_arr = (char**)calloc(cnt, sizeof(char *));

		sp = strchr(et->name, ' ');
		*sp = 0;

		sp = strchr(sp+1, ' ');

		for(i=0;i<cnt;i++)
			{
			sp2 = strchr(sp+1, ' ');
			*(char*)sp2 = 0;
			et->literal_arr[i] = sp+1;
			sp = sp2;

			newlen = fstUtilityEscToBin(NULL, (unsigned char*)et->literal_arr[i], strlen(et->literal_arr[i]));
			et->literal_arr[i][newlen] = 0;
			}

		for(i=0;i<cnt;i++)
			{
			sp2 = strchr(sp+1, ' ');
			if(sp2) { *sp2 = 0; }
			et->val_arr[i] = sp+1;
			sp = sp2;

			newlen = fstUtilityEscToBin(NULL, (unsigned char*)et->val_arr[i], strlen(et->val_arr[i]));
			et->val_arr[i][newlen] = 0;
			}
		}
	}

return(et);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0xcad7
movq %rdi, %r15
movl $0x20, %esi
callq 0x2160
movq %rax, %rbx
leaq 0x1(%rax), %rdi
callq 0x2360
movl %eax, %r12d
leal 0x1(,%r12,2), %r14d
incq %rbx
movq %rbx, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %rbx
decl %r14d
testq %rax, %rax
jne 0xcab7
testl %r14d, %r14d
je 0xcaeb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
movl $0x20, %esi
callq 0x21e0
movq %rax, %rbx
movl %r12d, 0x8(%rax)
movq %r15, %rdi
callq 0x23a0
movq %rax, %r15
movq %rax, (%rbx)
movq %r12, %r14
movslq %r14d, %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x21e0
movq %rax, 0x10(%rbx)
movl $0x8, %esi
movq %r12, %rdi
callq 0x21e0
movq %rbx, -0x30(%rbp)
movq %rax, 0x18(%rbx)
movq %r15, %rdi
movl $0x20, %esi
callq 0x2160
movb $0x0, (%rax)
leaq 0x1(%rax), %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %r12
movl %r14d, %r13d
movq %r14, -0x38(%rbp)
testl %r14d, %r14d
jle 0xcbbf
xorl %r14d, %r14d
movq -0x30(%rbp), %rbx
incq %r12
movq %r12, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %r15
xorl %eax, %eax
movb %al, (%r15)
movq 0x10(%rbx), %rax
movq %r12, (%rax,%r14,8)
movq %r12, %rdi
callq 0x2130
xorl %edi, %edi
movq %r12, %rsi
movl %eax, %edx
callq 0xc919
movq 0x10(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
cltq
xorl %edx, %edx
movb %dl, (%rcx,%rax)
incq %r14
movq %r15, %r12
cmpq %r14, %r13
jne 0xcb6f
jmp 0xcbc2
movq %r12, %r15
cmpl $0x0, -0x38(%rbp)
jle 0xcc25
xorl %r12d, %r12d
movq -0x30(%rbp), %rbx
movq %r15, %r14
incq %r14
movq %r14, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %r15
testq %rax, %rax
je 0xcbee
movb $0x0, (%r15)
movq 0x18(%rbx), %rax
movq %r14, (%rax,%r12,8)
movq %r14, %rdi
callq 0x2130
xorl %edi, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0xc919
movq 0x18(%rbx), %rcx
movq (%rcx,%r12,8), %rcx
cltq
movb $0x0, (%rcx,%rax)
incq %r12
cmpq %r12, %r13
jne 0xcbcf
jmp 0xcad9
movq -0x30(%rbp), %rbx
jmp 0xcad9