// File: suhasjains[P]AMR-Solver/src/amrsolver.cpp
// Function: main
int main(int argc, char **argv) {


	//reading input
	read_input_file();

	//setting up grid
	myOctree::OctreeGrid();
	amrsolver::adapt_gradient();

	//setting initial condition
	//amrsolver::set_field();
	
	//solving
	amrsolver::multigrid("alpha");
	
	//checking flags
	amrsolver::set_field();

	//writing vtk
	myOctree::create_lists_of_level_nodes();
	myOctree::create_list_of_leaf_nodes();
	myOctree::write_vtk(myOctree::leaf_nodes,"level-4");
	myOctree::write_vtk(myOctree::level_nodes[0],"level-0");
	myOctree::write_vtk(myOctree::level_nodes[1],"level-1");
	myOctree::write_vtk(myOctree::level_nodes[2],"level-2");
	myOctree::write_vtk(myOctree::level_nodes[3],"level-3");
	
	//writing output file
	write_output_file();

	cerr << "\n" << "Finishing" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x167e0
callq 0x59c0
callq 0x4050
leaq -0x31(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x3430
movq -0x118(%rbp), %rdx
leaq 0x1cf21(%rip), %rsi     # 0x21030
leaq -0x30(%rbp), %rdi
callq 0x4570
jmp 0x411a
leaq -0x30(%rbp), %rdi
callq 0x20320
jmp 0x4125
leaq -0x30(%rbp), %rdi
callq 0x3180
leaq -0x31(%rbp), %rdi
callq 0x3290
callq 0x3e80
callq 0x4a50
callq 0x4930
leaq -0x69(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x3430
movq -0x120(%rbp), %rdx
leaq 0x1ced2(%rip), %rsi     # 0x21036
leaq -0x68(%rbp), %rdi
callq 0x4570
jmp 0x416f
leaq 0x2213a(%rip), %rdi     # 0x262b0
leaq -0x68(%rbp), %rsi
callq 0x125f0
jmp 0x4181
leaq -0x68(%rbp), %rdi
callq 0x3180
leaq -0x69(%rbp), %rdi
callq 0x3290
leaq -0x91(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x3430
movq -0x128(%rbp), %rdx
leaq 0x1ce8a(%rip), %rsi     # 0x2103e
leaq -0x90(%rbp), %rdi
callq 0x4570
jmp 0x41c2
leaq 0x22117(%rip), %rdi     # 0x262e0
leaq -0x90(%rbp), %rsi
callq 0x125f0
jmp 0x41d7
leaq -0x90(%rbp), %rdi
callq 0x3180
leaq -0x91(%rbp), %rdi
callq 0x3290
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x3430
movq -0x130(%rbp), %rdx
leaq 0x1ce36(%rip), %rsi     # 0x21046
leaq -0xb8(%rbp), %rdi
callq 0x4570
jmp 0x421e
leaq 0x220bb(%rip), %rdi     # 0x262e0
addq $0x18, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x125f0
jmp 0x4237
leaq -0xb8(%rbp), %rdi
callq 0x3180
leaq -0xb9(%rbp), %rdi
callq 0x3290
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x3430
movq -0x138(%rbp), %rdx
leaq 0x1cdde(%rip), %rsi     # 0x2104e
leaq -0xe0(%rbp), %rdi
callq 0x4570
jmp 0x427e
leaq 0x2205b(%rip), %rdi     # 0x262e0
addq $0x30, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x125f0
jmp 0x4297
leaq -0xe0(%rbp), %rdi
callq 0x3180
leaq -0xe1(%rbp), %rdi
callq 0x3290
leaq -0x109(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x3430
movq -0x140(%rbp), %rdx
leaq 0x1cd86(%rip), %rsi     # 0x21056
leaq -0x108(%rbp), %rdi
callq 0x4570
jmp 0x42de
leaq 0x21ffb(%rip), %rdi     # 0x262e0
addq $0x48, %rdi
leaq -0x108(%rbp), %rsi
callq 0x125f0
jmp 0x42f7
leaq -0x108(%rbp), %rdi
callq 0x3180
leaq -0x109(%rbp), %rdi
callq 0x3290
callq 0x137e0
movq 0x21cd5(%rip), %rdi     # 0x25ff0
leaq 0x1cfdf(%rip), %rsi     # 0x21301
callq 0x3240
movq %rax, %rdi
leaq 0x1cd2d(%rip), %rsi     # 0x2105e
callq 0x3240
movq %rax, %rdi
movq 0x21c80(%rip), %rsi     # 0x25fc0
callq 0x3270
xorl %eax, %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4373
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3180
leaq -0x31(%rbp), %rdi
callq 0x3290
jmp 0x4483
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3180
leaq -0x69(%rbp), %rdi
callq 0x3290
jmp 0x4483
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3180
leaq -0x91(%rbp), %rdi
callq 0x3290
jmp 0x4483
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x440f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3180
leaq -0xb9(%rbp), %rdi
callq 0x3290
jmp 0x4483
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4443
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3180
leaq -0xe1(%rbp), %rdi
callq 0x3290
jmp 0x4483
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4477
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3180
leaq -0x109(%rbp), %rdi
callq 0x3290
movq -0x40(%rbp), %rdi
callq 0x3420
nopl (%rax)