// File: kelwinfc[P]ci4721-Fernandez-Gyomrey/src/AST/check.cpp
// Function: AST_return::fill_and_check(symbol_table*)
void AST_return::fill_and_check(symbol_table* st){
    
    if ( expected_return == NONE && expr ){
        logger->buf << "No se esperaba retorno con valor.";
        logger->error(line, column);
    } else if ( expected_return != NONE && !expr ){
        logger->buf << "Se esperaba retorno de tipo '"
                    << types.types[expected_return]->name << "'.";
        logger->error(line, column);
    } else if ( expected_return != NONE && expr ){
        expr->fill_and_check(st);
        if ( expr->type != expected_return ){
            logger->buf << "Se esperaba retorno de tipo '"
                        << types.types[expected_return]->name << "', '"
                        << types.types[expr->type]->name << "' obtenido.";
            logger->error(line, column);
        }
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpl $0x2, 0x5ef85(%rip)     # 0x6e3e4
jne 0xf4aa
movq 0x20(%rsp), %rax
cmpq $0x0, 0x78(%rax)
je 0xf4aa
leaq 0x5f064(%rip), %rax     # 0x6e4d8
movq (%rax), %rdi
addq $0x38, %rdi
addq $0x10, %rdi
leaq 0x437c6(%rip), %rsi     # 0x52c4c
callq 0x6370
movq 0x20(%rsp), %rax
leaq 0x5f041(%rip), %rcx     # 0x6e4d8
movq (%rcx), %rdi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2f440
jmp 0xf638
cmpl $0x2, 0x5ef33(%rip)     # 0x6e3e4
je 0xf538
movq 0x20(%rsp), %rax
cmpq $0x0, 0x78(%rax)
jne 0xf538
leaq 0x5f00e(%rip), %rax     # 0x6e4d8
movq (%rax), %rdi
addq $0x38, %rdi
addq $0x10, %rdi
leaq 0x43792(%rip), %rsi     # 0x52c6e
callq 0x6370
movq %rax, 0x18(%rsp)
movslq 0x5eef7(%rip), %rsi     # 0x6e3e4
leaq 0x5efec(%rip), %rdi     # 0x6e4e0
callq 0x1fc90
movq 0x18(%rsp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x6340
movq %rax, %rdi
leaq 0x481a3(%rip), %rsi     # 0x576b7
callq 0x6370
movq 0x20(%rsp), %rax
leaq 0x5efb3(%rip), %rcx     # 0x6e4d8
movq (%rcx), %rdi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2f440
jmp 0xf636
cmpl $0x2, 0x5eea5(%rip)     # 0x6e3e4
je 0xf634
movq 0x20(%rsp), %rax
cmpq $0x0, 0x78(%rax)
je 0xf634
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x28(%rsp), %rsi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rax
movl 0x10(%rax), %eax
cmpl 0x5ee69(%rip), %eax     # 0x6e3e4
je 0xf632
leaq 0x5ef50(%rip), %rax     # 0x6e4d8
movq (%rax), %rdi
addq $0x38, %rdi
addq $0x10, %rdi
leaq 0x436d4(%rip), %rsi     # 0x52c6e
callq 0x6370
movq %rax, 0x8(%rsp)
movslq 0x5ee39(%rip), %rsi     # 0x6e3e4
leaq 0x5ef2e(%rip), %rdi     # 0x6e4e0
callq 0x1fc90
movq 0x8(%rsp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x6340
movq %rax, %rdi
leaq 0x436ba(%rip), %rsi     # 0x52c8c
callq 0x6370
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rsp)
movq 0x78(%rax), %rax
movslq 0x10(%rax), %rsi
leaq 0x5eeed(%rip), %rdi     # 0x6e4e0
callq 0x1fc90
movq 0x10(%rsp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x6340
movq %rax, %rdi
leaq 0x4367e(%rip), %rsi     # 0x52c91
callq 0x6370
movq 0x20(%rsp), %rax
leaq 0x5eeb4(%rip), %rcx     # 0x6e4d8
movq (%rcx), %rdi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2f440
jmp 0xf634
jmp 0xf636
jmp 0xf638
addq $0x38, %rsp
retq
nopl (%rax)