// File: /workspace/github_cpp_makefile_star2_O1/rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::cielab2rgb(Image&, Image&)
void ImageProc::cielab2rgb(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++)
		{
			L = (double)(img_orig.getvalue(i,j,0));
			A = (double)(img_orig.getvalue(i,j,1));
			B = (double)(img_orig.getvalue(i,j,2));
			Lab2Rgb(&r,&g,&b,L,A,B);
			std::cout << L << " " << A << " " << B <<std::endl;
			img_modified.setvalue(i,j,0,(unsigned char)(r*255));
			img_modified.setvalue(i,j,1,(unsigned char)(g*255));
			img_modified.setvalue(i,j,2,(unsigned char)(b*255));
			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 0xe0c8
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
xorl %r13d, %r13d
movq %rsp, %rdx
movq 0x8140(%rip), %r15      # 0x15fd0
movq %rdi, 0x8(%rsp)
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0xe0ad
xorl %ebp, %ebp
movq 0x18(%rdi), %rcx
imull %r13d, %eax
addl %ebp, %eax
imull 0x10(%rdi), %eax
cltq
movzbl (%rcx,%rax), %esi
cvtsi2sd %esi, %xmm0
movsd %xmm0, 0x10(%rsp)
movzbl 0x1(%rcx,%rax), %esi
cvtsi2sd %esi, %xmm1
movsd %xmm1, 0x18(%rsp)
movzbl 0x2(%rcx,%rax), %eax
cvtsi2sd %eax, %xmm2
movsd %xmm2, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x68ff
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x2260
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f13(%rip), %r14      # 0x11e20
movq %r14, %rsi
callq 0x21b0
movq %r12, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x2260
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
movq %r12, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x2260
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movsd 0x30(%rsp), %xmm0
movsd 0x3594(%rip), %xmm1     # 0x11510
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %edx
imull %r13d, %edx
addl %ebp, %edx
imull 0x10(%rbx), %edx
movslq %edx, %rdx
movb %al, (%rcx,%rdx)
movsd 0x28(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %edx
imull %r13d, %edx
addl %ebp, %edx
imull 0x10(%rbx), %edx
movslq %edx, %rdx
movb %al, 0x1(%rcx,%rdx)
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movq 0x18(%rbx), %rcx
movl 0x8(%rbx), %edx
imull %r13d, %edx
addl %ebp, %edx
imull 0x10(%rbx), %edx
movslq %edx, %rdx
movb %al, 0x2(%rcx,%rdx)
movq 0x18(%rbx), %rax
movl 0x8(%rbx), %ecx
imull %r13d, %ecx
addl %ebp, %ecx
imull 0x10(%rbx), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
movq 0x18(%rbx), %rax
movl 0x8(%rbx), %ecx
imull %r13d, %ecx
addl %ebp, %ecx
imull 0x10(%rbx), %ecx
movslq %ecx, %rcx
movzbl 0x1(%rax,%rcx), %esi
movq %r12, %rdi
callq 0x2290
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
movq 0x18(%rbx), %rax
movl 0x8(%rbx), %ecx
imull %r13d, %ecx
addl %ebp, %ecx
imull 0x10(%rbx), %ecx
movslq %ecx, %rcx
movzbl 0x2(%rax,%rcx), %esi
movq %r12, %rdi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movq %rsp, %rdx
movq 0x8(%rsp), %rdi
incl %ebp
movl 0x8(%rdi), %eax
cmpl %eax, %ebp
jl 0xdea2
incl %r13d
cmpl 0xc(%rdi), %r13d
jl 0xde95
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop