// File: /workspace/github_cpp_makefile_star2_O1/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, -0x30(%rbp)
movq %rdi, %r15
leaq 0xb685(%rip), %rax      # 0x151e4
movl (%rax), %eax
movq %rax, -0xc0(%rbp)
leal 0x1(%rax), %eax
movl %eax, -0x58(%rbp)
leaq 0xb673(%rip), %rax      # 0x151e8
movl (%rax), %eax
movq %rax, %r14
leal 0x1(%rax), %ebx
leaq 0xb668(%rip), %rax      # 0x151ec
movl (%rax), %eax
movq %rax, -0x60(%rbp)
leal 0x1(%rax), %r13d
movq 0xb45b(%rip), %r12      # 0x14ff0
leaq 0x7797(%rip), %rsi      # 0x11333
movl $0x1, %edx
movq %r12, %rdi
callq 0x2230
leaq 0x76c1(%rip), %rsi      # 0x11271
movl $0xb, %edx
movq %r12, %rdi
callq 0x2230
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0xf0(%rbp), %r12
movq %r12, %rdi
callq 0x21b0
movq %r12, %rdi
callq 0x20f0
movl $0x6b74762e, -0xf0(%rbp,%rax) # imm = 0x6B74762E
movb $0x0, -0xec(%rbp,%rax)
leaq 0x7665(%rip), %rsi      # 0x11282
movq %r12, %rdi
callq 0x2240
movq %rax, %r12
leaq 0x7655(%rip), %rdi      # 0x11284
movl $0x1b, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2380
leaq 0x7658(%rip), %rdi      # 0x112a0
movl $0x14, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2380
leaq 0x7654(%rip), %rdi      # 0x112b5
movl $0x6, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2380
leaq 0x7642(%rip), %rdi      # 0x112bc
movl $0x1a, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x2380
imull -0x58(%rbp), %ebx
movq %rbx, -0xb8(%rbp)
imull %ebx, %r13d
movl %r13d, -0xac(%rbp)
movslq %r13d, %rdx
movq 0x10(%r15), %rax
imulq %rax, %rdx
leaq 0xb530(%rip), %rcx      # 0x151e4
movslq (%rcx), %rcx
leaq 0xb52a(%rip), %rsi      # 0x151e8
movslq (%rsi), %rsi
imulq %rcx, %rsi
leaq 0xb520(%rip), %rcx      # 0x151ec
movslq (%rcx), %rcx
imulq %rax, %rcx
imulq %rsi, %rcx
movq %rcx, -0x88(%rbp)
leaq 0x75f2(%rip), %rsi      # 0x112d7
movq %r12, -0x30(%rbp)
movq %r12, %rdi
xorl %eax, %eax
callq 0x22a0
movq (%r15), %rax
movq %r15, -0x40(%rbp)
cmpq %r15, %rax
je 0x9e82
leaq 0x75e0(%rip), %r12      # 0x112ea
movq -0x30(%rbp), %rbx
movq %rax, -0xc8(%rbp)
movq 0x10(%rax), %rdi
callq 0x4064
movsd 0x72f2(%rip), %xmm0     # 0x11018
cmpl $0x0, -0x60(%rbp)
js 0x9e6e
movsd 0x70(%rax), %xmm1
movsd 0x78(%rax), %xmm2
movsd %xmm2, -0x80(%rbp)
movsd 0x80(%rax), %xmm2
movsd %xmm2, -0x90(%rbp)
movsd 0x40(%rax), %xmm4
movsd 0x50(%rax), %xmm3
movsd %xmm3, -0x78(%rbp)
movsd 0x60(%rax), %xmm3
movsd %xmm3, -0xd0(%rbp)
xorl %eax, %eax
xorpd %xmm3, %xmm3
movsd %xmm3, -0x50(%rbp)
movsd %xmm1, -0xa8(%rbp)
movsd %xmm4, -0xa0(%rbp)
movq %rax, -0x98(%rbp)
testl %r14d, %r14d
js 0x9e4d
movsd -0x50(%rbp), %xmm2
mulsd -0x90(%rbp), %xmm2
addsd -0xd0(%rbp), %xmm2
xorl %r15d, %r15d
xorpd %xmm3, %xmm3
movsd %xmm3, -0x68(%rbp)
movsd %xmm2, -0x70(%rbp)
cmpl $0x0, -0xc0(%rbp)
js 0x9e2f
movsd -0x68(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
xorpd %xmm3, %xmm3
movl -0x58(%rbp), %r13d
movsd %xmm3, -0x38(%rbp)
movapd %xmm3, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm4, %xmm0
movq %rbx, %rdi
movq %r12, %rsi
movsd -0x48(%rbp), %xmm1
movb $0x3, %al
callq 0x22a0
movsd -0x38(%rbp), %xmm3
movsd -0x70(%rbp), %xmm2
movsd -0xa0(%rbp), %xmm4
movsd -0xa8(%rbp), %xmm1
movsd 0x71f2(%rip), %xmm0     # 0x11018
addsd %xmm0, %xmm3
decl %r13d
jne 0x9de1
movsd -0x68(%rbp), %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, -0x68(%rbp)
leal 0x1(%r15), %eax
cmpl %r14d, %r15d
movl %eax, %r15d
jne 0x9dbc
movsd -0x50(%rbp), %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, -0x50(%rbp)
movq -0x98(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpl -0x60(%rbp), %ecx
jne 0x9d86
movq -0xc8(%rbp), %rax
movq (%rax), %rax
cmpq -0x40(%rbp), %rax
jne 0x9d0e
movq -0x88(%rbp), %rdx
leaq (%rdx,%rdx,8), %rcx
leaq 0x746c(%rip), %rsi      # 0x11300
movq -0x30(%rbp), %rdi
xorl %eax, %eax
callq 0x22a0
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
leaq 0xb334(%rip), %rdx      # 0x151e4
je 0xa084
addl $0x2, %r14d
movl -0x58(%rbp), %eax
imull %eax, %r14d
movq %r14, -0x90(%rbp)
movl %eax, %eax
movq %rax, -0xa0(%rbp)
movq $0x0, -0x60(%rbp)
movq %rcx, -0x98(%rbp)
leaq 0xb305(%rip), %rax      # 0x151ec
cmpl $0x0, (%rax)
jle 0xa06c
movl -0xac(%rbp), %eax
imull -0x60(%rbp), %eax
movslq %eax, %r13
decq %r13
movq $0x0, -0x80(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x50(%rbp)
xorl %ecx, %ecx
movl %ecx, -0x68(%rbp)
leaq 0xb2b3(%rip), %rax      # 0x151e8
cmpl $0x0, (%rax)
jle 0xa041
xorl %ecx, %ecx
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdi
movq -0x58(%rbp), %r11
movq -0x50(%rbp), %r14
movl %ecx, -0xa8(%rbp)
cmpl $0x0, (%rdx)
jle 0xa017
xorl %eax, %eax
movq %rsi, -0x48(%rbp)
movq %r11, -0x70(%rbp)
leaq 0x1(%rax), %rcx
movq %rcx, -0x38(%rbp)
leal (%rsi,%rax), %ecx
incl %ecx
movslq %ecx, %rdx
addq %r13, %rdx
leal (%rsi,%rax), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
addq %r13, %rcx
leal (%rdi,%rax), %esi
addl $0x3, %esi
movslq %esi, %r8
addq %r13, %r8
leal (%rdi,%rax), %esi
addl $0x2, %esi
movslq %esi, %r9
addq %r13, %r9
leal (%r11,%rax), %esi
incl %esi
movslq %esi, %r10
addq %r13, %r10
leal (%r11,%rax), %esi
addl $0x2, %esi
movslq %esi, %r11
addq %r13, %r11
leal (%r14,%rax), %esi
addl $0x2, %esi
movslq %esi, %r12
addq %r13, %r12
addl %r14d, %eax
incl %eax
movslq %eax, %r15
addq %r13, %r15
movq %rdi, %rbx
movq -0x30(%rbp), %rdi
leaq 0x7332(%rip), %rsi      # 0x11311
xorl %eax, %eax
pushq %r15
pushq %r12
pushq %r11
pushq %r10
callq 0x22a0
movq -0x70(%rbp), %r11
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
leaq 0xb1e4(%rip), %rdx      # 0x151e4
addq $0x20, %rsp
movslq (%rdx), %rcx
movq -0x38(%rbp), %r8
movq %r8, %rax
cmpq %rcx, %r8
jl 0x9f69
movl -0xa8(%rbp), %ecx
incl %ecx
movq -0xa0(%rbp), %rax
addq %rax, %r14
addq %rax, %r11
addq %rax, %rdi
addq %rax, %rsi
leaq 0xb1af(%rip), %rax      # 0x151e8
cmpl (%rax), %ecx
jl 0x9f50
movl -0x68(%rbp), %ecx
incl %ecx
movq -0xb8(%rbp), %rax
addq %rax, -0x50(%rbp)
addq %rax, -0x58(%rbp)
addq %rax, -0x78(%rbp)
addq %rax, -0x80(%rbp)
leaq 0xb188(%rip), %rax      # 0x151ec
cmpl (%rax), %ecx
jl 0x9f2b
incq -0x60(%rbp)
movq -0x98(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0x9ed9
leaq 0x72aa(%rip), %rsi      # 0x11335
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rdx
xorl %eax, %eax
callq 0x22a0
leaq 0xb140(%rip), %rcx      # 0x151e4
movq -0x40(%rbp), %rax
movq (%rax), %rdx
cmpq %rax, %rdx
je 0xa138
leaq 0x728c(%rip), %r12      # 0x11347
movq -0x30(%rbp), %rbx
movq %rdx, -0x38(%rbp)
leaq 0xb122(%rip), %rax      # 0x151ec
cmpl $0x0, (%rax)
jle 0xa12b
xorl %r14d, %r14d
leaq 0xb10f(%rip), %rax      # 0x151e8
cmpl $0x0, (%rax)
jle 0xa11c
xorl %r15d, %r15d
cmpl $0x0, (%rcx)
jle 0xa10d
xorl %r13d, %r13d
movl $0x3, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x2380
leaq 0xb0df(%rip), %rcx      # 0x151e4
incl %r13d
cmpl (%rcx), %r13d
jl 0xa0e9
incl %r15d
leaq 0xb0d1(%rip), %rax      # 0x151e8
cmpl (%rax), %r15d
jl 0xa0e1
incl %r14d
leaq 0xb0c6(%rip), %rax      # 0x151ec
cmpl (%rax), %r14d
jl 0xa0d2
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
cmpq -0x40(%rbp), %rdx
jne 0xa0bf
leaq 0x720c(%rip), %rsi      # 0x1134b
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq -0x88(%rbp), %rdx
xorl %eax, %eax
callq 0x22a0
leaq 0x7201(%rip), %rdi      # 0x1135c
movl $0x22, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2380
leaq 0x720b(%rip), %rdi      # 0x1137f
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2380
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa284
movq -0x30(%rbp), %r14
movq %rcx, -0x38(%rbp)
movq 0x10(%rcx), %rdi
callq 0x4064
leaq 0xb032(%rip), %rdi      # 0x151e0
movq %rax, %r8
leaq 0xb034(%rip), %rax      # 0x151ec
cmpl $0x0, (%rax)
leaq 0xb022(%rip), %r9       # 0x151e4
jle 0xa273
movl (%rdi), %ecx
movslq %ecx, %rbx
movl (%rdi), %eax
leaq 0xb012(%rip), %rdx      # 0x151e8
movl (%rdx), %edx
addl %eax, %edx
cmpl %edx, %ecx
jge 0xa257
movslq %ecx, %r13
movl (%rdi), %ecx
addl (%r9), %ecx
cmpl %ecx, %eax
leaq 0x71a6(%rip), %rsi      # 0x11395
jge 0xa23f
movslq %eax, %r15
movq 0x8(%r8), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
movq %r8, %r12
callq 0x22a0
movq %r12, %r8
leaq 0xafc0(%rip), %rdi      # 0x151e0
leaq 0xafbd(%rip), %r9       # 0x151e4
incq %r15
movslq (%r9), %rax
movslq (%rdi), %rcx
addq %rax, %rcx
cmpq %rcx, %r15
leaq 0x7158(%rip), %rsi      # 0x11395
jl 0xa1f4
incq %r13
leaq 0xaf9f(%rip), %rax      # 0x151e8
movslq (%rax), %rcx
movslq (%rdi), %rax
addq %rax, %rcx
cmpq %rcx, %r13
jl 0xa1e1
incq %rbx
leaq 0xaf8b(%rip), %rax      # 0x151ec
movslq (%rax), %rax
movslq (%rdi), %rcx
addq %rcx, %rax
cmpq %rax, %rbx
jl 0xa1cd
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa19a
leaq 0xb39d(%rip), %rcx      # 0x15628
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
movq -0x30(%rbp), %rbx
je 0xa409
xorl %edx, %edx
movq %rdx, -0x38(%rbp)
movq %rdx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
movq %rbx, %rdi
leaq 0x70e4(%rip), %rsi      # 0x1139b
xorl %eax, %eax
callq 0x22a0
movl $0x15, %esi
movl $0x1, %edx
leaq 0x70b0(%rip), %rdi      # 0x1137f
movq %rbx, %rcx
callq 0x2380
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa3e0
movq %rcx, -0x48(%rbp)
movq 0x10(%rcx), %rdi
callq 0x4064
movq %rax, %r14
leaq 0xaeee(%rip), %rax      # 0x151ec
cmpl $0x0, (%rax)
leaq 0xaedc(%rip), %r11      # 0x151e4
leaq 0xaed1(%rip), %r10      # 0x151e0
jle 0xa3cf
movl (%r10), %ecx
movslq %ecx, %r13
movl (%r10), %eax
leaq 0xaec3(%rip), %rdx      # 0x151e8
movl (%rdx), %edx
addl %eax, %edx
cmpl %edx, %ecx
jge 0xa3b3
movslq %ecx, %rbx
movl (%r10), %ecx
addl (%r11), %ecx
cmpl %ecx, %eax
movq -0x30(%rbp), %rdi
leaq 0x704e(%rip), %rsi      # 0x11395
movq -0x38(%rbp), %r15
jge 0xa39b
movslq %eax, %r12
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%rbx,8), %rax
movsd (%rax,%r13,8), %xmm0
movb $0x1, %al
callq 0x22a0
leaq 0xae68(%rip), %r10      # 0x151e0
leaq 0xae65(%rip), %r11      # 0x151e4
incq %r12
movslq (%r11), %rax
movslq (%r10), %rcx
addq %rax, %rcx
cmpq %rcx, %r12
leaq 0x7000(%rip), %rsi      # 0x11395
movq -0x30(%rbp), %rdi
jl 0xa350
incq %rbx
leaq 0xae43(%rip), %rax      # 0x151e8
movslq (%rax), %rcx
movslq (%r10), %rax
addq %rax, %rcx
cmpq %rcx, %rbx
jl 0xa334
incq %r13
leaq 0xae2f(%rip), %rax      # 0x151ec
movslq (%rax), %rax
movslq (%r10), %rcx
addq %rcx, %rax
cmpq %rax, %r13
jl 0xa31b
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa2e7
movq -0x38(%rbp), %rdx
incq %rdx
leaq 0xb23a(%rip), %rcx      # 0x15628
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rdx, %rcx
movq -0x30(%rbp), %rbx
ja 0xa29e
leaq 0x6fa1(%rip), %rdi      # 0x113b1
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2380
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa550
movq -0x30(%rbp), %r14
movq %rcx, -0x48(%rbp)
movq 0x10(%rcx), %rdi
callq 0x4064
leaq 0xad96(%rip), %rdi      # 0x151e0
movq %rax, %r13
leaq 0xad98(%rip), %rax      # 0x151ec
cmpl $0x0, (%rax)
leaq 0xad86(%rip), %rsi      # 0x151e4
jle 0xa53f
movl (%rdi), %ecx
movslq %ecx, %r11
movl (%rdi), %eax
leaq 0xad76(%rip), %rdx      # 0x151e8
movl (%rdx), %edx
addl %eax, %edx
cmpl %edx, %ecx
jge 0xa523
movslq %ecx, %rbx
movl (%rdi), %ecx
addl (%rsi), %ecx
cmpl %ecx, %eax
leaq 0x6f42(%rip), %r12      # 0x113d0
jge 0xa507
movslq %eax, %r15
movq %rbx, -0x38(%rbp)
movq (%r13), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq (%rcx,%r15,8), %rcx
movq (%rcx,%rbx,8), %rcx
movsd (%rcx,%r11,8), %xmm0
movq (%rdx,%r15,8), %rcx
movq (%rcx,%rbx,8), %rcx
movsd (%rcx,%r11,8), %xmm1
movq 0x20(%rax), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%rbx,8), %rax
movsd (%rax,%r11,8), %xmm2
movq %r14, %rdi
movq %r12, %rsi
movb $0x3, %al
movq %r11, %rbx
callq 0x22a0
movq %rbx, %r11
movq -0x38(%rbp), %rbx
leaq 0xacf1(%rip), %rdi      # 0x151e0
leaq 0xacee(%rip), %rsi      # 0x151e4
incq %r15
movslq (%rsi), %rax
movslq (%rdi), %rcx
addq %rax, %rcx
cmpq %rcx, %r15
jl 0xa497
incq %rbx
leaq 0xacd7(%rip), %rax      # 0x151e8
movslq (%rax), %rcx
movslq (%rdi), %rax
addq %rax, %rcx
cmpq %rcx, %rbx
jl 0xa481
incq %r11
leaq 0xacbf(%rip), %rax      # 0x151ec
movslq (%rax), %rax
movslq (%rdi), %rcx
addq %rcx, %rax
cmpq %rax, %r11
jl 0xa469
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa436
leaq 0xb0e9(%rip), %rcx      # 0x15640
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
movq -0x30(%rbp), %rdi
je 0xa6ea
xorl %edx, %edx
movq -0x30(%rbp), %r13
movq %rdx, -0x38(%rbp)
movq %rdx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
leaq 0x6e59(%rip), %rsi      # 0x113dd
xorl %eax, %eax
callq 0x22a0
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa6c1
movq %rcx, -0x70(%rbp)
movq 0x10(%rcx), %rdi
callq 0x4064
movq %rax, %r8
leaq 0xac3a(%rip), %rax      # 0x151ec
cmpl $0x0, (%rax)
leaq 0xac28(%rip), %rsi      # 0x151e4
leaq 0xac1d(%rip), %rdi      # 0x151e0
jle 0xa6b0
movl (%rdi), %ecx
movslq %ecx, %r12
movl (%rdi), %eax
leaq 0xac11(%rip), %rdx      # 0x151e8
movl (%rdx), %edx
addl %eax, %edx
cmpl %edx, %ecx
jge 0xa694
movslq %ecx, %rbx
movl (%rdi), %ecx
addl (%rsi), %ecx
cmpl %ecx, %eax
leaq 0x6ddd(%rip), %r14      # 0x113d0
movq -0x38(%rbp), %rcx
jge 0xa678
movslq %eax, %r15
movq %rbx, -0x48(%rbp)
movq 0x18(%r8), %rax
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq (%rcx,%r15,8), %rcx
movq (%rcx,%rbx,8), %rcx
movsd (%rcx,%r12,8), %xmm0
movq (%rdx,%r15,8), %rcx
movq (%rcx,%rbx,8), %rcx
movsd (%rcx,%r12,8), %xmm1
movq 0x20(%rax), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%rbx,8), %rax
movsd (%rax,%r12,8), %xmm2
movq %r13, %rdi
movq %r14, %rsi
movb $0x3, %al
movq %r8, %rbx
callq 0x22a0
movq %rbx, %r8
movq -0x48(%rbp), %rbx
leaq 0xab84(%rip), %rdi      # 0x151e0
leaq 0xab81(%rip), %rsi      # 0x151e4
incq %r15
movslq (%rsi), %rax
movslq (%rdi), %rcx
addq %rax, %rcx
cmpq %rcx, %r15
movq -0x38(%rbp), %rcx
jl 0xa600
incq %rbx
leaq 0xab66(%rip), %rax      # 0x151e8
movslq (%rax), %rcx
movslq (%rdi), %rax
addq %rax, %rcx
cmpq %rcx, %rbx
jl 0xa5e6
incq %r12
leaq 0xab4e(%rip), %rax      # 0x151ec
movslq (%rax), %rax
movslq (%rdi), %rcx
addq %rcx, %rax
cmpq %rax, %r12
jl 0xa5ce
movq -0x70(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa59b
movq -0x38(%rbp), %rdx
incq %rdx
leaq 0xaf71(%rip), %rcx      # 0x15640
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rdx, %rcx
movq -0x30(%rbp), %rdi
ja 0xa56e
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq