// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::sobel_edge_detector(Image&, Image&, int)
void ImageProc::sobel_edge_detector(Image &img_orig, Image &img_edge_map, int percentage)
{
	Image img_Gx("bw", img_orig.cols, img_orig.rows);
	Image img_Gy("bw", img_orig.cols, img_orig.rows);
	Image img_modified("bw", img_orig.cols, img_orig.rows);
	int **sobel_opX, **sobel_opY;
	sobel_opX = new int *[3];
	sobel_opY = new int *[3];
	for(int i = 0; i < 3; i++)
	{
		sobel_opX[i] = new int[3];
		sobel_opY[i] = new int[3];
	}

	sobel_opX[0][0] = -1;	sobel_opX[0][1] = 0;	sobel_opX[0][2] = 1;
	sobel_opX[1][0] = -2;	sobel_opX[1][1] = 0;	sobel_opX[1][2] = 2;
	sobel_opX[2][0] = -1;	sobel_opX[2][1] = 0;	sobel_opX[2][2] = 1;

	sobel_opY[0][0] = -1;	sobel_opY[0][1] = -2;	sobel_opY[0][2] = -1;
	sobel_opY[1][0] = 0;	sobel_opY[1][1] = 0;	sobel_opY[1][2] = 0;
	sobel_opY[2][0] = 1;	sobel_opY[2][1] = 2;	sobel_opY[2][2] = 1;
	//int sum = 0;
	int Gx[img_orig.rows][img_orig.cols];
	int Gy[img_orig.rows][img_orig.cols];
	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
		{
			Gx[i][j] = 0;
			Gy[i][j] = 0;
		}
	int minGx = std::numeric_limits<int>::max();
	int minGy = std::numeric_limits<int>::max();
	int maxGx = std::numeric_limits<int>::min();
	int maxGy = std::numeric_limits<int>::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)
				{
					Gx[i][j] = func_gradient(sobel_opX, img_orig, i, j, k, 3);
					if(Gx[i][j] < minGx) minGx = Gx[i][j];
					if(Gx[i][j] > maxGx) maxGx = Gx[i][j];

					Gy[i][j] = func_gradient(sobel_opY, img_orig, i, j, k, 3);
					if(Gy[i][j] < minGy) minGy = Gy[i][j];
					if(Gy[i][j] > maxGy) maxGy = Gy[i][j];

				}

			}


	//Normalize Gradient values
	int abs_minGx = abs(minGx);
	int abs_minGy = abs(minGy);
	maxGx = maxGx + abs_minGx;
	maxGy = maxGy + abs_minGy;


	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
		{
			Gx[i][j] = Gx[i][j] + abs_minGx;
			Gx[i][j] = (int)(1.0*Gx[i][j]*255/maxGx);
			Gy[i][j] = Gy[i][j] + abs_minGy;
			Gy[i][j] = (int)(1.0*Gy[i][j]*255/maxGy);
		}

	int nGradient[img_orig.rows][img_orig.cols];
	int min_nGradient = std::numeric_limits<int>::max();
	int max_nGradient = std::numeric_limits<int>::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)
				{
					nGradient[i][j] = (int)sqrt(Gx[i][j]*Gx[i][j] + Gy[i][j]*Gy[i][j]);
					if(nGradient[i][j] < min_nGradient) min_nGradient = nGradient[i][j];
					if(nGradient[i][j] > max_nGradient) max_nGradient = nGradient[i][j];

					img_Gx.setvalue(i,j,k,Gx[i][j]);
					img_Gy.setvalue(i,j,k,Gy[i][j]);
				}

			}

	int abs_min_nGradient = abs(min_nGradient);
	max_nGradient = max_nGradient + abs_min_nGradient;

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
		{
			nGradient[i][j] = nGradient[i][j] + abs_min_nGradient;
			nGradient[i][j] = (int)(1.0*nGradient[i][j]*255/max_nGradient);
			img_modified.setvalue(i,j,0,nGradient[i][j]);
		}

	img_Gx.write_image("../output_images/Sobel_gradientInX.raw", img_Gx.cols, img_Gx.rows);
	img_Gy.write_image("../output_images/Sobel_gradientInY.raw", img_Gy.cols, img_Gy.rows);


	int histogram_bins[256], hist_cumulative[256];
	get_histogram(img_modified, histogram_bins);
	get_cumulative_histogram(histogram_bins, hist_cumulative);

	int threshold = (int)(((100-percentage)/100.0)*hist_cumulative[255]);

	for(int i = 0; i < 256; i++)
	{
		if(hist_cumulative[i] > threshold)
		{
			threshold = i-1;
			break;
		}
	}

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

	img_modified.write_image("../output_images/Sobel_gradient_map.raw", img_modified.cols, img_modified.rows);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x938, %rsp            # imm = 0x938
movl %edx, -0xc4(%rbp)
movq %rsi, -0x118(%rbp)
movq %rdi, %r15
movl 0x8(%rdi), %edx
movl 0xc(%rdi), %ecx
leaq 0x758e(%rip), %r14      # 0x121e7
leaq -0x158(%rbp), %rdi
movq %r14, %rsi
callq 0x4c6e
movl 0x8(%r15), %edx
movl 0xc(%r15), %ecx
leaq -0x138(%rbp), %rdi
movq %r14, %rsi
callq 0x4c6e
movl 0x8(%r15), %edx
movl 0xc(%r15), %ecx
leaq -0xf8(%rbp), %rdi
movq %r14, %rsi
callq 0x4c6e
movl $0x18, %edi
callq 0x2030
movq %rax, %r14
movl $0x18, %edi
callq 0x2030
movq %rax, %r12
xorl %ebx, %ebx
movl $0xc, %edi
callq 0x2030
movq %rax, (%r14,%rbx,8)
movl $0xc, %edi
callq 0x2030
movq %rax, (%r12,%rbx,8)
incq %rbx
cmpq $0x3, %rbx
jne 0xacb2
movq %rsp, -0x100(%rbp)
movq (%r14), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, (%rax)
movl $0x1, %edx
movl %edx, 0x8(%rax)
movq 0x8(%r14), %rax
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %rsi, (%rax)
movl $0x2, 0x8(%rax)
movq %r14, -0xa8(%rbp)
movq 0x10(%r14), %rax
movq %rcx, (%rax)
movl %edx, 0x8(%rax)
movq (%r12), %rax
movabsq $-0x100000001, %rcx     # imm = 0xFFFFFFFEFFFFFFFF
movq %rcx, (%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x8(%r12), %rax
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
movq %r12, -0xa0(%rbp)
movq 0x10(%r12), %rax
movabsq $0x200000001, %rcx      # imm = 0x200000001
movq %rcx, (%rax)
movl %edx, 0x8(%rax)
movl 0x8(%r15), %edx
movl 0xc(%r15), %eax
movq %rdx, -0x80(%rbp)
imulq %rdx, %rax
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x78(%rbp)
movq %rcx, %rsp
movl 0x8(%r15), %eax
movq %r15, -0x50(%rbp)
movl 0xc(%r15), %edx
movq %rax, -0x48(%rbp)
imulq %rdx, %rax
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
movq %rcx, -0x88(%rbp)
subq %rcx, %rax
movq %rax, -0x70(%rbp)
movq %rax, %rsp
movq %rdx, -0x38(%rbp)
testl %edx, %edx
jle 0xae10
movq -0x80(%rbp), %rax
leaq (,%rax,4), %rbx
movq -0x48(%rbp), %rax
leaq (,%rax,4), %r14
movq -0x38(%rbp), %r15
movq -0x78(%rbp), %r12
movq -0x70(%rbp), %r13
cmpl $0x0, -0x48(%rbp)
jle 0xae05
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20c0
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20c0
addq %r14, %r13
addq %rbx, %r12
decq %r15
jne 0xade5
cmpl $0x0, -0x38(%rbp)
jle 0xafa7
movq -0x48(%rbp), %r13
movslq %r13d, %rcx
movq -0x50(%rbp), %rax
movl 0x10(%rax), %edi
decq %rcx
movq %rcx, -0x90(%rbp)
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x80000000, %r8d       # imm = 0x80000000
xorl %r12d, %r12d
movl $0x80000000, -0x30(%rbp) # imm = 0x80000000
movl $0x7fffffff, -0x40(%rbp) # imm = 0x7FFFFFFF
movl %edi, -0x54(%rbp)
movq -0x50(%rbp), %rbx
testl %r13d, %r13d
jle 0xaf98
leaq 0x1(%r12), %rax
movq %rax, -0x98(%rbp)
movq %r12, %rax
imulq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, -0xb8(%rbp)
movq %r12, %rax
imulq %r13, %rax
movq -0x70(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, -0xb0(%rbp)
movq $0x0, -0x60(%rbp)
testl %edi, %edi
jle 0xaf80
movq -0x98(%rbp), %rax
cmpq -0x38(%rbp), %rax
setb %al
movq -0x60(%rbp), %r9
testq %r9, %r9
setne %cl
andb %al, %cl
cmpq -0x90(%rbp), %r9
setl %al
andb %cl, %al
xorl %r13d, %r13d
movb %al, -0xc0(%rbp)
testq %r12, %r12
je 0xaf74
testb %al, %al
je 0xaf74
movq -0xa8(%rbp), %rdi
movl %esi, -0x68(%rbp)
movq %rbx, %rsi
movl %r8d, %r15d
movl %r12d, %edx
movq -0x60(%rbp), %r14
movl %r14d, %ecx
movl %r13d, %r8d
movl $0x3, %r9d
callq 0xb534
movl -0x40(%rbp), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, -0x40(%rbp)
movq -0xb8(%rbp), %rcx
movl %eax, (%rcx,%r14,4)
movl -0x30(%rbp), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, -0x30(%rbp)
movq -0xa0(%rbp), %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %r14d, %ecx
movl %r13d, %r8d
movl $0x3, %r9d
callq 0xb534
movl -0x54(%rbp), %edi
movl -0x68(%rbp), %esi
movl %r15d, %r8d
cmpl %esi, %eax
cmovll %eax, %esi
movq -0xb0(%rbp), %rcx
movl %eax, (%rcx,%r14,4)
cmpl %r15d, %eax
cmovgl %eax, %r8d
movb -0xc0(%rbp), %al
incl %r13d
cmpl %r13d, %edi
jne 0xaed6
movq -0x60(%rbp), %rcx
incq %rcx
movq -0x48(%rbp), %r13
movq %rcx, -0x60(%rbp)
cmpq %r13, %rcx
jne 0xae9f
incq %r12
cmpq -0x38(%rbp), %r12
jne 0xae55
jmp 0xafc4
movl $0x80000000, -0x30(%rbp) # imm = 0x80000000
movl $0x7fffffff, -0x40(%rbp) # imm = 0x7FFFFFFF
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x80000000, %r8d       # imm = 0x80000000
movq -0x48(%rbp), %r13
movl -0x40(%rbp), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
movl %esi, %ecx
negl %ecx
cmovsl %esi, %ecx
cmpl $0x0, -0x38(%rbp)
movq -0x50(%rbp), %r15
jle 0xb076
addl %ecx, %r8d
movl -0x30(%rbp), %esi
addl %eax, %esi
cvtsi2sd %esi, %xmm0
cvtsi2sd %r8d, %xmm1
leaq (,%r13,4), %rdx
movq -0x80(%rbp), %rsi
leaq (,%rsi,4), %rsi
xorl %edi, %edi
movsd 0x64fe(%rip), %xmm2     # 0x11510
movq -0x78(%rbp), %r8
movq -0x70(%rbp), %r9
testl %r13d, %r13d
jle 0xb067
xorl %r10d, %r10d
movl (%r8,%r10,4), %r11d
addl %eax, %r11d
xorps %xmm3, %xmm3
cvtsi2sd %r11d, %xmm3
mulsd %xmm2, %xmm3
divsd %xmm0, %xmm3
cvttsd2si %xmm3, %r11d
movl (%r9,%r10,4), %ebx
addl %ecx, %ebx
xorps %xmm3, %xmm3
cvtsi2sd %ebx, %xmm3
mulsd %xmm2, %xmm3
divsd %xmm1, %xmm3
cvttsd2si %xmm3, %ebx
movl %r11d, (%r8,%r10,4)
movl %ebx, (%r9,%r10,4)
incq %r10
cmpq %r10, %r13
jne 0xb022
incq %rdi
addq %rdx, %r9
addq %rsi, %r8
cmpq -0x38(%rbp), %rdi
jne 0xb01a
movq %rsp, %rax
subq -0x88(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq %rax, %rsp
cmpl $0x0, 0xc(%r15)
jle 0xb2c4
movq -0x140(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x148(%rbp), %eax
movq -0x120(%rbp), %rcx
movq %rcx, -0x110(%rbp)
movl -0x128(%rbp), %ecx
movl -0x130(%rbp), %edx
movl %ecx, -0x90(%rbp)
imull %ecx, %edx
movl %edx, -0xcc(%rbp)
movl -0x150(%rbp), %ecx
movl %eax, -0x98(%rbp)
imull %eax, %ecx
movl %ecx, -0xc8(%rbp)
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x80000000, %edx       # imm = 0x80000000
xorl %edi, %edi
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpl $0x0, 0x8(%r15)
movq %rdi, -0x108(%rbp)
movl %r8d, -0xd0(%rbp)
jle 0xb297
leaq 0x1(%r9), %r10
movq %r9, %rax
imulq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
leaq (%rcx,%rax,4), %r11
movq %r9, %rax
imulq -0x48(%rbp), %rax
movq -0x70(%rbp), %rcx
leaq (%rcx,%rax,4), %r14
movq -0xd8(%rbp), %rcx
leaq (%rcx,%rax,4), %r13
movl %edi, %ecx
xorl %edi, %edi
movq %r9, -0xc0(%rbp)
movq %r10, -0xb8(%rbp)
movq %r11, -0xb0(%rbp)
movq %r14, -0xa8(%rbp)
movq %r13, -0xa0(%rbp)
cmpl $0x0, 0x10(%r15)
movl %ecx, -0x54(%rbp)
movl %r8d, -0x38(%rbp)
jle 0xb273
movslq %r8d, %r8
addq -0x110(%rbp), %r8
movslq %ecx, %rax
addq -0x88(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x1(%rdi), %rax
movq %rax, -0x40(%rbp)
xorl %ebx, %ebx
movq %rdi, -0x68(%rbp)
movq %r8, -0x60(%rbp)
testq %r9, %r9
je 0xb263
testq %rdi, %rdi
je 0xb263
movslq 0xc(%r15), %rax
cmpq %rax, %r10
jge 0xb263
movslq 0x8(%r15), %rax
cmpq %rax, -0x40(%rbp)
jge 0xb263
movl (%r11,%rdi,4), %r12d
movl %r12d, %eax
imull %r12d, %eax
movl (%r14,%rdi,4), %r15d
movl %r15d, %ecx
imull %r15d, %ecx
addl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
ucomisd %xmm1, %xmm0
jb 0xb200
sqrtsd %xmm0, %xmm0
jmp 0xb240
movl %edx, %r13d
movl %esi, %r14d
callq 0x20f0
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %rdi
movq -0xb0(%rbp), %r11
movq -0xb8(%rbp), %r10
movq -0xc0(%rbp), %r9
xorpd %xmm1, %xmm1
movl %r14d, %esi
movq -0xa8(%rbp), %r14
movl %r13d, %edx
movq -0xa0(%rbp), %r13
cvttsd2si %xmm0, %eax
movl %eax, (%r13,%rdi,4)
cmpl %eax, %esi
cmovgel %eax, %esi
cmpl %eax, %edx
cmovlel %eax, %edx
movq -0x30(%rbp), %rax
movb %r12b, (%rax,%rbx)
movb %r15b, (%r8,%rbx)
movq -0x50(%rbp), %r15
incq %rbx
movslq 0x10(%r15), %rax
cmpq %rax, %rbx
jl 0xb1a8
incq %rdi
movslq 0x8(%r15), %rax
movl -0x38(%rbp), %r8d
addl -0x90(%rbp), %r8d
movl -0x54(%rbp), %ecx
addl -0x98(%rbp), %ecx
cmpq %rax, %rdi
jl 0xb16c
incq %r9
movslq 0xc(%r15), %rax
movl -0xd0(%rbp), %r8d
addl -0xcc(%rbp), %r8d
movq -0x108(%rbp), %rdi
addl -0xc8(%rbp), %edi
cmpq %rax, %r9
jl 0xb0fd
jmp 0xb2ce
movl $0x80000000, %edx       # imm = 0x80000000
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
cmpl $0x0, 0xc(%r15)
movq -0x48(%rbp), %rbx
movq -0xd8(%rbp), %r14
jle 0xb36f
addl %eax, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movq -0xe0(%rbp), %rcx
movl -0xe8(%rbp), %edx
shlq $0x2, %rbx
movl -0xf0(%rbp), %esi
imull %edx, %esi
xorl %edi, %edi
movsd 0x61f8(%rip), %xmm1     # 0x11510
xorl %r8d, %r8d
cmpl $0x0, 0x8(%r15)
jle 0xb35e
movl %edi, %r9d
xorl %r10d, %r10d
movl (%r14,%r10,4), %r11d
addl %eax, %r11d
xorps %xmm2, %xmm2
cvtsi2sd %r11d, %xmm2
mulsd %xmm1, %xmm2
divsd %xmm0, %xmm2
cvttsd2si %xmm2, %r11d
movl %r11d, (%r14,%r10,4)
movslq %r9d, %r9
movb %r11b, (%rcx,%r9)
incq %r10
movslq 0x8(%r15), %r11
addl %edx, %r9d
cmpq %r11, %r10
jl 0xb328
incq %r8
movslq 0xc(%r15), %r9
addq %rbx, %r14
addl %esi, %edi
cmpq %r9, %r8
jl 0xb31b
leaq 0x639e(%rip), %rsi      # 0x11714
leaq -0x158(%rbp), %rdi
callq 0x4e1a
leaq 0x63b2(%rip), %rsi      # 0x1173b
leaq -0x138(%rbp), %rdi
callq 0x4e1a
leaq -0xf8(%rbp), %rdi
leaq -0x960(%rbp), %r14
movq %r14, %rsi
callq 0xb5ae
movl (%r14), %eax
movl %eax, -0x560(%rbp)
movl $0x1, %ecx
addl -0x960(%rbp,%rcx,4), %eax
movl %eax, -0x560(%rbp,%rcx,4)
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0xb3b9
movl $0x64, %eax
subl -0xc4(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6143(%rip), %xmm0     # 0x11530
xorps %xmm1, %xmm1
cvtsi2sdl -0x164(%rbp), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
xorl %ecx, %ecx
cmpl %eax, -0x560(%rbp,%rcx,4)
jg 0xb419
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0xb402
jmp 0xb41d
decl %ecx
movl %ecx, %eax
movslq -0xec(%rbp), %rcx
movq %rcx, -0x50(%rbp)
testq %rcx, %rcx
jle 0xb50a
movl -0xf0(%rbp), %edx
movl -0xe8(%rbp), %esi
movq -0xe0(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movslq %edx, %r8
decq %r8
movl %edx, %ecx
imull %esi, %ecx
movl %ecx, -0x68(%rbp)
movq $0x0, -0x30(%rbp)
xorl %r11d, %r11d
movq -0x118(%rbp), %rdi
testl %edx, %edx
jle 0xb4f2
leaq 0x1(%r11), %rbx
movq -0x30(%rbp), %rcx
movl %ecx, %r14d
xorl %r15d, %r15d
testl %esi, %esi
jle 0xb4e7
movslq %r14d, %r12
addq -0x40(%rbp), %r12
cmpq -0x50(%rbp), %rbx
setae %r9b
testq %r11, %r11
sete %r13b
testq %r15, %r15
sete %r10b
orb %r13b, %r10b
cmpq %r8, %r15
setge %r13b
orb %r9b, %r13b
orb %r10b, %r13b
xorl %r9d, %r9d
testb %r13b, %r13b
jne 0xb4df
movzbl (%r12,%r9), %r10d
cmpl %r10d, %eax
setg %r10b
negb %r10b
movl 0x8(%rdi), %ecx
imull %r11d, %ecx
addl %r15d, %ecx
imull 0x10(%rdi), %ecx
movslq %ecx, %rcx
addq 0x18(%rdi), %rcx
movb %r10b, (%r9,%rcx)
incq %r9
cmpq %r9, %rsi
jne 0xb4b2
incq %r15
addl %esi, %r14d
cmpq %rdx, %r15
jne 0xb47e
incq %r11
movq -0x30(%rbp), %rcx
addl -0x68(%rbp), %ecx
movq %rcx, -0x30(%rbp)
cmpq -0x50(%rbp), %r11
jne 0xb468
leaq 0x6251(%rip), %rsi      # 0x11762
leaq -0xf8(%rbp), %rdi
callq 0x4e1a
movq -0x100(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop