// File: /workspace/github_cpp_makefile_star2_O3/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 0x10346
movq %rax, %rbx
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3d20(%rip), %rsi      # 0x1b496
movq %rax, %rdi
callq 0xfc44
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3cdb(%rip), %rsi      # 0x1b478
movq %rax, %rdi
callq 0xfc44
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3c20(%rip), %rsi      # 0x1b3e4
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x376c(%rip), %rsi      # 0x1af4c
movq %rax, %rdi
callq 0xfe82
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x373b(%rip), %rsi      # 0x1af44
movq %rax, %rdi
callq 0xfe82
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3c60(%rip), %rsi      # 0x1b49d
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x36eb(%rip), %rsi      # 0x1af44
movq %rax, %rdi
callq 0xfe82
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 0x10f8c
movq %r13, %rdi
movl %eax, %esi
callq 0xfe48
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3b20(%rip), %rsi      # 0x1b3e4
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x3668(%rip), %rsi      # 0x1af48
movq %rax, %rdi
callq 0xfe82
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movl $0x10, %edi
callq 0x5290
movq %rax, %r13
leaq 0x363b(%rip), %rsi      # 0x1af44
movq %rax, %rdi
callq 0xfe82
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf294
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 0x3a93(%rip), %rsi      # 0x1b3e4
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
leaq 0x35d7(%rip), %rsi      # 0x1af44
movq %rax, %rdi
callq 0xfe82
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 0x118ec
movq %r12, %rdi
movq %rax, %rsi
callq 0xfe82
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x3a17(%rip), %rsi      # 0x1b3e4
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r15
leaq 0x3591(%rip), %rsi      # 0x1af7a
movq %rax, %rdi
callq 0xfe82
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movl $0x20, %edi
callq 0x5290
movq %rax, %r15
movq %rax, %rdi
callq 0xff08
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3526(%rip), %rsi      # 0x1af4c
movq %rax, %rdi
callq 0xfe82
movq %r15, %rdi
movq %r12, %rsi
callq 0xff60
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
movq %rax, %rdi
movl $0x8, %esi
callq 0xfe48
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xff22
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x3959(%rip), %rsi      # 0x1b3e4
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r15
leaq 0x36a8(%rip), %rsi      # 0x1b14f
movq %rax, %rdi
callq 0xfe82
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movl $0x20, %edi
callq 0x5290
movq %rax, %r15
movq %rax, %rdi
callq 0xff08
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
leaq 0x3468(%rip), %rsi      # 0x1af4c
movq %rax, %rdi
callq 0xfe82
movq %r15, %rdi
movq %r12, %rsi
callq 0xff60
movl $0x10, %edi
callq 0x5290
movq %rax, %r12
movq %rax, %rdi
movl $0x10, %esi
callq 0xfe48
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xff22
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x3968(%rip), %rsi      # 0x1b4b1
movq %rax, %rdi
callq 0xfc44
movl $0x10, %edi
callq 0x5290
movq %rax, %r15
leaq 0x33e3(%rip), %rsi      # 0x1af48
movq %rax, %rdi
callq 0xfe82
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf294
movl $0x28, %edi
callq 0x5290
movq %rax, %r14
leaq 0x3924(%rip), %rsi      # 0x1b4bc
movq %rax, %rdi
callq 0xfc44
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf294
jmp 0x17bdc
jmp 0x17bd2
jmp 0x17bdc
jmp 0x17c14
jmp 0x17c14
jmp 0x17bc8
jmp 0x17bd2
jmp 0x17bdc
jmp 0x17c14
jmp 0x17c14
movq %rax, %rbx
movl $0x20, %esi
jmp 0x17bf3
movq %rax, %rbx
movl $0x10, %esi
jmp 0x17bf3
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
jmp 0x17c2c
jmp 0x17c14
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
jmp 0x17c2c
jmp 0x17c21
jmp 0x17c21
jmp 0x17c0a
jmp 0x17c21
jmp 0x17c0a
jmp 0x17c21
jmp 0x17c21
jmp 0x17c0a
jmp 0x17c0a
movq %rax, %rbx
movl $0x28, %esi
jmp 0x17c1c
movq %rax, %rbx
movl $0x10, %esi
movq %r12, %rdi
jmp 0x17c2c
movq %rax, %rbx
movl $0x10, %esi
movq %r13, %rdi
callq 0x52a0
movq %rbx, %rdi
callq 0x5470
nop