// File: /workspace/github_cpp_makefile_star2_O1/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 0xb59d
leaq 0x330fc(%rip), %r12     # 0x3e408
movq (%r12), %rcx
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0xb5c9
movq (%r13), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %r15
leaq 0x328d0(%rip), %rax     # 0x3dc00
movq 0x8(%rax), %r14
cmpq %r14, %r15
je 0xb3af
cmpb $0x2a, (%r15)
je 0xb34e
movq %r15, %rdi
movq %r14, %rsi
callq 0x6400
testl %eax, %eax
je 0xb3af
leaq 0x328c3(%rip), %rax     # 0x3dc18
movq 0x8(%rax), %rsi
cmpq %rsi, %r15
je 0xb3af
cmpb $0x2a, (%r15)
je 0xb370
movq %r15, %rdi
callq 0x6400
testl %eax, %eax
je 0xb3af
leaq 0x33089(%rip), %r15     # 0x3e400
movq (%r15), %r14
addq $0x48, %r14
leaq 0x215e0(%rip), %rsi     # 0x2c965
movl $0x23, %edx
movq %r14, %rdi
callq 0x6360
movq 0x48(%rbx), %rax
movslq 0x10(%rax), %rax
movq (%r12), %rcx
movq (%rcx,%rax,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
jmp 0xb573
movq 0x30(%r13), %r15
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x50(%rbx), %rsi
movq 0x58(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x16c42
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x183ae
movq %rax, 0x70(%rbx)
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb3fc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62f0
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
leaq 0x32ffe(%rip), %r12     # 0x3e408
je 0xb512
callq 0x17fde
movl %eax, 0x10(%rbx)
movq 0x70(%rbx), %rdi
callq 0x17fda
testb %al, %al
je 0xb4ed
leaq 0x32fd0(%rip), %rbp     # 0x3e400
movq (%rbp), %r15
addq $0x48, %r15
leaq 0x21493(%rip), %rsi     # 0x2c8d2
movl $0x1f, %edx
movq %r15, %rdi
callq 0x6360
movq 0x70(%rbx), %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x17fb8
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x6360
movq %rax, %r15
leaq 0x2147a(%rip), %rsi     # 0x2c8f2
movl $0xe, %edx
movq %rax, %rdi
callq 0x6360
movq 0x70(%rbx), %rdi
callq 0x17fe2
movq %r15, %rdi
movl %eax, %esi
callq 0x6530
leaq 0x7(%rsp), %rsi
movb $0x3a, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x6360
movq %rax, %r15
movq 0x70(%rbx), %rdi
callq 0x17fe6
movq %r15, %rdi
movl %eax, %esi
callq 0x6530
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb4de
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x62f0
movq (%rbp), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1a9e6
movq (%r13), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rdi
cmpq %r14, %rdi
je 0xb5a6
cmpb $0x2a, (%rdi)
jne 0xb5aa
xorl %eax, %eax
jmp 0xb5b7
leaq 0x32ee7(%rip), %r15     # 0x3e400
movq (%r15), %r14
addq $0x48, %r14
leaq 0x21462(%rip), %rsi     # 0x2c989
movl $0x6, %edx
movq %r14, %rdi
callq 0x6360
movq 0x48(%rbx), %rax
movslq 0x10(%rax), %rax
movq (%r12), %rcx
movq (%rcx,%rax,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x6360
movq %rax, %r14
leaq 0x21432(%rip), %rsi     # 0x2c990
movl $0x12, %edx
movq %rax, %rdi
callq 0x6360
movq 0x50(%rbx), %rsi
movq 0x58(%rbx), %rdx
movq %r14, %rdi
callq 0x6360
leaq 0x26015(%rip), %rsi     # 0x31597
movl $0x2, %edx
movq %rax, %rdi
callq 0x6360
movq (%r15), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1a9e6
movl $0x1, 0x10(%rbx)
jmp 0xb5ba
movb $0x1, %al
jmp 0xb5b7
movq %r14, %rsi
callq 0x6400
testl %eax, %eax
sete %al
movb %al, 0x78(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6340
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb600
movq 0x18(%rsp), %rsi
jmp 0xb5f8
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb600
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x62f0
movq %rbx, %rdi
callq 0x6550