// File: /workspace/github_cpp_makefile_star2_O1/Davidc2525[P]Leaf/compiler/backend/x86_64_linux/generator.cpp
// Function: x86_64_linux_generator_visitor::visit(LEAF::AST::ThrowStatementNode*)
void x86_64_linux_generator_visitor::visit(ThrowStatementNode *_t_)
{
    UPDATE_STATICS
    Section *st = assembly->get_program()->section(Sections::text);
    DInstruccion *i = new DInstruccion(";throw");
    st->add(i);

    i = new DInstruccion("_pop_");
    st->add(i);

    i = new DInstruccion("mov");
    i->add_operand(new RegisterOperand("rcx"));
    i->add_operand(new RegisterOperand("rax"));
    st->add(i);

    i = new DInstruccion("list_find_h_by_type");
    i->add_operand(new RegisterOperand("rax"));
    i->add_operand(new InmediateIntOperand(symbol_table::get_id(_t_->child->obj->type, 0)));
    st->add(i);

    i = new DInstruccion("mov");
    i->add_operand(new RegisterOperand("rbx"));
    i->add_operand(new RegisterOperand("rax"));
    st->add(i);

    ax = Load;
    _t_->child->accept(this);
    ;

    i = new DInstruccion("mov");
    i->add_operand(new RegisterOperand("rax"));
    i->add_operand(new RegisterOperand(reg->getName()));
    st->add(i);

    i = new DInstruccion("mov");
    i->add_operand(new RegisterOperand("rbp"));
    MemoryOperand *m = new MemoryOperand();
    m->add_operand(new RegisterOperand("rcx"));
    m->add_operand(load_mod::add, new InmediateIntOperand(8));
    i->add_operand(m);
    st->add(i);

    i = new DInstruccion("mov");
    i->add_operand(new RegisterOperand("rsp"));
    m = new MemoryOperand();
    m->add_operand(new RegisterOperand("rcx"));
    m->add_operand(load_mod::add, new InmediateIntOperand(16));
    i->add_operand(m);
    st->add(i);

    i = new DInstruccion("J_H_RUTINE");
    i->add_operand(new RegisterOperand("rbx"));
    //i->add_operand(new RegisterOperand("rcx"));
    st->add(i);

    i = new DInstruccion(";end throw");
    st->add(i);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
incl 0x8(%rdi)
movq %rsi, %r15
movq 0x10(%rdi), %rax
movq (%rax), %rdi
movl $0x2, %esi
callq 0x102f0
movq %rax, %rbx
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3ab6(%rip), %rsi      # 0x1b436
movq %rax, %rdi
callq 0xfc18
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3a71(%rip), %rsi      # 0x1b418
movq %rax, %rdi
callq 0xfc18
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x39b6(%rip), %rsi      # 0x1b384
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x3502(%rip), %rsi      # 0x1aeec
movq %rax, %rdi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x34d1(%rip), %rsi      # 0x1aee4
movq %rax, %rdi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x39f6(%rip), %rsi      # 0x1b43d
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x3481(%rip), %rsi      # 0x1aee4
movq %rax, %rdi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
movq 0x20(%r15), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
callq 0x10fac
movq %r13, %rdi
movl %eax, %esi
callq 0xfe14
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x38b6(%rip), %rsi      # 0x1b384
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x33fe(%rip), %rsi      # 0x1aee8
movq %rax, %rdi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x33d1(%rip), %rsi      # 0x1aee4
movq %rax, %rdi
callq 0xfe4e
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf258
movl $0x1, 0x38(%r14)
movq 0x20(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *(%rax)
movl $0x28, %edi
callq 0x5290
movq %rax, %r15
leaq 0x3829(%rip), %rsi      # 0x1b384
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
leaq 0x336d(%rip), %rsi      # 0x1aee4
movq %rax, %rdi
callq 0xfe4e
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x20(%rax)
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
movq 0x20(%r14), %rdi
callq 0x1196c
movq %r12, %rdi
movq %rax, %rsi
callq 0xfe4e
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x37ad(%rip), %rsi      # 0x1b384
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r15
leaq 0x3327(%rip), %rsi      # 0x1af1a
movq %rax, %rdi
callq 0xfe4e
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movl $0x20, %edi
callq 0x5290
movq %rax, %r15
movq %rax, %rdi
callq 0xfed4
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
leaq 0x32bc(%rip), %rsi      # 0x1aeec
movq %rax, %rdi
callq 0xfe4e
movq %r15, %rdi
movq %r12, %rsi
callq 0xff2c
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
movq %rax, %rdi
movl $0x8, %esi
callq 0xfe14
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xfeee
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x36ef(%rip), %rsi      # 0x1b384
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r15
leaq 0x343e(%rip), %rsi      # 0x1b0ef
movq %rax, %rdi
callq 0xfe4e
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movl $0x20, %edi
callq 0x5290
movq %rax, %r15
movq %rax, %rdi
callq 0xfed4
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
leaq 0x31fe(%rip), %rsi      # 0x1aeec
movq %rax, %rdi
callq 0xfe4e
movq %r15, %rdi
movq %r12, %rsi
callq 0xff2c
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
movq %rax, %rdi
movl $0x10, %esi
callq 0xfe14
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xfeee
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x36fe(%rip), %rsi      # 0x1b451
movq %rax, %rdi
callq 0xfc18
movl $0x10, %edi
callq 0x5290
movq %rax, %r15
leaq 0x3179(%rip), %rsi      # 0x1aee8
movq %rax, %rdi
callq 0xfe4e
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf258
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x36ba(%rip), %rsi      # 0x1b45c
movq %rax, %rdi
callq 0xfc18
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf258
jmp 0x17de6
jmp 0x17ddc
jmp 0x17de6
jmp 0x17e1e
jmp 0x17e1e
jmp 0x17dd2
jmp 0x17ddc
jmp 0x17de6
jmp 0x17e1e
jmp 0x17e1e
movq %rax, %rbx
movl $0x20, %esi
jmp 0x17dfd
movq %rax, %rbx
movl $0x10, %esi
jmp 0x17dfd
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
jmp 0x17e36
jmp 0x17e1e
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
jmp 0x17e36
jmp 0x17e2b
jmp 0x17e2b
jmp 0x17e14
jmp 0x17e2b
jmp 0x17e14
jmp 0x17e2b
jmp 0x17e2b
jmp 0x17e14
jmp 0x17e14
movq %rax, %rbx
movl $0x28, %esi
jmp 0x17e26
movq %rax, %rbx
movl $0x10, %esi
movq %r12, %rdi
jmp 0x17e36
movq %rax, %rbx
movl $0x10, %esi
movq %r13, %rdi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470
nop