// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
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 0x116fd
movq %rax, %r12
cmpb $0x1, 0x10(%rax)
jne 0x11714
movq %r12, %rbx
jmp 0x11786
movl $0x18, %edi
callq 0x62f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x1d014
jmp 0x11786
movl $0x18, %edi
callq 0x62f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x1d014
leaq 0xf8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1d244(%rip), %rsi     # 0x2e980
leaq 0x1d270(%rip), %rdx     # 0x2e9b3
leaq 0xe8(%rsp), %r13
movq %r13, %rdi
callq 0x7008
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r13, %r9
callq 0x2b238
movq 0xe8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11786
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x50(%r15), %r12
cmpl $0x6, 0x10(%r12)
jne 0x1193c
addq $0x18, %r12
movq %r14, %rdi
callq 0x2b316
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x2b320
movl $0x18, %edi
callq 0x62f0
movq %rax, %r12
movq %rax, %rdi
movl $0x1, %esi
callq 0x1d3f2
leaq 0xd8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1d1d8(%rip), %rsi     # 0x2e9b4
leaq 0x1d208(%rip), %rdx     # 0x2e9eb
leaq 0xc8(%rsp), %r13
movq %r13, %rdi
callq 0x7008
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r13, %r9
callq 0x2b238
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11826
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x6300
movl $0x18, %edi
callq 0x62f0
movq %rax, %r12
movq %r14, %rdi
callq 0x2b316
addl $0x2, %eax
movq %r12, %rdi
movl %eax, %esi
movl $0x6, %edx
callq 0x1d02a
leaq 0xb8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1c7b1(%rip), %rsi     # 0x2e011
leaq 0x1c7d5(%rip), %rdx     # 0x2e03c
leaq 0xa8(%rsp), %r13
movq %r13, %rdi
callq 0x7008
movq %r14, %rdi
movl $0x16, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
movq %r13, %r9
callq 0x2b238
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x118ab
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x50(%r15), %r12
addq $0x30, %r12
movq %r14, %rdi
callq 0x2b316
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x2b320
movl $0x18, %edi
callq 0x62f0
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0x1d3f2
leaq 0x98(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1d0fa(%rip), %rsi     # 0x2e9ec
leaq 0x1d12b(%rip), %rdx     # 0x2ea24
leaq 0x88(%rsp), %r13
movq %r13, %rdi
callq 0x7008
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r13, %r9
callq 0x2b238
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1193c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6300
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d0d8(%rip), %rsi     # 0x2ea25
leaq 0x1d0e5(%rip), %rdx     # 0x2ea39
leaq 0x68(%rsp), %rdi
callq 0x7008
movl 0x48(%r15), %eax
cmpq $0x7, %rax
jae 0x11975
leaq 0x2d1e9(%rip), %rcx     # 0x3eb58
movq (%rcx,%rax,8), %rsi
jmp 0x1198a
cmpl $0x7, %eax
leaq 0x1d0e9(%rip), %rax     # 0x2ea68
leaq 0x1d0e9(%rip), %rsi     # 0x2ea6f
cmoveq %rax, %rsi
leaq 0x68(%rsp), %rdi
callq 0x65b0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x119bb
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x119c3
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1d091(%rip), %rsi     # 0x2ea77
callq 0x65b0
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x11a12
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x11a19
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x10(%r15), %eax
cmpq $0x7, %rax
jae 0x11a48
leaq 0x2d116(%rip), %rcx     # 0x3eb58
movq (%rcx,%rax,8), %rsi
jmp 0x11a5d
cmpl $0x7, %eax
leaq 0x1d016(%rip), %rax     # 0x2ea68
leaq 0x1d016(%rip), %rsi     # 0x2ea6f
cmoveq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x65b0
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x11a8e
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x11a95
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %r9
movq %rdx, 0x8(%r9)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
movl $0x6, %esi
movq %rbx, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x2b238
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x11ade
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11af5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x11b0c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6300
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x11b23
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6300
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0xe8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c52
movq 0xf8(%rsp), %rsi
jmp 0x11c38
jmp 0x11b5b
movq %rax, %r14
movl $0x18, %esi
movq %rbx, %rdi
jmp 0x11c4d
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c52
movq 0x98(%rsp), %rsi
jmp 0x11c38
jmp 0x11c42
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c52
movq 0xb8(%rsp), %rsi
jmp 0x11c38
movq %rax, %r14
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c52
movq 0xd8(%rsp), %rsi
jmp 0x11c38
jmp 0x11c42
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x11bf1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6300
jmp 0x11bf1
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11c0d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6300
jmp 0x11c0d
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x11c29
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6300
jmp 0x11c29
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x11c52
movq 0x78(%rsp), %rsi
incq %rsi
jmp 0x11c4d
movq %rax, %r14
jmp 0x11c52
movq %rax, %r14
movl $0x18, %esi
movq %r12, %rdi
callq 0x6300
movq %r14, %rdi
callq 0x6560