LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::film_effect_filter(Image&, Image&)
void ImageProc::film_effect_filter(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++)
			{
				img_modified.setvalue(i,j,k,(255-img_orig.getvalue(i,(img_orig.cols-j),k)));
			}

	int gmax[3] = {255,205,180};
	int gmin[3] = { 80, 30, 20};
	float scaling_factor[3];
	for(int i = 0; i < 3; i++)
		scaling_factor[i] = (gmax[i]-gmin[i]) / 255.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++)
			{
				img_modified.setvalue(i,j,k,((img_modified.getvalue(i,j,k)
											  * scaling_factor[k])
											  + gmin[k]));
			}
}

// Assembly:
pushq %rbx
cmpl $0x0, 0xc(%rsi)
jle 0x8043
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, 0x8(%rsi)
jle 0x803a
xorl %edx, %edx
xorl %r8d, %r8d
movl 0x10(%rsi), %r9d
testl %r9d, %r9d
jle 0x802f
xorl %r10d, %r10d
movl 0x8(%rdi), %r11d
imull %ecx, %r11d
addl %edx, %r11d
imull 0x10(%rdi), %r11d
movslq %r11d, %r11
addq 0x18(%rdi), %r11
movb (%r10,%r11), %r11b
notb %r11b
movl 0x8(%rsi), %ebx
imull %eax, %ebx
addl %r8d, %ebx
imull %r9d, %ebx
movslq %ebx, %r9
addq 0x18(%rsi), %r9
movb %r11b, (%r10,%r9)
movl 0x10(%rsi), %r9d
incq %r10
cmpl %r9d, %r10d
jl 0x7fed
incl %r8d
decl %edx
cmpl 0x8(%rsi), %r8d
jl 0x7fe1
incl %eax
incl %ecx
cmpl 0xc(%rsi), %eax
jl 0x7fd6
xorl %ecx, %ecx
leaq 0x95cc(%rip), %rdx      # 0x11618
leaq 0x95d1(%rip), %rax      # 0x11624
movsd 0x94b5(%rip), %xmm0     # 0x11510
movl (%rcx,%rdx), %edi
subl (%rcx,%rax), %edi
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
divsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, -0xc(%rsp,%rcx)
addq $0x4, %rcx
cmpq $0xc, %rcx
jne 0x805b
cmpl $0x0, 0xc(%rsi)
jle 0x80fb
xorl %ecx, %ecx
cmpl $0x0, 0x8(%rsi)
jle 0x80f4
xorl %edx, %edx
movl 0x10(%rsi), %r9d
testl %r9d, %r9d
jle 0x80ed
movq %rax, %rdi
xorl %r8d, %r8d
movl 0x8(%rsi), %r10d
imull %ecx, %r10d
addl %edx, %r10d
imull %r9d, %r10d
movslq %r10d, %r9
addq 0x18(%rsi), %r9
movzbl (%r8,%r9), %r10d
xorps %xmm0, %xmm0
cvtsi2ss %r10d, %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl (%rdi), %xmm1
mulss -0xc(%rsp,%r8,4), %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %r10d
movb %r10b, (%r8,%r9)
incq %r8
movslq 0x10(%rsi), %r9
addq $0x4, %rdi
cmpq %r9, %r8
jl 0x809f
incl %edx
cmpl 0x8(%rsi), %edx
jl 0x8090
incl %ecx
cmpl 0xc(%rsi), %ecx
jl 0x8088
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::mergesort(int*, int, int)
void ImageProc::mergesort(int *a, int low, int high)
{
	int mid;
	if (low < high)
	{
		mid = (low + high) / 2;
		mergesort(a, low, mid);
		mergesort(a, mid + 1, high);
		merge(a, low, high, mid);
	}
	return;
}

// Assembly:
cmpl %edx, %esi
jge 0x987f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leal (%rbx,%r14), %eax
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movl %r12d, %edx
callq 0x9828
leal 0x1(%r12), %esi
movq %r15, %rdi
movl %ebx, %edx
callq 0x9828
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r12d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x99c4
retq
// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::get_median(int*, int)
int ImageProc::get_median(int *sorted_array, int size)
{
	// Middle or average of middle values in the sorted array.
	int median = 0.0;
	if ((size % 2) == 0) {
		median = (int)((sorted_array[size / 2] + sorted_array[(size / 2) - 1]) / 2.0);
	}
	else {
		median = sorted_array[size / 2];
	}

	return median;
}

