// File: /workspace/github_c_makefile_star2_O1/nimble-code[P]Modex/Src/symtab.c
// Function: put_structs
void
put_structs(scopetab_t *that, FILE *fp)
{	scopetab_t *z;
	symentry_t *t;
	char *s;
	int j;

	if (that->htab)
	{	for (z = that; z; z = z->parent)
		{	if (z->owner
			&&  z->owner_t == TN_OBJ_DEF
			&&  strcmp(z->owner, "-") != 0)
			{	/* sanity pretest */
				int shouldshow = 1;
				for (j = 0; j < that->htab->tsize && shouldshow; j++)
				for (t = that->htab->tab[j]; t; t = t->next)
				{	s = nx_stmnt(t->node);
					if (strstr(s, "->")
					||  strstr(s, "[]"))	/* both would produce invalid code */
					{	shouldshow = 0;
						break;
				}	}
				if (!shouldshow) break;
				/* end pretest */

				/* a possible issue:
				 * this does not reproduce the fields in
				 * the same order as the original
				 * struct declaration
				 */
				fprintf(fp, "c_decl {	/* put_structs */\n");
				fprintf(fp, "	struct %s {\n", z->owner);
				for (j = 0; j < that->htab->tsize; j++)
				for (t = that->htab->tab[j]; t; t = t->next)
				{	s = nx_stmnt(t->node);
					remove_newlines(s);

					while (strlen(s) > 0
					&& (s[strlen(s)-1] == ';'
					 || s[strlen(s)-1] == ' '))
					{	s[strlen(s)-1] = '\0';
					}
					fprintf(fp, "\t\t%s; /* P: %p */\n", s, z);
				}
				fprintf(fp, "\t};\n");
				fprintf(fp, "} /* end c_code. */\n");
				break;
		}	}
	}

	for (j = 0; j < that->nchild; j++)
		put_structs(that->children[j], fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x8(%rdi)
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x708f
leaq 0x1da34(%rip), %r12     # 0x24a9b
movq %r14, %r15
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x7086
cmpl $0x18, 0x20(%r15)
jne 0x7086
movq %r12, %rsi
callq 0x41b0
testl %eax, %eax
jne 0x70c4
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0x706a
cmpl $0x0, 0x28(%r14)
jle 0x70b5
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x703d
incq %r15
movslq 0x28(%r14), %rax
cmpq %rax, %r15
jl 0x7099
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
cmpl $0x0, (%rax)
jle 0x713a
xorl %r13d, %r13d
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %r12
testq %r12, %r12
je 0x7119
movq 0x10(%r12), %rdi
callq 0xc229
movq %rax, %rbp
movq %rax, %rdi
leaq 0x1ec2d(%rip), %rsi     # 0x25d21
callq 0x42c0
testq %rax, %rax
jne 0x711d
movq %rbp, %rdi
leaq 0x1c017(%rip), %rsi     # 0x2311f
callq 0x42c0
testq %rax, %rax
jne 0x711d
movq 0x38(%r12), %r12
jmp 0x70d8
movb $0x1, %dl
jmp 0x711f
xorl %edx, %edx
testb %dl, %dl
je 0x7132
incq %r13
movq 0x8(%r14), %rax
movslq (%rax), %rcx
cmpq %rcx, %r13
jl 0x70d0
testb %dl, %dl
je 0x708f
leaq 0x1bfe1(%rip), %rdi     # 0x23122
movl $0x1b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movq 0x18(%r15), %rdx
leaq 0x1bfe0(%rip), %rsi     # 0x2313e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41c0
movq 0x8(%r14), %rax
cmpl $0x0, (%rax)
jle 0x71f0
leaq 0x1bfd4(%rip), %r12     # 0x2314c
xorl %edx, %edx
movq 0x8(%rax), %rax
movq %rdx, (%rsp)
movq (%rax,%rdx,8), %rbp
testq %rbp, %rbp
je 0x71dd
movq 0x10(%rbp), %rdi
callq 0xc229
movq %rax, %r13
movq %rax, %rdi
callq 0x7001
movq %r13, %rdi
callq 0x4110
testq %rax, %rax
je 0x71c4
movzbl -0x1(%r13,%rax), %ecx
cmpl $0x3b, %ecx
je 0x71bc
cmpl $0x20, %ecx
jne 0x71c4
movb $0x0, -0x1(%r13,%rax)
jmp 0x719f
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x41c0
movq 0x38(%rbp), %rbp
jmp 0x7186
movq (%rsp), %rdx
incq %rdx
movq 0x8(%r14), %rax
movslq (%rax), %rcx
cmpq %rcx, %rdx
jl 0x717a
leaq 0x1e526(%rip), %rdi     # 0x2571d
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1bf4f(%rip), %rdi     # 0x2315f
movl $0x14, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
jmp 0x708f