// File: /workspace/github_c_makefile_star2_O2/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 0xb32b
movq %rdi, %r15
pushq $0x20
popq %r14
movl %r14d, %esi
callq 0x2160
movq %rax, %r12
leaq 0x1(%rax), %rdi
callq 0x2360
movq %rax, %r13
leal 0x1(,%rax,2), %ebx
incq %r12
movq %r12, %rdi
movl %r14d, %esi
callq 0x2160
movq %rax, %r12
decl %ebx
testq %rax, %rax
jne 0xb30f
testl %ebx, %ebx
je 0xb33f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x21e0
movq %rax, %r14
movq %r13, %rbx
movl %ebx, 0x8(%rax)
movq %r15, %rdi
callq 0x23a0
movq %rax, %r15
movq %rax, (%r14)
movslq %ebx, %r12
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x21e0
movq %rax, %r13
movq %rax, 0x10(%r14)
movq %r12, %rdi
pushq $0x8
popq %rsi
callq 0x21e0
movq %r14, -0x30(%rbp)
movq %rax, 0x18(%r14)
pushq $0x20
popq %r14
movq %r15, %rdi
movl %r14d, %esi
callq 0x2160
movb $0x0, (%rax)
leaq 0x1(%rax), %rdi
movl %r14d, %esi
callq 0x2160
movq %rax, %r15
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
movq %rbx, -0x38(%rbp)
xorl %ebx, %ebx
cmpq %rbx, -0x38(%rbp)
je 0xb40b
incq %r15
movq %r15, %rdi
pushq $0x20
popq %rsi
callq 0x2160
movq %rax, %r12
xorl %r14d, %r14d
movb %r14b, (%rax)
movq %r15, (%r13,%rbx,8)
movq %r15, %rdi
callq 0x2130
xorl %edi, %edi
movq %r15, %rsi
movl %eax, %edx
callq 0xb185
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %r13
movq (%r13,%rbx,8), %rcx
cltq
movb %r14b, (%rcx,%rax)
incq %rbx
movq %r12, %r15
jmp 0xb3ba
xorl %r12d, %r12d
pushq $0x20
popq %r14
movq -0x30(%rbp), %rbx
cmpq %r12, -0x38(%rbp)
je 0xb32d
incq %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x2160
movq %rax, %r13
testq %rax, %rax
je 0xb43b
movb $0x0, (%r13)
movq 0x18(%rbx), %rax
movq %r15, (%rax,%r12,8)
movq %r15, %rdi
callq 0x2130
xorl %edi, %edi
movq %r15, %rsi
movl %eax, %edx
callq 0xb185
movq 0x18(%rbx), %rcx
movq (%rcx,%r12,8), %rcx
cltq
movb $0x0, (%rcx,%rax)
incq %r12
movq %r13, %r15
jmp 0xb416