// File: aronszanto[P]strassen/main.cpp
// Function: strassenMultThread(Matrix*, Matrix*, Matrix*, int, int, int, int, int, int, int)
void strassenMultThread(Matrix* A, Matrix* B, Matrix* C, int topA, int leftA, int topB, int leftB, int topC, int leftC, int dimension) {
    
    {
    // 1. C12 = A21 - A11
    thread t1(subtract, A, A, C, topA + dimension/2, leftA, topA, leftA, topC, leftC + dimension/2, dimension/2);
    // 2. C21 = B11 + B12
    add(B,B,C,topB,leftB,topB,leftB + dimension/2,topC + dimension/2,leftC,dimension/2);
    t1.join();
    //threads++;
    }

    // 3. C22 = C12 * C21
    multiply(C,C,C,topC,leftC + dimension/2,topC + dimension/2,leftC,topC + dimension/2,leftC + dimension/2,dimension/2);
    
    {
    // 4. C12 = A12 - A22
    thread t2(subtract, A,A,C,topA,leftA + dimension/2,topA + dimension/2,leftA + dimension/2,topC,leftC + dimension/2,dimension/2);
    // 5. C21 = B21 + B22
    add(B, B, C, topB + dimension/2,leftB,topB + dimension/2,leftB + dimension/2,topC + dimension/2,leftC,dimension/2);
    t2.join();
    //threads++;
    }

    //6. C11 = C12 * C21
    multiply(C,C,C,topC,leftC + dimension/2,topC + dimension/2,leftC,topC,leftC,dimension/2);
    
    Matrix* T2 = new Matrix();
    initMatrix(T2, dimension/2); // TODO deal with non-power of 2 case
    {
        
    // 7. C12 = A11 + A22
    thread t3(add,A, A, C, topA, leftA, topA + dimension/2, leftA + dimension/2, topC, leftC + dimension/2, dimension/2);
    //8. C21 = B11 + B22
    thread t4(add,B,B,C,topB,leftB,topB + dimension/2,leftB + dimension/2,topC + dimension/2,leftC,dimension/2);
    //12. T2 = A21 + A22
    add(A,A,T2,topA + dimension/2,leftA,topA + dimension/2,leftA + dimension/2,0,0,dimension/2);
    t3.join();
    t4.join();
    //threads++;
    //threads++;
    }
    

    Matrix* T1 = new Matrix();
    initMatrix(T1, dimension/2); // TODO deal with non-power of 2 case
    //9. T1 = C12*C21
    multiply(C,C,T1,topC,leftC + dimension/2,topC + dimension/2,leftC,0,0,dimension/2);
    
    {
    //10. C11 = T1 + C11
    thread t5(add,T1,C,C,0,0,topC,leftC,topC,leftC,dimension/2);
    //11. C22 = T1 + C22
    thread t6(add,T1,C,C,0,0,topC + dimension/2,leftC + dimension/2,topC + dimension/2,leftC + dimension/2,dimension/2);
    //13. C21 = T2 * B11
    multiply(T2,B,C,0,0,topB,leftB,topC + dimension/2,leftC,dimension/2);
    t5.join();
    t6.join();
    //threads++;
    //threads++;
    }

    {
    //14. C22 = C22 - C21
    thread t7(subtract,C,C,C,topC + dimension/2,leftC + dimension/2,topC + dimension/2,leftC,topC + dimension/2,leftC + dimension/2,dimension/2);
    //15. T1 = B21 - B11
    subtract(B,B,T1,topB + dimension/2,leftB,topB,leftB,0,0,dimension/2);
    t7.join();
    //threads++;
    }

    //16. T2 = A22 * T1
    multiply(A,T1,T2,topA + dimension/2,leftA + dimension/2,0,0,0,0,dimension/2);
    
    {
    //17. C21 = C21 + T2
    thread t8(add,C,T2,C,topC + dimension/2,leftC,0,0,topC + dimension/2,leftC,dimension/2);
    //18. C11 = C11 + T2
    thread t9(add,C,T2,C,topC,leftC,0,0,topC,leftC,dimension/2);
    //19. T1 = B12 - B22
    subtract(B,B,T1,topB,leftB + dimension/2,topB + dimension/2,leftB + dimension/2,0,0,dimension/2);
    t8.join();
    t9.join();
    }
    //threads++;
    //threads++;
    
    //20. C12 = A11 * T1
    multiply(A,T1,C,topA,leftA,0,0,topC,leftC + dimension/2,dimension/2);
    
    {
    //21. C22 = C22 + C12
    thread t10(add,C,C,C,topC + dimension/2,leftC + dimension/2,topC,leftC + dimension/2,topC + dimension/2,leftC + dimension/2,dimension/2);
    //22. T2 = A11 + A12
    add(A,A,T2,topA,leftA,topA,leftA + dimension/2,0,0,dimension/2);
    t10.join();
    //threads++;
    }

    //23. T1 = T2 * B22
    multiply(T2,B,T1,0,0,topB + dimension/2,leftB + dimension/2,0,0,dimension/2);
    {
    //24. C12 = C12 + T1
    thread t11(add,C,T1,C,topC,leftC + dimension/2,0,0,topC,leftC + dimension/2,dimension/2);
    //25. C11 = C11 - T1
    subtract(C,T1,C,topC,leftC,0,0,topC,leftC,dimension/2);
    t11.join();
    }
    
    //threads++;
    
    
    delete(T1);
    delete(T2);
}

