// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
leaq -0xb0(%rbp), %rdi
callq 0x2a5c
leaq -0x30(%rbp), %rdi
movl $0x3, %esi
movl $0x3, %edx
callq 0x25b8
leaq -0x70(%rbp), %rdi
movsd 0x57d(%rip), %xmm0      # 0x7008
movl $0x3, %esi
movl $0x3, %edx
callq 0x24fc
leaq -0x90(%rbp), %rdi
movsd 0x75f(%rip), %xmm0      # 0x7208
movl $0x3, %esi
movl $0x4, %edx
callq 0x24fc
leaq -0x1b0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x2e6c
leaq -0x1a8(%rbp), %rdi
callq 0x3d7a
leaq -0x190(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x2d5c
leaq -0x188(%rbp), %rdi
callq 0x3d7a
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x2a6c
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x2b62
leaq -0x48(%rbp), %r14
movq -0x8(%r14), %rax
leaq -0x28(%rbp), %rbx
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e14
movq %r14, %rdi
callq 0x3d7a
leaq -0xc8(%rbp), %rdi
callq 0x3d7a
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x2c3e
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e14
movq %r14, %rdi
callq 0x3d7a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x47a(%rip), %xmm0      # 0x7008
callq 0x2f9c
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e14
movq %r14, %rdi
callq 0x3d7a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x64a(%rip), %xmm0      # 0x7208
callq 0x3024
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e14
movq %r14, %rdi
callq 0x3d7a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x622(%rip), %xmm0      # 0x7210
callq 0x30ac
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e14
movq %r14, %rdi
callq 0x3d7a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x5fa(%rip), %xmm0      # 0x7218
callq 0x3134
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e14
movq %r14, %rdi
callq 0x3d7a
leaq -0x170(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x5cf(%rip), %xmm0      # 0x7220
callq 0x31bc
leaq -0x168(%rbp), %rdi
callq 0x3d7a
leaq -0x150(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x5b3(%rip), %xmm0      # 0x7228
callq 0x3274
leaq -0x148(%rbp), %rdi
callq 0x3d7a
leaq -0x130(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x597(%rip), %xmm0      # 0x7230
callq 0x3218
leaq -0x128(%rbp), %rdi
callq 0x3d7a
leaq -0x110(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x55b(%rip), %xmm0      # 0x7218
callq 0x32d0
leaq -0x108(%rbp), %rdi
callq 0x3d7a
leaq -0x289(%rip), %rdx      # 0x6a4c
leaq -0xf0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3c70
leaq -0xe8(%rbp), %rdi
callq 0x3d7a
leaq -0xb0(%rbp), %rdi
callq 0x3466
movq 0x42d4(%rip), %rdi      # 0xafd8
leaq 0x52d(%rip), %rsi       # 0x7238
movl $0xa, %edx
callq 0x2200
movq 0x42bc(%rip), %rdi      # 0xafd8
leaq -0xb0(%rbp), %rsi
callq 0x3546
movq %rax, %r14
leaq 0x511(%rip), %rsi       # 0x7243
movl $0xa, %edx
movq %rax, %rdi
callq 0x2200
leaq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x3546
movq %rax, %r14
leaq 0x4f9(%rip), %rsi       # 0x724e
movl $0xa, %edx
movq %rax, %rdi
callq 0x2200
leaq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x3546
movq %rax, %r14
leaq 0x4e1(%rip), %rsi       # 0x7259
movl $0xa, %edx
movq %rax, %rdi
callq 0x2200
leaq -0x90(%rbp), %rsi
movq %r14, %rdi
callq 0x3546
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x4213(%rip), %r14      # 0xafd8
leaq 0x498(%rip), %rsi       # 0x7264
movl $0x6, %edx
movq %r14, %rdi
callq 0x2200
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x41e1(%rip), %rdi      # 0xafd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
leaq -0x88(%rbp), %rdi
callq 0x3d7a
leaq -0x68(%rbp), %rdi
callq 0x3d7a
movq %rbx, %rdi
callq 0x3d7a
leaq -0xa8(%rbp), %rdi
callq 0x3d7a
xorl %eax, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x6e4b
jmp 0x6e84
jmp 0x6e4b
jmp 0x6e84
jmp 0x6e4b
jmp 0x6e84
jmp 0x6e4b
jmp 0x6e84
movq %rax, %rbx
movq %r14, %rdi
jmp 0x6e6c
jmp 0x6e84
movq %rax, %rbx
movq %r14, %rdi
callq 0x3d7a
jmp 0x6e65
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x3d7a
jmp 0x6e87
jmp 0x6e84
movq %rax, %rbx
jmp 0x6e93
movq %rax, %rbx
jmp 0x6e9c
movq %rax, %rbx
jmp 0x6ea5
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3d7a
leaq -0x68(%rbp), %rdi
callq 0x3d7a
leaq -0x28(%rbp), %rdi
callq 0x3d7a
leaq -0xa8(%rbp), %rdi
callq 0x3d7a
movq %rbx, %rdi
callq 0x22c0