// File: /workspace/github_c_makefile_star2_O1/thiagok00[P]INF1715-Compilers/TabelaSimbolos.c
// Function: tipa_bloco
static Simbolo* tipa_bloco(Simbolo *s, Bloco *b,int nivelEscopo) {

    DefVarL *auxvars;
    CMDL *auxcmds;

    if (b == NULL) return s;

    auxvars = b->declVars;
    while (auxvars != NULL) {
      s = cria_no_var(s,auxvars->v,nivelEscopo);
      auxvars = auxvars->prox;
    }

    auxcmds = b->cmds;
    while(auxcmds != NULL) {
      CMD *cmd = auxcmds->c;
      tipa_comando(s,cmd,nivelEscopo);
      auxcmds = auxcmds->prox;
    }

    //print_simbolos(s);
    //desempilha variaveis do escopo
    while (s != NULL && s->escopo >= nivelEscopo) {
      s = destroi_simbolo_final(s);
    }
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
testq %rsi, %rsi
je 0x3f82
movl %edx, %ebx
movq %rsi, %r15
movq (%rsi), %r12
testq %r12, %r12
je 0x3db1
movq (%r12), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x3c82
movq %rax, %r14
movq 0x8(%r12), %r12
jmp 0x3d94
movq 0x8(%r15), %r15
testq %r15, %r15
je 0x3f4f
leal 0x1(%rbx), %eax
movl %eax, -0x2c(%rbp)
movq (%r15), %r13
movl (%r13), %eax
cmpq $0x9, %rax
ja 0x3f07
leaq 0x3730(%rip), %rcx      # 0x750c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x404b
movq 0x10(%r13), %rsi
jmp 0x3ed1
movq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x408b
movq 0x8(%r13), %rax
movq 0x8(%rax), %rdi
movl 0x4(%rdi), %eax
cmpl $0x1, %eax
je 0x3f07
andl $-0x2, %eax
cmpl $0x2, %eax
je 0x3f07
cmpl $0x1, (%rdi)
je 0x3f07
jmp 0x3f97
movq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x455e
movq 0x10(%r13), %rsi
movq %r14, %rdi
callq 0x408b
movq 0x8(%r13), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rsi), %r12d
testl %r12d, %r12d
jne 0x3e6f
movq 0x10(%r13), %rax
movq 0x8(%rax), %rdi
cmpl $0x0, 0x4(%rdi)
je 0x3fb2
movl (%rsi), %eax
cmpl $0x1, %eax
je 0x3e98
testl %eax, %eax
jne 0x3f45
movq 0x10(%r13), %rcx
movq 0x8(%rcx), %rdi
cmpl $0x0, (%rdi)
je 0x3f16
cmpl $0x1, %eax
jne 0x3f45
movq 0x10(%r13), %rax
movq 0x8(%rax), %r12
cmpl $0x1, (%r12)
jne 0x3f45
movq %rsi, %rdi
movq %r12, %rsi
callq 0x46dd
testl %eax, %eax
je 0x3f07
jmp 0x3faf
movq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x408b
jmp 0x3f07
movq 0x8(%r13), %rsi
movq %r14, %rdi
movl -0x2c(%rbp), %edx
jmp 0x3f02
movq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x404b
movq 0x10(%r13), %rsi
movq %r14, %rdi
movl -0x2c(%rbp), %r12d
movl %r12d, %edx
callq 0x3d6f
movq 0x18(%r13), %rsi
movq %rax, %rdi
movl %r12d, %edx
callq 0x3d6f
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x3dc4
jmp 0x3f4f
movq %rcx, -0x38(%rbp)
callq 0x462f
testl %eax, %eax
jns 0x3f41
movq -0x38(%rbp), %rdi
movl %r12d, %esi
movl %eax, %r12d
callq 0x4667
movq 0x10(%r13), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x10(%r13)
movl %r12d, %eax
testl %eax, %eax
jle 0x3f07
movq 0x10(%r13), %rax
movq 0x8(%rax), %rdi
jmp 0x3fb2
testq %r14, %r14
je 0x3f82
cmpl %ebx, 0x10(%r14)
jl 0x3f82
movq 0x20(%r14), %r15
testq %r15, %r15
je 0x3f6d
movq 0x28(%r14), %rax
movq %rax, 0x28(%r15)
jmp 0x3f70
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x1030
movq %r15, %r14
testq %r15, %r15
jne 0x3f54
jmp 0x3f85
movq %r14, %r15
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3404
leaq 0x365a(%rip), %rdi      # 0x75fd
movq %rax, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x3fdb
movq %r12, %rdi
callq 0x3404
movq %rax, %rbx
movq 0x8(%r13), %rax
movq 0x8(%rax), %rdi
callq 0x3404
leaq 0x3654(%rip), %rdi      # 0x7622
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10c0
movl $0x1, %edi
callq 0x11c0