// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/vtk.cpp
// Function: myOctree::write_vtk(std::__cxx11::list<myOctree::Octree*, std::allocator<myOctree::Octree*>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void write_vtk(std::list<Octree*>& nodes, std::string name) {


	int Npx = nx_block + 1;
	int Npy = ny_block + 1;
	int Npz = nz_block + 1;

	std::cerr << "\n" << "Writing VTK" << std::endl;	

	char filename[30];
	strcpy (filename,name.c_str());
	strcat (filename,".vtk");
      //  sprintf(filename, name.c_str());
        FILE *fp = fopen(filename, "w");

        fprintf(fp,"# vtk DataFile Version 3.0\n");
        fprintf(fp,"particle point data\n");
        fprintf(fp,"ASCII\n");
        fprintf(fp,"DATASET UNSTRUCTURED_GRID\n");
	long int nPoints = Npx * Npy * Npz * nodes.size();
	long int nCells = nx_block * ny_block * nz_block * nodes.size();
       	long int point[8]; 
	int node_count = 0;


	fprintf(fp,"POINTS %ld double\n", nPoints);

	for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {
    	
		Block* block_data = (*iterator)->get_block_data();
		int N = block_data->mesh->N;
		double dx = block_data->dx;
		double dy = block_data->dy;
		double dz = block_data->dz;
		double x_min = block_data->x_min;		
		double y_min = block_data->y_min;		
		double z_min = block_data->z_min;		

		//std::cerr << dz  << std::endl;


//		printf("dx=%g dy=%g, dz=%g N =%d\n", dx, dy, dz, N);
//		printf("east bc = %d\n",(*iterator)->east_bc);
//		printf("west bc = %d\n",(*iterator)->west_bc);
//		printf("north bc = %d\n",(*iterator)->north_bc);
//		printf("south bc = %d\n",(*iterator)->south_bc);
//		printf("top bc = %d\n",(*iterator)->top_bc);
//		printf("bottom bc = %d\n",(*iterator)->bottom_bc);

	        for(int k = 0; k<Npz; k++) {
	                for(int j = 0; j<Npy; j++) {
	                        for(int i = 0; i<Npx ; i++) {
	                                fprintf(fp,"%2.8lf %2.8lf %2.8lf\n",x_min + i*dx, y_min + j*dy, z_min + k*dz);
	                        }
	                }
	        }


	}

	fprintf(fp,"\n\nCELLS %ld %ld\n", nCells, 9*nCells);

        for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {

                for(int k = 0; k<nz_block; k++) {
                        for(int j = 0; j<ny_block; j++) {
                                for(int i = 0; i<nx_block ; i++) {

					point[0] = node_count*Npx*Npy*Npz + get_point(i,j,k,Npx,Npy);
					point[1] = node_count*Npx*Npy*Npz + get_point(i+1,j,k,Npx,Npy);
					point[2] = node_count*Npx*Npy*Npz + get_point(i+1,j+1,k,Npx,Npy);
					point[3] = node_count*Npx*Npy*Npz + get_point(i,j+1,k,Npx,Npy);
					point[4] = node_count*Npx*Npy*Npz + get_point(i,j,k+1,Npx,Npy);
					point[5] = node_count*Npx*Npy*Npz + get_point(i+1,j,k+1,Npx,Npy);
					point[6] = node_count*Npx*Npy*Npz + get_point(i+1,j+1,k+1,Npx,Npy);
					point[7] = node_count*Npx*Npy*Npz + get_point(i,j+1,k+1,Npx,Npy);
	
                                        fprintf(fp,"8 %ld %ld %ld %ld %ld %ld %ld %ld \n",point[0], point[1], point[2], point[3], point[4], point[5], point[6], point[7]);
                                }
                        }
                }

		node_count++;

        }


	fprintf(fp,"\n\nCELL_TYPES %ld\n", nCells);

        for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {

                for(int k = 0; k<nz_block; k++) {
                        for(int j = 0; j<ny_block; j++) {
                                for(int i = 0; i<nx_block; i++) {

                                        fprintf(fp,"12\n");
                                }
                        }
                }


        }	

	fprintf(fp,"\n\nCELL_DATA %ld\n", nCells);
	fprintf(fp,"SCALARS input_field_data double 1\n");
	fprintf(fp,"LOOKUP_TABLE default\n");

        for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {


		Block* block_data = (*iterator)->get_block_data();
	

                for(int k = pad; k<(nz_block+pad); k++) {
                        for(int j = pad; j<(ny_block+pad); j++) {
                                for(int i = pad; i<(nx_block+pad); i++) {
	
                                        fprintf(fp,"%lf \n",block_data->field->val[i][j][k]);
                                }
                        }
                }

        }


	for (int f = 0 ; f < scalar_fields.size() ; f++) {
		fprintf(fp,"\nSCALARS %s double 1\n",scalar_fields[f].c_str());
		fprintf(fp,"LOOKUP_TABLE default\n");
	
	        for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {
	
	
			Block* block_data = (*iterator)->get_block_data();
		
	
	                for(int k = pad; k<(nz_block+pad); k++) {
	                        for(int j = pad; j<(ny_block+pad); j++) {
	                                for(int i = pad; i<(nx_block+pad); i++) {
		
	                                        fprintf(fp,"%lf \n",block_data->scalarfields[f]->val[i][j][k]);
	                                }
	                        }
	                }
	
	        }
	}
	
	fprintf(fp,"\nVECTORS location_data double\n");
	//fprintf(fp,"LOOKUP_TABLE default\n");

        for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {


		Block* block_data = (*iterator)->get_block_data();
	
		//std::cerr << block_data->z_max << std::endl;	

                for(int k = pad; k<(nz_block+pad); k++) {
                        for(int j = pad; j<(ny_block+pad); j++) {
                                for(int i = pad; i<(nx_block+pad); i++) {
                                        fprintf(fp,"%lf %lf %lf\n",block_data->mesh->x[i][j][k], block_data->mesh->y[i][j][k], block_data->mesh->z[i][j][k]);
                                }
                        }
                }
        }
	
	for (int f = 0 ; f < vector_fields.size() ; f++) {
		fprintf(fp,"\nVECTORS %s double\n",vector_fields[f].c_str());
		//fprintf(fp,"LOOKUP_TABLE default\n");
	
	        for (std::list<Octree*>::iterator iterator = nodes.begin(), end = nodes.end(); iterator != end; ++iterator) {
	
			Block* block_data = (*iterator)->get_block_data();
	
	                for(int k = pad; k<(nz_block+pad); k++) {
	                        for(int j = pad; j<(ny_block+pad); j++) {
	                                for(int i = pad; i<(nx_block+pad); i++) {
		
	                                        fprintf(fp,"%lf %lf %lf\n",block_data->vectorfields[f]->x[i][j][k], block_data->vectorfields[f]->y[i][j][k], block_data->vectorfields[f]->z[i][j][k]);
	                                }
	                        }
	                }
	
	        }
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, -0x38(%rbp)
leaq 0xa2e1(%rip), %rax      # 0x131d4
movl (%rax), %eax
movq %rax, -0xc8(%rbp)
leal 0x1(%rax), %eax
movl %eax, -0x5c(%rbp)
leaq 0xa2cf(%rip), %rax      # 0x131d8
movl (%rax), %eax
movq %rax, %r15
leal 0x1(%rax), %ebx
leaq 0xa2c4(%rip), %rax      # 0x131dc
movl (%rax), %eax
movq %rax, -0xa0(%rbp)
leal 0x1(%rax), %r13d
movq 0xa0c4(%rip), %rdi      # 0x12ff0
leaq 0x6400(%rip), %rsi      # 0xf333
callq 0x21d0
leaq 0x6332(%rip), %rsi      # 0xf271
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2110
movq (%r14), %rsi
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x20e0
movl $0x6b74762e, -0xf0(%rbp,%rax) # imm = 0x6B74762E
movb $0x0, -0xec(%rbp,%rax)
leaq 0x62ff(%rip), %rsi      # 0xf282
movq %r14, %rdi
callq 0x2210
movq %rax, %r14
leaq 0x62ef(%rip), %rdi      # 0xf284
pushq $0x1b
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
movq %rax, %rcx
callq 0x2360
leaq 0x62f2(%rip), %rdi      # 0xf2a0
pushq $0x14
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2360
leaq 0x62f2(%rip), %rdi      # 0xf2b5
pushq $0x6
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2360
leaq 0x62e4(%rip), %rdi      # 0xf2bc
pushq $0x1a
popq %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2360
imull -0x5c(%rbp), %ebx
movq %rbx, -0xc0(%rbp)
imull %ebx, %r13d
movl %r13d, -0xb4(%rbp)
movslq %r13d, %rdx
movq -0x38(%rbp), %rbx
movq 0x10(%rbx), %rax
movq %rax, -0x68(%rbp)
imulq %rax, %rdx
leaq 0xa1be(%rip), %rax      # 0x131d4
movslq (%rax), %rax
leaq 0xa1b8(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
imulq %rax, %rcx
leaq 0xa1ae(%rip), %rax      # 0x131dc
movslq (%rax), %rax
imulq %rcx, %rax
movq %rax, -0xd0(%rbp)
leaq 0x6294(%rip), %rsi      # 0xf2d7
movq %r14, -0x40(%rbp)
movq %r14, %rdi
xorl %eax, %eax
callq 0x2290
leaq 0x6292(%rip), %r12      # 0xf2ea
movq %rbx, %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x91ac
movq %rax, -0x88(%rbp)
movq 0x10(%rax), %rdi
callq 0x3db0
movsd 0x70(%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd 0x78(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x80(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
xorl %r13d, %r13d
xorpd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
cmpl -0xa0(%rbp), %r13d
jg 0x91a0
movsd -0x48(%rbp), %xmm0
mulsd -0x98(%rbp), %xmm0
addsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
xorl %r14d, %r14d
xorpd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
cmpl %r15d, %r14d
jg 0x9186
movsd -0x50(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
cmpl -0xc8(%rbp), %ebx
jg 0x916c
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0xb0(%rbp), %xmm0
addsd -0xa8(%rbp), %xmm0
movq -0x40(%rbp), %rdi
movq %r12, %rsi
movsd -0x58(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
movb $0x3, %al
callq 0x2290
movsd -0x30(%rbp), %xmm0
addsd 0x5eb0(%rip), %xmm0     # 0xf018
incl %ebx
jmp 0x9121
movsd -0x50(%rbp), %xmm0
addsd 0x5e9f(%rip), %xmm0     # 0xf018
movsd %xmm0, -0x50(%rbp)
incl %r14d
jmp 0x9102
movsd -0x48(%rbp), %xmm0
addsd 0x5e85(%rip), %xmm0     # 0xf018
movsd %xmm0, -0x48(%rbp)
incl %r13d
jmp 0x90cf
movq -0x88(%rbp), %rax
jmp 0x905b
movq -0x68(%rbp), %rdx
imulq -0xd0(%rbp), %rdx
leaq (%rdx,%rdx,8), %rcx
leaq 0x613d(%rip), %rsi      # 0xf300
movq -0x40(%rbp), %rdi
movq %rdx, -0x68(%rbp)
xorl %eax, %eax
callq 0x2290
movl -0x5c(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0xa8(%rbp)
addl $0x2, %r15d
imull %eax, %r15d
movq %r15, -0x88(%rbp)
xorl %ecx, %ecx
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x9398
movq %rax, -0x90(%rbp)
movl -0xb4(%rbp), %eax
movq %rcx, -0x98(%rbp)
imull %ecx, %eax
movslq %eax, %r15
decq %r15
xorl %ebx, %ebx
movq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
leaq 0x9f8e(%rip), %rax      # 0x131dc
movl -0x50(%rbp), %ecx
cmpl (%rax), %ecx
jge 0x9382
movl %ecx, %eax
incl %eax
movl %eax, -0x50(%rbp)
xorl %ecx, %ecx
movq -0x78(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x80(%rbp)
movq %rbx, -0xa0(%rbp)
leaq 0x9f50(%rip), %rax      # 0x131d8
cmpl (%rax), %ecx
jge 0x9360
incl %ecx
movl %ecx, -0xb0(%rbp)
xorl %eax, %eax
leaq 0x9f33(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
cmpq %rcx, %rax
jge 0x933f
leaq 0x1(%rax), %r14
leal (%rbx,%rax), %ecx
incl %ecx
movslq %ecx, %rdx
addq %r15, %rdx
leal (%rbx,%rax), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
addq %r15, %rcx
movq -0x80(%rbp), %rdi
leal (%rdi,%rax), %esi
addl $0x3, %esi
movslq %esi, %r8
addq %r15, %r8
leal (%rdi,%rax), %esi
addl $0x2, %esi
movslq %esi, %r9
addq %r15, %r9
movq -0x58(%rbp), %rdi
leal (%rdi,%rax), %esi
incl %esi
movslq %esi, %r10
addq %r15, %r10
leal (%rdi,%rax), %esi
addl $0x2, %esi
movslq %esi, %r11
addq %r15, %r11
movq -0x30(%rbp), %rdi
leal (%rdi,%rax), %esi
addl $0x2, %esi
movslq %esi, %r13
addq %r15, %r13
addl %edi, %eax
incl %eax
movslq %eax, %r12
addq %r15, %r12
movq -0x40(%rbp), %rdi
leaq 0x5fed(%rip), %rsi      # 0xf311
xorl %eax, %eax
pushq %r12
pushq %r13
pushq %r11
pushq %r10
callq 0x2290
addq $0x20, %rsp
movq %r14, %rax
jmp 0x929a
movq -0xa8(%rbp), %rax
addq %rax, %rbx
addq %rax, -0x80(%rbp)
addq %rax, -0x58(%rbp)
addq %rax, -0x30(%rbp)
movl -0xb0(%rbp), %ecx
jmp 0x9281
movq -0xc0(%rbp), %rax
movq -0xa0(%rbp), %rbx
addq %rax, %rbx
addq %rax, -0x48(%rbp)
addq %rax, -0x70(%rbp)
addq %rax, -0x78(%rbp)
jmp 0x9247
movq -0x98(%rbp), %rcx
incq %rcx
movq -0x90(%rbp), %rax
jmp 0x91f3
leaq 0x5f96(%rip), %rsi      # 0xf335
movq -0x40(%rbp), %rdi
movq -0x68(%rbp), %rdx
xorl %eax, %eax
callq 0x2290
leaq 0x5f92(%rip), %r12      # 0xf347
pushq $0x3
popq %r13
pushq $0x1
popq %r15
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x9422
movq %rax, -0x58(%rbp)
xorl %ecx, %ecx
leaq 0x9e05(%rip), %rax      # 0x131dc
cmpl (%rax), %ecx
jge 0x941c
movl %ecx, -0x30(%rbp)
xorl %ebx, %ebx
leaq 0x9df1(%rip), %rax      # 0x131d8
cmpl (%rax), %ebx
jge 0x9415
xorl %r14d, %r14d
leaq 0x9ddf(%rip), %rax      # 0x131d4
cmpl (%rax), %r14d
jge 0x9411
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq -0x40(%rbp), %rcx
callq 0x2360
incl %r14d
jmp 0x93ee
incl %ebx
jmp 0x93e0
movl -0x30(%rbp), %ecx
incl %ecx
jmp 0x93d0
movq -0x58(%rbp), %rax
jmp 0x93c1
leaq 0x5f22(%rip), %rsi      # 0xf34b
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq -0x68(%rbp), %rdx
xorl %eax, %eax
callq 0x2290
leaq 0x5f1a(%rip), %rdi      # 0xf35c
pushq $0x22
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2360
leaq 0x5f24(%rip), %rdi      # 0xf37f
pushq $0x15
popq %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2360
leaq 0x5f25(%rip), %r13      # 0xf395
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x9522
movq %rax, -0x30(%rbp)
movq 0x10(%rax), %rdi
callq 0x3db0
movq %rax, %r12
leaq 0x9d38(%rip), %rax      # 0x131d0
movl (%rax), %eax
movslq %eax, %r15
leaq 0x9d38(%rip), %rcx      # 0x131dc
movslq (%rcx), %rcx
movslq %eax, %r14
addq %r14, %rcx
cmpq %rcx, %r15
jge 0x9519
leaq 0x9d1f(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
movslq %eax, %rbx
addq %rbx, %rcx
cmpq %rcx, %r14
jge 0x9514
leaq 0x9d06(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
cmpq %rdx, %rbx
jge 0x950f
movq 0x8(%r12), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%r15,8), %xmm0
movq -0x40(%rbp), %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x2290
incq %rbx
leaq 0x9cc5(%rip), %rax      # 0x131d0
movl (%rax), %eax
jmp 0x94c7
incq %r14
jmp 0x94b2
incq %r15
jmp 0x949d
movq -0x30(%rbp), %rax
jmp 0x9474
xorl %ebx, %ebx
leaq 0xa0ed(%rip), %rcx      # 0x13618
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rbx, %rcx
jbe 0x963b
movq %rbx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
movq -0x40(%rbp), %r14
movq %r14, %rdi
leaq 0x5e40(%rip), %rsi      # 0xf39b
xorl %eax, %eax
callq 0x2290
leaq 0x5e16(%rip), %rdi      # 0xf37f
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2360
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x9633
movq %rax, -0x30(%rbp)
movq 0x10(%rax), %rdi
callq 0x3db0
movq %rax, %r13
leaq 0x9c31(%rip), %rax      # 0x131d0
movl (%rax), %eax
movslq %eax, %r15
leaq 0x9c31(%rip), %rcx      # 0x131dc
movslq (%rcx), %rcx
movslq %eax, %r14
addq %r14, %rcx
cmpq %rcx, %r15
jge 0x962a
leaq 0x9c18(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
movslq %eax, %r12
addq %r12, %rcx
cmpq %rcx, %r14
jl 0x9608
jmp 0x9622
movq 0x10(%r13), %rax
movq (%rax,%rbx,8), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%r15,8), %xmm0
movq -0x40(%rbp), %rdi
leaq 0x5da0(%rip), %rsi      # 0xf395
movb $0x1, %al
callq 0x2290
incq %r12
leaq 0x9bca(%rip), %rax      # 0x131d0
movl (%rax), %eax
leaq 0x9bc5(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
cmpq %rdx, %r12
jl 0x95d0
incq %r14
jmp 0x95b9
incq %r15
jmp 0x95a4
movq -0x30(%rbp), %rax
jmp 0x957b
incq %rbx
jmp 0x9524
leaq 0x5d6f(%rip), %rdi      # 0xf3b1
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
movq -0x40(%rbp), %rcx
callq 0x2360
leaq 0x5d78(%rip), %r13      # 0xf3d0
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x9737
movq %rax, -0x30(%rbp)
movq 0x10(%rax), %rdi
callq 0x3db0
movq %rax, %r12
leaq 0x9b50(%rip), %rax      # 0x131d0
movl (%rax), %eax
movslq %eax, %r15
leaq 0x9b50(%rip), %rcx      # 0x131dc
movslq (%rcx), %rcx
movslq %eax, %r14
addq %r14, %rcx
cmpq %rcx, %r15
jge 0x972e
leaq 0x9b33(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
movslq %eax, %rbx
addq %rbx, %rcx
cmpq %rcx, %r14
jge 0x9726
leaq 0x9b1a(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
cmpq %rdx, %rbx
jge 0x971e
movq (%r12), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq (%rcx,%rbx,8), %rcx
movq (%rcx,%r14,8), %rcx
movsd (%rcx,%r15,8), %xmm0
movq (%rdx,%rbx,8), %rcx
movq (%rcx,%r14,8), %rcx
movsd (%rcx,%r15,8), %xmm1
movq 0x20(%rax), %rax
movq (%rax,%rbx,8), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%r15,8), %xmm2
movq -0x40(%rbp), %rdi
movq %r13, %rsi
movb $0x3, %al
callq 0x2290
incq %rbx
leaq 0x9ab6(%rip), %rax      # 0x131d0
movl (%rax), %eax
jmp 0x96b3
incq %r14
jmp 0x969e
incq %r15
jmp 0x9685
movq -0x30(%rbp), %rax
jmp 0x965c
xorl %ebx, %ebx
leaq 0x9ef0(%rip), %rcx      # 0x13630
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rbx, %rcx
jbe 0x9863
movq %rbx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
movq -0x40(%rbp), %rdi
leaq 0x5c70(%rip), %rsi      # 0xf3dd
xorl %eax, %eax
callq 0x2290
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x985b
movq %rax, -0x30(%rbp)
movq 0x10(%rax), %rdi
callq 0x3db0
movq %rax, %r13
leaq 0x9a34(%rip), %rax      # 0x131d0
movl (%rax), %eax
movslq %eax, %r15
leaq 0x9a34(%rip), %rcx      # 0x131dc
movslq (%rcx), %rcx
movslq %eax, %r14
addq %r14, %rcx
cmpq %rcx, %r15
jge 0x9852
leaq 0x9a17(%rip), %rcx      # 0x131d8
movslq (%rcx), %rcx
movslq %eax, %r12
addq %r12, %rcx
cmpq %rcx, %r14
jl 0x982d
jmp 0x984a
movq 0x18(%r13), %rax
movq (%rax,%rbx,8), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq (%rcx,%r12,8), %rcx
movq (%rcx,%r14,8), %rcx
movsd (%rcx,%r15,8), %xmm0
movq (%rdx,%r12,8), %rcx
movq (%rcx,%r14,8), %rcx
movsd (%rcx,%r15,8), %xmm1
movq 0x20(%rax), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%r15,8), %xmm2
movq -0x40(%rbp), %rdi
leaq 0x5bb6(%rip), %rsi      # 0xf3d0
movb $0x3, %al
callq 0x2290
incq %r12
leaq 0x99a5(%rip), %rax      # 0x131d0
movl (%rax), %eax
leaq 0x99a0(%rip), %rcx      # 0x131d4
movslq (%rcx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
cmpq %rdx, %r12
jl 0x97d1
incq %r14
jmp 0x97ba
incq %r15
jmp 0x97a1
movq -0x30(%rbp), %rax
jmp 0x9778
incq %rbx
jmp 0x9739
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)