// File: /workspace/github_c_makefile_star2_O2/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, %rbx
testq %rsi, %rsi
je 0x396b
movl %edx, %r14d
movq %rsi, %r15
movq %rsi, %r12
movq (%r12), %r12
testq %r12, %r12
je 0x37b4
movq (%r12), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x3688
movq %rax, %rbx
addq $0x8, %r12
jmp 0x3793
leal 0x1(%r14), %eax
movl %eax, -0x2c(%rbp)
movq 0x8(%r15), %r15
testq %r15, %r15
je 0x3964
movq (%r15), %r12
movl (%r12), %eax
cmpq $0x9, %rax
ja 0x37bb
leaq 0x3d28(%rip), %rcx      # 0x7504
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x3a1e
movq 0x10(%r12), %rsi
jmp 0x38af
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x3a5e
movq 0x8(%r12), %rax
movq 0x8(%rax), %rdi
movl 0x4(%rdi), %eax
cmpl $0x1, %eax
je 0x37bb
andl $-0x2, %eax
cmpl $0x2, %eax
je 0x37bb
cmpl $0x1, (%rdi)
je 0x37bb
jmp 0x39ac
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x3f53
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x3a5e
movq 0x8(%r12), %rax
movq 0x10(%r12), %rcx
movq 0x8(%rax), %rsi
movl 0x4(%rsi), %edx
movq 0x8(%rcx), %r13
testl %edx, %edx
jne 0x386a
cmpl $0x0, 0x4(%r13)
je 0x397d
movl (%rsi), %eax
cmpl $0x1, %eax
je 0x3907
movl %edx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
testl %eax, %eax
jne 0x397d
cmpl $0x0, (%r13)
jne 0x397d
movq %r13, %rdi
callq 0x4021
testl %eax, %eax
js 0x3923
je 0x37bb
jmp 0x397d
movq 0x8(%r12), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
callq 0x376d
jmp 0x37bb
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x3a1e
movq 0x10(%r12), %rsi
movq %rbx, %rdi
movl -0x2c(%rbp), %r13d
movl %r13d, %edx
callq 0x376d
movq 0x18(%r12), %rsi
movq %rax, %rdi
movl %r13d, %edx
callq 0x376d
jmp 0x37bb
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x3a5e
jmp 0x37bb
cmpl $0x1, (%r13)
jne 0x397d
movq %rsi, %rdi
movq %r13, %rsi
callq 0x40c0
testl %eax, %eax
je 0x37bb
jmp 0x397d
movq -0x38(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x4056
movq 0x10(%r12), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x10(%r12)
jmp 0x37bb
cmpl %r14d, 0x10(%rbx)
jl 0x396b
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x3959
movq 0x28(%rbx), %rax
movq %rax, 0x28(%r15)
movq %rbx, %rdi
callq 0x1030
movq %r15, %rbx
testq %rbx, %rbx
jne 0x3942
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x2e8c
movq %rax, %rbx
movq 0x8(%r12), %rax
movq 0x8(%rax), %rdi
callq 0x2e8c
leaq 0x3c7d(%rip), %rdi      # 0x761a
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x39c2
callq 0x2e8c
leaq 0x3c3d(%rip), %rdi      # 0x75f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x10c0
pushq $0x1
popq %rdi
callq 0x11c0