// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b316
movl %eax, %ebp
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x17ff4
leaq 0x2cb75(%rip), %rdi     # 0x3f318
movq %r15, %rsi
callq 0x168c4
movl %ebp, (%rax)
leaq 0x18(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x127c8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
movl $0x18, %edi
callq 0x62f0
movq %rax, %r15
movq 0x98(%r14), %rsi
movq %rax, %rdi
callq 0x1d00c
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x17ff4
leaq 0x1c4cc(%rip), %rcx     # 0x2eccb
movl $0x13, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6360
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x12839
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x12841
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 0x2b238
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x12888
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1289f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0xa8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
movq 0xa8(%r14), %r15
addq $0x18, %r15
movq %rbx, %rdi
callq 0x2b316
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x2b320
movq 0xa8(%r14), %r15
addq $0x60, %r15
movq %rbx, %rdi
callq 0x2b316
movq %rbx, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x2b320
movq %rbx, %rdi
callq 0x2b316
movl %eax, %ebp
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x17ff4
leaq 0x2ca34(%rip), %rdi     # 0x3f348
movq %r15, %rsi
callq 0x168c4
movl %ebp, (%rax)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12935
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
movl $0x18, %edi
callq 0x62f0
movq %rax, %r15
movq 0x98(%r14), %rsi
movq %rax, %rdi
callq 0x1d00c
movq 0x98(%r14), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x17ff4
leaq 0x1c373(%rip), %rcx     # 0x2ecdf
movl $0x13, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6360
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x129a5
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x129ac
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 0x2b238
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x129f3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12a0a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
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 0x12a52
movq 0x38(%rsp), %rsi
jmp 0x12a45
jmp 0x12a4f
jmp 0x12a66
jmp 0x12a4f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x12a52
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6300
jmp 0x12a52
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12a76
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x12a71
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0x6300
movq %rbx, %rdi
callq 0x6560
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x12a5c
jmp 0x12a76
nop