// File: aronszanto[P]strassen/main.cpp
// Function: testConvMult()
void testConvMult(){
    Matrix* A = new Matrix();
    initMatrix(A,3);
    Matrix* B = new Matrix();
    initMatrix(B,3);
    Matrix* C = new Matrix();
    initMatrix(C,3);
    Matrix* D = new Matrix();
    initMatrix(D,3);

    A->matrix = {{1, 2, -3}, {1, 3, 0}, {2, -1, 1}};
    B->matrix = {{2, 1, 0}, {-2, -1, 1}, {2, 1, -3}};
    C->matrix = {{-8, -4, 11}, {-4, -2, 3}, {8, 4, -4}};
    
    convMult(A,B,D,0,0,0,0,0,0,3);
 
    assert(isEqual(D, C));
    free(A);
    free(B);
    free(C);
    cout << "all conventional tests pass" << endl;

}

// Assembly:
subq $0x428, %rsp            # imm = 0x428
movl $0x20, %edi
movq %rdi, 0x178(%rsp)
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x160(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x180(%rsp)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xd950
movq 0x160(%rsp), %rax
movq %rax, 0x420(%rsp)
movq 0x420(%rsp), %rdi
movl $0x3, %esi
movl %esi, 0x1a4(%rsp)
callq 0x2440
movq 0x178(%rsp), %rdi
callq 0x2190
movaps 0x180(%rsp), %xmm0
movq %rax, %rdi
movq %rdi, 0x168(%rsp)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xd950
movq 0x168(%rsp), %rax
movl 0x1a4(%rsp), %esi
movq %rax, 0x418(%rsp)
movq 0x418(%rsp), %rdi
callq 0x2440
movq 0x178(%rsp), %rdi
callq 0x2190
movaps 0x180(%rsp), %xmm0
movq %rax, %rdi
movq %rdi, 0x170(%rsp)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xd950
movq 0x170(%rsp), %rax
movl 0x1a4(%rsp), %esi
movq %rax, 0x410(%rsp)
movq 0x410(%rsp), %rdi
callq 0x2440
movq 0x178(%rsp), %rdi
callq 0x2190
movaps 0x180(%rsp), %xmm0
movq %rax, %rdi
movq %rdi, 0x198(%rsp)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xd950
movq 0x198(%rsp), %rax
movl 0x1a4(%rsp), %esi
movq %rax, 0x408(%rsp)
movq 0x408(%rsp), %rdi
callq 0x2440
movb $0x1, 0x33a(%rsp)
leaq 0x3b0(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq %rax, 0x3a8(%rsp)
movl $0x1, 0x38c(%rsp)
movl $0x2, 0x390(%rsp)
movl $0xfffffffd, 0x394(%rsp) # imm = 0xFFFFFFFD
leaq 0x38c(%rsp), %rax
movq %rax, 0x398(%rsp)
movq $0x3, 0x3a0(%rsp)
leaq 0x38b(%rsp), %rdi
movq %rdi, 0x1b0(%rsp)
callq 0xeab0
movq 0x1a8(%rsp), %rdi
movq 0x1b0(%rsp), %rcx
movq 0x398(%rsp), %rsi
movq 0x3a0(%rsp), %rdx
callq 0xeac0
jmp 0x5b8d
leaq 0x3c8(%rsp), %rax
movq %rax, 0x150(%rsp)
movq %rax, 0x3a8(%rsp)
movl $0x1, 0x35c(%rsp)
movl $0x3, 0x360(%rsp)
movl $0x0, 0x364(%rsp)
leaq 0x35c(%rsp), %rax
movq %rax, 0x368(%rsp)
movq $0x3, 0x370(%rsp)
leaq 0x35b(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0xeab0
movq 0x150(%rsp), %rdi
movq 0x158(%rsp), %rcx
movq 0x368(%rsp), %rsi
movq 0x370(%rsp), %rdx
callq 0xeac0
jmp 0x5c1e
leaq 0x3e0(%rsp), %rax
movq %rax, 0x140(%rsp)
movq %rax, 0x3a8(%rsp)
movl $0x2, 0x33c(%rsp)
movl $0xffffffff, 0x340(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x344(%rsp)
leaq 0x33c(%rsp), %rax
movq %rax, 0x348(%rsp)
movq $0x3, 0x350(%rsp)
leaq 0x33b(%rsp), %rdi
movq %rdi, 0x148(%rsp)
callq 0xeab0
movq 0x140(%rsp), %rdi
movq 0x148(%rsp), %rcx
movq 0x348(%rsp), %rsi
movq 0x350(%rsp), %rdx
callq 0xeac0
jmp 0x5caf
movb $0x0, 0x33a(%rsp)
leaq 0x3b0(%rsp), %rax
movq %rax, 0x3f8(%rsp)
movq $0x3, 0x400(%rsp)
movq 0x420(%rsp), %rdi
addq $0x8, %rdi
movq 0x3f8(%rsp), %rsi
movq 0x400(%rsp), %rdx
callq 0xeb50
jmp 0x5cf6
leaq 0x3b0(%rsp), %rax
movq %rax, 0x130(%rsp)
addq $0x48, %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x128(%rsp)
callq 0xebb0
movq 0x130(%rsp), %rcx
movq 0x128(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x138(%rsp)
jne 0x5d12
leaq 0x33b(%rsp), %rdi
callq 0xec10
leaq 0x35b(%rsp), %rdi
callq 0xec10
leaq 0x38b(%rsp), %rdi
callq 0xec10
movb $0x1, 0x27a(%rsp)
leaq 0x2e0(%rsp), %rax
movq %rax, 0x118(%rsp)
movq %rax, 0x2d8(%rsp)
movl $0x2, 0x2bc(%rsp)
movl $0x1, 0x2c0(%rsp)
movl $0x0, 0x2c4(%rsp)
leaq 0x2bc(%rsp), %rax
movq %rax, 0x2c8(%rsp)
movq $0x3, 0x2d0(%rsp)
leaq 0x2bb(%rsp), %rdi
movq %rdi, 0x120(%rsp)
callq 0xeab0
movq 0x118(%rsp), %rdi
movq 0x120(%rsp), %rcx
movq 0x2c8(%rsp), %rsi
movq 0x2d0(%rsp), %rdx
callq 0xeac0
jmp 0x5e08
leaq 0x2f8(%rsp), %rax
movq %rax, 0x108(%rsp)
movq %rax, 0x2d8(%rsp)
movl $0xfffffffe, 0x29c(%rsp) # imm = 0xFFFFFFFE
movl $0xffffffff, 0x2a0(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x2a4(%rsp)
leaq 0x29c(%rsp), %rax
movq %rax, 0x2a8(%rsp)
movq $0x3, 0x2b0(%rsp)
leaq 0x29b(%rsp), %rdi
movq %rdi, 0x110(%rsp)
callq 0xeab0
movq 0x108(%rsp), %rdi
movq 0x110(%rsp), %rcx
movq 0x2a8(%rsp), %rsi
movq 0x2b0(%rsp), %rdx
callq 0xeac0
jmp 0x5e99
leaq 0x310(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq %rax, 0x2d8(%rsp)
movl $0x2, 0x27c(%rsp)
movl $0x1, 0x280(%rsp)
movl $0xfffffffd, 0x284(%rsp) # imm = 0xFFFFFFFD
leaq 0x27c(%rsp), %rax
movq %rax, 0x288(%rsp)
movq $0x3, 0x290(%rsp)
leaq 0x27b(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0xeab0
movq 0xf8(%rsp), %rdi
movq 0x100(%rsp), %rcx
movq 0x288(%rsp), %rsi
movq 0x290(%rsp), %rdx
callq 0xeac0
jmp 0x5f2a
movb $0x0, 0x27a(%rsp)
leaq 0x2e0(%rsp), %rax
movq %rax, 0x328(%rsp)
movq $0x3, 0x330(%rsp)
movq 0x418(%rsp), %rdi
addq $0x8, %rdi
movq 0x328(%rsp), %rsi
movq 0x330(%rsp), %rdx
callq 0xeb50
jmp 0x5f71
leaq 0x2e0(%rsp), %rax
movq %rax, 0xe8(%rsp)
addq $0x48, %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0xe0(%rsp)
callq 0xebb0
movq 0xe8(%rsp), %rcx
movq 0xe0(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xf0(%rsp)
jne 0x5f8d
leaq 0x27b(%rsp), %rdi
callq 0xec10
leaq 0x29b(%rsp), %rdi
callq 0xec10
leaq 0x2bb(%rsp), %rdi
callq 0xec10
movb $0x1, 0x1ba(%rsp)
leaq 0x220(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq %rax, 0x218(%rsp)
movl $0xfffffff8, 0x1fc(%rsp) # imm = 0xFFFFFFF8
movl $0xfffffffc, 0x200(%rsp) # imm = 0xFFFFFFFC
movl $0xb, 0x204(%rsp)
leaq 0x1fc(%rsp), %rax
movq %rax, 0x208(%rsp)
movq $0x3, 0x210(%rsp)
leaq 0x1fb(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0xeab0
movq 0xd0(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movq 0x208(%rsp), %rsi
movq 0x210(%rsp), %rdx
callq 0xeac0
jmp 0x6083
leaq 0x238(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %rax, 0x218(%rsp)
movl $0xfffffffc, 0x1dc(%rsp) # imm = 0xFFFFFFFC
movl $0xfffffffe, 0x1e0(%rsp) # imm = 0xFFFFFFFE
movl $0x3, 0x1e4(%rsp)
leaq 0x1dc(%rsp), %rax
movq %rax, 0x1e8(%rsp)
movq $0x3, 0x1f0(%rsp)
leaq 0x1db(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0xeab0
movq 0xc0(%rsp), %rdi
movq 0xc8(%rsp), %rcx
movq 0x1e8(%rsp), %rsi
movq 0x1f0(%rsp), %rdx
callq 0xeac0
jmp 0x6114
leaq 0x250(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq %rax, 0x218(%rsp)
movl $0x8, 0x1bc(%rsp)
movl $0x4, 0x1c0(%rsp)
movl $0xfffffffc, 0x1c4(%rsp) # imm = 0xFFFFFFFC
leaq 0x1bc(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq $0x3, 0x1d0(%rsp)
leaq 0x1bb(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0xeab0
movq 0xb0(%rsp), %rdi
movq 0xb8(%rsp), %rcx
movq 0x1c8(%rsp), %rsi
movq 0x1d0(%rsp), %rdx
callq 0xeac0
jmp 0x61a5
movb $0x0, 0x1ba(%rsp)
leaq 0x220(%rsp), %rax
movq %rax, 0x268(%rsp)
movq $0x3, 0x270(%rsp)
movq 0x410(%rsp), %rdi
addq $0x8, %rdi
movq 0x268(%rsp), %rsi
movq 0x270(%rsp), %rdx
callq 0xeb50
jmp 0x61ec
leaq 0x220(%rsp), %rax
movq %rax, 0xa0(%rsp)
addq $0x48, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x98(%rsp)
callq 0xebb0
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xa8(%rsp)
jne 0x6208
leaq 0x1bb(%rsp), %rdi
callq 0xec10
leaq 0x1db(%rsp), %rdi
callq 0xec10
leaq 0x1fb(%rsp), %rdi
callq 0xec10
movq 0x420(%rsp), %rdi
movq 0x418(%rsp), %rsi
movq 0x408(%rsp), %rdx
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x3, 0x18(%rsp)
callq 0x2a20
movq 0x408(%rsp), %rdi
movq 0x410(%rsp), %rsi
callq 0x2570
testb $0x1, %al
jne 0x62c5
jmp 0x62ca
jmp 0x6640
leaq 0x129a1(%rip), %rdi     # 0x18c72
leaq 0x129a8(%rip), %rsi     # 0x18c80
movl $0x1d9, %edx            # imm = 0x1D9
leaq 0x129a5(%rip), %rcx     # 0x18c89
callq 0x2110
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x63b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x63a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x6399
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
leaq 0x3b0(%rsp), %rax
movq %rax, 0x88(%rsp)
addq $0x48, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x80(%rsp)
callq 0xebb0
movq 0x88(%rsp), %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x90(%rsp)
jne 0x6361
jmp 0x6399
leaq 0x33b(%rsp), %rdi
callq 0xec10
leaq 0x35b(%rsp), %rdi
callq 0xec10
leaq 0x38b(%rsp), %rdi
callq 0xec10
testb $0x1, 0x33a(%rsp)
jne 0x63cc
jmp 0x6412
movq 0x3a8(%rsp), %rax
leaq 0x3b0(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x78(%rsp)
je 0x6410
movq 0x78(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x70(%rsp)
callq 0xebb0
movq 0x70(%rsp), %rax
leaq 0x3b0(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x78(%rsp)
jne 0x63e6
jmp 0x6412
jmp 0x6691
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x64c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x64bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x64af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
leaq 0x2e0(%rsp), %rax
movq %rax, 0x60(%rsp)
addq $0x48, %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x58(%rsp)
callq 0xebb0
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x68(%rsp)
jne 0x6486
jmp 0x64af
leaq 0x27b(%rsp), %rdi
callq 0xec10
leaq 0x29b(%rsp), %rdi
callq 0xec10
leaq 0x2bb(%rsp), %rdi
callq 0xec10
testb $0x1, 0x27a(%rsp)
jne 0x64e2
jmp 0x6528
movq 0x2d8(%rsp), %rax
leaq 0x2e0(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x50(%rsp)
je 0x6526
movq 0x50(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x48(%rsp)
callq 0xebb0
movq 0x48(%rsp), %rax
leaq 0x2e0(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x50(%rsp)
jne 0x64fc
jmp 0x6528
jmp 0x6691
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x65df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x65d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
jmp 0x65c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x380(%rsp)
movl %eax, 0x37c(%rsp)
leaq 0x220(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x48, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x30(%rsp)
callq 0xebb0
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0x659c
jmp 0x65c5
leaq 0x1bb(%rsp), %rdi
callq 0xec10
leaq 0x1db(%rsp), %rdi
callq 0xec10
leaq 0x1fb(%rsp), %rdi
callq 0xec10
testb $0x1, 0x1ba(%rsp)
jne 0x65f8
jmp 0x663e
movq 0x218(%rsp), %rax
leaq 0x220(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x663c
movq 0x28(%rsp), %rdi
addq $-0x18, %rdi
movq %rdi, 0x20(%rsp)
callq 0xebb0
movq 0x20(%rsp), %rax
leaq 0x220(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x6612
jmp 0x663e
jmp 0x6691
movq 0x420(%rsp), %rdi
callq 0x21c0
movq 0x418(%rsp), %rdi
callq 0x21c0
movq 0x410(%rsp), %rdi
callq 0x21c0
movq 0x18962(%rip), %rdi     # 0x1efd0
leaq 0x12628(%rip), %rsi     # 0x18c9d
callq 0x2180
movq %rax, %rdi
movq 0x18934(%rip), %rsi     # 0x1efb8
callq 0x21a0
addq $0x428, %rsp            # imm = 0x428
retq
movq 0x380(%rsp), %rdi
callq 0x22a0
nop