// Assembly:
subq $0x258, %rsp            # imm = 0x258
movl 0x278(%rsp), %eax
movl 0x270(%rsp), %eax
movl 0x268(%rsp), %eax
movl 0x260(%rsp), %eax
movq %rdi, 0x250(%rsp)
movq %rsi, 0x248(%rsp)
movq %rdx, 0x240(%rsp)
movl %ecx, 0x23c(%rsp)
movl %r8d, 0x238(%rsp)
movl %r9d, 0x234(%rsp)
movl 0x23c(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x224(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x220(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x21c(%rsp)
movq %rsp, %rax
leaq 0x21c(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x220(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x268(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x238(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x23c(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
leaq -0x1682(%rip), %rsi     # 0x28f0
leaq 0x228(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
leaq 0x250(%rsp), %rcx
leaq 0x240(%rsp), %r8
leaq 0x224(%rsp), %r9
movq %rcx, %rdx
callq 0xd990
movq 0x248(%rsp), %rsi
movq 0x240(%rsp), %rdx
movl 0x234(%rsp), %r9d
movl 0x260(%rsp), %r8d
movl 0x278(%rsp), %r10d
movl %r10d, %eax
shrl $0x1f, %eax
addl %eax, %r10d
sarl %r10d
movl %r8d, %ecx
addl %r10d, %ecx
movl 0x268(%rsp), %edi
addl %r10d, %edi
movl 0x270(%rsp), %r11d
movq %rsp, %rax
movl %r11d, 0x10(%rax)
movl %r10d, 0x18(%rax)
movl %edi, 0x8(%rax)
movl %ecx, (%rax)
movq %rsi, %rdi
movl %r9d, %ecx
callq 0x27c0
movq 0xc8(%rsp), %rdi
callq 0x2270
jmp 0x4018
leaq 0x228(%rsp), %rdi
callq 0xdb20
movq 0x240(%rsp), %rdx
movl 0x268(%rsp), %ecx
movl 0x270(%rsp), %edi
movl 0x278(%rsp), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %eax, %esi
sarl %esi
movl %edi, %r8d
addl %esi, %r8d
movl %ecx, %r9d
addl %esi, %r9d
movq %rsp, %rax
movl %edi, (%rax)
movl %esi, 0x18(%rax)
movl %r8d, 0x10(%rax)
movl %r9d, 0x8(%rax)
movq %rdx, %rdi
movq %rdx, %rsi
callq 0x3d50
movl 0x238(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1fc(%rsp)
movl 0x23c(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1f8(%rsp)
movl 0x238(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1f4(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1f0(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x1ec(%rsp)
movq %rsp, %rax
leaq 0x1ec(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x1f0(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x268(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x1f4(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x1f8(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x1fc(%rsp), %rcx
movq %rcx, (%rax)
leaq -0x186a(%rip), %rsi     # 0x28f0
leaq 0x200(%rsp), %rdi
movq %rdi, 0xc0(%rsp)
leaq 0x250(%rsp), %rcx
leaq 0x240(%rsp), %r8
leaq 0x23c(%rsp), %r9
movq %rcx, %rdx
callq 0xdb40
movq 0x248(%rsp), %rsi
movq 0x240(%rsp), %rdx
movl 0x234(%rsp), %r9d
movl 0x278(%rsp), %r10d
movl %r10d, %eax
shrl $0x1f, %eax
addl %eax, %r10d
sarl %r10d
addl %r10d, %r9d
movl 0x260(%rsp), %r8d
movl %r8d, %ecx
addl %r10d, %ecx
movl 0x268(%rsp), %edi
addl %r10d, %edi
movl 0x270(%rsp), %r11d
movq %rsp, %rax
movl %r11d, 0x10(%rax)
movl %r10d, 0x18(%rax)
movl %edi, 0x8(%rax)
movl %ecx, (%rax)
movq %rsi, %rdi
movl %r9d, %ecx
callq 0x27c0
movq 0xc0(%rsp), %rdi
callq 0x2270
jmp 0x4203
leaq 0x200(%rsp), %rdi
callq 0xdb20
movq 0x240(%rsp), %rdx
movl 0x268(%rsp), %ecx
movl 0x270(%rsp), %edi
movl 0x278(%rsp), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %eax, %esi
sarl %esi
movl %edi, %r8d
addl %esi, %r8d
movl %ecx, %r9d
addl %esi, %r9d
movq %rsp, %rax
movl %edi, 0x10(%rax)
movl %ecx, 0x8(%rax)
movl %edi, (%rax)
movl %esi, 0x18(%rax)
movq %rdx, %rdi
movq %rdx, %rsi
callq 0x3d50
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0xa8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xd950
movq 0xa8(%rsp), %rax
movq %rax, 0x1e0(%rsp)
movq 0x1e0(%rsp), %rdi
movl 0x278(%rsp), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %eax, %esi
sarl %esi
callq 0x2440
movl 0x23c(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1d4(%rsp)
movl 0x238(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1d0(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1cc(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x1c8(%rsp)
movq %rsp, %rax
leaq 0x1c8(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x1cc(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x268(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x1d0(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x1d4(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x238(%rsp), %rcx
movq %rcx, (%rax)
leaq -0x1bb4(%rip), %rsi     # 0x27c0
movq %rsi, 0xb0(%rsp)
leaq 0x1d8(%rsp), %rdi
leaq 0x250(%rsp), %rcx
leaq 0x240(%rsp), %r8
movq %r8, 0xb8(%rsp)
leaq 0x23c(%rsp), %r9
movq %rcx, %rdx
callq 0xdcd0
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %r8
movl 0x234(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1bc(%rsp)
movl 0x260(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1b8(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x1b4(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x1b0(%rsp)
movq %rsp, %rax
leaq 0x1b0(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x270(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x1b4(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x1b8(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x1bc(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x260(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x1c0(%rsp), %rdi
leaq 0x248(%rsp), %rcx
leaq 0x234(%rsp), %r9
movq %rcx, %rdx
callq 0xde60
jmp 0x449f
movq 0x250(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
movl 0x23c(%rsp), %r9d
movl 0x278(%rsp), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %eax, %edi
sarl %edi
addl %edi, %r9d
movl 0x238(%rsp), %r8d
movl %r8d, %ecx
addl %edi, %ecx
movq %rsp, %rax
movl %edi, 0x18(%rax)
movl %ecx, (%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movq %rsi, %rdi
movl %r9d, %ecx
callq 0x27c0
leaq 0x1d8(%rsp), %rdi
callq 0x2270
jmp 0x4507
leaq 0x1c0(%rsp), %rdi
callq 0x2270
jmp 0x4516
leaq 0x1c0(%rsp), %rdi
callq 0xdb20
leaq 0x1d8(%rsp), %rdi
callq 0xdb20
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x88(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xd950
movq 0x88(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rdi
movl 0x278(%rsp), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %eax, %esi
sarl %esi
callq 0x2440
movq 0x240(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movl 0x268(%rsp), %ecx
movl 0x270(%rsp), %r10d
movl 0x278(%rsp), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %eax, %edi
sarl %edi
movl %r10d, %r8d
addl %edi, %r8d
movl %ecx, %r9d
addl %edi, %r9d
movq %rsp, %rax
movl %r10d, (%rax)
movl %edi, 0x18(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movq %rsi, %rdi
callq 0x3d50
movl $0x0, 0x19c(%rsp)
movl $0x0, 0x198(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x194(%rsp)
movq %rsp, %rax
leaq 0x194(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x270(%rsp), %rdx
movq %rdx, 0x20(%rax)
leaq 0x268(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x198(%rsp), %rcx
movq %rcx, (%rax)
leaq -0x1e89(%rip), %rsi     # 0x27c0
movq %rsi, 0x90(%rsp)
leaq 0x1a0(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
movq %rdx, 0x98(%rsp)
leaq 0x240(%rsp), %r8
movq %r8, 0xa0(%rsp)
leaq 0x19c(%rsp), %r9
movq %r8, %rcx
callq 0xdff0
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0xa0(%rsp), %r8
movl $0x0, 0x184(%rsp)
movl $0x0, 0x180(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %edi, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x17c(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %edi, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x178(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %edi, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x174(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %edi, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x170(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x16c(%rsp)
movq %rsp, %rax
leaq 0x16c(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x170(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x174(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x178(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x17c(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x180(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x188(%rsp), %rdi
leaq 0x184(%rsp), %r9
movq %r8, %rcx
callq 0xe180
jmp 0x47b2
movq 0x1e0(%rsp), %rdi
movq 0x248(%rsp), %rsi
movq 0x240(%rsp), %rdx
movl 0x234(%rsp), %r9d
movl 0x260(%rsp), %r8d
movl 0x268(%rsp), %ecx
movl 0x278(%rsp), %r11d
movl %r11d, %eax
shrl $0x1f, %eax
addl %eax, %r11d
sarl %r11d
addl %r11d, %ecx
movl 0x270(%rsp), %r10d
movq %rsp, %rax
movl %r11d, 0x18(%rax)
movl %r10d, 0x10(%rax)
movl %r8d, (%rax)
movl %ecx, 0x8(%rax)
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x3d50
jmp 0x481e
leaq 0x1a0(%rsp), %rdi
callq 0x2270
jmp 0x482d
leaq 0x188(%rsp), %rdi
callq 0x2270
jmp 0x483c
leaq 0x188(%rsp), %rdi
callq 0xdb20
leaq 0x1a0(%rsp), %rdi
callq 0xdb20
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x15c(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x158(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x154(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x150(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x14c(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x148(%rsp)
movq %rsp, %rax
leaq 0x148(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x14c(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x150(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x270(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x154(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x158(%rsp), %rcx
movq %rcx, (%rax)
leaq -0x206e(%rip), %rsi     # 0x28f0
leaq 0x160(%rsp), %rdi
movq %rdi, 0x80(%rsp)
leaq 0x240(%rsp), %r8
leaq 0x15c(%rsp), %r9
movq %r8, %rdx
movq %r8, %rcx
callq 0xe310
movq 0x248(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movl 0x234(%rsp), %r9d
movl 0x278(%rsp), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %eax, %edi
sarl %edi
movl %r9d, %ecx
addl %edi, %ecx
movl 0x260(%rsp), %r8d
movq %rsp, %rax
movl %r8d, (%rax)
movl %edi, 0x18(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movq %rsi, %rdi
callq 0x28f0
movq 0x80(%rsp), %rdi
callq 0x2270
jmp 0x49ec
leaq 0x160(%rsp), %rdi
callq 0xdb20
movq 0x250(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
movl 0x23c(%rsp), %ecx
movl 0x278(%rsp), %r9d
movl %r9d, %eax
shrl $0x1f, %eax
addl %eax, %r9d
sarl %r9d
addl %r9d, %ecx
movl 0x238(%rsp), %r8d
addl %r9d, %r8d
movq %rsp, %rax
movl %r9d, 0x18(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movl $0x0, (%rax)
xorl %r9d, %r9d
callq 0x3d50
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x13c(%rsp)
movl $0x0, 0x138(%rsp)
movl $0x0, 0x134(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x130(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0x12c(%rsp)
movq %rsp, %rax
leaq 0x12c(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0x270(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq %rcx, 0x20(%rax)
leaq 0x130(%rsp), %rdx
movq %rdx, 0x18(%rax)
leaq 0x134(%rsp), %rdx
movq %rdx, 0x10(%rax)
leaq 0x138(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
leaq -0x2358(%rip), %rsi     # 0x27c0
movq %rsi, 0x68(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x1e0(%rsp), %rcx
movq %rcx, 0x70(%rsp)
leaq 0x240(%rsp), %r8
movq %r8, 0x78(%rsp)
leaq 0x13c(%rsp), %r9
movq %r8, %rdx
callq 0xe4a0
movq 0x60(%rsp), %rdx
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %r8
movl $0x0, 0x11c(%rsp)
movl $0x0, 0x118(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %edi
shrl $0x1f, %edi
addl %edi, %eax
sarl %eax
movl %eax, 0x114(%rsp)
movq %rsp, %rax
leaq 0x114(%rsp), %rdi
movq %rdi, 0x28(%rax)
movq %rdx, 0x20(%rax)
leaq 0x268(%rsp), %r9
movq %r9, 0x18(%rax)
leaq 0x118(%rsp), %rdi
movq %rdi, 0x10(%rax)
leaq 0x11c(%rsp), %rdi
movq %rdi, 0x8(%rax)
movq %rdx, (%rax)
leaq 0x120(%rsp), %rdi
movq %r8, %rdx
callq 0xe630
jmp 0x4bdc
movq 0x248(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movl 0x234(%rsp), %ecx
movl 0x260(%rsp), %r8d
movl 0x278(%rsp), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %eax, %edi
sarl %edi
addl %edi, %r8d
movl %ecx, %r9d
addl %edi, %r9d
movq %rsp, %rax
movl %edi, 0x18(%rax)
movl %r8d, (%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movq %rsi, %rdi
callq 0x28f0
leaq 0x140(%rsp), %rdi
callq 0x2270
jmp 0x4c42
leaq 0x120(%rsp), %rdi
callq 0x2270
jmp 0x4c51
leaq 0x120(%rsp), %rdi
callq 0xdb20
leaq 0x140(%rsp), %rdi
callq 0xdb20
movq 0x250(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movq 0x240(%rsp), %rdx
movl 0x23c(%rsp), %ecx
movl 0x238(%rsp), %r8d
movl 0x268(%rsp), %r11d
movl 0x270(%rsp), %r9d
movl 0x278(%rsp), %r10d
movl %r10d, %eax
shrl $0x1f, %eax
addl %eax, %r10d
sarl %r10d
addl %r10d, %r9d
movq %rsp, %rax
movl %r11d, 0x8(%rax)
movl %r10d, 0x18(%rax)
movl %r9d, 0x10(%rax)
movl $0x0, (%rax)
xorl %r9d, %r9d
callq 0x3d50
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x104(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0x100(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0xfc(%rsp)
movl 0x268(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0xf8(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0xf4(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0xf0(%rsp)
movq %rsp, %rax
leaq 0xf0(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0xf4(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0xf8(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0xfc(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x268(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x100(%rsp), %rcx
movq %rcx, (%rax)
leaq -0x261e(%rip), %rsi     # 0x27c0
leaq 0x108(%rsp), %rdi
movq %rdi, 0x58(%rsp)
leaq 0x240(%rsp), %r8
leaq 0x104(%rsp), %r9
movq %r8, %rdx
movq %r8, %rcx
callq 0xe7c0
movq 0x250(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
movl 0x23c(%rsp), %r9d
movl 0x238(%rsp), %r8d
movl 0x278(%rsp), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %eax, %edi
sarl %edi
movl %r8d, %ecx
addl %edi, %ecx
movq %rsp, %rax
movl %edi, 0x18(%rax)
movl %ecx, (%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movq %rsi, %rdi
movl %r9d, %ecx
callq 0x27c0
movq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x4e68
leaq 0x108(%rsp), %rdi
callq 0xdb20
movq 0x1e0(%rsp), %rdi
movq 0x248(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
movl 0x234(%rsp), %r9d
movl 0x278(%rsp), %r8d
movl %r8d, %eax
shrl $0x1f, %eax
addl %eax, %r8d
sarl %r8d
addl %r8d, %r9d
movl 0x260(%rsp), %ecx
addl %r8d, %ecx
movq %rsp, %rax
movl %r8d, 0x18(%rax)
movl %ecx, (%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
xorl %r8d, %r8d
movl %r8d, 0x4c(%rsp)
movl %r8d, %ecx
callq 0x3d50
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0xe4(%rsp)
movl $0x0, 0xe0(%rsp)
movl $0x0, 0xdc(%rsp)
movl 0x270(%rsp), %eax
movl 0x278(%rsp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0xd8(%rsp)
movl 0x278(%rsp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, 0xd4(%rsp)
movq %rsp, %rax
leaq 0xd4(%rsp), %rcx
movq %rcx, 0x28(%rax)
leaq 0xd8(%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x268(%rsp), %r9
movq %r9, 0x18(%rax)
leaq 0xdc(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0xe4(%rsp), %rcx
movq %rcx, (%rax)
leaq -0x27db(%rip), %rsi     # 0x27c0
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x50(%rsp)
leaq 0x1a8(%rsp), %rcx
leaq 0x240(%rsp), %r8
movq %r8, %rdx
callq 0xdb40
movl 0x4c(%rsp), %r9d
movq 0x240(%rsp), %rdx
movq 0x1a8(%rsp), %rsi
movl 0x268(%rsp), %ecx
movl 0x270(%rsp), %r8d
movl 0x278(%rsp), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %eax, %edi
sarl %edi
movq %rsp, %rax
movl %r8d, 0x10(%rax)
movl %ecx, 0x8(%rax)
movl %edi, 0x18(%rax)
movl $0x0, (%rax)
movq %rdx, %rdi
callq 0x28f0
movq 0x50(%rsp), %rdi
callq 0x2270
jmp 0x501b
leaq 0xe8(%rsp), %rdi
callq 0xdb20
movq 0x1a8(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x504f
movq 0x40(%rsp), %rdi
callq 0xd970
movq 0x40(%rsp), %rdi
callq 0x2170
movq 0x1e0(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x5076
movq 0x38(%rsp), %rdi
callq 0xd970
movq 0x38(%rsp), %rdi
callq 0x2170
addq $0x258, %rsp            # imm = 0x258
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x228(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x200(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0x5101
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0xdb20
leaq 0x1d8(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0x514a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x188(%rsp), %rdi
callq 0xdb20
leaq 0x1a0(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x160(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0x51b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xdb20
leaq 0x140(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x108(%rsp), %rdi
callq 0xdb20
jmp 0x520c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0xdb20
movq 0x210(%rsp), %rdi
callq 0x22a0
nopl (%rax)