// File: 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 %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, -0x218(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x13c5a(%rip), %rax     # 0x2626c
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
leaq 0x13c4f(%rip), %rax     # 0x26270
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
leaq 0x13c44(%rip), %rax     # 0x26274
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq 0x139b1(%rip), %rdi     # 0x25ff0
leaq 0xecbb(%rip), %rsi      # 0x21301
callq 0x3240
movq %rax, %rdi
leaq 0xebea(%rip), %rsi      # 0x2123f
callq 0x3240
movq %rax, %rdi
movq 0x1395c(%rip), %rsi     # 0x25fc0
callq 0x3270
movq -0x218(%rbp), %rdi
leaq -0x50(%rbp), %rax
movq %rax, -0x210(%rbp)
callq 0x3110
movq -0x210(%rbp), %rdi
movq %rax, %rsi
callq 0x3230
leaq -0x50(%rbp), %rdi
leaq 0xebb1(%rip), %rsi      # 0x2124b
callq 0x3440
leaq -0x50(%rbp), %rdi
leaq 0xeba6(%rip), %rsi      # 0x21250
callq 0x32d0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
leaq 0xeb94(%rip), %rsi      # 0x21252
movb $0x0, %al
callq 0x3380
movq -0x58(%rbp), %rdi
leaq 0xeb9e(%rip), %rsi      # 0x2126e
movb $0x0, %al
callq 0x3380
movq -0x58(%rbp), %rdi
leaq 0xeba1(%rip), %rsi      # 0x21283
movb $0x0, %al
callq 0x3380
movq -0x58(%rbp), %rdi
leaq 0xeb96(%rip), %rsi      # 0x2128a
movb $0x0, %al
callq 0x3380
movl -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x208(%rbp)
movq -0x10(%rbp), %rdi
callq 0x136c0
movq %rax, %rcx
movq -0x208(%rbp), %rax
imulq %rcx, %rax
movq %rax, -0x60(%rbp)
leaq 0x13b3b(%rip), %rax     # 0x2626c
movl (%rax), %eax
leaq 0x13b36(%rip), %rcx     # 0x26270
imull (%rcx), %eax
leaq 0x13b30(%rip), %rcx     # 0x26274
imull (%rcx), %eax
cltq
movq %rax, -0x200(%rbp)
movq -0x10(%rbp), %rdi
callq 0x136c0
movq %rax, %rcx
movq -0x200(%rbp), %rax
imulq %rcx, %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0xb4(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rdx
leaq 0xeb21(%rip), %rsi      # 0x212a5
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x127c7
jmp 0x12980
leaq -0xc0(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movl 0xc(%rax), %eax
movl %eax, -0xd4(%rbp)
movq -0xd0(%rbp), %rax
movsd 0x70(%rax), %xmm0
movsd %xmm0, -0xe0(%rbp)
movq -0xd0(%rbp), %rax
movsd 0x78(%rax), %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0xd0(%rbp), %rax
movsd 0x80(%rax), %xmm0
movsd %xmm0, -0xf0(%rbp)
movq -0xd0(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0xf8(%rbp)
movq -0xd0(%rbp), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x100(%rbp)
movq -0xd0(%rbp), %rax
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x108(%rbp)
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1296d
movl $0x0, -0x110(%rbp)
movl -0x110(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x12957
movl $0x0, -0x114(%rbp)
movl -0x114(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x12941
movq -0x58(%rbp), %rdi
movsd -0xf8(%rbp), %xmm1
cvtsi2sdl -0x114(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x100(%rbp), %xmm2
cvtsi2sdl -0x110(%rbp), %xmm1
movsd -0xe8(%rbp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd -0x108(%rbp), %xmm3
cvtsi2sdl -0x10c(%rbp), %xmm2
movsd -0xf0(%rbp), %xmm4
mulsd %xmm4, %xmm2
addsd %xmm3, %xmm2
leaq 0xe992(%rip), %rsi      # 0x212b8
movb $0x3, %al
callq 0x3380
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x128ac
jmp 0x12943
movl -0x110(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x12893
jmp 0x12959
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x1287a
jmp 0x1296f
leaq -0xc0(%rbp), %rdi
callq 0x4550
jmp 0x127ab
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rdx
imulq $0x9, -0x68(%rbp), %rcx
leaq 0xe93a(%rip), %rsi      # 0x212ce
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0x120(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x129d7
jmp 0x12d71
movl $0x0, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
leaq 0x13886(%rip), %rcx     # 0x26274
cmpl (%rcx), %eax
jge 0x12d51
movl $0x0, -0x130(%rbp)
movl -0x130(%rbp), %eax
leaq 0x13863(%rip), %rcx     # 0x26270
cmpl (%rcx), %eax
jge 0x12d3b
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
leaq 0x13840(%rip), %rcx     # 0x2626c
cmpl (%rcx), %eax
jge 0x12d25
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x258(%rbp)
movl -0x134(%rbp), %edi
movl -0x130(%rbp), %esi
movl -0x12c(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x258(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x250(%rbp)
movl -0x134(%rbp), %edi
addl $0x1, %edi
movl -0x130(%rbp), %esi
movl -0x12c(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x250(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x248(%rbp)
movl -0x134(%rbp), %edi
addl $0x1, %edi
movl -0x130(%rbp), %esi
addl $0x1, %esi
movl -0x12c(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x248(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x240(%rbp)
movl -0x134(%rbp), %edi
movl -0x130(%rbp), %esi
addl $0x1, %esi
movl -0x12c(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x240(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x238(%rbp)
movl -0x134(%rbp), %edi
movl -0x130(%rbp), %esi
movl -0x12c(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x238(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x230(%rbp)
movl -0x134(%rbp), %edi
addl $0x1, %edi
movl -0x130(%rbp), %esi
movl -0x12c(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x230(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x228(%rbp)
movl -0x134(%rbp), %edi
addl $0x1, %edi
movl -0x130(%rbp), %esi
addl $0x1, %esi
movl -0x12c(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x228(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl -0xb4(%rbp), %eax
imull -0x1c(%rbp), %eax
imull -0x20(%rbp), %eax
imull -0x24(%rbp), %eax
cltq
movq %rax, -0x220(%rbp)
movl -0x134(%rbp), %edi
movl -0x130(%rbp), %esi
addl $0x1, %esi
movl -0x12c(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
callq 0x12590
movq %rax, %rcx
movq -0x220(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rdi
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0xa0(%rbp), %r8
movq -0x98(%rbp), %r9
movq -0x90(%rbp), %rbx
movq -0x88(%rbp), %r11
movq -0x80(%rbp), %r10
movq -0x78(%rbp), %rax
leaq 0xe5e8(%rip), %rsi      # 0x212df
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x3380
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x12a1f
jmp 0x12d27
movl -0x130(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x130(%rbp)
jmp 0x12a00
jmp 0x12d3d
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x129e1
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4550
jmp 0x129bb
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0xe583(%rip), %rsi      # 0x21303
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0x148(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x12dc3
jmp 0x12e77
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
leaq 0x1349a(%rip), %rcx     # 0x26274
cmpl (%rcx), %eax
jge 0x12e64
movl $0x0, -0x150(%rbp)
movl -0x150(%rbp), %eax
leaq 0x13477(%rip), %rcx     # 0x26270
cmpl (%rcx), %eax
jge 0x12e4e
movl $0x0, -0x154(%rbp)
movl -0x154(%rbp), %eax
leaq 0x13458(%rip), %rcx     # 0x2626c
cmpl (%rcx), %eax
jge 0x12e3b
movq -0x58(%rbp), %rdi
leaq 0xe4f2(%rip), %rsi      # 0x21315
movb $0x0, %al
callq 0x3380
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x12e07
jmp 0x12e3d
movl -0x150(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x150(%rbp)
jmp 0x12dec
jmp 0x12e50
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x12dcd
jmp 0x12e66
leaq -0x140(%rbp), %rdi
callq 0x4550
jmp 0x12da7
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0xe493(%rip), %rsi      # 0x21319
movb $0x0, %al
callq 0x3380
movq -0x58(%rbp), %rdi
leaq 0xe492(%rip), %rsi      # 0x2132a
movb $0x0, %al
callq 0x3380
movq -0x58(%rbp), %rdi
leaq 0xe4a3(%rip), %rsi      # 0x2134d
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0x160(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x12eed
jmp 0x13024
leaq -0x160(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq %rax, -0x170(%rbp)
leaq 0x13359(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x174(%rbp)
movl -0x174(%rbp), %eax
leaq 0x13350(%rip), %rcx     # 0x26274
movl (%rcx), %ecx
leaq 0x1333b(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13011
leaq 0x1332a(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x178(%rbp)
movl -0x178(%rbp), %eax
leaq 0x1331d(%rip), %rcx     # 0x26270
movl (%rcx), %ecx
leaq 0x1330c(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x12ffb
leaq 0x132fb(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
leaq 0x132ea(%rip), %rcx     # 0x2626c
movl (%rcx), %ecx
leaq 0x132dd(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x12fe5
movq -0x58(%rbp), %rdi
movq -0x170(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movslq -0x17c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x178(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x174(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0xe396(%rip), %rsi      # 0x21363
movb $0x1, %al
callq 0x3380
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x12f75
jmp 0x12fe7
movl -0x178(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x178(%rbp)
jmp 0x12f46
jmp 0x12ffd
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0x12f17
jmp 0x13013
leaq -0x160(%rbp), %rdi
callq 0x4550
jmp 0x12ed1
movl $0x0, -0x180(%rbp)
movslq -0x180(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq 0x13675(%rip), %rdi     # 0x266b8
callq 0x5b00
movq %rax, %rcx
movq -0x260(%rbp), %rax
cmpq %rcx, %rax
jae 0x1323f
movq -0x58(%rbp), %rax
movq %rax, -0x268(%rbp)
movslq -0x180(%rbp), %rsi
leaq 0x13644(%rip), %rdi     # 0x266b8
callq 0x5b20
movq %rax, %rdi
callq 0x3110
movq -0x268(%rbp), %rdi
movq %rax, %rdx
leaq 0xe2d7(%rip), %rsi      # 0x21369
movb $0x0, %al
callq 0x3380
movq -0x58(%rbp), %rdi
leaq 0xe2a9(%rip), %rsi      # 0x2134d
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0x188(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0x190(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x130e7
jmp 0x13229
leaq -0x188(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq %rax, -0x198(%rbp)
leaq 0x1315f(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x19c(%rbp)
movl -0x19c(%rbp), %eax
leaq 0x13156(%rip), %rcx     # 0x26274
movl (%rcx), %ecx
leaq 0x13141(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13216
leaq 0x13130(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1a0(%rbp)
movl -0x1a0(%rbp), %eax
leaq 0x13123(%rip), %rcx     # 0x26270
movl (%rcx), %ecx
leaq 0x13112(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13200
leaq 0x13101(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1a4(%rbp)
movl -0x1a4(%rbp), %eax
leaq 0x130f0(%rip), %rcx     # 0x2626c
movl (%rcx), %ecx
leaq 0x130e3(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x131ea
movq -0x58(%rbp), %rdi
movq -0x198(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x180(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movslq -0x1a4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1a0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x19c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0xe191(%rip), %rsi      # 0x21363
movb $0x1, %al
callq 0x3380
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x1316f
jmp 0x131ec
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x13140
jmp 0x13202
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0x13111
jmp 0x13218
leaq -0x188(%rbp), %rdi
callq 0x4550
jmp 0x130cb
jmp 0x1322b
movl -0x180(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x180(%rbp)
jmp 0x1302e
movq -0x58(%rbp), %rdi
leaq 0xe135(%rip), %rsi      # 0x2137f
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0x1b0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0x1b8(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x1328d
jmp 0x1342a
leaq -0x1b0(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq %rax, -0x1c0(%rbp)
leaq 0x12fb9(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1c4(%rbp)
movl -0x1c4(%rbp), %eax
leaq 0x12fb0(%rip), %rcx     # 0x26274
movl (%rcx), %ecx
leaq 0x12f9b(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13417
leaq 0x12f8a(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1c8(%rbp)
movl -0x1c8(%rbp), %eax
leaq 0x12f7d(%rip), %rcx     # 0x26270
movl (%rcx), %ecx
leaq 0x12f6c(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13401
leaq 0x12f5b(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1cc(%rbp)
movl -0x1cc(%rbp), %eax
leaq 0x12f4a(%rip), %rcx     # 0x2626c
movl (%rcx), %ecx
leaq 0x12f3d(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x133eb
movq -0x58(%rbp), %rdi
movq -0x1c0(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq -0x1cc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x1c0(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq -0x1cc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x1c0(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movslq -0x1cc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
leaq 0xdfce(%rip), %rsi      # 0x2139e
movb $0x3, %al
callq 0x3380
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
jmp 0x13315
jmp 0x133ed
movl -0x1c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c8(%rbp)
jmp 0x132e6
jmp 0x13403
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x132b7
jmp 0x13419
leaq -0x1b0(%rbp), %rdi
callq 0x4550
jmp 0x13271
movl $0x0, -0x1d0(%rbp)
movslq -0x1d0(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq 0x13287(%rip), %rdi     # 0x266d0
callq 0x5b00
movq %rax, %rcx
movq -0x270(%rbp), %rax
cmpq %rcx, %rax
jae 0x136b2
movq -0x58(%rbp), %rax
movq %rax, -0x278(%rbp)
movslq -0x1d0(%rbp), %rsi
leaq 0x13256(%rip), %rdi     # 0x266d0
callq 0x5b20
movq %rax, %rdi
callq 0x3110
movq -0x278(%rbp), %rdi
movq %rax, %rdx
leaq 0xdf13(%rip), %rsi      # 0x213ab
movb $0x0, %al
callq 0x3380
movq -0x10(%rbp), %rdi
callq 0x4490
movq %rax, -0x1d8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x44c0
movq %rax, -0x1e0(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x44f0
testb $0x1, %al
jne 0x134db
jmp 0x1369c
leaq -0x1d8(%rbp), %rdi
callq 0x4520
movq (%rax), %rdi
callq 0x6de0
movq %rax, -0x1e8(%rbp)
leaq 0x12d6b(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1ec(%rbp)
movl -0x1ec(%rbp), %eax
leaq 0x12d62(%rip), %rcx     # 0x26274
movl (%rcx), %ecx
leaq 0x12d4d(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13689
leaq 0x12d3c(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1f0(%rbp)
movl -0x1f0(%rbp), %eax
leaq 0x12d2f(%rip), %rcx     # 0x26270
movl (%rcx), %ecx
leaq 0x12d1e(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x13673
leaq 0x12d0d(%rip), %rax     # 0x26268
movl (%rax), %eax
movl %eax, -0x1f4(%rbp)
movl -0x1f4(%rbp), %eax
leaq 0x12cfc(%rip), %rcx     # 0x2626c
movl (%rcx), %ecx
leaq 0x12cef(%rip), %rdx     # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x1365d
movq -0x58(%rbp), %rdi
movq -0x1e8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1d0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movslq -0x1f4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1f0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1ec(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x1e8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1d0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movslq -0x1f4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1f0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1ec(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x1e8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1d0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movslq -0x1f4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1f0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1ec(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
leaq 0xdd5c(%rip), %rsi      # 0x2139e
movb $0x3, %al
callq 0x3380
movl -0x1f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f4(%rbp)
jmp 0x13563
jmp 0x1365f
movl -0x1f0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f0(%rbp)
jmp 0x13534
jmp 0x13675
movl -0x1ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ec(%rbp)
jmp 0x13505
jmp 0x1368b
leaq -0x1d8(%rbp), %rdi
callq 0x4550
jmp 0x134bf
jmp 0x1369e
movl -0x1d0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d0(%rbp)
jmp 0x13434
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %rbp
retq
nopl (%rax)