LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::hist_equal_proc(Image&, Image&)
void ImageProc::hist_equal_proc(Image &img_orig, Image &img_modified)
{
	//Image img_bw("bw", width, height);

	//img_bw.read_image(infile, width, height);

	int histogram_bins[256] = {0};

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			if((img_orig.getvalue(i,j,0) >= 0) && (img_orig.getvalue(i,j,0) < 256))
				histogram_bins[img_orig.getvalue(i,j,0)]++;


	int hist_cumulative[256] = {0};
	hist_cumulative[0] = histogram_bins[0];
	for(int i = 1; i < 256; i++)
		hist_cumulative[i] = hist_cumulative[i-1] + histogram_bins[i];


	for(int i = 0; i < img_modified.rows; i++)
		for(int j = 0; j < img_modified.cols; j++)
			if      (img_orig.getvalue(i,j,0) < 0  ) img_modified.setvalue(i,j,0,0);
			else if (img_orig.getvalue(i,j,0) > 255) img_modified.setvalue(i,j,0,255);
			else    img_modified.setvalue(i,j,0,(255 * hist_cumulative[img_orig.getvalue(i,j,0)] \
															      / hist_cumulative[255]));


	//img_modified.write_image(outfile, width, height);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x400(%rsp), %rdi
xorl %ebp, %ebp
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x20e0
movl 0x8(%r14), %eax
movl 0xc(%r14), %ecx
movq 0x18(%r14), %rdx
movl 0x10(%r14), %esi
testl %eax, %eax
movl $0x0, %edi
cmovgl %eax, %edi
testl %ecx, %ecx
cmovlel %ebp, %ecx
imull %esi, %eax
xorl %r8d, %r8d
movl %ebp, %r9d
movq %rdi, %r10
cmpl %ecx, %r8d
je 0x9399
subq $0x1, %r10
jb 0x9392
movslq %r9d, %r9
movzbl (%rdx,%r9), %r11d
incl 0x400(%rsp,%r11,4)
addl %esi, %r9d
jmp 0x9377
incl %r8d
addl %eax, %ebp
jmp 0x936c
movq %rsp, %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x20e0
movl 0x400(%rsp), %eax
movl %eax, (%r15)
pushq $0x1
popq %rcx
cmpq $0x100, %rcx            # imm = 0x100
je 0x93d0
addl 0x400(%rsp,%rcx,4), %eax
movl %eax, (%rsp,%rcx,4)
incq %rcx
jmp 0x93b8
xorl %ecx, %ecx
movl 0x3fc(%rsp), %esi
cmpl 0xc(%rbx), %ecx
jge 0x942b
xorl %edi, %edi
movl 0x8(%rbx), %r8d
cmpl %r8d, %edi
jge 0x9427
movq 0x18(%r14), %rax
movl 0x8(%r14), %edx
imull %ecx, %edx
addl %edi, %edx
imull 0x10(%r14), %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
imull $0xff, (%rsp,%rax,4), %eax
cltd
idivl %esi
movq 0x18(%rbx), %rdx
imull %ecx, %r8d
addl %edi, %r8d
imull 0x10(%rbx), %r8d
movslq %r8d, %r8
movb %al, (%rdx,%r8)
incl %edi
jmp 0x93e0
incl %ecx
jmp 0x93d9
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::apply_sobel_operator(char const*, char const*, int, int, int)
void ImageProc::apply_sobel_operator(const char *infile, const char *outfile, int width, int height, int percentage)
{
	Image img_orig("bw", width, height);
	Image img_edge_map("bw", width, height);


	img_orig.read_image(infile, img_orig.cols, img_orig.rows);

	sobel_edge_detector(img_orig, img_edge_map, percentage);

	img_edge_map.write_image(outfile, img_edge_map.cols, img_edge_map.rows);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, 0xc(%rsp)
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, 0x10(%rsp)
movq %rdi, %r12
leaq 0x8252(%rip), %r13      # 0x116b4
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3fd6
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4032
movq %rbx, %rdi
movq %rbp, %rsi
movl 0xc(%rsp), %edx
callq 0x94be
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x411c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::func_gradient(int**, Image&, int, int, int, int)
int ImageProc::func_gradient(int **operator_mask, Image &img_orig, int x, int y, int z, int window_size)
{
	int result = 0;
	for(int m = -window_size/2, p = 0; m <= window_size/2; m++, p++)
		for(int n = -window_size/2, q = 0; n <= window_size/2; n++, q++)
		{
			result += img_orig.getvalue((x+m),(y+n),z) * operator_mask[p][q];
		}

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r9d, %r10d
movl %edx, %r9d
movl $0xfffffffe, %r11d      # imm = 0xFFFFFFFE
movl %r10d, %eax
cltd
idivl %r11d
movl %eax, %r11d
movl $0x2, %ebx
movl %r10d, %eax
cltd
idivl %ebx
movq 0x18(%rsi), %r10
movl 0x8(%rsi), %ebx
movl 0x10(%rsi), %esi
movslq %r11d, %r14
movslq %eax, %r15
addl %r14d, %ecx
addl %r14d, %r9d
imull %ebx, %r9d
addl %ecx, %r9d
imull %esi, %r9d
addl %r8d, %r9d
imull %esi, %ebx
xorl %ecx, %ecx
xorl %edx, %edx
cmpl %eax, %r11d
jg 0x9d7d
movl %r9d, %r8d
xorl %r12d, %r12d
leaq (%r14,%r12), %r13
cmpq %r15, %r13
jg 0x9d72
movslq %r8d, %r8
movzbl (%r10,%r8), %ebp
movq (%rdi,%rcx,8), %r13
imull (%r13,%r12,4), %ebp
addl %ebp, %edx
incq %r12
addl %esi, %r8d
jmp 0x9d4d
incl %r11d
incq %rcx
addl %ebx, %r9d
jmp 0x9d42
movl %edx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::get_histogram(Image&, int*)
void ImageProc::get_histogram(Image &img_orig, int histogram_bins[256])
{
	for(int i = 0; i < 256; i++)
	{
		histogram_bins[i] = 0;
	}

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			if((img_orig.getvalue(i,j,0) >= 0) && (img_orig.getvalue(i,j,0) < 256))
				histogram_bins[img_orig.getvalue(i,j,0)]++;

}

// Assembly:
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x9d9d
andl $0x0, (%rsi,%rax,4)
incq %rax
jmp 0x9d8c
xorl %eax, %eax
cmpl 0xc(%rdi), %eax
jge 0x9dd3
movq 0x18(%rdi), %rcx
xorl %edx, %edx
movl 0x8(%rdi), %r8d
cmpl %r8d, %edx
jge 0x9dcf
imull %eax, %r8d
addl %edx, %r8d
imull 0x10(%rdi), %r8d
movslq %r8d, %r8
movzbl (%rcx,%r8), %r8d
incl (%rsi,%r8,4)
incl %edx
jmp 0x9daa
incl %eax
jmp 0x9d9f
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::apply_LoG_operator(char const*, char const*, int, int)
void ImageProc::apply_LoG_operator(const char *infile, const char *outfile, int width, int height)
{
	Image img_orig("bw", width, height);
	Image img_modified("bw", width, height);
	img_orig.read_image(infile, img_orig.cols, img_orig.rows);

	LoG_edge_detector(img_orig, img_modified);

	img_modified.write_image(outfile, img_modified.cols, img_modified.rows);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, (%rsp)
movq %rdi, %r15
leaq 0x789f(%rip), %r12      # 0x116b4
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x3fd6
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x3fd6
movq %r13, %rdi
movq %r15, %rsi
callq 0x4032
movq %r13, %rdi
movq %rbx, %rsi
callq 0x9e6c
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x411c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::func_gradient_float(float**, Image&, int, int, int, int)
float ImageProc::func_gradient_float(float **operator_mask, Image &img_orig, int x, int y, int z, int window_size)
{
	float result = 0.0;
	for(int m = -window_size/2, p = 0; m <= window_size/2; m++, p++)
		for(int n = -window_size/2, q = 0; n <= window_size/2; n++, q++)
		{
			result += (1.0 * img_orig.getvalue((x+m),(y+n),z) * operator_mask[p][q]);
		}

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %r10d
movl %edx, %r9d
movl $0xfffffffe, %r11d      # imm = 0xFFFFFFFE
movl %r10d, %eax
cltd
idivl %r11d
movl %eax, %r11d
movl $0x2, %ebx
movl %r10d, %eax
cltd
idivl %ebx
movq 0x18(%rsi), %rdx
movl 0x8(%rsi), %r10d
movl 0x10(%rsi), %esi
movslq %r11d, %rbx
movslq %eax, %r14
addl %ebx, %ecx
addl %ebx, %r9d
imull %r10d, %r9d
addl %ecx, %r9d
imull %esi, %r9d
addl %r8d, %r9d
imull %esi, %r10d
xorps %xmm0, %xmm0
xorl %ecx, %ecx
cmpl %eax, %r11d
jg 0xa515
movl %r9d, %r8d
xorl %r15d, %r15d
leaq (%rbx,%r15), %r12
cmpq %r14, %r12
jg 0xa50a
movslq %r8d, %r8
movzbl (%rdx,%r8), %ebp
cvtsi2sd %ebp, %xmm1
movq (%rdi,%rcx,8), %r12
cvtss2sd (%r12,%r15,4), %xmm2
mulsd %xmm1, %xmm2
cvtss2sd %xmm0, %xmm0
addsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
incq %r15
addl %esi, %r8d
jmp 0xa4d3
incl %r11d
incq %rcx
addl %r10d, %r9d
jmp 0xa4c8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::halftone_fixed_thresh(Image&, Image&)
void ImageProc::halftone_fixed_thresh(Image &img_orig, Image &img_modified)
{
	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(img_orig.getvalue(i,j,k) <= 127)	img_modified.setvalue(i,j,k,0  );
				else								img_modified.setvalue(i,j,k,255);
}

// Assembly:
xorl %eax, %eax
cmpl 0xc(%rsi), %eax
jge 0xa881
xorl %ecx, %ecx
cmpl 0x8(%rsi), %ecx
jge 0xa87d
xorl %edx, %edx
movl 0x10(%rsi), %r8d
cmpl %r8d, %edx
jge 0xa879
movl 0x8(%rdi), %r9d
imull %eax, %r9d
addl %ecx, %r9d
imull 0x10(%rdi), %r9d
movslq %r9d, %r9
addq 0x18(%rdi), %r9
movl 0x8(%rsi), %r10d
imull %eax, %r10d
addl %ecx, %r10d
imull %r10d, %r8d
movslq %r8d, %r8
addq 0x18(%rsi), %r8
movb (%rdx,%r9), %r9b
sarb $0x7, %r9b
movb %r9b, (%rdx,%r8)
incq %rdx
jmp 0xa832
incl %ecx
jmp 0xa82b
incl %eax
jmp 0xa824
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::halftone_random_thresh(Image&, Image&)
void ImageProc::halftone_random_thresh(Image &img_orig, Image &img_modified)
{
	srand(time(0));
	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(img_orig.getvalue(i,j,k) <= rand() % 255)	img_modified.setvalue(i,j,k,0  );
				else											img_modified.setvalue(i,j,k,255);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2140
movl %eax, %edi
callq 0x2160
cmpl 0xc(%rbx), %r15d
jge 0xa915
xorl %r12d, %r12d
cmpl 0x8(%rbx), %r12d
jge 0xa910
xorl %r13d, %r13d
cmpl 0x10(%rbx), %r13d
jge 0xa90b
movl 0x8(%r14), %eax
imull %r15d, %eax
addl %r12d, %eax
imull 0x10(%r14), %eax
cltq
addq 0x18(%r14), %rax
movzbl (%r13,%rax), %ebp
callq 0x2080
cltd
movl $0xff, %ecx
idivl %ecx
cmpl %ebp, %edx
setl %al
movl 0x8(%rbx), %ecx
imull %r15d, %ecx
addl %r12d, %ecx
imull 0x10(%rbx), %ecx
movslq %ecx, %rcx
addq 0x18(%rbx), %rcx
negb %al
movb %al, (%r13,%rcx)
incq %r13
jmp 0xa8b6
incl %r12d
jmp 0xa8ad
incl %r15d
jmp 0xa8a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::color_halftoning(char const*, char const*, int, int)
void ImageProc::color_halftoning(const char *infile, const char *outfile, int width, int height)
{
	Image img_orig("color", width, height);
	Image img_modified("color", width, height);
	img_orig.read_image(infile, img_orig.cols, img_orig.rows);

	error_diffusion(img_orig, img_modified);
	//mbvq_error_diffusion(img_orig, img_modified);

	img_modified.write_image(outfile, img_modified.cols, img_modified.rows);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, (%rsp)
movq %rdi, %r15
leaq 0x5799(%rip), %r12      # 0x106c8
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x3fd6
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x3fd6
movq %r13, %rdi
movq %r15, %rsi
callq 0x4032
movq %r13, %rdi
movq %rbx, %rsi
callq 0xaaca
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x411c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::nearest_vertex(float*, int, int, int, int)
int ImageProc::nearest_vertex(float distance[8], int i, int j, int k, int l)
{
	if 		(distance[i] < distance[j] && distance[i] < distance[k] && distance[i] < distance[l])	return i;
	else if (distance[j] < distance[i] && distance[i] < distance[k] && distance[i] < distance[l])	return j;
	else if (distance[k] < distance[i] && distance[i] < distance[j] && distance[i] < distance[l])	return k;
	else if (distance[l] < distance[i] && distance[i] < distance[j] && distance[i] < distance[k])	return l;
}

// Assembly:
movl %esi, %eax
movslq %esi, %rsi
movss (%rdi,%rsi,4), %xmm0
movslq %edx, %rsi
movss (%rdi,%rsi,4), %xmm1
ucomiss %xmm0, %xmm1
movslq %ecx, %r9
movslq %r8d, %rsi
jbe 0xbd36
movss (%rdi,%r9,4), %xmm2
ucomiss %xmm0, %xmm2
jbe 0xbd36
movss (%rdi,%rsi,4), %xmm2
ucomiss %xmm0, %xmm2
ja 0xbd6b
ucomiss %xmm1, %xmm0
movss (%rdi,%r9,4), %xmm2
jbe 0xbd52
ucomiss %xmm0, %xmm2
jbe 0xbd52
movss (%rdi,%rsi,4), %xmm3
ucomiss %xmm0, %xmm3
movl %edx, %eax
ja 0xbd6b
movss (%rdi,%rsi,4), %xmm3
ucomiss %xmm0, %xmm3
cmovbel %esi, %ecx
ucomiss %xmm2, %xmm0
cmovbel %esi, %ecx
ucomiss %xmm0, %xmm1
cmovbel %esi, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::rgb2cielab(Image&, Image&)
void ImageProc::rgb2cielab(Image &img_orig, Image &img_modified)
{
	double L,A,B,r,g,b;
	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
		{
			r = (double)(img_orig.getvalue(i,j,0)/255.0);
			g = (double)(img_orig.getvalue(i,j,1)/255.0);
			b = (double)(img_orig.getvalue(i,j,2)/255.0);
			Rgb2Lab(&L,&A,&B,r,g,b);
			//std::cout << L << " " << A << " " << B <<std::endl;
			img_modified.setvalue(i,j,0,(unsigned char)(L));
			img_modified.setvalue(i,j,1,(unsigned char)(A));
			img_modified.setvalue(i,j,2,(unsigned char)(B));
			//std::cout << img_modified.getvalue(i,j,0) << " " << img_modified.getvalue(i,j,1) << " " << img_modified.getvalue(i,j,2)<<std::endl;
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movq %rsp, %r13
cmpl 0xc(%r14), %ebp
jge 0xc69c
xorl %r15d, %r15d
movl 0x8(%r14), %eax
cmpl %eax, %r15d
jge 0xc695
movq 0x18(%r14), %rcx
imull %ebp, %eax
addl %r15d, %eax
imull 0x10(%r14), %eax
cltq
movzbl (%rcx,%rax), %edx
cvtsi2sd %edx, %xmm0
movsd 0x3ea9(%rip), %xmm3     # 0x104b0
divsd %xmm3, %xmm0
movzbl 0x1(%rcx,%rax), %edx
cvtsi2sd %edx, %xmm1
divsd %xmm3, %xmm1
movzbl 0x2(%rcx,%rax), %eax
cvtsi2sd %eax, %xmm2
divsd %xmm3, %xmm2
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x5a0e
cvttsd2si 0x10(%rsp), %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %edx
imull %ebp, %edx
addl %r15d, %edx
imull 0x10(%rbx), %edx
movslq %edx, %rdx
movb %al, (%rcx,%rdx)
cvttsd2si 0x8(%rsp), %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %edx
imull %ebp, %edx
addl %r15d, %edx
imull 0x10(%rbx), %edx
movslq %edx, %rdx
movb %al, 0x1(%rcx,%rdx)
cvttsd2si (%rsp), %eax
movl 0x8(%rbx), %ecx
imull %ebp, %ecx
addl %r15d, %ecx
imull 0x10(%rbx), %ecx
movq 0x18(%rbx), %rdx
movslq %ecx, %rcx
movb %al, 0x2(%rdx,%rcx)
incl %r15d
jmp 0xc5d9
incl %ebp
jmp 0xc5cc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::apply_morphology(char const*, char const*, int, int)
void ImageProc::apply_morphology(const char *infile, const char *outfile, int width, int height)
{
	Image img_orig_bw("bw", width, height);
	Image img_binary("bw", width, height);
	Image img_shrinked("bw", width, height);
	Image img_thinned("bw", width, height);
	Image img_skeletonized("bw", width, height);
	Image img_unsharped("bw", width, height);
	Image img_modified("bw", width, height);
	Image img_modified_color("color", width, height);

	img_orig_bw.read_image(infile, img_orig_bw.cols, img_orig_bw.rows);

	//unsharp_mask(img_orig_bw, img_unsharp_masked);
	otsu_th(img_orig_bw, img_binary);
	img_binary.write_image("../output_images/morphology_binarized_img.raw", img_binary.cols, img_binary.rows);

	shrink(img_binary, img_shrinked);
	thin(img_binary, img_thinned);
	skeletonize(img_binary, img_skeletonized);

	img_shrinked.write_image("../output_images/morphology_shrinked_img.raw", img_shrinked.cols, img_shrinked.rows);
	img_thinned.write_image("../output_images/morphology_thinned_img.raw", img_thinned.cols, img_thinned.rows);
	img_skeletonized.write_image("../output_images/morphology_skeletonized_img.raw", img_skeletonized.cols, img_skeletonized.rows);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %rbp
leaq 0x4def(%rip), %r12      # 0x116b4
leaq 0xe8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x3fd6
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
leaq 0xa8(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
leaq 0x3d6b(%rip), %rsi      # 0x106c8
leaq 0x68(%rsp), %rdi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x3fd6
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4032
movq %r13, %rdi
movq %rbx, %rsi
callq 0xca02
leaq 0x4475(%rip), %rsi      # 0x10dff
movq %rbx, %rdi
callq 0x411c
movq %rbx, %rdi
leaq 0x48(%rsp), %r14
movq %r14, %rsi
callq 0xcbf2
movq %rbx, %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0xd388
movq %rbx, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0xda74
leaq 0x4464(%rip), %rsi      # 0x10e2d
movq %r14, %rdi
callq 0x411c
leaq 0x4482(%rip), %rsi      # 0x10e5a
movq %r15, %rdi
callq 0x411c
leaq 0x449f(%rip), %rsi      # 0x10e86
movq %rbx, %rdi
callq 0x411c
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::apply_binarization(char const*, char const*, int, int)
void ImageProc::apply_binarization(const char* infile, const char *outfile, int width, int height)
{
	Image img_orig_bw("bw", width, height);
	Image img_binary("bw", width, height);

	img_orig_bw.read_image(infile, img_orig_bw.cols, img_orig_bw.rows);
	//unsharp_mask(img_orig_bw, img_unsharp_masked);
	otsu_th(img_orig_bw, img_binary);
	img_binary.write_image(outfile, img_binary.cols, img_binary.rows);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, (%rsp)
movq %rdi, %r15
leaq 0x3533(%rip), %r12      # 0x116b4
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x3fd6
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x3fd6
movq %r13, %rdi
movq %r15, %rsi
callq 0x4032
movq %r13, %rdi
movq %rbx, %rsi
callq 0xca02
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x411c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: usage()
static int usage() {
  puts("usage: bench [--threads N] [--rsa|--ecdsa] "
       "<handshake|handshake-resume|handshake-ticket> <suite>");
  puts("usage: bench [--threads N] bulk <suite> <plaintext-size>");
  puts("usage: bench memory <count>");
  return 1;
}

// Assembly:
pushq %rax
leaq 0x30c9(%rip), %rdi      # 0x70ac
callq 0x3420
leaq 0x311e(%rip), %rdi      # 0x710d
callq 0x3420
leaq 0x314b(%rip), %rdi      # 0x7146
popq %rax
jmp 0x3420
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: test_bulk_one(Timings&, Context&, Context&, unsigned long, unsigned long)
static void test_bulk_one(Timings &timings_out, Context &server_ctx,
                          Context &client_ctx, const size_t rounds,
                          const size_t plaintext_size) {
  Conn server(server_ctx.open());
  Conn client(client_ctx.open());

  do_handshake(client, server);

  std::vector<uint8_t> plaintext(plaintext_size, 0);
  double time_send = 0;
  double time_recv = 0;

  for (size_t i = 0; i < rounds; i++) {
    double t = get_time();
    server.write(&plaintext[0], plaintext.size());
    time_send += get_time() - t;

    server.transfer_to(client);
    t = get_time();
    client.read(&plaintext[0], plaintext.size());
    time_recv += get_time() - t;
  }

  timings_out.server.store(time_send);
  timings_out.client.store(time_recv);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x52f6
leaq 0x80(%rsp), %rdi
movq %rax, %rsi
callq 0x52fe
movq %r12, %rdi
callq 0x52f6
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x52fe
leaq 0x48(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x45d4
leaq 0x7(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x5740
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x80(%rsp), %r15
leaq 0x48(%rsp), %r12
xorpd %xmm1, %xmm1
subq $0x1, %r14
jb 0x4555
movsd %xmm1, 0x40(%rsp)
callq 0x47eb
movsd %xmm0, 0x38(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
subq %rsi, %rdx
movq %r15, %rdi
callq 0x579e
callq 0x47eb
movsd %xmm0, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
subq %rsi, %rdx
movq %r12, %rdi
callq 0x5856
movsd 0x30(%rsp), %xmm1
subsd 0x38(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x47eb
subsd 0x28(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
addsd %xmm0, %xmm1
jmp 0x44b9
movq 0x8(%rsp), %xmm0
movq %xmm0, %rax
xchgq %rax, 0x8(%rbx)
movq %xmm1, %rax
xchgq %rax, (%rbx)
leaq 0x10(%rsp), %rdi
callq 0x58c0
leaq 0x48(%rsp), %rdi
callq 0x5420
leaq 0x80(%rsp), %rdi
callq 0x5420
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x459e
movq %rax, %rbx
jmp 0x45b5
movq %rax, %rbx
jmp 0x45bf
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x58c0
leaq 0x48(%rsp), %rdi
callq 0x5420
leaq 0x80(%rsp), %rdi
callq 0x5420
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: apply_work_multiplier(unsigned long)
static size_t apply_work_multiplier(size_t work) {
  const char *multiplier = getenv("BENCH_MULTIPLIER");
  if (multiplier) {
    return size_t(work * atof(multiplier));
  }
  return work;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x2bf7(%rip), %rdi      # 0x7397
callq 0x3360
testq %rax, %rax
je 0x47e2
cvtsi2sd %rbx, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rax, %rdi
callq 0x3370
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x2861(%rip), %xmm0     # 0x7038
cvttsd2si %xmm0, %rbx
andq %rcx, %rbx
orq %rax, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: get_time()
static double get_time() {
  timeval tv;
  gettimeofday(&tv, NULL);

  double v = tv.tv_sec;
  v += double(tv.tv_usec) / 1.e6;
  return v;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3480
cvtsi2sdq (%rbx), %xmm1
cvtsi2sdq 0x8(%rbx), %xmm0
divsd 0x2830(%rip), %xmm0     # 0x7040
addsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: chkerr(int)
static bool chkerr(int err) {
  if (err == SSL_ERROR_SYSCALL || err == SSL_ERROR_SSL) {
    ERR_print_errors_fp(stdout);
    puts("error");
    exit(1);
    return true;
  }
  return err == 0;
}

// Assembly:
movl %edi, %eax
andl $-0x5, %eax
cmpl $0x1, %eax
je 0x482a
testl %edi, %edi
sete %al
retq
pushq %rax
movq 0x679e(%rip), %rax      # 0xafd0
movq (%rax), %rdi
callq 0x3190
leaq 0x2b81(%rip), %rdi      # 0x73c2
callq 0x3420
pushq $0x1
popq %rdi
callq 0x3350
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: do_handshake_step(Conn&, Conn&)
static bool do_handshake_step(Conn &client, Conn &server) {
  bool s_connected = server.accept();
  bool c_connected = client.connect();

  if (s_connected && c_connected) {
    return false;
  }

  client.transfer_to(server);
  server.transfer_to(client);
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x5c96
movl %eax, %r15d
movq %rbx, %rdi
callq 0x5cb4
movl %eax, %ebp
andb %r15b, %bpl
jne 0x488b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x57bc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x57bc
xorb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: new_session_cb(ssl_st*, ssl_session_st*)
static int new_session_cb(SSL *ssl, SSL_SESSION *sess) {
  Conn *conn = (Conn *)SSL_get_app_data(ssl);
  if (conn) {
    return conn->save_one_session(sess);
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x3100
testq %rax, %rax
je 0x4f6b
cmpq $0x0, 0x30(%rax)
jne 0x4f6b
movq %r14, 0x30(%rax)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Context::set_ciphers(char const*)
void set_ciphers(const char *ciphers) {
    if (!strcmp(ciphers, "TLS_AES_128_GCM_SHA256") ||
        !strcmp(ciphers, "TLS_AES_256_GCM_SHA384") ||
        !strcmp(ciphers, "TLS_CHACHA20_POLY1305_SHA256")) {
      int err =
          SSL_CTX_set1_groups_list(m_ctx, "X25519MLKEM768:X25519:P-256:P-384");
      assert(err == 1);
      set_version(TLS1_3_VERSION, TLS1_3_VERSION);
#ifndef BORINGSSL
      SSL_CTX_set_ciphersuites(m_ctx, ciphers);
#else
      // boringssl does not have any direct way to configure TLS1.3 cipher
      // suites. however, it does have "compliance policies" which give limited
      // control over their order, and a configuration switch for pretending
      // hardware-accelerated AES is absent -- which prioritises chacha.
      //
      // So we can arrange for one ciphersuite, as follows:
      //
      // - TLS_CHACHA20_POLY1305_SHA256:
      // `SSL_CTX_set_aes_hw_override_for_testing(ctx, false)`
      // - TLS_AES_128_GCM_SHA256: the default
      // - TLS_AES_256_GCM_SHA384: `SSL_CTX_set_compliance_policy(ctx,
      // ssl_compliance_policy_cnsa_202407)`
      if (!strcmp(ciphers, "TLS_AES_256_GCM_SHA384")) {
        SSL_CTX_set_compliance_policy(m_ctx, ssl_compliance_policy_cnsa_202407);
      } else if (!strcmp(ciphers, "TLS_CHACHA20_POLY1305_SHA256")) {
        bssl::SSL_CTX_set_aes_hw_override_for_testing(m_ctx, false);
      } else {
        assert(!strcmp(ciphers, "TLS_AES_128_GCM_SHA256"));
      }
#endif
    } else {
      set_version(TLS1_2_VERSION, TLS1_2_VERSION);
      SSL_CTX_set_cipher_list(m_ctx, ciphers);
    }
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2197(%rip), %rsi      # 0x7162
movq %rbx, %rdi
callq 0x33c0
testl %eax, %eax
je 0x5021
leaq 0x219b(%rip), %rsi      # 0x7179
movq %rbx, %rdi
callq 0x33c0
testl %eax, %eax
je 0x5021
leaq 0x219f(%rip), %rsi      # 0x7190
movq %rbx, %rdi
callq 0x33c0
testl %eax, %eax
je 0x5021
movq %r14, %rdi
movl $0x303, %esi            # imm = 0x303
movl $0x303, %edx            # imm = 0x303
callq 0x51ba
movq (%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32a0
movq (%r14), %rdi
leaq 0x2182(%rip), %rcx      # 0x71ad
pushq $0x5c
popq %rsi
xorl %edx, %edx
callq 0x3280
cmpl $0x1, %eax
jne 0x505e
movq %r14, %rdi
movl $0x304, %esi            # imm = 0x304
movl $0x304, %edx            # imm = 0x304
callq 0x51ba
movq (%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3340
leaq 0x216a(%rip), %rdi      # 0x71cf
leaq 0x216c(%rip), %rsi      # 0x71d8
leaq 0x216e(%rip), %rcx      # 0x71e1
pushq $0x63
popq %rdx
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Context::load_server_creds(KeyType)
void load_server_creds(const KeyType which) {
    int err;

    switch (which) {
    case KeyType::RSA2048:
      err = SSL_CTX_use_certificate_chain_file(
          m_ctx, "../rustls/test-ca/rsa-2048/end.fullchain");
      assert(err == 1);
      err = SSL_CTX_use_PrivateKey_file(
          m_ctx, "../rustls/test-ca/rsa-2048/end.key", SSL_FILETYPE_PEM);
      assert(err == 1);
      break;
    case KeyType::ECDSAP256:
      err = SSL_CTX_use_certificate_chain_file(
          m_ctx, "../rustls/test-ca/ecdsa-p256/end.fullchain");
      assert(err == 1);
      err = SSL_CTX_use_PrivateKey_file(
          m_ctx, "../rustls/test-ca/ecdsa-p256/end.key", SSL_FILETYPE_PEM);
      assert(err == 1);
      break;
    }
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x1, %esi
je 0x50cd
testl %esi, %esi
jne 0x50f8
movq (%rbx), %rdi
leaq 0x2176(%rip), %rsi      # 0x7209
callq 0x3220
cmpl $0x1, %eax
jne 0x50fa
movq (%rbx), %rdi
leaq 0x21ba(%rip), %rsi      # 0x7261
pushq $0x1
popq %rdx
callq 0x3030
cmpl $0x1, %eax
je 0x50f8
leaq 0x2114(%rip), %rdi      # 0x71cf
leaq 0x2116(%rip), %rsi      # 0x71d8
leaq 0x2169(%rip), %rcx      # 0x7232
pushq $0x38
jmp 0x5143
movq (%rbx), %rdi
leaq 0x21ad(%rip), %rsi      # 0x7284
callq 0x3220
cmpl $0x1, %eax
jne 0x5113
movq (%rbx), %rdi
leaq 0x21c4(%rip), %rsi      # 0x72af
pushq $0x1
popq %rdx
callq 0x3030
cmpl $0x1, %eax
jne 0x512c
popq %rbx
retq
leaq 0x20ce(%rip), %rdi      # 0x71cf
leaq 0x20d0(%rip), %rsi      # 0x71d8
leaq 0x2123(%rip), %rcx      # 0x7232
pushq $0x35
jmp 0x5143
leaq 0x20b5(%rip), %rdi      # 0x71cf
leaq 0x20b7(%rip), %rsi      # 0x71d8
leaq 0x210a(%rip), %rcx      # 0x7232
pushq $0x3d
jmp 0x5143
leaq 0x209c(%rip), %rdi      # 0x71cf
leaq 0x209e(%rip), %rsi      # 0x71d8
leaq 0x20f1(%rip), %rcx      # 0x7232
pushq $0x40
popq %rdx
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Context::load_client_creds(KeyType)
void load_client_creds(const KeyType which) {
    int err;
    switch (which) {
    case KeyType::RSA2048:
      err = SSL_CTX_load_verify_locations(
          m_ctx, "../rustls/test-ca/rsa-2048/ca.cert", NULL);
      break;
    case KeyType::ECDSAP256:
      err = SSL_CTX_load_verify_locations(
          m_ctx, "../rustls/test-ca/ecdsa-p256/ca.cert", NULL);
      break;
    }
    assert(err == 1);
  }

// Assembly:
pushq %rax
testl %esi, %esi
je 0x515d
cmpl $0x1, %esi
jne 0x5173
leaq 0x219c(%rip), %rsi      # 0x72f7
jmp 0x5164
leaq 0x2170(%rip), %rsi      # 0x72d4
movq (%rdi), %rdi
xorl %edx, %edx
callq 0x3380
cmpl $0x1, %eax
jne 0x5175
popq %rax
retq
leaq 0x2053(%rip), %rdi      # 0x71cf
leaq 0x2055(%rip), %rsi      # 0x71d8
leaq 0x2192(%rip), %rcx      # 0x731c
pushq $0x51
popq %rdx
callq 0x31d0
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::get_cipher_string[abi:cxx11]()
std::string get_cipher_string() {
    std::string r;
    r += SSL_get_cipher_version(m_ssl);
    r += '\t';
    r += SSL_get_cipher(m_ssl);
    return r;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
movq (%rsi), %rdi
callq 0x3180
movq %rax, %rdi
callq 0x3210
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3540
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x3250
movq (%r14), %rdi
callq 0x3180
movq %rax, %rdi
callq 0x3310
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3540
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3150
movq %r14, %rdi
callq 0x34d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::transfer_to(Conn&)
void transfer_to(Conn &other) {
    uint8_t buf[262144] = {0};

    bool new_bytes = false;

    while (true) {
      int err = BIO_read(m_writes_to, buf, sizeof(buf));

      if (err == 0 || err == -1) {
        break;
      } else if (err > 0) {
        if (!new_bytes) {
          other.drop_read_bytes();
          new_bytes = true;
        }

        other.m_read_buffer.insert(other.m_read_buffer.end(), buf, buf + err);
      }
    }

    if (new_bytes) {
      other.install_read_bio();
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40008, %rsp          # imm = 0x40008
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
xorl %ebp, %ebp
movl $0x40000, %edx          # imm = 0x40000
movq %r15, %rdi
xorl %esi, %esi
callq 0x31b0
leaq 0x8(%rbx), %r12
movq 0x28(%r14), %rdi
movq %r15, %rsi
movl $0x40000, %edx          # imm = 0x40000
callq 0x3320
movl %eax, %r13d
leal 0x1(%r13), %eax
cmpl $0x2, %eax
jb 0x5836
testl %r13d, %r13d
jle 0x57eb
testb $0x1, %bpl
jne 0x581e
movq %rbx, %rdi
callq 0x593a
movb $0x1, %bpl
movq 0x10(%rbx), %rsi
movl %r13d, %eax
leaq (%rsp,%rax), %rcx
movq %r12, %rdi
movq %r15, %rdx
callq 0x5974
jmp 0x57eb
testb $0x1, %bpl
je 0x5844
movq %rbx, %rdi
callq 0x5994
addq $0x40008, %rsp          # imm = 0x40008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::read(unsigned char*, unsigned long)
void read(uint8_t *buf, size_t n) {
    while (n) {
      int rd = SSL_read(m_ssl, buf, n);

      assert(rd >= 0);
      buf += rd;
      n -= rd;
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rbx, %rbx
je 0x5884
movq (%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x3060
testl %eax, %eax
js 0x588a
movl %eax, %eax
addq %rax, %r14
subq %rax, %rbx
jmp 0x5864
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1b85(%rip), %rdi      # 0x7416
leaq 0x1940(%rip), %rsi      # 0x71d8
leaq 0x1b7f(%rip), %rcx      # 0x741e
movl $0x139, %edx            # imm = 0x139
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::drop_read_bytes()
void drop_read_bytes() {
    // eliminate processed bytes from read buffer
    char *old_buf = nullptr;
    long old_len = BIO_get_mem_data(m_reads_from, &old_buf);
    long consumed = m_read_buffer.size() - old_len;
    m_read_buffer.erase(m_read_buffer.begin(),
                        m_read_buffer.begin() + consumed);
    // caller _MUST_ now call install_read_bio() prior to touching
    // m_ssl
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
movq 0x20(%rdi), %rdi
pushq $0x3
popq %rsi
xorl %edx, %edx
callq 0x30e0
leaq 0x8(%rbx), %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
subq %rax, %rdx
callq 0x59fc
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::install_read_bio()
void install_read_bio() {
    static uint8_t empty_buf[0] = {};
    m_reads_from =
        BIO_new_mem_buf(m_read_buffer.data() ? m_read_buffer.data() : empty_buf,
                        m_read_buffer.size());
    assert(m_reads_from != nullptr);
    BIO_set_mem_eof_return(m_reads_from, -1);
    SSL_set0_rbio(m_ssl, m_reads_from); // frees previous m_reads_from
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
leaq 0x593b(%rip), %rdi      # 0xb2e1
cmovneq %rax, %rdi
movl 0x10(%rbx), %esi
subl %eax, %esi
callq 0x30a0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x59dc
pushq $-0x1
popq %rdx
movq %rax, %rdi
movl $0x82, %esi
xorl %ecx, %ecx
callq 0x30e0
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
popq %rbx
jmp 0x3500
leaq 0x19fd(%rip), %rdi      # 0x73e0
leaq 0x17ee(%rip), %rsi      # 0x71d8
leaq 0x1a07(%rip), %rcx      # 0x73f8
movl $0xcd, %edx
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: LatencyOutput::LatencyOutput(char const*)
LatencyOutput(const char *which) : m_output(nullptr) {
    const char *file_prefix = getenv("BENCH_LATENCY");
    if (file_prefix) {
      std::ostringstream thread_id;
      thread_id << std::this_thread::get_id();
      char filename[128] = {0};
      snprintf(filename, sizeof(filename), "%s-%s-%s-latency.tsv", file_prefix,
               which, thread_id.str().c_str());
      m_output = fopen(filename, "w+");
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, (%rdi)
leaq 0x173d(%rip), %rdi      # 0x75aa
callq 0x3360
testq %rax, %rax
je 0x5f2f
movq %rax, %r15
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
callq 0x33a0
callq 0x3270
movq %r12, %rdi
movq %rax, %rsi
callq 0x5fc5
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0xb0(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x3450
leaq 0x88(%rsp), %r12
movq (%r12), %r9
leaq 0x16c8(%rip), %rdx      # 0x75b8
movq %rsp, %r13
movl $0x80, %esi
movq %r13, %rdi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x3460
movq %r12, %rdi
callq 0x3150
leaq 0x16b6(%rip), %rsi      # 0x75cd
movq %r13, %rdi
callq 0x3330
movq %rax, (%rbx)
leaq 0xa8(%rsp), %rdi
callq 0x30b0
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x5f42
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Context::enable_resume()
void enable_resume() {
    SSL_CTX_sess_set_new_cb(m_ctx, new_session_cb);
    SSL_CTX_set_session_cache_mode(m_ctx, SSL_SESS_CACHE_BOTH);
    SSL_CTX_set_session_id_context(m_ctx, (const uint8_t *)"localhost",
                                   strlen("localhost"));
    SSL_CTX_sess_set_cache_size(m_ctx, 1024 * 1024);
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
leaq -0x10d8(%rip), %rsi     # 0x4f48
callq 0x32b0
movq (%rbx), %rdi
pushq $0x2c
popq %rsi
pushq $0x3
popq %rdx
xorl %ecx, %ecx
callq 0x3280
movq (%rbx), %rdi
leaq 0x1402(%rip), %rsi      # 0x7441
pushq $0x9
popq %rdx
callq 0x3470
movq (%rbx), %rdi
pushq $0x2a
popq %rsi
movl $0x100000, %edx         # imm = 0x100000
xorl %ecx, %ecx
popq %rbx
jmp 0x3280
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::show_kx()
void show_kx() {
    printf("negotiated v=%s cs=%s kx=%s\n", SSL_get_cipher_version(m_ssl),
           SSL_get_cipher(m_ssl),
#ifdef BORINGSSL
           OBJ_nid2ln(SSL_get_negotiated_group(m_ssl))
#else
           // OpenSSL 3.5.0 broke the working of OBJ_nid2ln by not registering
           // NIDs for built-in groups.
           SSL_group_to_name(m_ssl, SSL_get_negotiated_group(m_ssl))
#endif
    );
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x3180
movq %rax, %rdi
callq 0x3210
movq %rax, %rbx
movq (%r14), %rdi
callq 0x3180
movq %rax, %rdi
callq 0x3310
movq %rax, %r15
movq (%r14), %r14
movq %r14, %rdi
movl $0x86, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3120
movq %r14, %rdi
movl %eax, %esi
callq 0x3390
leaq 0x1619(%rip), %rdi      # 0x76e4
movq %rbx, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x3050
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::get_session()
SSL_SESSION *get_session() {
    ragged_close();
    if (m_one_session) {
      SSL_SESSION_up_ref(m_one_session);
      return m_one_session;
    }
    return SSL_get1_session(m_ssl);
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x6106
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x60fd
callq 0x3090
movq 0x30(%rbx), %rax
popq %rbx
retq
movq (%rbx), %rdi
popq %rbx
jmp 0x3520
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Context::dump_sess_stats()
void dump_sess_stats() {
    printf(
        "connects: %ld, connects-good: %ld, accepts: %ld, accepts-good: %ld\n",
        long(SSL_CTX_sess_connect(m_ctx)),
        long(SSL_CTX_sess_connect_good(m_ctx)),
        long(SSL_CTX_sess_accept(m_ctx)),
        long(SSL_CTX_sess_accept_good(m_ctx)));
    printf("sessions: %ld, hits: %ld, misses: %ld\n",
           long(SSL_CTX_sess_number(m_ctx)), long(SSL_CTX_sess_hits(m_ctx)),
           long(SSL_CTX_sess_misses(m_ctx)));
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
pushq $0x15
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
movq %rax, %r14
movq (%rbx), %rdi
pushq $0x16
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
movq %rax, %r15
movq (%rbx), %rdi
pushq $0x18
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
movq %rax, %r12
movq (%rbx), %rdi
pushq $0x19
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
leaq 0x155f(%rip), %rdi      # 0x7784
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x3050
movq (%rbx), %rdi
pushq $0x14
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
movq %rax, %r14
movq (%rbx), %rdi
pushq $0x1b
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
movq %rax, %r15
movq (%rbx), %rdi
pushq $0x1d
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3280
leaq 0x1556(%rip), %rdi      # 0x77c8
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3050
nop
// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: Conn::Conn(Conn&&)
Conn(Conn &&other)
      : m_ssl(other.m_ssl), m_reads_from(nullptr),
        m_writes_to(other.m_writes_to), m_one_session(other.m_one_session) {
    SSL_set_app_data(m_ssl, this);
    other.m_ssl = nullptr;
    m_read_buffer.swap(other.m_read_buffer);
    install_read_bio();
    other.m_writes_to = nullptr;
    other.m_one_session = nullptr;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rdi
movq %rdi, (%r15)
leaq 0x8(%r15), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movups %xmm0, 0x18(%r15)
movups 0x28(%rsi), %xmm0
movups %xmm0, 0x28(%r15)
xorl %esi, %esi
movq %r15, %rdx
callq 0x30c0
andq $0x0, (%rbx)
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x6568
movq %r15, %rdi
callq 0x5994
addq $0x28, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x58c0
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O2/kodejuice[P]chip8-emulator/./chip8.cc
// Function: Chip8::load_program(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Chip8::load_program(string file) {
	FILE *f = fopen(file.c_str(), "rb");

	if (f == NULL) 
		return printf("Error: Couldn't open '%s'\n", file.c_str()), false;

	// get file size
	fseek(f, 0L, SEEK_END);
	program_size = ftell(f);
	fseek(f, 0L, SEEK_SET);

	// allocate memory for ROM (buffer)
	byte* rom = (byte*) malloc(sizeof(byte) * program_size);

	// read program into buffer
	fread(rom, sizeof(byte), program_size, f);

	// load program from buffer into memory
	for (int i=PC, j=0; i < int(PC + program_size); ++i, ++j) {
		memory[i] = rom[j];
	}

	free(rom);
	fclose(f);

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rdi
leaq 0x2c0f(%rip), %rsi      # 0x51d0
callq 0x22b0
movq %rax, %rbx
testq %rax, %rax
je 0x266c
xorl %r13d, %r13d
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2290
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x1028(%r14)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2290
movq 0x1028(%r14), %r12
movq %r12, %rdi
callq 0x2300
movq %rax, %r15
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x2330
movzwl 0x1002(%r14), %edx
movzwl %dx, %eax
leaq (%r14,%rax), %rcx
leaq (%rax,%r13), %rsi
movzwl %dx, %edx
addl 0x1028(%r14), %edx
movslq %edx, %rdx
cmpq %rdx, %rsi
jge 0x265a
movb (%r15,%r13), %dl
movb %dl, (%rcx,%r13)
incq %r13
movzwl 0x1002(%r14), %edx
jmp 0x262f
movq %r15, %rdi
callq 0x22c0
movq %rbx, %rdi
callq 0x2260
jmp 0x267d
movq (%r15), %rsi
leaq 0x2b5d(%rip), %rdi      # 0x51d3
xorl %eax, %eax
callq 0x2060
testq %rbx, %rbx
setne %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kodejuice[P]chip8-emulator/./debug/disassembler.cc
// Function: Chip8::disassemble[abi:cxx11]()
string Chip8::disassemble() {

	byte lsb, msb;
	string str = "";

	for (int i=PC; i < (PC + program_size); i+=2) {
		msb = memory[i], lsb = memory[i+1];

		str += decode(i, msb, lsb) + "\n";
	}

	return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2644(%rip), %rsi      # 0x51ed
leaq 0x28(%rsp), %r15
movq %r15, %rdx
callq 0x2140
movzwl 0x1002(%r14), %eax
movzwl %ax, %r12d
leaq 0x8(%rsp), %r13
leaq 0x261e(%rip), %rbp      # 0x51ec
movzwl %ax, %eax
addq 0x1028(%r14), %rax
cmpq %r12, %rax
jbe 0x2c2a
movzbl (%r14,%r12), %edx
movzbl 0x1(%r14,%r12), %ecx
movq %r13, %rdi
movl %r12d, %esi
callq 0x2c6d
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x38b6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23d0
movq %r15, %rdi
callq 0x2170
movq %r13, %rdi
callq 0x2170
addq $0x2, %r12
movzwl 0x1002(%r14), %eax
jmp 0x2bce
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2170
jmp 0x2c4e
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2170
jmp 0x2c5d
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/kodejuice[P]chip8-emulator/main.cc
// Function: getfilename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string getfilename(const string filepath) {
	string filename = filepath;

	// Remove directory if present.
	// Do this before extension removal incase directory has a period character.
	const size_t last_slash_idx = filename.find_last_of("\\/");
	if (std::string::npos != last_slash_idx)
		filename.erase(0, last_slash_idx + 1);

	// Remove extension if present.
	const size_t period_idx = filename.rfind('.');
	if (std::string::npos != period_idx)
	    filename.erase(period_idx);

	return filename;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2310
leaq 0x1c04(%rip), %rsi      # 0x53ce
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2240
cmpq $-0x1, %rax
je 0x37eb
incq %rax
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x20d0
pushq $0x2e
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x23e0
cmpq $-0x1, %rax
je 0x380d
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20d0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x381a
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x23a0
nop