// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x2
popq %rsi
callq 0xe61c
movq %rax, %rbx
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x3710(%rip), %rsi      # 0x184b6
movq %rax, %rdi
callq 0xdf60
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x36cd(%rip), %rsi      # 0x18498
movq %rax, %rdi
callq 0xdf60
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x3614(%rip), %rsi      # 0x18404
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r13
leaq 0x3162(%rip), %rsi      # 0x17f6c
movq %rax, %rdi
callq 0xe1b2
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r13
leaq 0x3133(%rip), %rsi      # 0x17f64
movq %rax, %rdi
callq 0xe1b2
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x365a(%rip), %rsi      # 0x184bd
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r13
leaq 0x30e7(%rip), %rsi      # 0x17f64
movq %rax, %rdi
callq 0xe1b2
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r13
movq 0x20(%r15), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
callq 0xf264
movq %r13, %rdi
movl %eax, %esi
callq 0xe17c
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x3520(%rip), %rsi      # 0x18404
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r13
leaq 0x306a(%rip), %rsi      # 0x17f68
movq %rax, %rdi
callq 0xe1b2
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r13
leaq 0x303f(%rip), %rsi      # 0x17f64
movq %rax, %rdi
callq 0xe1b2
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd750
movl $0x1, 0x38(%r14)
movq 0x20(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *(%rax)
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r15
leaq 0x3499(%rip), %rsi      # 0x18404
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x2fdf(%rip), %rsi      # 0x17f64
movq %rax, %rdi
callq 0xe1b2
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x20(%rax)
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r12
movq 0x20(%r14), %rdi
callq 0xfa1e
movq %r12, %rdi
movq %rax, %rsi
callq 0xe1b2
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r14
leaq 0x3423(%rip), %rsi      # 0x18404
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r15
leaq 0x2f9f(%rip), %rsi      # 0x17f9a
movq %rax, %rdi
callq 0xe1b2
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %r15
movq %rax, %rdi
callq 0xe234
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x2f38(%rip), %rsi      # 0x17f6c
movq %rax, %rdi
callq 0xe1b2
movq %r15, %rdi
movq %r12, %rsi
callq 0xe288
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r12
pushq $0x8
popq %rsi
movq %rax, %rdi
callq 0xe17c
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xe24c
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r14
leaq 0x3371(%rip), %rsi      # 0x18404
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r15
leaq 0x30c2(%rip), %rsi      # 0x1816f
movq %rax, %rdi
callq 0xe1b2
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
pushq $0x20
popq %rdi
callq 0x5260
movq %rax, %r15
movq %rax, %rdi
callq 0xe234
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r12
leaq 0x2e86(%rip), %rsi      # 0x17f6c
movq %rax, %rdi
callq 0xe1b2
movq %r15, %rdi
movq %r12, %rsi
callq 0xe288
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r12
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0xe17c
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xe24c
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r14
leaq 0x338c(%rip), %rsi      # 0x184d1
movq %rax, %rdi
callq 0xdf60
pushq $0x10
popq %rdi
callq 0x5260
movq %rax, %r15
leaq 0x2e09(%rip), %rsi      # 0x17f68
movq %rax, %rdi
callq 0xe1b2
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd750
pushq $0x28
popq %rdi
callq 0x5260
movq %rax, %r14
leaq 0x334c(%rip), %rsi      # 0x184dc
movq %rax, %rdi
callq 0xdf60
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd750
jmp 0x151ce
jmp 0x151c7
jmp 0x151ce
jmp 0x151ff
jmp 0x151ff
jmp 0x151c0
jmp 0x151c7
jmp 0x151ce
jmp 0x151ff
jmp 0x151ff
movq %rax, %rbx
pushq $0x20
jmp 0x151e0
movq %rax, %rbx
pushq $0x10
jmp 0x151e0
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r14, %rdi
jmp 0x15213
jmp 0x151ff
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
jmp 0x15213
jmp 0x1520a
jmp 0x1520a
jmp 0x151f8
jmp 0x1520a
jmp 0x151f8
jmp 0x1520a
jmp 0x1520a
jmp 0x151f8
jmp 0x151f8
movq %rax, %rbx
pushq $0x28
jmp 0x15204
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r12, %rdi
jmp 0x15213
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r13, %rdi
callq 0x5270
movq %rbx, %rdi
callq 0x5420