// File: /workspace/github_cpp_makefile_star2_O1/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/AST/to_tac.cpp
// Function: AST_function::to_tac(Tac*)
void AST_function::to_tac(Tac* t){
    
    func_to_prologue[func->getName()] = t->next_instruction();
    t->append_quad(inst::PROLOGUE,  0, 0, new opd(func),
                            "prologo de funcion " + func->getName()
                  );
    
    instructions->to_tac(t);
    
    t->backpatch( instructions->next_list, t->next_instruction() );
    t->backpatch( instructions->return_list, t->next_instruction() );
    
    func_to_epilogue[func->getName()] = t->next_instruction();
    t->append_quad(inst::EPILOGUE,  0, 0, new opd(func),
                            "epilogo de funcion " + func->getName()
                  );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2af04
movl %eax, %ebp
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x17fb8
leaq 0x2bbdb(%rip), %rdi     # 0x3e310
movq %r15, %rsi
callq 0x168a6
movl %ebp, (%rax)
leaq 0x18(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x1275a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62f0
movl $0x18, %edi
callq 0x62e0
movq %rax, %r15
movq 0x98(%r14), %rsi
movq %rax, %rdi
callq 0x1cfac
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x17fb8
leaq 0x1b53a(%rip), %rcx     # 0x2dccb
movl $0x13, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6350
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x127cb
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x127d3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %r9
movq %rdx, 0x8(%r9)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x2ae24
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1281a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x62f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12831
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62f0
movq 0xa8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
movq 0xa8(%r14), %r15
addq $0x18, %r15
movq %rbx, %rdi
callq 0x2af04
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x2af0e
movq 0xa8(%r14), %r15
addq $0x60, %r15
movq %rbx, %rdi
callq 0x2af04
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x2af0e
movq %rbx, %rdi
callq 0x2af04
movl %eax, %ebp
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x17fb8
leaq 0x2ba9a(%rip), %rdi     # 0x3e340
movq %r15, %rsi
callq 0x168a6
movl %ebp, (%rax)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x128c7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62f0
movl $0x18, %edi
callq 0x62e0
movq %rax, %r15
movq 0x98(%r14), %rsi
movq %rax, %rdi
callq 0x1cfac
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x17fb8
leaq 0x1b3e1(%rip), %rcx     # 0x2dcdf
movl $0x13, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6350
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x12937
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1293e
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %r9
movq %rdx, 0x8(%r9)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movl $0xf, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x2ae24
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x12985
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x62f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1299c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62f0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x129e4
movq 0x38(%rsp), %rsi
jmp 0x129d7
jmp 0x129e1
jmp 0x129f8
jmp 0x129e1
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x129e4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x62f0
jmp 0x129e4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12a08
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x12a03
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0x62f0
movq %rbx, %rdi
callq 0x6550
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x129ee
jmp 0x12a08
nop