// File: /workspace/github_cpp_makefile_star2_O3/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::halftoning(char const*, int, int)
void ImageProc::halftoning(const char *infile, int width, int height)
{
	Image img_orig("bw", width, height);
	Image img_halftone_fixed_thresh("bw", width, height);
	Image img_halftone_random_thresh("bw", width, height);
	Image img_halftone_dither_matrix_2("bw", width, height);
	Image img_halftone_dither_matrix_4("bw", width, height);
	Image img_halftone_error_diffusion("bw", width, height);
	img_orig.read_image(infile, img_orig.cols, img_orig.rows);

	halftone_fixed_thresh(img_orig, img_halftone_fixed_thresh);
	halftone_random_thresh(img_orig, img_halftone_random_thresh);
	halftone_dither_matrix(img_orig, img_halftone_dither_matrix_2, 2);
	halftone_dither_matrix(img_orig, img_halftone_dither_matrix_4, 4);
	error_diffusion(img_orig, img_halftone_error_diffusion);

	img_halftone_fixed_thresh.write_image("../output_images/halftone_fixed_thresh.raw", img_halftone_fixed_thresh.cols, img_halftone_fixed_thresh.rows);
	img_halftone_random_thresh.write_image("../output_images/halftone_random_thresh.raw", img_halftone_random_thresh.cols, img_halftone_random_thresh.rows);
	img_halftone_dither_matrix_2.write_image("../output_images/halftone_dither_matrix_2x2.raw", img_halftone_dither_matrix_2.cols, img_halftone_dither_matrix_2.rows);
	img_halftone_dither_matrix_4.write_image("../output_images/halftone_dither_matrix_4x4.raw", img_halftone_dither_matrix_4.cols, img_halftone_dither_matrix_4.rows);
	img_halftone_error_diffusion.write_image("../output_images/halftone_error_diffusion.raw", img_halftone_error_diffusion.cols, img_halftone_error_diffusion.rows);
	//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 $0xc8, %rsp
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r14
leaq 0x6162(%rip), %r13      # 0x12253
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c56
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c56
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c56
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c56
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c56
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c56
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4cb2
movq %rbx, %rdi
leaq 0x68(%rsp), %r14
movq %r14, %rsi
callq 0xc22c
movq %rbx, %rdi
leaq 0x48(%rsp), %r15
movq %r15, %rsi
callq 0xc2a2
movq %rbx, %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
movl $0x2, %edx
callq 0xc37a
movq %rbx, %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
movl $0x4, %edx
callq 0xc37a
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc532
leaq 0x5667(%rip), %rsi      # 0x1183d
movq %r14, %rdi
callq 0x4dee
leaq 0x5683(%rip), %rsi      # 0x11868
movq %r15, %rdi
callq 0x4dee
leaq 0x56a0(%rip), %rsi      # 0x11894
movq %r12, %rdi
callq 0x4dee
leaq 0x56c1(%rip), %rsi      # 0x118c4
movq %r13, %rdi
callq 0x4dee
leaq 0x56e2(%rip), %rsi      # 0x118f4
movq %rbp, %rdi
callq 0x4dee
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq