// File: /workspace/github_cpp_makefile_star2_O1/Davidc2525[P]Leaf/compiler/backend/x86_64_linux/generator.cpp
// Function: x86_64_linux_generator_visitor::visit2(LEAF::AST::FloatConst*)
void x86_64_linux_generator_visitor::visit2(FloatConst *number)
{
    UPDATE_STATICS
    if (!number->in_data)
    {
        string *label_data = new string(number->adr_label->c_str());
        label_data->append(" dq ");
        char *chars_val = new char[20];
        sprintf(chars_val, "%.7lf", number->value);
        label_data->append(chars_val);
        assembly->get_program()->section(Sections::data)->add(new RegisterOperand(label_data->c_str()));
        number->in_data = true;
    }

    Section *st = assembly->get_program()->section(Sections::text);
    Section *dt = assembly->get_program()->section(Sections::data);
    Register *current_reg = this->reg;
    this->reg = this->rp->reserve_by_size(128);
    if (this->ax == Load)
    {
        DInstruccion *i = new DInstruccion("movss");
        MemoryOperand *ops = new MemoryOperand();
        RegisterOperand *adr_label = new RegisterOperand(number->adr_label->c_str());
        ops->add_operand(adr_label);
        RegisterOperand *opd = new RegisterOperand(this->reg->getName());
        i->add_operand(opd);
        i->add_operand(ops);
        st->add(i);
    }

    if (this->ax == op_types::Plus)
    {
        DInstruccion *i = new DInstruccion("addss");
        MemoryOperand *ops = new MemoryOperand();
        RegisterOperand *adr_label = new RegisterOperand(number->adr_label->c_str());
        ops->add_operand(adr_label);
        RegisterOperand *opd = new RegisterOperand(this->reg->getName());
        i->add_operand(opd);
        i->add_operand(ops);
        st->add(i);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
incl 0x8(%rdi)
movq %rsi, %r14
cmpb $0x0, 0x30(%rsi)
jne 0x16ea6
movl $0x20, %edi
callq 0x5290
movq %rax, %r15
movq 0x28(%r14), %rax
movq (%rax), %rsi
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0xe90c
leaq 0x4564(%rip), %rsi      # 0x1b39a
movq %r15, %rdi
callq 0x54b0
movl $0x14, %edi
callq 0x5040
movq %rax, %r12
cvtss2sd 0x24(%r14), %xmm0
leaq 0x4547(%rip), %rsi      # 0x1b39f
movq %rax, %rdi
movb $0x1, %al
callq 0x5090
movq %r15, %rdi
movq %r12, %rsi
callq 0x54b0
movq 0x10(%rbx), %rax
movq (%rax), %rdi
xorl %esi, %esi
callq 0x102f0
movq %rax, %r13
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
movq (%r15), %rsi
movq %rax, %rdi
callq 0xfe4e
movq %r13, %rdi
movq %r12, %rsi
callq 0xf258
movb $0x1, 0x30(%r14)
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movl $0x2, %esi
callq 0x102f0
movq %rax, %r15
movq 0x10(%rbx), %rax
movq (%rax), %rdi
xorl %esi, %esi
callq 0x102f0
movq 0x30(%rbx), %rdi
movq (%rdi), %rax
movl $0x80, %esi
callq *0x78(%rax)
movq %rax, 0x20(%rbx)
cmpl $0x1, 0x38(%rbx)
jne 0x16f83
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x449b(%rip), %rsi      # 0x1b394
movq %rax, %rdi
callq 0xfc18
movl $0x20, %edi
callq 0x5290
movq %rax, %r13
movq %rax, %rdi
callq 0xfed4
movl $0x10, %edi
callq 0x5290
movq %rax, %rbp
movq 0x28(%r14), %rax
movq (%rax), %rsi
movq %rbp, %rdi
callq 0xfe4e
movq %r13, %rdi
movq %rbp, %rsi
callq 0xff2c
movl $0x10, %edi
callq 0x5290
movq %rax, %rbp
movq 0x20(%rbx), %rdi
callq 0x1196c
movq %rbp, %rdi
movq %rax, %rsi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %rbp, %rsi
callq *0x20(%rax)
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0xf258
cmpl $0x2, 0x38(%rbx)
jne 0x1702b
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x4404(%rip), %rsi      # 0x1b3a5
movq %rax, %rdi
callq 0xfc18
movl $0x20, %edi
callq 0x5290
movq %rax, %r13
movq %rax, %rdi
callq 0xfed4
movl $0x10, %edi
callq 0x5290
movq %rax, %rbp
movq 0x28(%r14), %rax
movq (%rax), %rsi
movq %rbp, %rdi
callq 0xfe4e
movq %r13, %rdi
movq %rbp, %rsi
callq 0xff2c
movl $0x10, %edi
callq 0x5290
movq %rax, %r14
movq 0x20(%rbx), %rdi
callq 0x1196c
movq %r14, %rdi
movq %rax, %rsi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
callq *0x20(%rax)
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0xf258
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17080
jmp 0x17042
jmp 0x1704f
jmp 0x17080
movq %rax, %rbx
movl $0x20, %esi
movq %r13, %rdi
jmp 0x1708b
movq %rax, %rbx
movl $0x28, %esi
jmp 0x17061
movq %rax, %rbx
movl $0x10, %esi
movq %r12, %rdi
jmp 0x1708b
movq %rax, %rbx
movl $0x20, %esi
movq %r15, %rdi
jmp 0x1708b
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
jmp 0x1708b
movq %rax, %rbx
movl $0x10, %esi
movq %rbp, %rdi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470