// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Modex/Src/xtract.c
// Function: add_nomap_locals
void
add_nomap_locals(FILE *fd)
{	Fcts *g;
	char *t;

	for (g = modex_locals; g; g = g->nxt)
	{
		if (spintype(g->dt, g->full?g->full:g->nm))
			continue;

		if (!allprocs && !g->wanted)
			continue;

		if (!imported(g->nm, g->tg, 1))
			continue;

		if (g->purged)
		{	continue;
		}
		g->purged = 1;
		if (!strstr(g->dt, "typedef")
#if 0
		&&  !strstr(g->dt, "struct")
#endif
		)
		{	t = checkfull(g->dt, g->full, g->lno);
			cleanse(g->dt);

if (0)		fprintf(stderr, "%3d: (%d) add_nomap_locals fct %s: dt %s nm %s tg %s full %s fc (%d,%p) want %s [%d]\n",
			g->lno, du_mode, fct_name, g->dt, g->nm, g->tg,
			g->full, g->fc,
			spintype(g->dt, g->full?g->full:g->nm), want, allprocs);

			if (du_mode)
			{	char *yy, *y = g->full?g->full:g->nm;
				while (*y == '*' || *y == ' ' || *y == '\t')
					y++;
				if ((yy = strstr(y, "[]")) != NULL)
				{	*yy = '\0';
				}
				fprintf(fd, "int %s;	/* local to %s */\n",
					y, g->tg);
			} else
			{	fprintf(fd, " c_state \"%s %s\" \"Local p_%s\"",
					g->dt, g->full?g->full:g->nm, g->tg);
				if (t)
				{	fprintf(fd, " \"%s\"", t);
					fprintf(stderr, "modex: error: local %s is ", g->full?g->full:g->nm);
					fprintf(stderr, "initialized in declaration in instrumented %s()\n", g->tg);
				}
				fprintf(fd, " /* nomap */\n");
	}	}	}

	if (used_spin_malloc)
	{	static int not_twice = 0;
		if (not_twice++ == 0)
		{	int i;
			fprintf(fd, " c_state \"char spin_heap[%d]\" \"Global\"\n",
				spin_heap_size);
			fprintf(fd, " c_state \"int  spin_heap_n\" \"Global\"\n");
			fprintf(fd, " c_code {\n");
			for (i = 0; SomeCode[i]; i++)
			{	fprintf(fd, "\t\t%s\n", SomeCode[i]);
			}
			fprintf(fd, " }\n");
	}	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2cb49(%rip), %r12     # 0x393d0
leaq 0x2a1da(%rip), %r13     # 0x36a68
pushq $0x1
popq %rbp
leaq 0x157dc(%rip), %r15     # 0x22074
movabsq $0x40100000200, %r14    # imm = 0x40100000200
movq (%r12), %r12
testq %r12, %r12
je 0xca31
movq 0x18(%r12), %rsi
testq %rsi, %rsi
jne 0xc8bd
movq (%r12), %rsi
movq 0x10(%r12), %rdi
callq 0xc486
testq %rax, %rax
je 0xc8d2
addq $0x38, %r12
jmp 0xc8a2
cmpl $0x0, (%r13)
jne 0xc8e1
cmpl $0x0, 0x28(%r12)
je 0xc8cc
movq (%r12), %rdi
movq 0x8(%r12), %rsi
movl %ebp, %edx
callq 0xcaf8
testl %eax, %eax
je 0xc8cc
cmpl $0x0, 0x20(%r12)
jne 0xc8cc
movl $0x1, 0x20(%r12)
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x42d0
testq %rax, %rax
jne 0xc8cc
movq 0x18(%r12), %rsi
callq 0xc786
movq %rax, %r15
movq 0x10(%r12), %rdi
callq 0xc831
leaq 0x2a122(%rip), %rax     # 0x36a58
cmpl $0x0, (%rax)
je 0xc990
movq 0x18(%r12), %r15
testq %r15, %r15
jne 0xc949
movq (%r12), %r15
movzbl (%r15), %eax
cmpq $0x2a, %rax
ja 0xc95e
btq %rax, %r14
jae 0xc95e
incq %r15
jmp 0xc949
movq %r15, %rdi
leaq 0x137b7(%rip), %rsi     # 0x2011f
callq 0x42d0
testq %rax, %rax
je 0xc975
movb $0x0, (%rax)
movq 0x8(%r12), %rcx
movq %rbx, %rdi
leaq 0x15804(%rip), %rsi     # 0x22188
movq %r15, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0xc9d3
movq 0x18(%r12), %rcx
testq %rcx, %rcx
jne 0xc99e
movq (%r12), %rcx
movq 0x10(%r12), %rdx
movq 0x8(%r12), %r8
movq %rbx, %rdi
leaq 0x157f1(%rip), %rsi     # 0x221a3
xorl %eax, %eax
callq 0x41c0
testq %r15, %r15
jne 0xc9df
leaq 0x1584e(%rip), %rdi     # 0x22213
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1569a(%rip), %r15     # 0x22074
jmp 0xc8cc
movq %rbx, %rdi
leaq 0x157d8(%rip), %rsi     # 0x221c1
movq %r15, %rdx
xorl %eax, %eax
callq 0x41c0
movq 0x18(%r12), %rdx
testq %rdx, %rdx
jne 0xca01
movq (%r12), %rdx
movq 0x275f0(%rip), %r15     # 0x33ff8
movq (%r15), %rdi
leaq 0x157b5(%rip), %rsi     # 0x221c7
xorl %eax, %eax
callq 0x41c0
movq (%r15), %rdi
movq 0x8(%r12), %rdx
leaq 0x157ba(%rip), %rsi     # 0x221e2
xorl %eax, %eax
callq 0x41c0
jmp 0xc9be
leaq 0x2a928(%rip), %rax     # 0x37360
cmpl $0x0, (%rax)
je 0xca50
movl 0x2eb9d(%rip), %eax     # 0x3b5e0
leal 0x1(%rax), %ecx
movl %ecx, 0x2eb94(%rip)     # 0x3b5e0
testl %eax, %eax
je 0xca5f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27782(%rip), %rax     # 0x341e8
movl (%rax), %edx
leaq 0x157b2(%rip), %rsi     # 0x22221
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41c0
leaq 0x157c9(%rip), %rdi     # 0x22249
pushq $0x25
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x42c0
leaq 0x157d6(%rip), %rdi     # 0x2226f
pushq $0xa
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x42c0
leaq 0x26a12(%rip), %r15     # 0x334c0
leaq 0x157c5(%rip), %r14     # 0x2227a
xorl %r12d, %r12d
cmpq $0x70, %r12
je 0xcad5
movq (%r12,%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x41c0
addq $0x8, %r12
jmp 0xcab8
leaq 0x16c84(%rip), %rdi     # 0x23760
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42c0