// File: rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::LoG_edge_detector(Image&, Image&)
void ImageProc::LoG_edge_detector(Image &img_orig, Image &img_modified)
{
	Image img_GradiantLoG("bw", img_orig.cols, img_orig.rows);
	Image img_ternary_map_LoG("bw", img_orig.cols, img_orig.rows);
	int size = 17;
	float **LoG_kernel;
	LoG_kernel = new float *[size];
	for(int i = 0; i < size; i++)
		LoG_kernel[i] = new float[size];

	float sigma = 2;
	int kernel_radius = size/2;
	float coeff = (-1.0)/(M_PI * pow(sigma,4));
	for(int p = -1*kernel_radius, row = 0 ; p <= kernel_radius ; p++, row++)
		for(int q = -1*kernel_radius, col = 0 ; q <= kernel_radius ; q++, col++)
		{
			float value = (-1.0) * (((p*p) + (q*q))/(2*sigma*sigma));
			LoG_kernel[row][col] = coeff * (1+value) * (exp(value));
		}

	float Gradient_LoG[img_orig.rows][img_orig.cols];
	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
		{
			Gradient_LoG[i][j] = 0.0;
		}
	float minGradient = std::numeric_limits<float>::max();
	float maxGradient = std::numeric_limits<float>::min();
	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			for(int k = 0; k < img_orig.channels; k++)
			{
				if((i-1)>=0 && (i+1)<img_orig.rows && (j-1)>=0 && (j+1)<img_orig.cols)
				{
					Gradient_LoG[i][j] = func_gradient_float(LoG_kernel, img_orig, i, j, k, size);
					if(Gradient_LoG[i][j] < minGradient) minGradient = Gradient_LoG[i][j];
					if(Gradient_LoG[i][j] > maxGradient) maxGradient = Gradient_LoG[i][j];
				}

			}


	//Normalize Gradient values
	int abs_minGradient = abs(minGradient);
	maxGradient = maxGradient + abs_minGradient;

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
		{
			Gradient_LoG[i][j] = Gradient_LoG[i][j] + abs_minGradient;
			Gradient_LoG[i][j] = (int)(1.0*Gradient_LoG[i][j]*255/maxGradient);
		}


	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			for(int k = 0; k < img_orig.channels; k++)
				if((i-1)>=0 && (i+1)<img_orig.rows && (j-1)>=0 && (j+1)<img_orig.cols)
				{
					img_modified.setvalue(i,j,k,Gradient_LoG[i][j]);
					img_GradiantLoG.setvalue(i,j,k,Gradient_LoG[i][j]);
				}

	img_GradiantLoG.write_image("../output_images/Gradient_LoG.raw", img_GradiantLoG.cols, img_GradiantLoG.rows);

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			for(int k = 0; k < img_orig.channels; k++)
			{
				if((i-1)>=0 && (i+1)<img_orig.rows && (j-1)>=0 && (j+1)<img_orig.cols)
				{
					if(img_modified.getvalue(i,j,k) < 135)
					{
						img_modified.setvalue(i,j,k,64);
						img_ternary_map_LoG.setvalue(i,j,k,64);
					}
					else if(img_modified.getvalue(i,j,k) > 165)
					{
						img_modified.setvalue(i,j,k,192);
						img_ternary_map_LoG.setvalue(i,j,k,192);
					}
					else
					{
						img_modified.setvalue(i,j,k,128);
						img_ternary_map_LoG.setvalue(i,j,k,128);
					}
				}

			}

	img_ternary_map_LoG.write_image("../output_images/ternary_map_LoG.raw", img_ternary_map_LoG.cols, img_ternary_map_LoG.rows);

	Image img_modified_copy("bw", img_modified.cols, img_modified.rows);

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			for(int k = 0; k < img_orig.channels; k++)
				img_modified_copy.setvalue(i,j,k,img_modified.getvalue(i,j,k));

	int zero_crossing;
	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			for(int k = 0; k < img_orig.channels; k++)
			{
				if((i-1)>=0 && (i+1)<img_orig.rows && (j-1)>=0 && (j+1)<img_orig.cols)
				{
					zero_crossing = check_zero_crossing(img_modified_copy, i, j, k);
					if(zero_crossing == 0) 	img_modified.setvalue(i,j,k,255);
					else					img_modified.setvalue(i,j,k,0);
				}

			}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edx
movl 0xc(%rax), %ecx
leaq 0xb4f0(%rip), %rsi      # 0x1d5d4
movq %rsi, -0x130(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x7eb0
movq -0x130(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edx
movl 0xc(%rax), %ecx
leaq -0x50(%rbp), %rdi
callq 0x7eb0
jmp 0x12110
movl $0x11, -0x60(%rbp)
movslq -0x60(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x2030
movq %rax, -0x138(%rbp)
jmp 0x1213f
movq -0x138(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x121c1
movslq -0x60(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x2030
movq %rax, -0x140(%rbp)
jmp 0x12181
movq -0x140(%rbp), %rdx
movq -0x68(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x12151
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12e2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12e21
movl $0x40000000, -0x70(%rbp) # imm = 0x40000000
movl -0x60(%rbp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x74(%rbp)
movss -0x70(%rbp), %xmm0
movl $0x4, %edi
callq 0x1b3e0
movsd %xmm0, -0x148(%rbp)
jmp 0x121f0
movsd -0x148(%rbp), %xmm0
movsd 0xa210(%rip), %xmm1     # 0x1c410
mulsd %xmm0, %xmm1
movsd 0xa2c4(%rip), %xmm0     # 0x1c4d0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x78(%rbp)
imull $0xffffffff, -0x74(%rbp), %eax # imm = 0xFFFFFFFF
movl %eax, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jg 0x1233f
imull $0xffffffff, -0x74(%rbp), %eax # imm = 0xFFFFFFFF
movl %eax, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x74(%rbp), %eax
jg 0x12326
movl -0x7c(%rbp), %eax
imull %eax, %eax
movl -0x84(%rbp), %ecx
imull %ecx, %ecx
addl %ecx, %eax
cvtsi2ss %eax, %xmm0
movss -0x70(%rbp), %xmm2
movaps %xmm2, %xmm1
addss %xmm1, %xmm1
mulss %xmm2, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0xa290(%rip), %xmm1     # 0x1c520
pxor %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8c(%rbp)
movss -0x78(%rbp), %xmm1
movss -0x8c(%rbp), %xmm0
movss 0xa313(%rip), %xmm3     # 0x1c5c8
movaps %xmm0, %xmm2
addss %xmm3, %xmm2
mulss %xmm2, %xmm1
movss %xmm1, -0x150(%rbp)
callq 0x1b410
movss %xmm0, -0x14c(%rbp)
jmp 0x122d7
movss -0x14c(%rbp), %xmm1
movss -0x150(%rbp), %xmm0
mulss %xmm1, %xmm0
movq -0x68(%rbp), %rax
movslq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x88(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x1224d
jmp 0x12328
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1222a
movq -0x8(%rbp), %rcx
movl 0x8(%rcx), %eax
movl 0xc(%rcx), %ecx
movq %rax, -0x160(%rbp)
movq %rsp, %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, %rdx
imulq %rax, %rdx
leaq 0xf(,%rdx,4), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x158(%rbp)
movq %rdx, %rsp
movq %rcx, -0xa0(%rbp)
movq %rax, -0xa8(%rbp)
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12410
movl $0x0, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x123fd
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rdx
movslq -0xac(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xb0(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x123ae
jmp 0x123ff
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x12395
callq 0x1b430
movss %xmm0, -0xb4(%rbp)
callq 0x1b440
movss %xmm0, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12642
movl $0x0, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x1262c
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x12616
movl -0xbc(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x12600
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12600
movl -0xc0(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x12600
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x12600
movq -0x68(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0xbc(%rbp), %edx
movl -0xc0(%rbp), %ecx
movl -0xc4(%rbp), %r8d
movl -0x60(%rbp), %r9d
callq 0x12e40
movss %xmm0, -0x164(%rbp)
jmp 0x124ff
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rdx
movss -0x164(%rbp), %xmm0
movslq -0xbc(%rbp), %rsi
imulq %rdx, %rsi
shlq $0x2, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movslq -0xc0(%rbp), %rsi
movss %xmm0, (%rcx,%rsi,4)
movslq -0xbc(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xc0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
movss -0xb4(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x12595
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rdx
movslq -0xbc(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xc0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0xb4(%rbp)
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rdx
movslq -0xbc(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xc0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss -0xb8(%rbp), %xmm0
jbe 0x125fe
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rdx
movslq -0xbc(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xc0(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0xb8(%rbp)
jmp 0x12600
jmp 0x12602
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x1246e
jmp 0x12618
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
jmp 0x12451
jmp 0x1262e
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x12434
movss -0xb4(%rbp), %xmm0
callq 0x1b450
movss %xmm0, -0x168(%rbp)
jmp 0x12659
movss -0x168(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0xc8(%rbp)
movss -0xb8(%rbp), %xmm0
cvtsi2ssl -0xc8(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0xb8(%rbp)
movl $0x0, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x127ba
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x127a4
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rdx
movslq -0xcc(%rbp), %rsi
imulq %rdx, %rsi
shlq $0x2, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movslq -0xd0(%rbp), %rsi
movss (%rcx,%rsi,4), %xmm0
cvtsi2ssl -0xc8(%rbp), %xmm1
addss %xmm1, %xmm0
movslq -0xcc(%rbp), %rsi
imulq %rdx, %rsi
shlq $0x2, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movslq -0xd0(%rbp), %rsi
movss %xmm0, (%rcx,%rsi,4)
movslq -0xcc(%rbp), %rsi
imulq %rdx, %rsi
shlq $0x2, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movslq -0xd0(%rbp), %rsi
movss (%rcx,%rsi,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x9b1e(%rip), %xmm0     # 0x1c268
mulsd %xmm1, %xmm0
movsd 0x9d72(%rip), %xmm1     # 0x1c4c8
mulsd %xmm1, %xmm0
movss -0xb8(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
cvtsi2ss %ecx, %xmm0
movslq -0xcc(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xd0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x126ae
jmp 0x127a6
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x12691
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12933
movl $0x0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x1291d
movl $0x0, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x12907
movl -0xd4(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x128f1
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x128f1
movl -0xd8(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x128f1
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x128f1
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %r9
movq -0x10(%rbp), %rdi
movl -0xd4(%rbp), %esi
movl -0xd8(%rbp), %edx
movl -0xdc(%rbp), %ecx
movslq -0xd4(%rbp), %r8
imulq %r9, %r8
shlq $0x2, %r8
addq %r8, %rax
movslq -0xd8(%rbp), %r8
cvttss2si (%rax,%r8,4), %r8d
callq 0x83f0
movq -0x160(%rbp), %r8
movq -0x158(%rbp), %rax
movl -0xd4(%rbp), %esi
movl -0xd8(%rbp), %edx
movl -0xdc(%rbp), %ecx
movslq -0xd4(%rbp), %rdi
imulq %r8, %rdi
shlq $0x2, %rdi
addq %rdi, %rax
movslq -0xd8(%rbp), %rdi
cvttss2si (%rax,%rdi,4), %r8d
leaq -0x30(%rbp), %rdi
callq 0x83f0
jmp 0x128f3
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x127fe
jmp 0x12909
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x127e1
jmp 0x1291f
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x127c4
movl -0x28(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0xa23b(%rip), %rsi      # 0x1cb7b
leaq -0x30(%rbp), %rdi
callq 0x8150
jmp 0x1294b
movl $0x0, -0xe0(%rbp)
movl -0xe0(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12b49
movl $0x0, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x12b33
movl $0x0, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x12b1d
movl -0xe0(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x12b07
movl -0xe0(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12b07
movl -0xe4(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x12b07
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x12b07
movq -0x10(%rbp), %rdi
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
callq 0x83b0
cmpl $0x87, %eax
jge 0x12a5b
movq -0x10(%rbp), %rdi
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
movl $0x40, %r8d
callq 0x83f0
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
leaq -0x50(%rbp), %rdi
movl $0x40, %r8d
callq 0x83f0
jmp 0x12b05
movq -0x10(%rbp), %rdi
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
callq 0x83b0
cmpl $0xa5, %eax
jle 0x12ac1
movq -0x10(%rbp), %rdi
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
movl $0xc0, %r8d
callq 0x83f0
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
leaq -0x50(%rbp), %rdi
movl $0xc0, %r8d
callq 0x83f0
jmp 0x12b03
movq -0x10(%rbp), %rdi
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
movl $0x80, %r8d
callq 0x83f0
movl -0xe0(%rbp), %esi
movl -0xe4(%rbp), %edx
movl -0xe8(%rbp), %ecx
leaq -0x50(%rbp), %rdi
movl $0x80, %r8d
callq 0x83f0
jmp 0x12b05
jmp 0x12b07
jmp 0x12b09
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x1298f
jmp 0x12b1f
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x12972
jmp 0x12b35
movl -0xe0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0x12955
movl -0x48(%rbp), %edx
movl -0x44(%rbp), %ecx
leaq 0xa047(%rip), %rsi      # 0x1cb9d
leaq -0x50(%rbp), %rdi
callq 0x8150
jmp 0x12b61
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
movl 0xc(%rax), %ecx
leaq 0xaa62(%rip), %rsi      # 0x1d5d4
leaq -0x108(%rbp), %rdi
callq 0x7eb0
jmp 0x12b80
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12c70
movl $0x0, -0x110(%rbp)
movl -0x110(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x12c5a
movl $0x0, -0x114(%rbp)
movl -0x114(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x12c44
movl -0x10c(%rbp), %eax
movl %eax, -0x174(%rbp)
movl -0x110(%rbp), %eax
movl %eax, -0x170(%rbp)
movl -0x114(%rbp), %eax
movl %eax, -0x16c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x10c(%rbp), %esi
movl -0x110(%rbp), %edx
movl -0x114(%rbp), %ecx
callq 0x83b0
movl -0x174(%rbp), %esi
movl -0x170(%rbp), %edx
movl -0x16c(%rbp), %ecx
movl %eax, %r8d
leaq -0x108(%rbp), %rdi
callq 0x83f0
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x12bc4
jmp 0x12c46
movl -0x110(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x12ba7
jmp 0x12c5c
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x12b8a
movl $0x0, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12df4
movl $0x0, -0x120(%rbp)
movl -0x120(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x12dde
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x12dc8
movl -0x11c(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x12db2
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x12db2
movl -0x120(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jl 0x12db2
movl -0x120(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x12db2
movl -0x11c(%rbp), %esi
movl -0x120(%rbp), %edx
movl -0x124(%rbp), %ecx
leaq -0x108(%rbp), %rdi
callq 0x12f70
movl %eax, -0x178(%rbp)
jmp 0x12d3d
movl -0x178(%rbp), %eax
movl %eax, -0x118(%rbp)
cmpl $0x0, -0x118(%rbp)
jne 0x12d92
movq -0x10(%rbp), %rdi
movl -0x11c(%rbp), %esi
movl -0x120(%rbp), %edx
movl -0x124(%rbp), %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x12db0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x1b2c0
jmp 0x12e21
movq -0x10(%rbp), %rdi
movl -0x11c(%rbp), %esi
movl -0x120(%rbp), %edx
movl -0x124(%rbp), %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x12db2
jmp 0x12db4
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x12cb4
jmp 0x12dca
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x12c97
jmp 0x12de0
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x12c7a
leaq -0x108(%rbp), %rdi
callq 0x1b2c0
movq -0x98(%rbp), %rax
movq %rax, %rsp
leaq -0x50(%rbp), %rdi
callq 0x1b2c0
leaq -0x30(%rbp), %rdi
callq 0x1b2c0
movq %rbp, %rsp
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x1b2c0
leaq -0x30(%rbp), %rdi
callq 0x1b2c0
movq -0x58(%rbp), %rdi
callq 0x2360
nopl (%rax)