// File: /workspace/github_c_makefile_star2_O3/nimble-code[P]Uno/Src/explore.c
// Function: walker
void
walker(treenode *n, int level, int pre)
{
	if (level >= sizeof(XBuf_Levels)/sizeof(char *))
	{	fprintf(stderr, "error: exceeded builtin depth limit\n");
		clean_tmps();
		exit(1);
	}
	if (!XBuf_Levels[level])
	{	XBuf_Levels[level] = emalloc(BufLimit * sizeof(char));
	}
	Xbuf = XBuf_Levels[level];

	if (n->hdr.warned || exclude_location(n))
	{	return;
	}

	/**** rule 4.1.14  all if/then/else/if chains must end with an else */
	/**** rule 4.1.13  all if stmnts must be compound statements */

	if (IF_THEN_ELSE(n))
	{	if (follow_chain(IF_ELSE(n)->rnode))
		{	if (pre)
			{	found_4_1_14++;
				Xbuf[0] = '\0';
			} else
			{	if (--found_4_1_14 == 0)
				{	location(n);
					printf("if-then-else-if chain does not end with 'else' (%s)\n",
					Xbuf);
		}	}	}

		if (IF_BODY(n)->rnode == NULL
		|| (W_TYPE(IF_BODY(n)->rnode) != TN_BLOCK && W_TYPE(IF_BODY(n)->rnode) != TN_IF ))
		{	location(n);
			printf("body of if-statement is not enclosed in braces\n");
		}
		if (ELSE_BODY(n)->rnode == NULL
		|| (W_TYPE(ELSE_BODY(n)->rnode) != TN_BLOCK && W_TYPE(ELSE_BODY(n)->rnode) != TN_IF ))
		{	location(n);
			printf("body of else is not enclosed in braces\n");
	}	}

	/**** rule 4.1.13  all if stmnts must be compound statements */
	if (IF_THEN(n))
	{	if (IF_BODY(n)->rnode == NULL
		|| (W_TYPE(IF_BODY(n)->rnode) != TN_BLOCK && W_TYPE(IF_BODY(n)->rnode) != TN_IF ))
		{	location(n);
			printf("body of if-statement is not enclosed in braces\n");
	}	}


	/**** rule 4.1.12 all loops must be compound statements */

	if (pre && FOR_LOOP(n)
	&& (FOR_BODY(n)->rnode == NULL || W_TYPE(FOR_BODY(n)->rnode) != TN_BLOCK))
	{	location(n);
		printf("body of for-stmnt is not enclosed in braces\n");
		/* name_of_node(W_TYPE(FOR_BODY(n))) */
	}

	if (pre && (WHILE_LOOP(n) || UNTIL_LOOP(n))
	&& W_TYPE(WHILE_BODY(n->rnode)) != TN_BLOCK)
	{	location(n);
		printf("body of while is not enclosed in braces\n");
		/* name_of_node(W_TYPE(WHILE_BODY(n->rnode))) */
	}

	/**** rule 4.1.15 every switch statement must have a default */

	if (pre && SWITCH(n) && W_TYPE(SWITCH_BODY(n)->rnode) == TN_BLOCK)
	{	if (!has_default(SWITCH_BODY(n)->rnode->lnode))
		{	location(n);
			printf("switch has no default case\n");
		}
	}

	/**** rule 4.9.5 enum and macro names must be in upper case */
	if (pre && B_TYPE(n) == NODE_T && W_TYPE(n) == TN_ENUM_LIST)
	{	char *p = has_lower_case(n);
		if (p)
		{	location(n);
			printf("enum name '%s' has lower-case characters\n", p);
	}	}

	/**** rule 4.9.4 variable and function names, and tags, have no uppercase */
	/**** rule 4.1.5 function prototypes must be declared at file scope */
	if (pre && B_TYPE(n) == NODE_T && W_TYPE(n) == TN_FUNC_DECL)
	{
		if (n->lnode
		&&  W_TYPE(n->lnode) == TN_IDENT)
		{	if (has_upper(((leafnode *)n->lnode)->data.sval->str))
			{	location(n);
				printf("function name '%s' has uppercase chars\n",
					((leafnode *)n->lnode)->data.sval->str);
			}
			if (n->lnode->syment->nes->level > 3)
			{	location(n);
				printf("function prototype '%s' not declared at file-scope\n",
					((leafnode *)n->lnode)->data.sval->str);
	}	}	}

	/**** rule 4.1.4 no objects or functions may be defined in header files */

	if (W_TYPE(n) == TN_DECL
	&&  strstr(W_FILE, ".h")
	&&  n->lnode
	&&  n->rnode
	&&  W_TYPE(n->lnode) == TN_TYPE_LIST
	&&  has_non_obj(n->lnode))
	{	if (has_extern(n->lnode))
		{	if (pre)
			{	found_4_1_4++;
			} else
			{	found_4_1_4--;
			}
		} else if (n->rnode)
		{	if (found_4_1_4 == 0)
			{	if (pre)
				{	Xbuf[0] = '\0';
				} else
				{	location(n);
					printf("object '%s' defined in header file\n", Xbuf);
					Xbuf[0] = '\0';
	}	}	}	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x200, %esi            # imm = 0x200
jae 0x1a606
movl %edx, %ebx
movq %rdi, %r14
movl %esi, %r12d
leaq 0x656d7(%rip), %r13     # 0x7f990
movq (%r13,%r12,8), %r15
testq %r15, %r15
jne 0x1a2d5
movl $0xfa00, %edi           # imm = 0xFA00
callq 0x5fdd
movq %rax, %r15
movq %rax, (%r13,%r12,8)
movq %r15, 0x1dec4(%rip)     # 0x381a0
cmpl $0x0, 0x30(%r14)
jne 0x1a5fc
movq %r14, %rdi
callq 0x1a094
testl %eax, %eax
jne 0x1a5fc
cmpl $0x1b, 0x1c(%r14)
jne 0x1a3f2
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x1a3bd
movq 0x48(%rax), %rax
cmpl $0x1b, 0x1c(%rax)
jne 0x1a361
movq 0x50(%rax), %rax
testq %rax, %rax
jne 0x1a30f
movl 0x66668(%rip), %eax     # 0x80990
testl %ebx, %ebx
je 0x1a33a
incl %eax
movl %eax, 0x6665c(%rip)     # 0x80990
movb $0x0, (%r15)
jmp 0x1a361
decl %eax
movl %eax, 0x6664e(%rip)     # 0x80990
jne 0x1a361
movq %r14, %rdi
callq 0x1a13d
movq 0x1de4d(%rip), %rsi     # 0x381a0
leaq 0x163d5(%rip), %rdi     # 0x3072f
xorl %eax, %eax
callq 0x3100
movq 0x48(%r14), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x1a37b
movl 0x1c(%rax), %eax
cmpl $0x4, %eax
je 0x1a38f
cmpl $0x1b, %eax
je 0x1a38f
movq %r14, %rdi
callq 0x1a13d
leaq 0x164ab(%rip), %rdi     # 0x30835
callq 0x30a0
movq 0x50(%r14), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x1a3a9
movl 0x1c(%rax), %eax
cmpl $0x4, %eax
je 0x1a3bd
cmpl $0x1b, %eax
je 0x1a3bd
movq %r14, %rdi
callq 0x1a13d
leaq 0x16456(%rip), %rdi     # 0x3080e
callq 0x30a0
cmpl $0x1b, 0x1c(%r14)
jne 0x1a3f2
movq 0x48(%r14), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x1a3de
movl 0x1c(%rax), %eax
cmpl $0x4, %eax
je 0x1a3f2
cmpl $0x1b, %eax
je 0x1a3f2
movq %r14, %rdi
callq 0x1a13d
leaq 0x16448(%rip), %rdi     # 0x30835
callq 0x30a0
testl %ebx, %ebx
je 0x1a551
movl 0x1c(%r14), %eax
cmpl $0x1e, %eax
jne 0x1a42e
movq 0x58(%r14), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x1a416
cmpl $0x4, 0x1c(%rax)
je 0x1a490
movq %r14, %rdi
callq 0x1a13d
leaq 0x1643f(%rip), %rdi     # 0x30864
callq 0x30a0
movl 0x1c(%r14), %eax
leal -0x1f(%rax), %ecx
cmpl $0x1, %ecx
ja 0x1a45c
movq 0x48(%r14), %rax
movq 0x48(%rax), %rax
cmpl $0x4, 0x1c(%rax)
je 0x1a490
movq %r14, %rdi
callq 0x1a13d
leaq 0x1643d(%rip), %rdi     # 0x30890
callq 0x30a0
movl 0x1c(%r14), %eax
cmpl $0x21, %eax
jne 0x1a490
movq 0x48(%r14), %rax
movq 0x48(%rax), %rax
cmpl $0x4, 0x1c(%rax)
jne 0x1a490
movq 0x40(%rax), %rdi
callq 0x1a172
testl %eax, %eax
jne 0x1a490
movq %r14, %rdi
callq 0x1a13d
leaq 0x1642d(%rip), %rdi     # 0x308b8
callq 0x30a0
cmpl $0x4, (%r14)
jne 0x1a551
movl 0x1c(%r14), %eax
cmpl $0xc, %eax
jne 0x1a4d6
movq %r14, %rdi
callq 0x1a60b
testq %rax, %rax
je 0x1a4cc
movq %rax, %r15
movq %r14, %rdi
callq 0x1a13d
leaq 0x162a2(%rip), %rdi     # 0x30764
movq %r15, %rsi
xorl %eax, %eax
callq 0x3100
cmpl $0x4, (%r14)
jne 0x1a551
movl 0x1c(%r14), %eax
cmpl $0x2, %eax
jne 0x1a551
movq 0x40(%r14), %rax
testq %rax, %rax
je 0x1a551
cmpl $0x2d, 0x1c(%rax)
jne 0x1a551
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdi
callq 0xf43e
testl %eax, %eax
je 0x1a51d
movq %r14, %rdi
callq 0x1a13d
movq 0x40(%r14), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x16278(%rip), %rdi     # 0x3078e
xorl %eax, %eax
callq 0x3100
movq 0x40(%r14), %rax
movq 0x38(%rax), %rax
movq 0x18(%rax), %rax
cmpl $0x4, 0x4(%rax)
jl 0x1a551
movq %r14, %rdi
callq 0x1a13d
movq 0x40(%r14), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x1626c(%rip), %rdi     # 0x307b6
xorl %eax, %eax
callq 0x3100
cmpl $0x5, 0x1c(%r14)
jne 0x1a5fc
movq 0x8(%r14), %rdi
testq %rdi, %rdi
jne 0x1a56c
movq 0x55a04(%rip), %rdi     # 0x6ff70
leaq 0x15e33(%rip), %rsi     # 0x303a6
callq 0x3280
testq %rax, %rax
je 0x1a5fc
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x1a5fc
cmpq $0x0, 0x48(%r14)
je 0x1a5fc
cmpl $0x14, 0x1c(%rdi)
jne 0x1a5fc
callq 0x1a244
testl %eax, %eax
je 0x1a5fc
movq 0x40(%r14), %rdi
callq 0x1a1db
testl %eax, %eax
je 0x1a5b7
movl 0x663e5(%rip), %eax     # 0x80994
testl %ebx, %ebx
je 0x1a5f4
incl %eax
jmp 0x1a5f6
cmpq $0x0, 0x48(%r14)
je 0x1a5fc
cmpl $0x0, 0x663cf(%rip)     # 0x80994
jne 0x1a5fc
testl %ebx, %ebx
jne 0x1a5e8
movq %r14, %rdi
callq 0x1a13d
movq 0x1dbc6(%rip), %rsi     # 0x381a0
leaq 0x16209(%rip), %rdi     # 0x307ea
xorl %eax, %eax
callq 0x3100
movq 0x1dbb1(%rip), %rax     # 0x381a0
movb $0x0, (%rax)
jmp 0x1a5fc
decl %eax
movl %eax, 0x66398(%rip)     # 0x80994
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x4131