// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
leaq 0xb5ce(%rip), %rax      # 0x151ec
movl (%rax), %eax
movq %rax, -0x88(%rbp)
leal 0x1(%rax), %eax
movl %eax, -0x44(%rbp)
leaq 0xb5bc(%rip), %rax      # 0x151f0
movl (%rax), %r15d
leal 0x1(%r15), %eax
movl %eax, -0x58(%rbp)
leaq 0xb5af(%rip), %rax      # 0x151f4
movl (%rax), %eax
movq %rax, -0xa8(%rbp)
leal 0x1(%rax), %r13d
movq 0xb397(%rip), %r12      # 0x14ff0
leaq 0x76d3(%rip), %rsi      # 0x11333
movl $0x1, %edx
movq %r12, %rdi
callq 0x2240
leaq 0x75fd(%rip), %rsi      # 0x11271
movl $0xb, %edx
movq %r12, %rdi
callq 0x2240
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
movq (%r14), %rsi
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
callq 0x21c0
movq %r14, %rdi
callq 0x20f0
movl $0x6b74762e, -0xf0(%rbp,%rax) # imm = 0x6B74762E
movb $0x0, -0xec(%rbp,%rax)
leaq 0x75a5(%rip), %rsi      # 0x11282
movq %r14, %rdi
callq 0x2250
movq %rax, %r14
leaq 0x7595(%rip), %rdi      # 0x11284
movl $0x1b, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2390
leaq 0x7598(%rip), %rdi      # 0x112a0
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2390
leaq 0x7594(%rip), %rdi      # 0x112b5
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2390
leaq 0x7582(%rip), %rdi      # 0x112bc
movl $0x1a, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2390
movl -0x58(%rbp), %eax
imull -0x44(%rbp), %eax
movl %r13d, -0x54(%rbp)
imull %r13d, %eax
movslq %eax, %rdx
movq 0x10(%rbx), %rax
imulq %rax, %rdx
leaq 0xb47f(%rip), %rcx      # 0x151ec
movslq (%rcx), %rcx
leaq 0xb479(%rip), %rsi      # 0x151f0
movslq (%rsi), %rsi
imulq %rcx, %rsi
leaq 0xb46f(%rip), %rcx      # 0x151f4
movslq (%rcx), %rcx
imulq %rax, %rcx
imulq %rsi, %rcx
movq %rcx, -0x68(%rbp)
leaq 0x753c(%rip), %rsi      # 0x112d7
movq %r14, -0x38(%rbp)
movq %r14, %rdi
xorl %eax, %eax
callq 0x22b0
movq (%rbx), %rax
movq %rbx, -0x40(%rbp)
cmpq %rbx, %rax
je 0x9f42
leaq 0x752a(%rip), %r12      # 0x112ea
movq -0x38(%rbp), %r14
movq %rax, -0xb0(%rbp)
movq 0x10(%rax), %rdi
callq 0x418c
movsd 0x723c(%rip), %xmm0     # 0x11018
cmpl $0x0, -0xa8(%rbp)
js 0x9f2e
movsd 0x70(%rax), %xmm1
movsd 0x78(%rax), %xmm2
movsd %xmm2, -0x80(%rbp)
movsd 0x80(%rax), %xmm2
movsd %xmm2, -0xc0(%rbp)
movsd 0x40(%rax), %xmm4
movsd 0x50(%rax), %xmm3
movsd %xmm3, -0x78(%rbp)
movsd 0x60(%rax), %xmm3
movsd %xmm3, -0xb8(%rbp)
xorl %eax, %eax
xorpd %xmm3, %xmm3
movsd %xmm3, -0x70(%rbp)
movsd %xmm1, -0x98(%rbp)
movsd %xmm4, -0x90(%rbp)
movq %rax, -0xc8(%rbp)
testl %r15d, %r15d
js 0x9f0a
movsd -0x70(%rbp), %xmm2
mulsd -0xc0(%rbp), %xmm2
addsd -0xb8(%rbp), %xmm2
xorl %r13d, %r13d
xorpd %xmm3, %xmm3
movsd %xmm3, -0x60(%rbp)
movsd %xmm2, -0xa0(%rbp)
cmpl $0x0, -0x88(%rbp)
js 0x9eec
movsd -0x60(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
xorpd %xmm3, %xmm3
movl -0x44(%rbp), %ebx
movsd %xmm3, -0x30(%rbp)
movapd %xmm3, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm4, %xmm0
movq %r14, %rdi
movq %r12, %rsi
movsd -0x50(%rbp), %xmm1
movb $0x3, %al
callq 0x22b0
movsd -0x30(%rbp), %xmm3
movsd -0xa0(%rbp), %xmm2
movsd -0x90(%rbp), %xmm4
movsd -0x98(%rbp), %xmm1
movsd 0x7134(%rip), %xmm0     # 0x11018
addsd %xmm0, %xmm3
decl %ebx
jne 0x9e9c
movsd -0x60(%rbp), %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, -0x60(%rbp)
leal 0x1(%r13), %eax
cmpl %r15d, %r13d
movl %eax, %r13d
jne 0x9e78
movsd -0x70(%rbp), %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, -0x70(%rbp)
movq -0xc8(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpl -0xa8(%rbp), %ecx
jne 0x9e3f
movq -0xb0(%rbp), %rax
movq (%rax), %rax
cmpq -0x40(%rbp), %rax
jne 0x9dc4
movq -0x68(%rbp), %rdx
leaq (%rdx,%rdx,8), %rcx
leaq 0x73af(%rip), %rsi      # 0x11300
movq -0x38(%rbp), %rdi
xorl %eax, %eax
callq 0x22b0
movq -0x40(%rbp), %rax
movq (%rax), %rdx
cmpq %rax, %rdx
leaq 0xb27f(%rip), %rsi      # 0x151ec
je 0xa129
movl -0x54(%rbp), %eax
imull -0x58(%rbp), %eax
imull -0x44(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0xb26c(%rip), %rax      # 0x151f4
movl (%rax), %ecx
xorl %r8d, %r8d
movq %rdx, -0x80(%rbp)
testl %ecx, %ecx
movq %r8, -0x78(%rbp)
jle 0xa111
movl -0x54(%rbp), %eax
imull %r8d, %eax
movslq %eax, %rbx
decq %rbx
leaq 0xb23f(%rip), %rax      # 0x151f0
movl (%rax), %eax
xorl %edx, %edx
testl %eax, %eax
jle 0xa107
movl %edx, %r8d
movl -0x58(%rbp), %ecx
imull %ecx, %r8d
movq %r8, -0x90(%rbp)
incl %edx
movl %edx, -0x88(%rbp)
imull %ecx, %edx
movq %rdx, -0x60(%rbp)
movl (%rsi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
jle 0xa0e5
movq -0x90(%rbp), %rcx
leal (%rdx,%rcx), %esi
movl -0x44(%rbp), %eax
imull %eax, %esi
movq %rsi, -0x30(%rbp)
leal 0x1(%rdx), %esi
movl %esi, -0x98(%rbp)
addl %edx, %ecx
incl %ecx
imull %eax, %ecx
movq %rcx, -0x50(%rbp)
movl %edx, %r13d
movq -0x60(%rbp), %rcx
addl %ecx, %r13d
imull %eax, %r13d
addl %edx, %ecx
incl %ecx
imull %eax, %ecx
movq %rcx, -0xa0(%rbp)
xorl %eax, %eax
leaq 0x1(%rax), %r15
movq -0x30(%rbp), %rsi
leal (%rsi,%rax), %ecx
incl %ecx
movslq %ecx, %rdx
addq %rbx, %rdx
leal (%rsi,%rax), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
addq %rbx, %rcx
movq -0x50(%rbp), %rdi
leal (%rdi,%rax), %esi
addl $0x2, %esi
movslq %esi, %r8
addq %rbx, %r8
leal (%rdi,%rax), %esi
incl %esi
movslq %esi, %r9
addq %rbx, %r9
leal (%rax,%r13), %esi
incl %esi
movslq %esi, %r10
addq %rbx, %r10
leal (%rax,%r13), %esi
addl $0x2, %esi
movslq %esi, %r11
addq %rbx, %r11
movq -0xa0(%rbp), %rdi
leal (%rdi,%rax), %esi
addl $0x2, %esi
movslq %esi, %r14
addq %rbx, %r14
addl %edi, %eax
incl %eax
movslq %eax, %r12
addq %rbx, %r12
movq -0x38(%rbp), %rdi
leaq 0x7267(%rip), %rsi      # 0x11311
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0x22b0
leaq 0xb12c(%rip), %rsi      # 0x151ec
addq $0x20, %rsp
movslq (%rsi), %rcx
movq %r15, %rax
cmpq %rcx, %r15
jl 0xa02f
leaq 0xb116(%rip), %rax      # 0x151f0
movl (%rax), %eax
movl -0x98(%rbp), %r8d
jmp 0xa0ea
incl %edx
movl %edx, %r8d
movl %r8d, %edx
cmpl %eax, %r8d
jl 0x9fe1
leaq 0xb0f7(%rip), %rcx      # 0x151f4
movl (%rcx), %ecx
movl -0x88(%rbp), %edx
jmp 0xa109
incl %edx
cmpl %ecx, %edx
jl 0x9fb5
movq -0x78(%rbp), %r8
incq %r8
movq -0x80(%rbp), %rdx
movq (%rdx), %rdx
cmpq -0x40(%rbp), %rdx
jne 0x9f8d
leaq 0x7205(%rip), %rsi      # 0x11335
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rdx
xorl %eax, %eax
callq 0x22b0
leaq 0xb0a6(%rip), %rdx      # 0x151ec
movq -0x40(%rbp), %rax
movq (%rax), %rsi
cmpq %rax, %rsi
je 0xa1e3
leaq 0xb097(%rip), %rax      # 0x151f4
movl (%rax), %ecx
leaq 0x71e1(%rip), %r12      # 0x11347
movq -0x38(%rbp), %rbx
movq %rsi, -0x30(%rbp)
testl %ecx, %ecx
jle 0xa1d6
leaq 0xb077(%rip), %rax      # 0x151f0
movl (%rax), %eax
xorl %r14d, %r14d
testl %eax, %eax
jle 0xa1ce
movl (%rdx), %ecx
xorl %r15d, %r15d
testl %ecx, %ecx
jle 0xa1bd
xorl %r13d, %r13d
movl $0x3, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x2390
leaq 0xb042(%rip), %rdx      # 0x151ec
incl %r13d
movl (%rdx), %ecx
cmpl %ecx, %r13d
jl 0xa18e
leaq 0xb035(%rip), %rax      # 0x151f0
movl (%rax), %eax
incl %r15d
cmpl %eax, %r15d
jl 0xa187
leaq 0xb028(%rip), %rcx      # 0x151f4
movl (%rcx), %ecx
incl %r14d
cmpl %ecx, %r14d
jl 0xa17e
movq -0x30(%rbp), %rsi
movq (%rsi), %rsi
cmpq -0x40(%rbp), %rsi
jne 0xa16a
leaq 0x7161(%rip), %rsi      # 0x1134b
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq -0x68(%rbp), %rdx
xorl %eax, %eax
callq 0x22b0
leaq 0x7159(%rip), %rdi      # 0x1135c
movl $0x22, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2390
leaq 0x7163(%rip), %rdi      # 0x1137f
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2390
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa318
movq %rcx, -0x30(%rbp)
movq 0x10(%rcx), %rdi
callq 0x418c
leaq 0xaf96(%rip), %rcx      # 0x151e8
movq %rax, %r14
leaq 0xaf98(%rip), %rax      # 0x151f4
movl (%rax), %edx
testl %edx, %edx
leaq 0xaf85(%rip), %rdi      # 0x151ec
jle 0xa307
movl (%rcx), %eax
movslq %eax, %rbx
leaq 0xaf77(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
testl %ecx, %ecx
jle 0xa2f5
movslq %eax, %r15
movl (%rdi), %edx
testl %edx, %edx
jle 0xa2de
movslq %eax, %r13
leaq 0x7103(%rip), %r12      # 0x11395
movq 0x8(%r14), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%r15,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq -0x38(%rbp), %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x22b0
leaq 0xaf2c(%rip), %rax      # 0x151e8
leaq 0xaf29(%rip), %rdi      # 0x151ec
incq %r13
movl (%rdi), %edx
movl (%rax), %eax
leal (%rax,%rdx), %ecx
movslq %ecx, %rcx
cmpq %rcx, %r13
jl 0xa292
leaq 0xaf14(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
incq %r15
leal (%rax,%rcx), %esi
movslq %esi, %rsi
cmpq %rsi, %r15
jl 0xa284
leaq 0xaf01(%rip), %rdx      # 0x151f4
movl (%rdx), %edx
incq %rbx
leal (%rax,%rdx), %esi
movslq %esi, %rsi
cmpq %rsi, %rbx
jl 0xa27b
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa23e
leaq 0xb319(%rip), %rcx      # 0x15638
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
movq -0x38(%rbp), %rbx
je 0xa484
xorl %edx, %edx
movq %rdx, -0x30(%rbp)
movq %rdx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
movq %rbx, %rdi
leaq 0x7050(%rip), %rsi      # 0x1139b
xorl %eax, %eax
callq 0x22b0
movl $0x15, %esi
movl $0x1, %edx
leaq 0x701c(%rip), %rdi      # 0x1137f
movq %rbx, %rcx
callq 0x2390
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa45b
movq %rcx, -0x50(%rbp)
movq 0x10(%rcx), %rdi
callq 0x418c
movq %rax, %r12
leaq 0xae62(%rip), %rax      # 0x151f4
movl (%rax), %edx
testl %edx, %edx
leaq 0xae4f(%rip), %rdi      # 0x151ec
leaq 0xae44(%rip), %rax      # 0x151e8
jle 0xa44a
movl (%rax), %eax
movslq %eax, %rbx
leaq 0xae3a(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
testl %ecx, %ecx
jle 0xa438
movslq %eax, %r15
movl (%rdi), %edx
testl %edx, %edx
jle 0xa421
movslq %eax, %r13
movq -0x30(%rbp), %r14
movq 0x10(%r12), %rax
movq (%rax,%r14,8), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%r15,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq -0x38(%rbp), %rdi
leaq 0x6fa4(%rip), %rsi      # 0x11395
movb $0x1, %al
callq 0x22b0
leaq 0xaded(%rip), %rdi      # 0x151ec
incq %r13
movl (%rdi), %edx
leaq 0xaddd(%rip), %rax      # 0x151e8
movl (%rax), %eax
leal (%rax,%rdx), %ecx
movslq %ecx, %rcx
cmpq %rcx, %r13
jl 0xa3cc
leaq 0xadd1(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
incq %r15
leal (%rax,%rcx), %esi
movslq %esi, %rsi
cmpq %rsi, %r15
jl 0xa3c1
leaq 0xadbe(%rip), %rdx      # 0x151f4
movl (%rdx), %edx
incq %rbx
leal (%rax,%rdx), %esi
movslq %esi, %rsi
cmpq %rsi, %rbx
jl 0xa3b8
movq -0x50(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa37b
movq -0x30(%rbp), %rdx
incq %rdx
leaq 0xb1cf(%rip), %rcx      # 0x15638
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rdx, %rcx
movq -0x38(%rbp), %rbx
ja 0xa332
leaq 0x6f26(%rip), %rdi      # 0x113b1
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2390
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa5b3
movq %rcx, -0x30(%rbp)
movq 0x10(%rcx), %rdi
callq 0x418c
leaq 0xad27(%rip), %rcx      # 0x151e8
movq %rax, %r15
leaq 0xad29(%rip), %rax      # 0x151f4
movl (%rax), %edx
testl %edx, %edx
leaq 0xad16(%rip), %rdi      # 0x151ec
jle 0xa5a2
movl (%rcx), %eax
movslq %eax, %r14
leaq 0xad08(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
testl %ecx, %ecx
jle 0xa590
movslq %eax, %rbx
movl (%rdi), %edx
testl %edx, %edx
jle 0xa575
movslq %eax, %r13
leaq 0x6ecb(%rip), %r12      # 0x113d0
movq (%r15), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq (%rcx,%r13,8), %rcx
movq (%rcx,%rbx,8), %rcx
movsd (%rcx,%r14,8), %xmm0
movq (%rdx,%r13,8), %rcx
movq (%rcx,%rbx,8), %rcx
movsd (%rcx,%r14,8), %xmm1
movq 0x20(%rax), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbx,8), %rax
movsd (%rax,%r14,8), %xmm2
movq -0x38(%rbp), %rdi
movq %r12, %rsi
movb $0x3, %al
callq 0x22b0
leaq 0xac95(%rip), %rax      # 0x151e8
leaq 0xac92(%rip), %rdi      # 0x151ec
incq %r13
movl (%rdi), %edx
movl (%rax), %eax
leal (%rax,%rdx), %ecx
movslq %ecx, %rcx
cmpq %rcx, %r13
jl 0xa505
leaq 0xac7d(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
incq %rbx
leal (%rax,%rcx), %esi
movslq %esi, %rsi
cmpq %rsi, %rbx
jl 0xa4f7
leaq 0xac66(%rip), %rdx      # 0x151f4
movl (%rdx), %edx
incq %r14
leal (%rax,%rdx), %esi
movslq %esi, %rsi
cmpq %rsi, %r14
jl 0xa4ea
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa4ad
leaq 0xb096(%rip), %rcx      # 0x15650
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
movq -0x38(%rbp), %rdi
je 0xa733
xorl %edx, %edx
movq %rdx, -0x30(%rbp)
movq %rdx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
leaq 0x6dfa(%rip), %rsi      # 0x113dd
xorl %eax, %eax
callq 0x22b0
movq -0x40(%rbp), %rax
movq (%rax), %rcx
cmpq %rax, %rcx
je 0xa70a
movq %rcx, -0x50(%rbp)
movq 0x10(%rcx), %rdi
callq 0x418c
movq %rax, %r13
leaq 0xabe3(%rip), %rax      # 0x151f4
movl (%rax), %edx
testl %edx, %edx
leaq 0xabd0(%rip), %rdi      # 0x151ec
leaq 0xabc5(%rip), %rax      # 0x151e8
jle 0xa6f9
movl (%rax), %eax
movslq %eax, %r14
leaq 0xabbb(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
testl %ecx, %ecx
jle 0xa6e7
movslq %eax, %r15
movl (%rdi), %edx
testl %edx, %edx
jle 0xa6cc
movslq %eax, %r12
movq -0x30(%rbp), %rbx
movq 0x18(%r13), %rax
movq (%rax,%rbx,8), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq (%rcx,%r12,8), %rcx
movq (%rcx,%r15,8), %rcx
movsd (%rcx,%r14,8), %xmm0
movq (%rdx,%r12,8), %rcx
movq (%rcx,%r15,8), %rcx
movsd (%rcx,%r14,8), %xmm1
movq 0x20(%rax), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r15,8), %rax
movsd (%rax,%r14,8), %xmm2
movq -0x38(%rbp), %rdi
leaq 0x6d34(%rip), %rsi      # 0x113d0
movb $0x3, %al
callq 0x22b0
leaq 0xab42(%rip), %rdi      # 0x151ec
incq %r12
movl (%rdi), %edx
leaq 0xab32(%rip), %rax      # 0x151e8
movl (%rax), %eax
leal (%rax,%rdx), %ecx
movslq %ecx, %rcx
cmpq %rcx, %r12
jl 0xa653
leaq 0xab26(%rip), %rcx      # 0x151f0
movl (%rcx), %ecx
incq %r15
leal (%rax,%rcx), %esi
movslq %esi, %rsi
cmpq %rsi, %r15
jl 0xa644
leaq 0xab0f(%rip), %rdx      # 0x151f4
movl (%rdx), %edx
incq %r14
leal (%rax,%rdx), %esi
movslq %esi, %rsi
cmpq %rsi, %r14
jl 0xa637
movq -0x50(%rbp), %rcx
movq (%rcx), %rcx
cmpq -0x40(%rbp), %rcx
jne 0xa5fa
movq -0x30(%rbp), %rdx
incq %rdx
leaq 0xaf38(%rip), %rcx      # 0x15650
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rdx, %rcx
movq -0x38(%rbp), %rdi
ja 0xa5cd
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)