// Assembly:
testb $0x1, %sil
jne 0x98a3
sarl %esi
movslq %esi, %rax
movl -0x4(%rdi,%rax,4), %ecx
addl (%rdi,%rax,4), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x788a(%rip), %xmm0     # 0x11128
cvttsd2si %xmm0, %eax
retq
movl %esi, %eax
shrl $0x1f, %eax
addl %esi, %eax
sarl %eax
cltq
movl (%rdi,%rax,4), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::get_MSE(Image&, Image&)
float ImageProc::get_MSE(Image &img_orig, Image &img_modified)
{
	float sum = 0.0, MSE;
	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			sum += pow((img_modified.getvalue(i,j,0) - img_orig.getvalue(i,j,0)),2);

	MSE = sum / (img_modified.rows * img_modified.cols);
	std::cout << MSE << std::endl;
	return MSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq 0xc(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
movq %rsi, 0x10(%rsp)
jle 0x9951
movl 0x8(%rdi), %ecx
movl 0x10(%rdi), %edx
movq 0x18(%rsi), %r8
movl 0x10(%rsi), %r9d
movq 0x18(%rdi), %rdi
movl 0x8(%rsi), %r10d
imull %r9d, %r10d
movl %ecx, %r11d
imull %edx, %r11d
xorps %xmm1, %xmm1
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %rcx, %r15
movl %ebx, %r12d
movl %ebp, %r13d
testl %ecx, %ecx
jle 0x993f
movslq %r13d, %r13
movzbl (%r8,%r13), %eax
movslq %r12d, %r12
movzbl (%rdi,%r12), %esi
subl %esi, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
addsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
addl %r9d, %r13d
addl %edx, %r12d
decq %r15
jne 0x990b
incq %r14
addl %r10d, %ebp
addl %r11d, %ebx
cmpq 0x8(%rsp), %r14
jne 0x98fe
jmp 0x9954
xorps %xmm1, %xmm1
movq 0x10(%rsp), %rcx
movl 0x8(%rcx), %eax
imull 0xc(%rcx), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movq 0xc651(%rip), %rdi      # 0x15fd0
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movss 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::merge(int*, int, int, int)
void ImageProc::merge(int *a, int low, int high, int mid)
{
	int i, j, k, c[50];
	i = low;
	k = low;
	j = mid + 1;
	while (i <= mid && j <= high)
	{
		if (a[i] < a[j])
		{
			c[k] = a[i];
			k++;	i++;
		}
		else
		{
			c[k] = a[j];
			k++;	j++;
		}
	}
	while (i <= mid)
	{
		c[k] = a[i];
		k++;	i++;
	}
	while (j <= high)
	{
		c[k] = a[j];
		k++;	j++;
	}
	for (i = low; i < k; i++)
	{
		a[i] = c[i];
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %ebx
movq %rdi, %r14
leal 0x1(%r12), %ebp
cmpl %ecx, %esi
setg %al
cmpl %edx, %ecx
setge %cl
orb %al, %cl
movslq %esi, %r13
jne 0x9a30
leaq (%rsp,%r13,4), %rdx
addq $0x10, %rdx
movl %ebx, %eax
movl %ebx, %ecx
movslq %ecx, %rsi
movl (%r14,%rsi,4), %esi
movslq %ebp, %rdi
movl (%r14,%rdi,4), %edi
cmpl %edi, %esi
jge 0x9a1a
movl %esi, (%rdx)
incl %ecx
jmp 0x9a1e
movl %edi, (%rdx)
incl %ebp
incl %eax
cmpl %r12d, %ecx
jg 0x9a34
addq $0x4, %rdx
cmpl %r15d, %ebp
jle 0x9a02
jmp 0x9a34
movl %ebx, %ecx
movl %ebx, %eax
subl %ecx, %r12d
jl 0x9a68
movq %r13, 0x8(%rsp)
movslq %eax, %r13
leaq (%rsp,%r13,4), %rdi
addq $0x10, %rdi
movslq %ecx, %rax
leaq (%r14,%rax,4), %rsi
leaq 0x4(,%r12,4), %rdx
callq 0x2100
leal (%r12,%r13), %eax
incl %eax
movq 0x8(%rsp), %r13
subl %ebp, %r15d
jl 0x9a92
movslq %eax, %r12
leaq (%rsp,%r12,4), %rdi
addq $0x10, %rdi
movslq %ebp, %rax
leaq (%r14,%rax,4), %rsi
leaq 0x4(,%r15,4), %rdx
callq 0x2100
leal (%r12,%r15), %eax
incl %eax
cmpl %ebx, %eax
jle 0x9ab3
leaq (%r14,%r13,4), %rdi
leaq (%rsp,%r13,4), %rsi
addq $0x10, %rsi
notl %ebx
addl %ebx, %eax
leaq 0x4(,%rax,4), %rdx
callq 0x2100
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::apply_non_local_mean(char const*, char const*, int, int, int, int, int, int)
void ImageProc::apply_non_local_mean(const char *infile, const char *outfile, int width, int height, int window_size, int region_size, int sigma, int h)
{
	Image img_orig("color", width, height);
	Image img_modified("color", width, height);
	img_orig.read_image(infile, img_orig.cols, img_orig.rows);

	non_local_mean(img_orig, img_modified, window_size, region_size, sigma, h);

	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 $0x58, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, 0x8(%rsp)
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
leaq 0x738d(%rip), %rbx      # 0x1165c
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4c6e
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c6e
movq %rbp, %rdi
movq %r13, %rsi
callq 0x4cde
movq %rbp, %rdi
movq %r14, %rsi
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x90(%rsp), %r8d
movl 0x98(%rsp), %r9d
callq 0xa340
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x4e1a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x400(%rsp), %rdi
xorl %r15d, %r15d
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x20c0
movslq 0xc(%r14), %rax
testq %rax, %rax
jle 0xaaf9
movl 0x8(%r14), %ecx
movl 0x10(%r14), %edx
movq 0x18(%r14), %rsi
movl %ecx, %edi
imull %edx, %edi
xorl %r8d, %r8d
movq %rcx, %r9
movl %r15d, %r10d
testl %ecx, %ecx
jle 0xaaee
movslq %r10d, %r10
movzbl (%rsi,%r10), %r11d
incl 0x400(%rsp,%r11,4)
addl %edx, %r10d
decq %r9
jne 0xaad6
incq %r8
addl %edi, %r15d
cmpq %rax, %r8
jne 0xaacc
movq %rsp, %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x20c0
movl 0x400(%rsp), %eax
movl %eax, (%r15)
movl $0x1, %ecx
addl 0x400(%rsp,%rcx,4), %eax
movl %eax, (%rsp,%rcx,4)
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0xab1a
cmpl $0x0, 0xc(%rbx)
jle 0xab96
xorl %ecx, %ecx
movl 0x3fc(%rsp), %esi
movl 0x8(%rbx), %edi
testl %edi, %edi
jle 0xab8f
xorl %r8d, %r8d
movq 0x18(%r14), %rax
movl 0x8(%r14), %edx
imull %ecx, %edx
addl %r8d, %edx
imull 0x10(%r14), %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
movl (%rsp,%rax,4), %edx
movl %edx, %eax
shll $0x8, %eax
subl %edx, %eax
cltd
idivl %esi
movq 0x18(%rbx), %rdx
imull %ecx, %edi
addl %r8d, %edi
imull 0x10(%rbx), %edi
movslq %edi, %rdi
movb %al, (%rdx,%rdi)
incl %r8d
movl 0x8(%rbx), %edi
cmpl %edi, %r8d
jl 0xab49
incl %ecx
cmpl 0xc(%rbx), %ecx
jl 0xab3f
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x761b(%rip), %r13      # 0x121e7
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4c6e
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4cde
movq %rbx, %rdi
movq %rbp, %rsi
movl 0xc(%rsp), %edx
callq 0xac28
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x4e1a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
movl %r9d, %r10d
shrl $0x1f, %r10d
addl %r9d, %r10d
sarl %r10d
movl %r10d, %ebx
negl %ebx
xorl %eax, %eax
cmpl %r10d, %ebx
jg 0xb5a8
movq 0x18(%rsi), %r9
movl 0x8(%rsi), %r11d
movl 0x10(%rsi), %esi
subl %ebx, %r10d
incl %r10d
addl %ebx, %ecx
addl %ebx, %edx
imull %r11d, %edx
addl %ecx, %edx
imull %esi, %edx
addl %edx, %r8d
imull %esi, %r11d
xorl %ecx, %ecx
xorl %eax, %eax
movq (%rdi,%rcx,8), %rdx
movl %r8d, %ebx
xorl %r14d, %r14d
movslq %ebx, %rbx
movzbl (%r9,%rbx), %ebp
imull (%rdx,%r14,4), %ebp
addl %ebp, %eax
incq %r14
addl %esi, %ebx
cmpq %r14, %r10
jne 0xb584
incq %rcx
addl %r11d, %r8d
cmpq %r10, %rcx
jne 0xb57a
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x400, %edx            # imm = 0x400
movq %rsi, %rdi
xorl %esi, %esi
callq 0x20c0
cmpl $0x0, 0xc(%r14)
jle 0xb604
movq 0x18(%r14), %rax
movl 0x8(%r14), %edx
testl %edx, %edx
jle 0xb5fc
xorl %ecx, %ecx
imull %ebp, %edx
addl %ecx, %edx
imull 0x10(%r14), %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %edx
incl (%rbx,%rdx,4)
incl %ecx
movl 0x8(%r14), %edx
cmpl %edx, %ecx
jl 0xb5de
incl %ebp
cmpl 0xc(%r14), %ebp
jl 0xb5d4
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6ba0(%rip), %r12      # 0x121e7
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4c6e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x4c6e
movq %r13, %rdi
movq %r15, %rsi
callq 0x4cde
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb69e
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x4e1a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl %r9d, %eax
shrl $0x1f, %eax
addl %r9d, %eax
sarl %eax
movl %eax, %r11d
negl %r11d
xorps %xmm0, %xmm0
cmpl %eax, %r11d
jg 0xbdea
pushq %rbp
pushq %rbx
movq 0x18(%rsi), %r9
movl 0x8(%rsi), %r10d
movl 0x10(%rsi), %esi
subl %r11d, %eax
incl %eax
addl %r11d, %ecx
addl %r11d, %edx
imull %r10d, %edx
addl %ecx, %edx
imull %esi, %edx
addl %edx, %r8d
imull %esi, %r10d
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movq (%rdi,%rcx,8), %rdx
movl %r8d, %r11d
xorl %ebx, %ebx
movslq %r11d, %r11
movzbl (%r9,%r11), %ebp
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
xorps %xmm2, %xmm2
cvtss2sd (%rdx,%rbx,4), %xmm2
mulsd %xmm1, %xmm2
cvtss2sd %xmm0, %xmm0
addsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
incq %rbx
addl %esi, %r11d
cmpq %rbx, %rax
jne 0xbdab
incq %rcx
addl %r10d, %r8d
cmpq %rax, %rcx
jne 0xbda2
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0xc(%rsi)
jle 0xc166
xorl %eax, %eax
cmpl $0x0, 0x8(%rsi)
jle 0xc15f
xorl %ecx, %ecx
movl 0x10(%rsi), %edx
testl %edx, %edx
jle 0xc158
xorl %r8d, %r8d
movl 0x8(%rdi), %r9d
imull %eax, %r9d
addl %ecx, %r9d
imull 0x10(%rdi), %r9d
movslq %r9d, %r9
addq 0x18(%rdi), %r9
movb (%r8,%r9), %r9b
sarb $0x7, %r9b
movl 0x8(%rsi), %r10d
imull %eax, %r10d
addl %ecx, %r10d
imull %edx, %r10d
movslq %r10d, %rdx
addq 0x18(%rsi), %rdx
movb %r9b, (%r8,%rdx)
movl 0x10(%rsi), %edx
incq %r8
cmpl %edx, %r8d
jl 0xc114
incl %ecx
cmpl 0x8(%rsi), %ecx
jl 0xc10a
incl %eax
cmpl 0xc(%rsi), %eax
jl 0xc102
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2130
movl %eax, %edi
callq 0x2150
cmpl $0x0, 0xc(%rbx)
jle 0xc223
cmpl $0x0, 0x8(%rbx)
jle 0xc216
xorl %ebp, %ebp
cmpl $0x0, 0x10(%rbx)
jle 0xc20f
xorl %r12d, %r12d
movl 0x8(%r14), %eax
imull %r15d, %eax
addl %ebp, %eax
imull 0x10(%r14), %eax
cltq
addq 0x18(%r14), %rax
movzbl (%r12,%rax), %r13d
callq 0x2080
cltq
imulq $-0x7f7f7f7f, %rax, %rcx # imm = 0x80808081
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x7, %ecx
addl %edx, %ecx
movl %ecx, %edx
shll $0x8, %edx
subl %edx, %ecx
addl %eax, %ecx
cmpl %r13d, %ecx
setl %al
movl 0x8(%rbx), %ecx
imull %r15d, %ecx
addl %ebp, %ecx
imull 0x10(%rbx), %ecx
negb %al
movslq %ecx, %rcx
addq 0x18(%rbx), %rcx
movb %al, (%r12,%rcx)
incq %r12
cmpl 0x10(%rbx), %r12d
jl 0xc1a5
incl %ebp
cmpl 0x8(%rbx), %ebp
jl 0xc19c
incl %r15d
cmpl 0xc(%rbx), %r15d
jl 0xc194
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4de7(%rip), %r12      # 0x1165c
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4c6e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x4c6e
movq %r13, %rdi
movq %r15, %rsi
callq 0x4cde
movq %r13, %rdi
movq %rbx, %rsi
callq 0xc3ea
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x4e1a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %rsi
jbe 0xd2f2
movss (%rdi,%rsi,4), %xmm2
ucomiss %xmm0, %xmm2
jbe 0xd2f2
movslq %r8d, %r9
movss (%rdi,%r9,4), %xmm2
ucomiss %xmm0, %xmm2
ja 0xd32d
ucomiss %xmm1, %xmm0
jbe 0xd310
movss (%rdi,%rsi,4), %xmm2
ucomiss %xmm0, %xmm2
jbe 0xd310
movslq %r8d, %rax
movss (%rdi,%rax,4), %xmm2
ucomiss %xmm0, %xmm2
movl %edx, %eax
ja 0xd32d
ucomiss %xmm0, %xmm1
jbe 0xd32a
ucomiss (%rdi,%rsi,4), %xmm0
jbe 0xd32a
movslq %r8d, %rax
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
movl %ecx, %eax
ja 0xd32d
movl %r8d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0xc(%rdi)
jle 0xde66
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
xorl %ebp, %ebp
movsd 0x37a7(%rip), %xmm3     # 0x11510
leaq 0x20(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %r14
movq %rdi, 0x8(%rsp)
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0xde4d
xorl %r15d, %r15d
movq 0x18(%rdi), %rcx
imull %ebp, %eax
addl %r15d, %eax
imull 0x10(%rdi), %eax
cltq
movzbl (%rcx,%rax), %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
divsd %xmm3, %xmm0
movzbl 0x1(%rcx,%rax), %esi
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
divsd %xmm3, %xmm1
movzbl 0x2(%rcx,%rax), %eax
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
divsd %xmm3, %xmm2
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x68a0
movq 0x8(%rsp), %rdi
movsd 0x372b(%rip), %xmm3     # 0x11510
cvttsd2si 0x20(%rsp), %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %esi
imull %ebp, %esi
addl %r15d, %esi
imull 0x10(%rbx), %esi
movslq %esi, %rsi
movb %al, (%rcx,%rsi)
cvttsd2si 0x18(%rsp), %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %esi
imull %ebp, %esi
addl %r15d, %esi
imull 0x10(%rbx), %esi
movslq %esi, %rsi
movb %al, 0x1(%rcx,%rsi)
cvttsd2si 0x10(%rsp), %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %esi
imull %ebp, %esi
addl %r15d, %esi
imull 0x10(%rbx), %esi
movslq %esi, %rsi
movb %al, 0x2(%rcx,%rsi)
incl %r15d
movl 0x8(%rdi), %eax
cmpl %eax, %r15d
jl 0xdd8b
incl %ebp
cmpl 0xc(%rdi), %ebp
jl 0xdd7d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x40fc(%rip), %r12      # 0x121e7
leaq 0xe8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4c6e
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
leaq 0xa8(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
leaq 0x34d9(%rip), %rsi      # 0x1165c
leaq 0x68(%rsp), %rdi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x4c6e
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4cde
movq %r13, %rdi
movq %rbx, %rsi
callq 0xe228
leaq 0x377e(%rip), %rsi      # 0x1192e
movq %rbx, %rdi
callq 0x4e1a
movq %rbx, %rdi
leaq 0x48(%rsp), %r14
movq %r14, %rsi
callq 0xe40c
movq %rbx, %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0xecb4
movq %rbx, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0xf450
leaq 0x376d(%rip), %rsi      # 0x1195c
movq %r14, %rdi
callq 0x4e1a
leaq 0x378b(%rip), %rsi      # 0x11989
movq %r15, %rdi
callq 0x4e1a
leaq 0x37a8(%rip), %rsi      # 0x119b5
movq %rbx, %rdi
callq 0x4e1a
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_O1/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 0x25da(%rip), %r12      # 0x121e7
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4c6e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x4c6e
movq %r13, %rdi
movq %r15, %rsi
callq 0x4cde
movq %r13, %rdi
movq %rbx, %rsi
callq 0xe228
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x4e1a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x30dc(%rip), %rdi      # 0x70ac
callq 0x3400
leaq 0x3131(%rip), %rdi      # 0x710d
callq 0x3400
leaq 0x315e(%rip), %rdi      # 0x7146
popq %rax
jmp 0x3400
// File: /workspace/github_cpp_makefile_star2_O1/ctz[P]openssl-bench/bench.cc
// Function: test_memory(Context&, Context&, unsigned long)
static void test_memory(Context &server_ctx, Context &client_ctx,
                        size_t session_count) {
  std::vector<Conn> servers;
  std::vector<Conn> clients;

  session_count /= 2;

  servers.reserve(session_count);
  clients.reserve(session_count);

  for (size_t i = 0; i < session_count; i++) {
    servers.push_back(std::move(server_ctx.open()));
    clients.push_back(std::move(client_ctx.open()));
    clients.back().set_sni("localhost");
  }

  for (size_t s = 0; s < 5; s++) {
    for (size_t i = 0; i < session_count; i++) {
      do_handshake_step(clients[i], servers[i]);
    }
  }

  for (size_t i = 0; i < session_count; i++) {
    uint8_t buf[1024] = {0};
    clients[i].write(buf, sizeof buf);
  }

  for (size_t i = 0; i < session_count; i++) {
    clients[i].transfer_to(servers[i]);
    uint8_t buf[1024];
    servers[i].read(buf, sizeof buf);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %rdx, %r14
shrq %r14
movq %r14, %rsi
callq 0x681c
movq %rsp, %rdi
movq %r14, %rsi
callq 0x681c
cmpq $0x2, %rbp
jb 0x4611
leaq 0x40(%rsp), %r13
movq %r14, %rbx
movq (%r12), %rdi
callq 0x32d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5a48
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x6ae8
movq %r13, %rdi
callq 0x5b4a
movq (%r15), %rdi
callq 0x32d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5a48
movq %rsp, %rdi
movq %r13, %rsi
callq 0x6ae8
movq %r13, %rdi
callq 0x5b4a
movq 0x8(%rsp), %rdi
addq $-0x38, %rdi
leaq 0x2e3a(%rip), %rsi      # 0x7441
callq 0x6210
decq %rbx
jne 0x45a8
xorl %ebx, %ebx
cmpq $0x2, %rbp
jb 0x463c
xorl %r15d, %r15d
movq %r14, %r12
movq (%rsp), %rdi
addq %r15, %rdi
movq 0x20(%rsp), %rsi
addq %r15, %rsi
callq 0x4be2
addq $0x38, %r15
decq %r12
jne 0x461f
incq %rbx
cmpq $0x5, %rbx
jne 0x4613
cmpq $0x2, %rbp
jb 0x4681
xorl %ebx, %ebx
leaq 0x40(%rsp), %r15
movq %r14, %r12
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x31b0
movq (%rsp), %rdi
addq %rbx, %rdi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rsi
callq 0x5de0
addq $0x38, %rbx
decq %r12
jne 0x4655
cmpq $0x2, %rbp
jb 0x46c1
xorl %r15d, %r15d
leaq 0x40(%rsp), %rbx
movq (%rsp), %rdi
addq %r15, %rdi
movq 0x20(%rsp), %rsi
addq %r15, %rsi
callq 0x5dfe
movq 0x20(%rsp), %rdi
addq %r15, %rdi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x5e92
addq $0x38, %r15
decq %r14
jne 0x468f
movq %rsp, %rdi
callq 0x68e0
leaq 0x20(%rsp), %rdi
callq 0x68e0
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4704
jmp 0x4704
jmp 0x4704
jmp 0x4704
jmp 0x46ef
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5b4a
jmp 0x4707
jmp 0x4704
jmp 0x4704
jmp 0x4704
movq %rax, %rbx
movq %rsp, %rdi
callq 0x68e0
leaq 0x20(%rsp), %rdi
callq 0x68e0
movq %rbx, %rdi
callq 0x34c0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2836(%rip), %rdi      # 0x7397
callq 0x3340
testq %rax, %rax
je 0x4ba3
cvtsi2sd %rbx, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rax, %rdi
callq 0x3350
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x24a8(%rip), %xmm0     # 0x7040
cvttsd2si %xmm0, %rbx
andq %rcx, %rbx
orq %rax, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4bbc
testl %edi, %edi
sete %al
retq
pushq %rax
movq 0x5404(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x3180
leaq 0x27ef(%rip), %rdi      # 0x73c2
callq 0x3400
movl $0x1, %edi
callq 0x3330
// File: /workspace/github_cpp_makefile_star2_O1/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 0x624a
movl %eax, %r15d
movq %rbx, %rdi
callq 0x6268
movl %eax, %ebp
andb %r15b, %bpl
jne 0x4c1f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5dfe
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5dfe
xorb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x30f0
testq %rax, %rax
je 0x56dc
cmpq $0x0, 0x30(%rax)
jne 0x56dc
movq %r14, 0x30(%rax)
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a6b(%rip), %rsi      # 0x7162
movq %rbx, %rdi
callq 0x33a0
testl %eax, %eax
je 0x5763
leaq 0x1a6f(%rip), %rsi      # 0x7179
movq %rbx, %rdi
callq 0x33a0
testl %eax, %eax
je 0x5763
leaq 0x1a73(%rip), %rsi      # 0x7190
movq %rbx, %rdi
callq 0x33a0
testl %eax, %eax
je 0x5763
movq (%r14), %rdi
movl $0x303, %edx            # imm = 0x303
movl $0x7b, %esi
xorl %ecx, %ecx
callq 0x3260
movq (%r14), %rdi
movl $0x303, %edx            # imm = 0x303
movl $0x7c, %esi
xorl %ecx, %ecx
callq 0x3260
movq (%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3280
movq (%r14), %rdi
leaq 0x1a40(%rip), %rcx      # 0x71ad
movl $0x5c, %esi
xorl %edx, %edx
callq 0x3260
cmpl $0x1, %eax
jne 0x57b8
movq (%r14), %rdi
movl $0x304, %edx            # imm = 0x304
movl $0x7b, %esi
xorl %ecx, %ecx
callq 0x3260
movq (%r14), %rdi
movl $0x304, %edx            # imm = 0x304
movl $0x7c, %esi
xorl %ecx, %ecx
callq 0x3260
movq (%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3320
leaq 0x1a10(%rip), %rdi      # 0x71cf
leaq 0x1a12(%rip), %rsi      # 0x71d8
leaq 0x1a14(%rip), %rcx      # 0x71e1
movl $0x63, %edx
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5831
testl %esi, %esi
jne 0x585e
movq (%rbx), %rdi
leaq 0x1a1a(%rip), %rsi      # 0x7209
callq 0x3210
cmpl $0x1, %eax
jne 0x5860
movq (%rbx), %rdi
leaq 0x1a5e(%rip), %rsi      # 0x7261
movl $0x1, %edx
callq 0x3030
cmpl $0x1, %eax
je 0x585e
leaq 0x19b6(%rip), %rdi      # 0x71cf
leaq 0x19b8(%rip), %rsi      # 0x71d8
leaq 0x1a0b(%rip), %rcx      # 0x7232
movl $0x38, %edx
callq 0x31d0
movq (%rbx), %rdi
leaq 0x1a49(%rip), %rsi      # 0x7284
callq 0x3210
cmpl $0x1, %eax
jne 0x587f
movq (%rbx), %rdi
leaq 0x1a60(%rip), %rsi      # 0x72af
movl $0x1, %edx
callq 0x3030
cmpl $0x1, %eax
jne 0x589e
popq %rbx
retq
leaq 0x1968(%rip), %rdi      # 0x71cf
leaq 0x196a(%rip), %rsi      # 0x71d8
leaq 0x19bd(%rip), %rcx      # 0x7232
movl $0x35, %edx
callq 0x31d0
leaq 0x1949(%rip), %rdi      # 0x71cf
leaq 0x194b(%rip), %rsi      # 0x71d8
leaq 0x199e(%rip), %rcx      # 0x7232
movl $0x3d, %edx
callq 0x31d0
leaq 0x192a(%rip), %rdi      # 0x71cf
leaq 0x192c(%rip), %rsi      # 0x71d8
leaq 0x197f(%rip), %rcx      # 0x7232
movl $0x40, %edx
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58d1
cmpl $0x1, %esi
jne 0x58e8
leaq 0x1a28(%rip), %rsi      # 0x72f7
jmp 0x58d8
leaq 0x19fc(%rip), %rsi      # 0x72d4
movq (%rdi), %rdi
xorl %edx, %edx
callq 0x3360
cmpl $0x1, %eax
sete %al
testb $0x1, %al
je 0x58ee
popq %rax
retq
leaq 0x18da(%rip), %rdi      # 0x71cf
leaq 0x18dc(%rip), %rsi      # 0x71d8
leaq 0x1a19(%rip), %rcx      # 0x731c
movl $0x51, %edx
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq (%rsi), %rdi
callq 0x3170
movq %rax, %rdi
callq 0x3200
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3530
movq %rbx, %rdi
movl $0x9, %esi
callq 0x3230
movq (%r14), %rdi
callq 0x3170
movq %rax, %rdi
callq 0x32e0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3530
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x5b42
movq (%r15), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x34c0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13d, %r13d
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 0x3300
movl %eax, %ebp
testl %eax, %eax
jle 0x5e6b
testb $0x1, %r13b
jne 0x5e56
movq %rbx, %rdi
callq 0x5f1e
movb $0x1, %r13b
movq 0x10(%rbx), %rsi
movl %ebp, %eax
leaq (%rsp,%rax), %rcx
movq %r12, %rdi
movq %r15, %rdx
callq 0x5ffa
decl %ebp
cmpl $-0x2, %ebp
jb 0x5e2e
testb $0x1, %r13b
je 0x5e80
movq %rbx, %rdi
callq 0x5f8e
addq $0x40008, %rsp          # imm = 0x40008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
testq %rdx, %rdx
je 0x5ec0
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x3060
testl %eax, %eax
js 0x5ec6
movl %eax, %eax
addq %rax, %r14
subq %rax, %rbx
jne 0x5ea5
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1549(%rip), %rdi      # 0x7416
leaq 0x1304(%rip), %rsi      # 0x71d8
leaq 0x1543(%rip), %rcx      # 0x741e
movl $0x139, %edx            # imm = 0x139
callq 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movq 0x20(%rdi), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x30d0
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rdx
leaq (%rax,%r14), %rcx
cmpq %rcx, %rdx
je 0x5f83
movq %rdx, %r15
subq %rax, %r15
subq %r15, %rdx
je 0x5f6d
movq %r14, %rdi
movq %r15, %rsi
callq 0x3480
movq 0x10(%rbx), %rax
movq %rax, %rcx
subq %r15, %rcx
addq %rcx, %r14
cmpq %r14, %rax
je 0x5f83
movq %r14, 0x10(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4329(%rip), %rdi      # 0xa2c9
cmovneq %rax, %rdi
movl 0x10(%rbx), %esi
subl %eax, %esi
callq 0x30a0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x5fda
movq %rax, %rdi
movl $0x82, %esi
movq $-0x1, %rdx
xorl %ecx, %ecx
callq 0x30d0
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
popq %rbx
jmp 0x34f0
leaq 0x13ff(%rip), %rdi      # 0x73e0
leaq 0x11f0(%rip), %rsi      # 0x71d8
leaq 0x1409(%rip), %rcx      # 0x73f8
movl $0xcd, %edx
callq 0x31d0
nop