// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x12bc5
movq -0x8(%rbp), %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x2360
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x129b0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x129b2
jmp 0x129b4
jmp 0x12988
movl -0x14(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jne 0x12bc3
movl $0x1, %edi
movl $0x20, %esi
callq 0x21f0
movq %rax, -0x10(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x23a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movslq -0x2c(%rbp), %rdi
movl $0x8, %esi
callq 0x21f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movslq -0x2c(%rbp), %rdi
movl $0x8, %esi
callq 0x21f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, -0x38(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x12b09
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rdx
addq $0x1, %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2130
movq -0x48(%rbp), %rsi
movl %eax, %edx
xorl %eax, %eax
movl %eax, %edi
callq 0x12610
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x12a5f
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x12bc1
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
movl $0x20, %esi
callq 0x2160
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x12b40
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rdx
addq $0x1, %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2130
movq -0x50(%rbp), %rsi
movl %eax, %edx
xorl %eax, %eax
movl %eax, %edi
callq 0x12610
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x12b10
jmp 0x12bc3
jmp 0x12bc5
movq -0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop