// File: /workspace/github_cpp_makefile_star2_O2/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/AST/check.cpp
// Function: AST_struct_access::fill_and_check(symbol_table*, bool)
void AST_struct_access::fill_and_check(symbol_table* st, bool lval){
    value->fill_and_check(st, lval);
    
    type_descriptor* td = types.types[value->type];
    
    if ( value->type == INVALID ){
        type = INVALID;
        return;
    }
    
    if (    typeid(*td) != typeid(struct_type) 
         && typeid(*td) != typeid(union_type) 
    )
    {
        logger->buf << "Intento de acceso a campo en tipo '"
                    << types.types[value->type]->name << "'.";
        logger->error(line, column);
        type = INVALID;
    } else {
        sym = ((struct_type*)td)->fields->lookup( field );
        
        if ( sym != 0 ){
            type = sym->getType();
            
            if ( sym->isConst() ){
                logger->buf << "Intento de acceso a constante '"
                            << sym->getName() << "' definida en "
                            << sym->getLine() << ':' << sym->getColumn();
                logger->error(line, column);
            }
            union_access = typeid(*td) == typeid(struct_type);
        } else {
            logger->buf << "Tipo '" << types.types[value->type]->name
                        << "' no posee campo '" << field << "'.";
            logger->error(line, column);
            type = INVALID;
        }
        
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x48(%rbx), %rax
movslq 0x10(%rax), %rax
cmpq $0x1, %rax
je 0x9d4a
leaq 0x2e8c4(%rip), %rbp     # 0x38408
movq (%rbp), %rcx
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0x9d60
movq (%r13), %rax
movq -0x8(%rax), %rdi
leaq 0x2e0dc(%rip), %rsi     # 0x37c40
callq 0x12274
testb %al, %al
je 0x9bd2
movq (%r13), %rax
movq -0x8(%rax), %rdi
leaq 0x2e0dc(%rip), %rsi     # 0x37c58
callq 0x12274
testb %al, %al
je 0x9bd2
leaq 0x2e874(%rip), %r14     # 0x38400
movq (%r14), %rdi
addq $0x48, %rdi
leaq 0x19dcb(%rip), %rsi     # 0x23965
callq 0x62b0
movq 0x48(%rbx), %rcx
movslq 0x10(%rcx), %rcx
movq (%rbp), %rdx
movq (%rdx,%rcx,8), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x62a0
leaq 0x1e9d5(%rip), %rsi     # 0x28597
movq %rax, %rdi
callq 0x62b0
movq (%r14), %rdi
jmp 0x9d3f
movq 0x30(%r13), %r15
leaq 0x50(%rbx), %r14
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x63e0
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1422e
movq %rax, 0x70(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x65c8
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x9cdd
callq 0x13f0c
movl %eax, 0x10(%rbx)
movq 0x70(%rbx), %rdi
callq 0x13f08
testb %al, %al
je 0x9cc4
leaq 0x2e7ce(%rip), %r12     # 0x38400
movq (%r12), %rdi
addq $0x48, %rdi
leaq 0x19c91(%rip), %rsi     # 0x238d2
callq 0x62b0
movq %rax, %r14
movq 0x70(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x13efa
movq %r14, %rdi
movq %r15, %rsi
callq 0x62a0
leaq 0x19c86(%rip), %rsi     # 0x238f2
movq %rax, %rdi
callq 0x62b0
movq %rax, %r14
movq 0x70(%rbx), %rdi
callq 0x13f10
movq %r14, %rdi
movl %eax, %esi
callq 0x6510
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x6350
movq %rax, %r14
movq 0x70(%rbx), %rdi
callq 0x13f14
movq %r14, %rdi
movl %eax, %esi
callq 0x6510
leaq 0x8(%rsp), %rdi
callq 0x65c8
movq (%r12), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x16112
movq (%r13), %rax
movq -0x8(%rax), %rdi
leaq 0x2df6d(%rip), %rsi     # 0x37c40
callq 0x1227e
movb %al, 0x78(%rbx)
jmp 0x9d51
leaq 0x2e71c(%rip), %r15     # 0x38400
movq (%r15), %rdi
addq $0x48, %rdi
leaq 0x19c97(%rip), %rsi     # 0x23989
callq 0x62b0
movq 0x48(%rbx), %rcx
movslq 0x10(%rcx), %rcx
movq (%rbp), %rdx
movq (%rdx,%rcx,8), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x62a0
leaq 0x19c76(%rip), %rsi     # 0x23990
movq %rax, %rdi
callq 0x62b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x62a0
leaq 0x1e863(%rip), %rsi     # 0x28597
movq %rax, %rdi
callq 0x62b0
movq (%r15), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x16112
movl $0x1, 0x10(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6320
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x9d77
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65c8
movq %rbx, %rdi
callq 0x6530