// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x603b
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6039
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x6026
movq -0x18(%rbp), %rax
cmpl $0x18, 0x20(%rax)
jne 0x6026
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x2ee86(%rip), %rsi     # 0x34c54
callq 0x4180
cmpl $0x0, %eax
je 0x6026
movl $0x1, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %eax, %eax
cmpl (%rdx), %ecx
movb %al, -0x31(%rbp)
jge 0x5e08
cmpl $0x0, -0x30(%rbp)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x5e14
jmp 0x5e99
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5e89
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc890
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x301da(%rip), %rsi     # 0x36029
callq 0x4280
cmpq $0x0, %rax
jne 0x5e70
movq -0x28(%rbp), %rdi
leaq 0x2d2cb(%rip), %rsi     # 0x33130
callq 0x4280
cmpq $0x0, %rax
je 0x5e79
movl $0x0, -0x30(%rbp)
jmp 0x5e89
jmp 0x5e7b
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x5e2c
jmp 0x5e8b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5dea
cmpl $0x0, -0x30(%rbp)
jne 0x5ea4
jmp 0x6039
movq -0x10(%rbp), %rdi
leaq 0x2d284(%rip), %rsi     # 0x33133
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x2d286(%rip), %rsi     # 0x3314f
movb $0x0, %al
callq 0x4190
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x6000
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5ff0
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc890
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5d20
movq -0x28(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x32(%rbp)
jbe 0x5f97
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x40(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x3b, %ecx
movb %al, -0x33(%rbp)
je 0x5f91
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x48(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
sete %al
movb %al, -0x33(%rbp)
movb -0x33(%rbp), %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x5fa0
jmp 0x5fc5
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x5f27
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x2d185(%rip), %rsi     # 0x3315d
movb $0x0, %al
callq 0x4190
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x5f02
jmp 0x5ff2
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5ed7
movq -0x10(%rbp), %rdi
leaq 0x2f9ff(%rip), %rsi     # 0x35a0a
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rdi
leaq 0x2d153(%rip), %rsi     # 0x33170
movb $0x0, %al
callq 0x4190
jmp 0x6039
jmp 0x6028
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x5d97
jmp 0x603b
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x6072
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
callq 0x5d70
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x6042
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)