// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Modex/Src/tree.c
// Function: find_ident_name
void
find_ident_name(treenode *n, treenode *def, treenode *container, FindFunction find)
{
    if (!n)
        return;

    switch(n->hdr.which)
    {
    case LEAF_T:
        (find)((leafnode*) n,def,container);
        break;

    case NODE_T:
    {
        switch(n->hdr.type)
        {
        case TN_IDENT:
            (find)((leafnode*) n,def,container);
            break;

        case TN_DECL:
            find_ident_name(n->rnode,def,container,find);
            break;

        case TN_COMP_DECL:
            find_ident_name(n->rnode,def,container,find);
            break;

        case TN_ASSIGN:
        case TN_ARRAY_DECL:
            find_ident_name(n->lnode,def,container,find);
            break;

        case TN_FIELD_LIST:
        case TN_DECL_LIST:
        case TN_DECLS:
        case TN_PARAM_LIST:
	case TN_IDENT_LIST:
            find_ident_name(n->lnode,def,container,find);
            find_ident_name(n->rnode,def,container,find);
            break;

        case TN_ELLIPSIS:
            break;

        case TN_PNTR:
            break;

        case TN_FUNC_DECL:
            find_ident_name(n->lnode,def,container,find);
            break;

	case TN_BIT_FIELD:	/* added gjh */
		break;

        default:
            fprintf(stderr,
                    "%s: parse error:%d: "
                    "unknown node type (%s) in find_ident_name\n",
                    progname, n->hdr.line, name_of_node(n->hdr.type));
            break;
        }
    }
    break;

    case IF_T:
    case FOR_T:
    case NONE_T:
    default:
        fprintf(stderr,
            "%s: parse error:%d: unknown node in find_ident_name: %s\n",
            progname, n->hdr.line, name_of_nodetype(n->hdr.which));
        break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x38
popq %r12
leaq 0xffa5(%rip), %r13      # 0x24664
testq %rbx, %rbx
je 0x14757
movl (%rbx), %edi
cmpl $0x4, %edi
jne 0x14707
movl 0x1c(%rbx), %edi
leal -0x2(%rdi), %eax
cmpl $0x1a, %eax
ja 0x14728
movslq (%r13,%rax,4), %rcx
addq %r13, %rcx
movq %r12, %rax
jmpq *%rcx
movq 0x30(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x1469d
movq %r12, %rax
jmp 0x14701
pushq $0x30
popq %rax
movq (%rbx,%rax), %rbx
jmp 0x146bf
cmpl $0x1, %edi
jne 0x14766
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
cmpl $0x2c, %edi
je 0x14757
cmpl $0x2d, %edi
je 0x1470c
movq 0x1f8bf(%rip), %rax     # 0x33ff8
movq (%rax), %r14
leaq 0x1fa5d(%rip), %rax     # 0x341a0
movq (%rax), %r15
movl 0x10(%rbx), %ebx
callq 0x1467f
leaq 0x1029e(%rip), %rsi     # 0x249f3
jmp 0x14789
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f88b(%rip), %rax     # 0x33ff8
movq (%rax), %r14
leaq 0x1fa29(%rip), %rax     # 0x341a0
movq (%rax), %r15
movl 0x10(%rbx), %ebx
callq 0x14527
leaq 0x102a9(%rip), %rsi     # 0x24a32
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %ecx
movq %rax, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41c0