// File: /workspace/github_cpp_makefile_star2_O2/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/AST/to_tac.cpp
// Function: AST_conversion::to_tac(Tac*)
opd *AST_conversion::to_tac(Tac* t){
    opd *v = expr->to_tac(t);
    if (0 == v) {
        v = new opd();
    } else if (O_TEMP != v->type) {
        opd *o = new opd();
        t->append_quad(inst::CP, o, v, 0, "la conversión de tipos requiere a juro un temporal");
        v = o;
    }
    if (BOOLEAN == expr->type) {
        t->backpatch(expr->truelist, t->next_instruction() );
        t->append_quad(inst::CP, v, new opd(true), 0, "asignación de valor booleano (true) obtenido al lvalue");
        t->append_quad(inst::GOTO, 0, 0, new opd(t->next_instruction() + 2, O_LABEL), "salto después de asignar el valor booleano");

        t->backpatch( expr->falselist, t->next_instruction() );
        t->append_quad(inst::CP, v, new opd(false), 0, "asignación de valor booleano (false) obtenido al lvalue");
    }
    t->append_quad(inst::CONV, v, v, 0, string("conversión de tipo ") + PRINT_TYPE(original_type) + " a " + PRINT_TYPE(type));
    return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %r14
movq %rdi, %r15
movq 0x50(%rdi), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testq %rax, %rax
je 0xe967
movq %rax, %r12
cmpb $0x1, 0x10(%rax)
jne 0xe97c
movq %r12, %rbx
jmp 0xe9d0
pushq $0x18
popq %rdi
callq 0x62d0
movq %rax, %rbx
movq %rax, %rdi
callq 0x18148
jmp 0xe9d0
pushq $0x18
popq %rdi
callq 0x62d0
movq %rax, %rbx
movq %rax, %rdi
callq 0x18148
leaq 0x15fea(%rip), %rsi     # 0x24980
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6d6c
leaq 0xe8(%rsp), %r9
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x212de
leaq 0xe8(%rsp), %rdi
callq 0x65c8
movq 0x50(%r15), %r12
cmpl $0x6, 0x10(%r12)
jne 0xeb26
addq $0x18, %r12
movq %r14, %rdi
callq 0x2138a
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x21394
pushq $0x18
popq %rdi
callq 0x62d0
movq %rax, %r12
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x1837e
leaq 0x15f9e(%rip), %rsi     # 0x249b4
leaq 0xc8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6d6c
leaq 0xc8(%rsp), %r9
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x212de
leaq 0xc8(%rsp), %rdi
callq 0x65c8
pushq $0x18
popq %rdi
callq 0x62d0
movq %rax, %r12
movq %r14, %rdi
callq 0x2138a
addl $0x2, %eax
pushq $0x6
popq %rdx
movq %r12, %rdi
movl %eax, %esi
callq 0x1815e
leaq 0x15597(%rip), %rsi     # 0x24011
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6d6c
pushq $0x16
popq %rsi
leaq 0xa8(%rsp), %r9
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x212de
leaq 0xa8(%rsp), %rdi
callq 0x65c8
movq 0x50(%r15), %r12
addq $0x30, %r12
movq %r14, %rdi
callq 0x2138a
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x21394
pushq $0x18
popq %rdi
callq 0x62d0
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0x1837e
leaq 0x15f00(%rip), %rsi     # 0x249ec
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6d6c
leaq 0x88(%rsp), %r9
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x212de
leaq 0x88(%rsp), %rdi
callq 0x65c8
leaq 0x15ef8(%rip), %rsi     # 0x24a25
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6d6c
movl 0x48(%r15), %eax
leaq 0x29051(%rip), %r12     # 0x37b98
cmpq $0x7, %rax
jae 0xeb53
movq (%r12,%rax,8), %rdx
jmp 0xeb68
cmpl $0x7, %eax
leaq 0x15f0b(%rip), %rax     # 0x24a68
leaq 0x15f0b(%rip), %rdx     # 0x24a6f
cmoveq %rax, %rdx
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x12447
leaq 0x15ef9(%rip), %rdx     # 0x24a77
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x12447
movl 0x10(%r15), %eax
cmpq $0x7, %rax
jae 0xeb9d
movq (%r12,%rax,8), %rdx
jmp 0xebb2
cmpl $0x7, %eax
leaq 0x15ec1(%rip), %rax     # 0x24a68
leaq 0x15ec1(%rip), %rdx     # 0x24a6f
cmoveq %rax, %rdx
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x12447
pushq $0x6
popq %rsi
leaq 0x68(%rsp), %r9
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x212de
leaq 0x68(%rsp), %rdi
callq 0x65c8
leaq 0x8(%rsp), %rdi
callq 0x65c8
leaq 0x48(%rsp), %rdi
callq 0x65c8
leaq 0x28(%rsp), %rdi
callq 0x65c8
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
jmp 0xec96
jmp 0xec9d
jmp 0xec25
movq %rax, %r14
pushq $0x18
popq %rsi
movq %rbx, %rdi
jmp 0xecab
movq %rax, %r14
leaq 0x88(%rsp), %rdi
jmp 0xec96
jmp 0xec9d
jmp 0xeca2
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
jmp 0xec96
jmp 0xec9d
movq %rax, %r14
leaq 0xc8(%rsp), %rdi
jmp 0xec96
jmp 0xec9d
jmp 0xeca2
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x65c8
jmp 0xec73
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x65c8
jmp 0xec82
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x65c8
jmp 0xec91
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x65c8
jmp 0xecb0
movq %rax, %r14
jmp 0xecb0
movq %rax, %r14
pushq $0x18
popq %rsi
movq %r12, %rdi
callq 0x62e0
movq %r14, %rdi
callq 0x6530