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

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

        Nx = obj.Nx;
        Ny = obj.Ny;
        Nz = obj.Nz;
        N = obj.N;
        name = obj.name;
        //      std::cerr << "field is" << name <<  std::endl;

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

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

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x18, %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 $0x18, %rsi
callq 0x3050
jmp 0xc4a2
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 0xc4ca
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl (%rcx), %eax
jge 0xc5f3
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, -0x48(%rbp)
jmp 0xc515
movq -0x48(%rbp), %rdx
movq -0x38(%rbp), %rax
movq 0x10(%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 0xc5e3
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, -0x50(%rbp)
jmp 0xc569
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rsi
movq 0x10(%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
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc530
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x3180
jmp 0xc62b
jmp 0xc5e5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc4dd
movl $0x0, -0x28(%rbp)
cmpl $0x3, -0x28(%rbp)
jge 0xc625
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x28(%rbp), %rsi
movq 0x38(%rdx,%rsi,8), %rdx
movq %rdx, 0x38(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xc5fa
addq $0x50, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)