// File: /workspace/github_cpp_makefile_star2_O1/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 0x5bd(%rip), %xmm0      # 0x7008
movl $0x3, %esi
movl $0x3, %edx
callq 0x24fc
leaq -0x90(%rbp), %rdi
movsd 0x79f(%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 0x3d9a
leaq -0x190(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x2d5c
leaq -0x188(%rbp), %rdi
callq 0x3d9a
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 0x3e2e
movq %r14, %rdi
callq 0x3d9a
leaq -0xc8(%rbp), %rdi
callq 0x3d9a
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 0x3e2e
movq %r14, %rdi
callq 0x3d9a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x4ba(%rip), %xmm0      # 0x7008
callq 0x2f9c
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e2e
movq %r14, %rdi
callq 0x3d9a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x68a(%rip), %xmm0      # 0x7208
callq 0x3024
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e2e
movq %r14, %rdi
callq 0x3d9a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x662(%rip), %xmm0      # 0x7210
callq 0x30ac
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e2e
movq %r14, %rdi
callq 0x3d9a
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x63a(%rip), %xmm0      # 0x7218
callq 0x3134
movq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e2e
movq %r14, %rdi
callq 0x3d9a
leaq -0x170(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x60f(%rip), %xmm0      # 0x7220
callq 0x31bc
leaq -0x168(%rbp), %rdi
callq 0x3d9a
leaq -0x150(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x5f3(%rip), %xmm0      # 0x7228
callq 0x3274
leaq -0x148(%rbp), %rdi
callq 0x3d9a
leaq -0x130(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x5d7(%rip), %xmm0      # 0x7230
callq 0x3218
leaq -0x128(%rbp), %rdi
callq 0x3d9a
leaq -0x110(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movsd 0x59b(%rip), %xmm0      # 0x7218
callq 0x32d0
leaq -0x108(%rbp), %rdi
callq 0x3d9a
leaq -0x289(%rip), %rdx      # 0x6a0c
leaq -0xf0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3c92
leaq -0xe8(%rbp), %rdi
callq 0x3d9a
leaq -0xb0(%rbp), %rdi
callq 0x3464
movq 0x4314(%rip), %rdi      # 0xafd8
leaq 0x56d(%rip), %rsi       # 0x7238
movl $0xa, %edx
callq 0x2200
movq 0x42fc(%rip), %rdi      # 0xafd8
leaq -0xb0(%rbp), %rsi
callq 0x3544
movq %rax, %r14
leaq 0x551(%rip), %rsi       # 0x7243
movl $0xa, %edx
movq %rax, %rdi
callq 0x2200
leaq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x3544
movq %rax, %r14
leaq 0x539(%rip), %rsi       # 0x724e
movl $0xa, %edx
movq %rax, %rdi
callq 0x2200
leaq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x3544
movq %rax, %r14
leaq 0x521(%rip), %rsi       # 0x7259
movl $0xa, %edx
movq %rax, %rdi
callq 0x2200
leaq -0x90(%rbp), %rsi
movq %r14, %rdi
callq 0x3544
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 0x4253(%rip), %r14      # 0xafd8
leaq 0x4d8(%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 0x4221(%rip), %rdi      # 0xafd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
leaq -0x88(%rbp), %rdi
callq 0x3d9a
leaq -0x68(%rbp), %rdi
callq 0x3d9a
movq %rbx, %rdi
callq 0x3d9a
leaq -0xa8(%rbp), %rdi
callq 0x3d9a
xorl %eax, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x6e0b
jmp 0x6e44
jmp 0x6e0b
jmp 0x6e44
jmp 0x6e0b
jmp 0x6e44
jmp 0x6e0b
jmp 0x6e44
movq %rax, %rbx
movq %r14, %rdi
jmp 0x6e2c
jmp 0x6e44
movq %rax, %rbx
movq %r14, %rdi
callq 0x3d9a
jmp 0x6e25
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x3d9a
jmp 0x6e47
jmp 0x6e44
movq %rax, %rbx
jmp 0x6e53
movq %rax, %rbx
jmp 0x6e5c
movq %rax, %rbx
jmp 0x6e65
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3d9a
leaq -0x68(%rbp), %rdi
callq 0x3d9a
leaq -0x28(%rbp), %rdi
callq 0x3d9a
leaq -0xa8(%rbp), %rdi
callq 0x3d9a
movq %rbx, %rdi
callq 0x22c0