// File: suhasjains[P]AMR-Solver/src/vecfield.cpp
// Function: myOctree::VecField::VecField(myOctree::VecField const&)
VecField::VecField(const VecField &obj) {

//              std::cerr << "copy constructor of vecfield is working" << std::endl;

        Nx = obj.Nx;
        Ny = obj.Ny;
        Nz = obj.Nz;
        N = obj.N;
        name = obj.name;

        x = new double** [Nx];
        y = new double** [Nx];
        z = new double** [Nx];
        for(int i=0;i<Nx;i++) {
                x[i] = new double* [Ny];
                y[i] = new double* [Ny];
                z[i] = new double* [Ny];
                for(int j=0;j<Ny;j++) {
                        x[i][j] = new double [Nz];
                        y[i][j] = new double [Nz];
                        z[i][j] = new double [Nz];
                        memcpy(x[i][j],obj.x[i][j],sizeof(double)*Nz);
                        memcpy(y[i][j],obj.y[i][j],sizeof(double)*Nz);
                        memcpy(z[i][j],obj.z[i][j],sizeof(double)*Nz);
                }
        }

	for(int i = 0; i < 3; ++ i) {
                 memcpy(&(xbc[i][0]), &(obj.xbc[i][0]), 2 * sizeof(FieldBc));
                 memcpy(&(ybc[i][0]), &(obj.ybc[i][0]), 2 * sizeof(FieldBc));
                 memcpy(&(zbc[i][0]), &(obj.zbc[i][0]), 2 * sizeof(FieldBc));
     	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x28, %rdi
movq %rdi, -0x30(%rbp)
callq 0x3360
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x3050
jmp 0xbb55
movq -0x38(%rbp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x40(%rbp)
jmp 0xbb7d
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rax)
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x48(%rbp)
jmp 0xbbad
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rax)
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x50(%rbp)
jmp 0xbbdd
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl (%rcx), %eax
jge 0xbe74
movq -0x38(%rbp), %rax
movslq 0x4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x58(%rbp)
jmp 0xbc28
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %rsi
movq 0x10(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movslq 0x4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x60(%rbp)
jmp 0xbc61
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rsi
movq 0x18(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movslq 0x4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x68(%rbp)
jmp 0xbc9a
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x24(%rbp)
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0xbe64
movq -0x38(%rbp), %rax
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x70(%rbp)
jmp 0xbcee
movq -0x38(%rbp), %rax
movq -0x70(%rbp), %rsi
movq 0x10(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x78(%rbp)
jmp 0xbd2f
movq -0x38(%rbp), %rax
movq -0x78(%rbp), %rsi
movq 0x18(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x80(%rbp)
jmp 0xbd70
movq -0x38(%rbp), %rax
movq -0x80(%rbp), %rsi
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x10(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movslq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x31f0
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movslq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x31f0
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movslq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x31f0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xbcb5
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x3180
jmp 0xbedb
jmp 0xbe66
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xbbf0
movl $0x0, -0x28(%rbp)
cmpl $0x3, -0x28(%rbp)
jge 0xbed2
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x28(%rbp), %rsi
movq 0x48(%rdx,%rsi,8), %rdx
movq %rdx, 0x48(%rax,%rcx,8)
movslq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x28(%rbp), %rsi
movq 0x60(%rdx,%rsi,8), %rdx
movq %rdx, 0x60(%rax,%rcx,8)
movslq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x28(%rbp), %rsi
movq 0x78(%rdx,%rsi,8), %rdx
movq %rdx, 0x78(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xbe7b
addq $0x80, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)