// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Modex/Src/xtract.c
// Function: do_locals
void
do_locals(int d)
{	FILE *fd;
	Fcts *g;
	char *z;

	if (suppress || globals_only
	||  (strcmp(wanttype, "body") == 0
	&&   import_all == 0))
		return;

if (0) fprintf(stderr, "===> %d %d %d\n", suppress, globals_only, import_all);

	if (!d)
	{	if (do_inc_locals)
		{	sprintf(tbuf, "\n#include \"%s_%d.h\"\n\n", o_base, o_cnt);
			vis_direct(tbuf);
		}
		return;
	}

	sprintf(tbuf, "%s_%d.h", o_base, o_cnt++);
	if ((fd = fopen(tbuf, MFLAGS)) == NULL)
	{	fprintf(stderr, "%s: error, cannot create local header file %s\n",
			progname, tbuf);
		return;
	}
if (debug_io) fprintf(stderr, "open %s -> %p\n", tbuf, fd);

	fprintf(fd, "/** locals of %s **/\n\n", fct_name);

	for (g = modex_locals; g; g = g->nxt)
	{
if (0)		printf("%3d: %s: %s %s %s (%s) (%d,%d)\n",
		g->lno, fct_name, g->dt, g->nm, g->tg, g->full, g->fc, g->derived);
		if (strcmp(fct_name, g->tg) != 0
		||  (allkeep && g->fc != 2))	/* formal params only */
			continue;

		if (g->fc == 2 && !show_deps && Warnings)
		{	fprintf(stderr, "%s: ", progname);
			if (g->lno > 0)
			fprintf(stderr, "line %3d, ", g->lno);
			fprintf(stderr, "initialize parameter to %s: %s %s\n",
				fct_name, g->dt, g->full?g->full:g->nm);
		}

		if (!imported(g->nm, g->tg, 1))
		{	if (Warnings)
			fprintf(stderr, "Not imported %s <%s>\n", g->nm, g->tg);
			continue;
		}

		if (!did_parameters)
		if ((z = spintype(g->dt, g->full?g->full:g->nm)) != NULL)
		{	char *w, *x, *y = g->full?g->full:g->nm;
			if (y && strstr(y, "pan_rand()"))
			{	x = e_malloc(strlen(y)+strlen("c_expr { } ") + 1);
				strcpy(x, y);
				w = strstr(x, "pan_rand()");
				*w = '\0';
				w += strlen("pan_rand()");
				fprintf(fd, "%s %s", z, x);
				fprintf(fd, "c_expr { pan_rand() }");
				fprintf(fd, "%s;\t/*mapped */\n", w);
			} else
			{	fprintf(fd, "%s %s;\t/* mapped */\n",
					z, g->full?g->full:g->nm);
			}
			/* others printed in add_nomap_locals */
	}	}
	fprintf(fd, "\n");
if (debug_io) fprintf(stderr, "close x %p\n", fd);
	Fclose(fd);

	z = (char *) e_malloc(strlen(o_base)+10);
	sprintf(z, "%s_%d.h", o_base, o_cnt-1);
	add_fnm(z);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
leaq 0x3632b(%rip), %rax     # 0x47e90
cmpl $0x0, (%rax)
jne 0x11b9a
leaq 0x362fb(%rip), %rax     # 0x47e6c
cmpl $0x0, (%rax)
jne 0x11b9a
leaq 0x3360b(%rip), %rax     # 0x45188
movq (%rax), %rdi
leaq 0x2286e(%rip), %rsi     # 0x343f5
callq 0x4180
cmpl $0x0, %eax
jne 0x11b9f
cmpl $0x0, 0x3c0cc(%rip)     # 0x4dc64
jne 0x11b9f
jmp 0x12047
cmpl $0x0, -0x4(%rbp)
jne 0x11be4
leaq 0x33610(%rip), %rax     # 0x451bc
cmpl $0x0, (%rax)
je 0x11bdf
movl 0x3c0b1(%rip), %ecx     # 0x4dc68
leaq 0x3ac12(%rip), %rdi     # 0x4c7d0
leaq 0x23e7e(%rip), %rsi     # 0x35a43
leaq 0x36094(%rip), %rdx     # 0x47c60
movb $0x0, %al
callq 0x4260
leaq 0x3abf6(%rip), %rdi     # 0x4c7d0
callq 0x10b40
jmp 0x12047
movl 0x3c07e(%rip), %ecx     # 0x4dc68
movl %ecx, %eax
addl $0x1, %eax
movl %eax, 0x3c073(%rip)     # 0x4dc68
leaq 0x3abd4(%rip), %rdi     # 0x4c7d0
leaq 0x23e56(%rip), %rsi     # 0x35a59
leaq 0x36056(%rip), %rdx     # 0x47c60
movb $0x0, %al
callq 0x4260
leaq 0x3abb8(%rip), %rdi     # 0x4c7d0
leaq 0x29190(%rip), %rsi     # 0x3adaf
callq 0x4230
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x11c5c
movq 0x333c3(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq 0x33531(%rip), %rax     # 0x45170
movq (%rax), %rdx
leaq 0x23e18(%rip), %rsi     # 0x35a61
leaq 0x3ab80(%rip), %rcx     # 0x4c7d0
movb $0x0, %al
callq 0x4190
jmp 0x12047
leaq 0x35f85(%rip), %rax     # 0x47be8
cmpl $0x0, (%rax)
je 0x11c8b
movq 0x33389(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rcx
leaq 0x23a73(%rip), %rsi     # 0x356f0
leaq 0x3ab4c(%rip), %rdx     # 0x4c7d0
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rdi
leaq 0x23dfa(%rip), %rsi     # 0x35a90
leaq 0x336c3(%rip), %rdx     # 0x45360
movb $0x0, %al
callq 0x4190
movq 0x388f5(%rip), %rax     # 0x4a5a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x11fbe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x33697(%rip), %rdi     # 0x45360
callq 0x4180
cmpl $0x0, %eax
jne 0x11ce9
leaq 0x3619e(%rip), %rax     # 0x47e78
cmpl $0x0, (%rax)
je 0x11cee
movq -0x18(%rbp), %rax
cmpl $0x2, 0x30(%rax)
je 0x11cee
jmp 0x11fad
movq -0x18(%rbp), %rax
cmpl $0x2, 0x30(%rax)
jne 0x11dc6
leaq 0x35f3d(%rip), %rax     # 0x47c40
cmpl $0x0, (%rax)
jne 0x11dc6
leaq 0x35f3d(%rip), %rax     # 0x47c50
cmpl $0x0, (%rax)
je 0x11dc6
movq 0x332d5(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq 0x33443(%rip), %rax     # 0x45170
movq (%rax), %rdx
leaq 0x237bb(%rip), %rsi     # 0x354f2
movb $0x0, %al
callq 0x4190
movq -0x18(%rbp), %rax
cmpl $0x0, 0x34(%rax)
jle 0x11d67
movq 0x332a9(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x34(%rax), %edx
leaq 0x23797(%rip), %rsi     # 0x354f7
movb $0x0, %al
callq 0x4190
movq 0x3328a(%rip), %rax     # 0x44ff8
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x11d9a
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x11da5
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %r8
leaq 0x23cef(%rip), %rsi     # 0x35aa7
leaq 0x335a1(%rip), %rdx     # 0x45360
movb $0x0, %al
callq 0x4190
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x1, %edx
callq 0x10430
cmpl $0x0, %eax
jne 0x11e1c
leaq 0x35e65(%rip), %rax     # 0x47c50
cmpl $0x0, (%rax)
je 0x11e17
movq 0x33201(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x23cba(%rip), %rsi     # 0x35aca
movb $0x0, %al
callq 0x4190
jmp 0x11fad
cmpl $0x0, 0x3be3d(%rip)     # 0x4dc60
jne 0x11fab
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x11e4e
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x11e59
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xfa40
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x11fa9
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x11e8d
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x11e98
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x11f59
movq -0x38(%rbp), %rdi
leaq 0x23c2a(%rip), %rsi     # 0x35ae0
callq 0x4280
cmpq $0x0, %rax
je 0x11f59
movq -0x38(%rbp), %rdi
callq 0x40f0
addq $0xb, %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x40a0
movq -0x30(%rbp), %rdi
leaq 0x23be7(%rip), %rsi     # 0x35ae0
callq 0x4280
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x23b15(%rip), %rsi     # 0x35a3d
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rdi
leaq 0x23bb1(%rip), %rsi     # 0x35aeb
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x23bb1(%rip), %rsi     # 0x35b01
movb $0x0, %al
callq 0x4190
jmp 0x11fa7
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x11f82
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x11f8d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rcx
leaq 0x23b72(%rip), %rsi     # 0x35b12
movb $0x0, %al
callq 0x4190
jmp 0x11fa9
jmp 0x11fab
jmp 0x11fad
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x11caf
movq -0x10(%rbp), %rdi
leaq 0x23a8e(%rip), %rsi     # 0x35a57
movb $0x0, %al
callq 0x4190
leaq 0x35c11(%rip), %rax     # 0x47be8
cmpl $0x0, (%rax)
je 0x11ff8
movq 0x33015(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x23b36(%rip), %rsi     # 0x35b27
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rdi
callq 0x6d20
leaq 0x35c58(%rip), %rdi     # 0x47c60
callq 0x40f0
addq $0xa, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl 0x3bc42(%rip), %ecx     # 0x4dc68
subl $0x1, %ecx
leaq 0x23a29(%rip), %rsi     # 0x35a59
leaq 0x35c29(%rip), %rdx     # 0x47c60
movb $0x0, %al
callq 0x4260
movq -0x20(%rbp), %rdi
callq 0x10500
addq $0x80, %rsp
popq %rbp
retq