// File: /workspace/github_cpp_makefile_star2_O2/Krymancer[P]Matrix-cpp/src/main.cpp
// Function: main
int main() {
    Matrix a;           //Empty matrix, no data (maybe can resize in futere verions?)
    Matrix b(3, 3);     //A 3x3 Matrix with 0 as a inital value
    Matrix c(3, 3, 1);  // A 3x3 Matrix with 1 as initial value
    Matrix d(3, 4, 5);  // A 4x3 Matrix with 5 as inital value

    b *= c;         // Mutiply two Matrixes (mutiple matrix not suported yet ex: b *= c + c)
    c += b;         //  Sum two Matrixes (mutiple matrix not suported yet ex: c += c + c)
    b = c + b - c;  // Atribuition works (not mix +/- with *);
    b = c * d;      // For now i dont recomend make mutiple operations with mutiplication in the same statement

    //Scalar operations

    b = b + 1;
    b = b - 5;
    b = b * 10;
    b = b / 2;

    b += 3;
    b *= 0.5;
    b -= 4;
    b /= 2;

    b.map(idenity); // Map apply a function in each element of the Matrix

    a.print();  // is equivalent a std::cout << a;

    std::cout
        << "Matrix A:\n"
        << a
        << "Matrix B:\n"
        << b
        << "Matrix C:\n"
        << c
        << "Matrix D:\n"
        << d
        << std::endl;

    std::cout << "[PASS]" << std::endl;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
leaq -0xa8(%rbp), %rdi
callq 0x28fa
leaq -0x48(%rbp), %rdi
pushq $0x3
popq %rdx
movl %edx, %esi
callq 0x252c
leaq -0x68(%rbp), %rdi
pushq $0x3
popq %rdx
movsd 0x911(%rip), %xmm0      # 0x7008
movl %edx, %esi
callq 0x248c
leaq -0x88(%rbp), %rdi
pushq $0x3
popq %rsi
pushq $0x4
popq %rdx
movsd 0xae5(%rip), %xmm0      # 0x71f8
callq 0x248c
leaq -0x1a8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x2ca8
leaq -0x1a0(%rbp), %rdi
callq 0x3978
leaq -0x188(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x2bb4
leaq -0x180(%rbp), %rdi
callq 0x3978
leaq -0xc8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x290a
leaq -0x28(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x29f4
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3aba
leaq -0x20(%rbp), %rdi
callq 0x3978
leaq -0xc0(%rbp), %rdi
callq 0x3978
leaq -0x28(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x2ac4
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3aba
leaq -0x20(%rbp), %rdi
callq 0x3978
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x82c(%rip), %xmm0      # 0x7008
callq 0x2da2
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3aba
leaq -0x20(%rbp), %rdi
callq 0x3978
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x9f1(%rip), %xmm0      # 0x71f8
callq 0x2e1e
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3aba
leaq -0x20(%rbp), %rdi
callq 0x3978
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x9ce(%rip), %xmm0      # 0x7200
callq 0x2e9a
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3aba
leaq -0x20(%rbp), %rdi
callq 0x3978
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x9ab(%rip), %xmm0      # 0x7208
callq 0x2f16
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3aba
leaq -0x20(%rbp), %rdi
callq 0x3978
leaq -0x168(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x985(%rip), %xmm0      # 0x7210
callq 0x2f92
leaq -0x160(%rbp), %rdi
callq 0x3978
leaq -0x148(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x969(%rip), %xmm0      # 0x7218
callq 0x303a
leaq -0x140(%rbp), %rdi
callq 0x3978
leaq -0x128(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x94d(%rip), %xmm0      # 0x7220
callq 0x2fe6
leaq -0x120(%rbp), %rdi
callq 0x3978
leaq -0x108(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movsd 0x911(%rip), %xmm0      # 0x7208
callq 0x308e
leaq -0x100(%rbp), %rdi
callq 0x3978
leaq -0x253(%rip), %rdx      # 0x66bc
leaq -0xe8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3882
leaq -0xe0(%rbp), %rdi
callq 0x3978
leaq -0xa8(%rbp), %rdi
callq 0x31d2
movq 0x469a(%rip), %rdi      # 0xafd8
leaq 0x8e3(%rip), %rsi       # 0x7228
callq 0x21b0
leaq -0xa8(%rbp), %rsi
movq %rax, %rdi
callq 0x327a
leaq 0x8d3(%rip), %rsi       # 0x7233
movq %rax, %rdi
callq 0x21b0
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x327a
leaq 0x8c3(%rip), %rsi       # 0x723e
movq %rax, %rdi
callq 0x21b0
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x327a
leaq 0x8b3(%rip), %rsi       # 0x7249
movq %rax, %rdi
callq 0x21b0
leaq -0x88(%rbp), %rsi
movq %rax, %rdi
callq 0x327a
movq %rax, %rdi
callq 0x20d0
movq 0x461c(%rip), %rdi      # 0xafd8
leaq 0x891(%rip), %rsi       # 0x7254
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
leaq -0x80(%rbp), %rdi
callq 0x3978
leaq -0x60(%rbp), %rdi
callq 0x3978
leaq -0x40(%rbp), %rdi
callq 0x3978
leaq -0xa0(%rbp), %rdi
callq 0x3978
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %rbp
retq
jmp 0x6a13
jmp 0x6a4e
jmp 0x6a13
jmp 0x6a4e
jmp 0x6a13
jmp 0x6a4e
jmp 0x6a13
jmp 0x6a4e
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
jmp 0x6a36
jmp 0x6a4e
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x3978
jmp 0x6a2f
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3978
jmp 0x6a51
jmp 0x6a4e
movq %rax, %rbx
jmp 0x6a5a
movq %rax, %rbx
jmp 0x6a63
movq %rax, %rbx
jmp 0x6a6c
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3978
leaq -0x60(%rbp), %rdi
callq 0x3978
leaq -0x40(%rbp), %rdi
callq 0x3978
leaq -0xa0(%rbp), %rdi
callq 0x3978
movq %rbx, %rdi
callq 0x22c0