// File: /workspace/github_cpp_makefile_star2_O1/Eshaancoding[P]AutoDiff/src/Matrix/operations.cpp
// Function: Matrix::operator=(std::initializer_list<std::initializer_list<double>>)
void Matrix::operator= (initializer_list<initializer_list<double>> ar) {
    // find height / width
    int ar_height = ar.size();
    int ar_width = ar.begin()->size();
    for (int i = 1; i < ar_height; i++) {
        if (ar_width != (ar.begin()+i)->size()) {
            throw invalid_argument("array invalid");
        }
    }
    // check height / width
    if (this->height != ar_height) throw invalid_argument("height invalid. Expected " + to_string(this->height) + " got: " + to_string(ar_height));
    if (this->width != ar_width) throw invalid_argument("width invalid. Expected " + to_string(this->width) + " got: " + to_string(ar_width));
    // assign
    for (int i = 0; i < ar_height; i++) {
        this->array[i] = *(ar.begin() + i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq 0x8(%rsi), %r15
cmpl $0x2, %r14d
jl 0x2d0c
movslq %r15d, %rax
movl %r14d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0x18(%rbx), %rdx
decq %rcx
cmpq (%rdx), %rax
jne 0x2d5f
addq $0x10, %rdx
decq %rcx
jne 0x2cfe
cmpl %r14d, 0x8(%r12)
jne 0x2d91
cmpl %r15d, 0xc(%r12)
jne 0x2df8
testl %r14d, %r14d
jle 0x2d4f
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
shlq $0x4, %r14
xorl %r15d, %r15d
movq (%rbx,%r15), %rsi
movq 0x8(%rbx,%r15), %rdx
movq (%r12), %rdi
addq %r15, %rdi
callq 0x8b2c
addq $0x10, %r15
cmpq %r15, %r14
jne 0x2d31
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x7291(%rip), %rsi      # 0xa004
movq %rax, %rdi
callq 0x2290
movq 0xc25e(%rip), %rsi      # 0xefe0
movq 0xc247(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
movl 0x8(%r12), %esi
leaq -0x80(%rbp), %rdi
callq 0x4065
leaq 0x725f(%rip), %rsi      # 0xa012
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x3feb
leaq 0x7262(%rip), %rsi      # 0xa02c
leaq -0xa0(%rbp), %rdi
callq 0x22a0
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x2e5f
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x2e6a
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
movl 0xc(%r12), %esi
leaq -0x80(%rbp), %rdi
callq 0x4065
leaq 0x7219(%rip), %rsi      # 0xa033
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x3feb
leaq 0x71fb(%rip), %rsi      # 0xa02c
leaq -0xa0(%rbp), %rdi
callq 0x22a0
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x2ece
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x2ed9
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rdi
movl %r14d, %esi
callq 0x4065
leaq -0xc0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x3f39
movb $0x1, %r15b
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x2230
xorl %r15d, %r15d
movq 0xc123(%rip), %rsi      # 0xefe0
movq 0xc10c(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
jmp 0x2f3b
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rdi
movl %r15d, %esi
callq 0x4065
leaq -0xc0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x3f39
movb $0x1, %r15b
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x2230
xorl %r15d, %r15d
movq 0xc0b4(%rip), %rsi      # 0xefe0
movq 0xc09d(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
jmp 0x2f3f
jmp 0x2f59
movq %rax, %r14
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f5f
callq 0x2170
jmp 0x2f5f
movq %rax, %r14
movb $0x1, %r15b
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f7b
callq 0x2170
jmp 0x2f7b
jmp 0x2f75
movq %rax, %r14
movb $0x1, %r15b
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x2f93
callq 0x2170
jmp 0x2f93
jmp 0x2f8d
movq %rax, %r14
movb $0x1, %r15b
leaq -0x90(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2fb2
callq 0x2170
jmp 0x2fb2
jmp 0x2fac
movq %rax, %r14
movb $0x1, %r15b
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2fce
callq 0x2170
jmp 0x2fce
jmp 0x2fc8
movq %rax, %r14
movb $0x1, %r15b
testb %r15b, %r15b
jne 0x2fd8
jmp 0x2fe0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x2250