// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Modex/Src/xtract.c
// Function: add_local
void
add_local(char *s, char *t, char *r, int d, int ln, int which)
{	Fcts *g;

if (0) fprintf(stderr, "Add_Local <%s> <%s> <%s> which=%d\n", s, t, r, which);

	if (strncmp(s, "static", strlen("static")) == 0)
	{	s += strlen("static");	/* can't have this in a State vector decl. */
		while (*s == ' ' || *s == '\t')
			s++;
		add_global(s, t, d, ln);	/* static local becomes global */
		if (Warnings)
		fprintf(stderr, "%s: %3d, warning, treating <%s %s> in <%s> as global\n",
			progname, ln, s, t, r);
		return;
	}

	if (strlen(s) == 0
	||  strlen(t) == 0
	||  strcmp(r, "-") == 0)
		return;

	while (*t == ' ' || *t == '\t')
		t++;

	if (strncmp(s, "extern", strlen("extern")) == 0
	||  strncmp(t, "=", 1) == 0
	||  strncmp(t, "*", 1) == 0)
		return;

	if (strcmp(s, "unsigned unsigned ") == 0)
	{	s += strlen("unsigned ");
	}

if (0)	printf("%3d: {%d} addlocal <%s> <%s> <%s> %d -- want=%s -- inargs=%d\n",
		ln, which, s, t, r, d, want, in_args);

	for (g = modex_locals; g; g = g->nxt)
	{
if (0) printf("\tcheck <%s> <%s> <%s>\n", g->dt, g->nm, g->tg);
		if (strcmp(g->dt, s) == 0 && strlen(g->dt) == strlen(s)
		&&  strcmp(g->nm, t) == 0 && strlen(g->nm) == strlen(t)
		&&  strcmp(g->tg, r) == 0 && strlen(g->tg) == strlen(r))
		{	if (allprocs
			||  strcmp(r, want) == 0)
				g->wanted = 1;
if (0)	printf("	found %s\n", t);
			return;
		}
	}

	g = modex_fct_el(s);
	g->dt = g->nm;
	g->lno = ln;

	t = sep_decor(t, g);

	g->nm = (char *) e_malloc(strlen(t)+1);
	strcpy(g->nm, t);

	g->tg = (char *) e_malloc(strlen(r)+1);
	strcpy(g->tg, r);

	g->derived = d;

if (0) printf("%3d: added dt=%s nm=%s tg=%s (s=%s t=%s r=%s d=%d)\n",
		g->lno, g->dt, g->nm, g->tg, s, t, r, d);

	g->nxt = modex_locals;
	modex_locals = g;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x26164(%rip), %rsi     # 0x3534e
movl $0x6, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0xf29a
movq -0x8(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x31(%rbp)
je 0xf22a
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0xf233
jmp 0xf241
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xf209
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0xd440
leaq 0x389f5(%rip), %rax     # 0x47c50
cmpl $0x0, (%rax)
je 0xf295
movq 0x35d91(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq 0x35eff(%rip), %rax     # 0x45170
movq (%rax), %rdx
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %r8
movq -0x10(%rbp), %r9
movq -0x18(%rbp), %rax
leaq 0x26179(%rip), %rsi     # 0x35403
movq %rax, (%rsp)
movb $0x0, %al
callq 0x4190
jmp 0xf554
movq -0x8(%rbp), %rdi
callq 0x40f0
cmpq $0x0, %rax
je 0xf2cd
movq -0x10(%rbp), %rdi
callq 0x40f0
cmpq $0x0, %rax
je 0xf2cd
movq -0x18(%rbp), %rdi
leaq 0x25991(%rip), %rsi     # 0x34c54
callq 0x4180
cmpl $0x0, %eax
jne 0xf2d2
jmp 0xf554
jmp 0xf2d4
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x32(%rbp)
je 0xf2f5
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0xf2fe
jmp 0xf30c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xf2d4
movq -0x8(%rbp), %rdi
leaq 0x2603e(%rip), %rsi     # 0x35355
movl $0x6, %edx
callq 0x4090
cmpl $0x0, %eax
je 0xf35a
movq -0x10(%rbp), %rdi
leaq 0x2eb87(%rip), %rsi     # 0x3deb8
movl $0x1, %edx
callq 0x4090
cmpl $0x0, %eax
je 0xf35a
movq -0x10(%rbp), %rdi
leaq 0x274e1(%rip), %rsi     # 0x3682c
movl $0x1, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0xf35f
jmp 0xf554
movq -0x8(%rbp), %rdi
leaq 0x25ff2(%rip), %rsi     # 0x3535c
callq 0x4180
cmpl $0x0, %eax
jne 0xf380
movq -0x8(%rbp), %rax
addq $0x9, %rax
movq %rax, -0x8(%rbp)
movq 0x3b219(%rip), %rax     # 0x4a5a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf49b
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xf488
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x40f0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jne 0xf488
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xf488
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x40f0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jne 0xf488
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xf488
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x40f0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jne 0xf488
leaq 0x387dd(%rip), %rax     # 0x47c38
cmpl $0x0, (%rax)
jne 0xf478
movq -0x18(%rbp), %rdi
leaq 0x35d0d(%rip), %rax     # 0x45178
movq (%rax), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xf483
movq -0x30(%rbp), %rax
movl $0x1, 0x28(%rax)
jmp 0xf554
jmp 0xf48a
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xf38b
movq -0x8(%rbp), %rdi
callq 0xd060
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x20(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xd330
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x40a0
movq -0x18(%rbp), %rdi
callq 0x40f0
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x40a0
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x24(%rax)
movq 0x3b05f(%rip), %rcx     # 0x4a5a0
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
movq %rax, 0x3b04c(%rip)     # 0x4a5a0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)