// File: /workspace/github_cpp_makefile_star2_O2/aronszanto[P]strassen/main.cpp
// Function: main
int main(int argc, char *argv[]){
    convThreshold = 32;
    threadThresh = 512;
    if (argc == 2){
        switch (stoi(argv[1])){
            case 1:
                testStrasMult();
                return 0;
            case 2:
                testConvMult();
                return 0;
            case 3:
                testfindOptDim();
                return 0;
            case 4:
                testInitPadding();
                return 0;
            case 5:
                testRandMatrix();
                return 0;
            case 6:
                testPowers2();
                return 0;
            case 7:
                findOptimalThreadThresh();
                return 0;
            case 8:
                findOptimalconvThreshold();
                return 0;
            default:
                return -1;
        }
        return 0;

    }
    else if (argc == 3 && stoi(argv[1]) == 9){
        cout << timeRandMult(stoi(argv[2]));
    }
    else if (argc != 4)
        std::cout<<"Incorrect numargs, proper: \'0 dimension inputfile\'";
    else if (stoi(argv[1]) == 0)
    {
        int dimension = atoi(argv[2]);
        char* inputfile = argv[3];

    

        Matrix* A = FileToMatrix(inputfile, dimension, 0);
        Matrix* B = FileToMatrix(inputfile, dimension, 0);

        Matrix* C = multiply(A,B);

        printDiagonal(C, dimension);
        return 0;
    }
    
    else return -1;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl $0x20, 0x8abf(%rip)     # 0xf170
movl $0x200, 0x8ab1(%rip)    # imm = 0x200
cmpl $0x4, %edi
je 0x67b0
cmpl $0x3, %edi
je 0x6725
cmpl $0x2, %edi
jne 0x6799
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x71a0
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x20c0
decl %ebx
cmpl $0x7, %ebx
ja 0x67e2
leaq 0x29ee(%rip), %rax      # 0x9100
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
callq 0x408d
jmp 0x67ac
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x71a0
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x20c0
cmpl $0x9, %ebp
jne 0x6799
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x71a0
movl %eax, %edi
callq 0x3a69
movq 0x8848(%rip), %rdi      # 0xefd0
callq 0x2200
leaq 0x8(%rsp), %rdi
callq 0x20c0
jmp 0x67ac
movq 0x8830(%rip), %rdi      # 0xefd0
leaq 0x341e(%rip), %rsi      # 0x9bc5
callq 0x2180
xorl %ebx, %ebx
jmp 0x6828
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20a0
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x71a0
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x20c0
testl %ebp, %ebp
je 0x67e7
pushq $-0x1
popq %rbx
jmp 0x6828
movq 0x10(%rbx), %rdi
callq 0x21f0
movl %eax, %ebp
movq 0x18(%rbx), %r14
xorl %ebx, %ebx
movq %r14, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x64f9
movq %rax, %r15
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x64f9
movq %r15, %rdi
movq %rax, %rsi
callq 0x3762
movq %rax, %rdi
movl %ebp, %esi
callq 0x664a
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x3be5
jmp 0x67ac
callq 0x605b
jmp 0x67ac
callq 0x6111
jmp 0x67ac
callq 0x38e7
jmp 0x67ac
callq 0x3c56
jmp 0x67ac
callq 0x6380
jmp 0x67ac
callq 0x3b4e
jmp 0x67ac
jmp 0x6887
jmp 0x688c
jmp 0x688c
jmp 0x688c
jmp 0x6887
jmp 0x6887
movq %rax, %rbx
jmp 0x6899
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2270
nop