// File: /workspace/github_c_makefile_star2_O3/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 0xe3a7
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 0xe387
testl %r14d, %r14d
je 0xe3bb
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, -0x30(%rbp)
movslq -0x30(%rbp), %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x21e0
movq %rax, %r12
movq %rax, 0x10(%rbx)
movl $0x8, %esi
movq %r13, %rdi
movq -0x30(%rbp), %r14
callq 0x21e0
movq %rax, 0x18(%rbx)
movq %r15, %rdi
movl $0x20, %esi
callq 0x2160
movb $0x0, (%rax)
testl %r14d, %r14d
jle 0xe3a9
incq %rax
movq %rax, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %r15
movl %r14d, %r13d
xorl %r14d, %r14d
movq %rbx, -0x38(%rbp)
movq %r13, %rbx
movq %r15, %r13
incq %r13
movq %r13, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %r15
xorl %eax, %eax
movb %al, (%r15)
movq %r13, (%r12,%r14,8)
movq %r13, %rdi
callq 0x2130
xorl %edi, %edi
movq %r13, %rsi
movq %rbx, %r13
movq -0x38(%rbp), %rbx
movl %eax, %edx
callq 0xe1e9
movq 0x10(%rbx), %r12
movq (%r12,%r14,8), %rcx
cltq
xorl %edx, %edx
movb %dl, (%rcx,%rax)
incq %r14
cmpq %r14, %r13
jne 0xe442
cmpl $0x0, -0x30(%rbp)
jle 0xe3a9
xorl %r12d, %r12d
movq %r15, %r14
incq %r14
movq %r14, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, %r15
testq %rax, %rax
je 0xe4c2
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 0xe1e9
movq 0x18(%rbx), %rcx
movq (%rcx,%r12,8), %rcx
cltq
movb $0x0, (%rcx,%rax)
incq %r12
cmpq %r12, %r13
jne 0xe4a3
jmp 0xe3a9