// File: /workspace/github_cpp_makefile_star2_O3/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 0xb571
leaq 0x3413c(%rip), %r12     # 0x3f410
movq (%r12), %rcx
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0xb59d
movq (%r13), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %r15
leaq 0x33908(%rip), %rax     # 0x3ec00
movq 0x8(%rax), %r14
cmpq %r14, %r15
je 0xb380
cmpb $0x2a, (%r15)
jne 0xb316
leaq 0x3390a(%rip), %rax     # 0x3ec18
cmpq 0x8(%rax), %r15
jne 0xb341
jmp 0xb380
movq %r15, %rdi
movq %r14, %rsi
callq 0x6410
testl %eax, %eax
je 0xb380
leaq 0x338ec(%rip), %rax     # 0x3ec18
movq 0x8(%rax), %rsi
cmpq %rsi, %r15
je 0xb380
movq %r15, %rdi
callq 0x6410
testl %eax, %eax
je 0xb380
leaq 0x340c0(%rip), %r15     # 0x3f408
movq (%r15), %r14
addq $0x48, %r14
leaq 0x2260f(%rip), %rsi     # 0x2d965
movl $0x23, %edx
movq %r14, %rdi
callq 0x6370
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 0xb547
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 0x16c68
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x183ea
movq %rax, 0x70(%rbx)
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb3d1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x70(%rbx), %rax
testq %rax, %rax
leaq 0x34035(%rip), %r12     # 0x3f410
je 0xb4e6
movq %rax, %rdi
callq 0x1801a
movl %eax, 0x10(%rbx)
movq 0x70(%rbx), %rdi
callq 0x18016
testb %al, %al
je 0xb4c1
leaq 0x34004(%rip), %rbp     # 0x3f408
movq (%rbp), %r15
addq $0x48, %r15
leaq 0x224bf(%rip), %rsi     # 0x2d8d2
movl $0x1f, %edx
movq %r15, %rdi
callq 0x6370
movq 0x70(%rbx), %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x17ff4
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x6370
movq %rax, %r15
leaq 0x224a6(%rip), %rsi     # 0x2d8f2
movl $0xe, %edx
movq %rax, %rdi
callq 0x6370
movq 0x70(%rbx), %rdi
callq 0x1801e
movq %r15, %rdi
movl %eax, %esi
callq 0x6540
leaq 0x7(%rsp), %rsi
movb $0x3a, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x6370
movq %rax, %r15
movq 0x70(%rbx), %rdi
callq 0x18022
movq %r15, %rdi
movl %eax, %esi
callq 0x6540
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb4b2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6300
movq (%rbp), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1aa40
movq (%r13), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rdi
cmpq %r14, %rdi
je 0xb57a
cmpb $0x2a, (%rdi)
jne 0xb57e
xorl %eax, %eax
jmp 0xb58b
leaq 0x33f1b(%rip), %r15     # 0x3f408
movq (%r15), %r14
addq $0x48, %r14
leaq 0x2248e(%rip), %rsi     # 0x2d989
movl $0x6, %edx
movq %r14, %rdi
callq 0x6370
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 0x6370
movq %rax, %r14
leaq 0x2245e(%rip), %rsi     # 0x2d990
movl $0x12, %edx
movq %rax, %rdi
callq 0x6370
movq 0x50(%rbx), %rsi
movq 0x58(%rbx), %rdx
movq %r14, %rdi
callq 0x6370
leaq 0x27041(%rip), %rsi     # 0x32597
movl $0x2, %edx
movq %rax, %rdi
callq 0x6370
movq (%r15), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1aa40
movl $0x1, 0x10(%rbx)
jmp 0xb58e
movb $0x1, %al
jmp 0xb58b
movq %r14, %rsi
callq 0x6410
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 0x6350
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb5d4
movq 0x18(%rsp), %rsi
jmp 0xb5cc
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb5d4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6300
movq %rbx, %rdi
callq 0x6560