// File: kelwinfc[P]ci4721-Fernandez-Gyomrey/src/AST/check.cpp
// Function: AST_bounded_loop::fill_and_check(symbol_table*)
void AST_bounded_loop::fill_and_check(symbol_table* st){

    if (0 != left_bound) {
        left_bound->fill_and_check(st);
    }
    if (0 != right_bound) {
        right_bound->fill_and_check(st);
    }
    
    if ( 0 == left_bound || left_bound->type == INVALID
        || 0 == right_bound || right_bound->type == INVALID )
    {
        return;
    } else if ( left_bound->type != right_bound->type ){
        logger->buf << "Ambos límites deben tener el mismo tipo.";
        logger->error(line, column);
    } else if ( left_bound->type != INT
                && left_bound->type != CHAR
                && left_bound->type != BOOLEAN
              )
    {
        logger->buf << "Se esperaba un tipo discreto int, char, boolean.";
        logger->error(line, column);
    }
    
    symbol_table* nested_block = st->new_son();
    
    sym = new symbol(name, true, left_bound->type, line_name, column_name,true);
    nested_block->insert(sym);
    
    blck->fill_and_check(nested_block);
    delete nested_block;
    
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x60(%rsp), %rcx
movq %rcx, 0x18(%rsp)
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0xf85a
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x58(%rsp), %rsi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq 0xb0(%rcx), %rax
je 0xf881
movq 0x18(%rsp), %rax
movq 0xb0(%rax), %rdi
movq 0x58(%rsp), %rsi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0xf8c5
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rax
cmpl $0x1, 0x10(%rax)
je 0xf8c5
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq 0xb0(%rcx), %rax
je 0xf8c5
movq 0x18(%rsp), %rax
movq 0xb0(%rax), %rax
cmpl $0x1, 0x10(%rax)
jne 0xf8ca
jmp 0xfa7b
movq 0x18(%rsp), %rcx
movq 0xa8(%rcx), %rax
movl 0x10(%rax), %eax
movq 0xb0(%rcx), %rcx
cmpl 0x10(%rcx), %eax
je 0xf91f
leaq 0x5ebec(%rip), %rax     # 0x6e4d8
movq (%rax), %rdi
addq $0x38, %rdi
addq $0x10, %rdi
leaq 0x433b4(%rip), %rsi     # 0x52cb2
callq 0x6370
movq 0x18(%rsp), %rax
leaq 0x5ebc9(%rip), %rcx     # 0x6e4d8
movq (%rcx), %rdi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2f440
jmp 0xf98f
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rax
cmpl $0x3, 0x10(%rax)
je 0xf98d
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rax
cmpl $0x5, 0x10(%rax)
je 0xf98d
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rax
cmpl $0x6, 0x10(%rax)
je 0xf98d
leaq 0x5eb7c(%rip), %rax     # 0x6e4d8
movq (%rax), %rdi
addq $0x38, %rdi
addq $0x10, %rdi
leaq 0x4336e(%rip), %rsi     # 0x52cdc
callq 0x6370
movq 0x18(%rsp), %rax
leaq 0x5eb59(%rip), %rcx     # 0x6e4d8
movq (%rcx), %rdi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x2f440
jmp 0xf98f
jmp 0xf991
movq 0x58(%rsp), %rdi
callq 0x2a330
movq %rax, 0x50(%rsp)
movl $0x78, %edi
callq 0x6390
movq 0x18(%rsp), %rsi
movq %rax, 0x10(%rsp)
movb $0x1, 0x23(%rsp)
addq $0x78, %rsi
leaq 0x30(%rsp), %rdi
callq 0x6170
jmp 0xf9c9
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0xa8(%rax), %rcx
movl 0x10(%rcx), %ecx
movl 0xa0(%rax), %r8d
movl 0xa4(%rax), %r9d
movq %rsp, %rax
movl $0x1, (%rax)
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x294c0
jmp 0xfa05
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, 0x23(%rsp)
movq %rcx, 0x98(%rax)
leaq 0x30(%rsp), %rdi
callq 0x6778
movq 0x18(%rsp), %rax
movq 0x50(%rsp), %rdi
movq 0x98(%rax), %rsi
callq 0x2a1f0
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rdi
movq 0x50(%rsp), %rsi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xfa7b
movq 0x8(%rsp), %rdi
callq 0x203d0
movq 0x8(%rsp), %rdi
movl $0x48, %esi
callq 0x63a0
addq $0x68, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0xfaa8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x6778
testb $0x1, 0x23(%rsp)
jne 0xfab1
jmp 0xfac0
movq 0x10(%rsp), %rdi
movl $0x78, %esi
callq 0x63a0
jmp 0xfac2
movq 0x28(%rsp), %rdi
callq 0x66b0
nopl (%rax)