LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/Image.h
// Function: Image::read_image(char const*, int, int)
void Image::read_image(const char *filename, int width, int height)
{
  if (!strcmp(imgtype, "color"))
  {
    //cols = width;
    //rows = height;
    FILE *file;
    if (!(file=fopen(filename,"rb"))) 
    {
      std::cout << "Cannot open file: " << filename << std::endl;
      exit(1);
    }

    if (!(fread(imgdata, sizeof(int), cols*rows*channels, file)))
      std::cout << "Error Reading" << std::endl;

    fclose(file);
  }

  else if (!strcmp(imgtype, "bw"))
  {
    // cols = width;
    // rows = height;

    FILE *file;
    if (!(file=fopen(filename,"rb"))) 
    {
      std::cout << "Cannot open file: " << filename << std::endl;
      exit(1);
    }
    if (!(fread(imgdata, sizeof(int), cols*rows*channels, file)))
      std::cout << "Error Reading" << std::endl;
    fclose(file);  
    
  }

  else
  {
    std::cout << "Filetype wasn't right!" << std::endl;
  }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
leaq 0xc681(%rip), %rsi      # 0x106c8
movq %r15, %rdi
callq 0x21e0
testl %eax, %eax
je 0x4087
cmpb $0x62, (%r15)
jne 0x4067
cmpb $0x77, 0x1(%r15)
jne 0x4067
cmpb $0x0, 0x2(%r15)
je 0x4087
movq 0x10f62(%rip), %rdi     # 0x14fd0
leaq 0xc67d(%rip), %rsi      # 0x106f2
callq 0x2170
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x20c0
leaq 0xc640(%rip), %rsi      # 0x106ce
movq %rbx, %rdi
callq 0x2190
testq %rax, %rax
je 0x40ee
movq %rax, %r15
movq 0x18(%r14), %rdi
movslq 0x8(%r14), %rax
movslq 0xc(%r14), %rcx
imulq %rax, %rcx
movslq 0x10(%r14), %rdx
imulq %rcx, %rdx
pushq $0x4
popq %rsi
movq %r15, %rcx
callq 0x2200
testq %rax, %rax
jne 0x40e1
movq 0x10f03(%rip), %rdi     # 0x14fd0
leaq 0xc610(%rip), %rsi      # 0x106e4
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2180
movq 0x10edb(%rip), %rdi     # 0x14fd0
leaq 0xc5d5(%rip), %rsi      # 0x106d1
callq 0x2170
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rdi
callq 0x21a0
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/Image.h
// Function: Image::write_image(char const*, int, int)
void Image::write_image(const char *filename, int width, int height)
{
  if (!strcmp(imgtype, "color"))
  {
    // cols = width;
    // rows = height;

    FILE *file;
    if (!(file=fopen(filename,"wb"))) 
    {
      std::cout << "Cannot open file: " << filename << std::endl;
      exit(1);
    }
    if (!(fwrite(imgdata, sizeof(unsigned char), cols*rows*channels, file)))
       std::cout << "Error Writing" << std::endl;
    fclose(file);
   
  }

  else if (!strcmp(imgtype, "bw"))
  {
    // cols = width;
    // rows = height;

    FILE *file;

    if (!(file=fopen(filename,"wb"))) 
    {
      std::cout << "Cannot open file: " << filename << std::endl;
      exit(1);
    }
    if (!(fwrite(imgdata, sizeof(unsigned char), cols*rows*channels, file)))
      std::cout << "Error Writing" << std::endl;
    fclose(file);  

  }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rbx
leaq 0xc597(%rip), %rsi      # 0x106c8
movq %rbx, %rdi
callq 0x21e0
testl %eax, %eax
je 0x4154
cmpb $0x62, (%rbx)
jne 0x414e
cmpb $0x77, 0x1(%rbx)
jne 0x414e
cmpb $0x0, 0x2(%rbx)
je 0x4154
popq %rbx
popq %r14
popq %r15
retq
leaq 0xc5ae(%rip), %rsi      # 0x10709
movq %r14, %rdi
callq 0x2190
testq %rax, %rax
je 0x41bb
movq %rax, %rbx
movq 0x18(%r15), %rdi
movslq 0x8(%r15), %rax
movslq 0xc(%r15), %rcx
imulq %rax, %rcx
movslq 0x10(%r15), %rdx
imulq %rcx, %rdx
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x22e0
testq %rax, %rax
jne 0x41ae
movq 0x10e36(%rip), %rdi     # 0x14fd0
leaq 0xc56b(%rip), %rsi      # 0x1070c
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2180
movq 0x10e0e(%rip), %rdi     # 0x14fd0
leaq 0xc508(%rip), %rsi      # 0x106d1
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rdi
callq 0x21a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/Image.h
// Function: Image::operator=(Image)
void Image::operator=(Image img_copy)
{
  strcpy(imgtype, img_copy.imgtype);
  img_copy.rows = rows;
  img_copy.cols = cols;
  img_copy.channels = channels;
  for(int i = 0; i < rows; i++)
    for(int j = 0; j < cols; j++)
      for(int k = 0; k < channels; k++)
        img_copy.setvalue(i,j,k,getvalue(i,j,k));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq (%rsi), %rsi
callq 0x2150
movl 0xc(%r14), %edx
movl %edx, 0xc(%rbx)
movl 0x8(%r14), %esi
movl %esi, 0x8(%rbx)
movl 0x10(%r14), %ecx
movl %ecx, 0x10(%rbx)
xorl %eax, %eax
cmpl %edx, %eax
jge 0x4300
xorl %edx, %edx
cmpl %esi, %edx
jge 0x42f8
xorl %edi, %edi
movl 0x8(%r14), %esi
cmpl %ecx, %edi
jge 0x42f4
movq 0x18(%r14), %r8
imull %eax, %esi
addl %edx, %esi
imull %esi, %ecx
addl %edi, %ecx
movl 0x8(%rbx), %esi
imull %eax, %esi
addl %edx, %esi
imull 0x10(%rbx), %esi
movslq %ecx, %rcx
movslq %esi, %rsi
addq 0x18(%rbx), %rsi
movb (%r8,%rcx), %cl
movb %cl, (%rdi,%rsi)
movl 0x10(%r14), %ecx
incq %rdi
jmp 0x42b8
incl %edx
jmp 0x42b2
incl %eax
movl 0xc(%r14), %edx
jmp 0x42ac
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Ycbcr2Rgb(double*, double*, double*, double, double, double)
void Ycbcr2Rgb(num *R, num *G, num *B, num Y, num Cr, num Cb)
{
	Y -= 16;
	Cb -= 128;
	Cr -= 128;
	*R = (num)(0.00456621004566210107*Y + 1.1808799897946415e-09*Cr + 0.00625892896994393634*Cb);
	*G = (num)(0.00456621004566210107*Y - 0.00153632368604490212*Cr - 0.00318811094965570701*Cb);
	*B = (num)(0.00456621004566210107*Y + 0.00791071623355474145*Cr + 1.1977497040190077e-08*Cb);
}

// Assembly:
addsd 0xbc39(%rip), %xmm0     # 0x100d0
movsd 0xbc39(%rip), %xmm3     # 0x100d8
addsd %xmm3, %xmm2
addsd %xmm3, %xmm1
movsd 0xbc31(%rip), %xmm3     # 0x100e0
mulsd 0xbc31(%rip), %xmm0     # 0x100e8
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
movsd 0xbc29(%rip), %xmm4     # 0x100f0
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rdi)
movsd 0xbc1d(%rip), %xmm3     # 0x100f8
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
movsd 0xbc15(%rip), %xmm4     # 0x10100
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rsi)
mulsd 0xbc09(%rip), %xmm1     # 0x10108
addsd %xmm0, %xmm1
mulsd 0xbc05(%rip), %xmm2     # 0x10110
addsd %xmm1, %xmm2
movsd %xmm2, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Rgb2Hsv(double*, double*, double*, double, double, double)
void Rgb2Hsv(num *H, num *S, num *V, num R, num G, num B)
{
	num Max = MAX3(R, G, B);
	num Min = MIN3(R, G, B);
	num C = Max - Min;
	
	
	*V = Max;
	
	if(C > 0)
	{
		if(Max == R)
		{
			*H = (G - B) / C;
			
			if(G < B)
				*H += 6;
		}
		else if(Max == G)
			*H = 2 + (B - R) / C;
		else
			*H = 4 + (R - G) / C;
		
		*H *= 60;
		*S = C / Max;
	}
	else
		*H = *S = 0;
}

// Assembly:
movapd %xmm1, %xmm4
cmplesd %xmm0, %xmm4
movapd %xmm4, %xmm3
andpd %xmm0, %xmm3
andnpd %xmm1, %xmm4
orpd %xmm3, %xmm4
movapd %xmm2, %xmm3
cmplesd %xmm4, %xmm3
movapd %xmm3, %xmm5
andpd %xmm4, %xmm5
andnpd %xmm2, %xmm3
orpd %xmm5, %xmm3
movapd %xmm0, %xmm4
cmplesd %xmm1, %xmm4
movapd %xmm4, %xmm5
andpd %xmm0, %xmm5
andnpd %xmm1, %xmm4
orpd %xmm5, %xmm4
movapd %xmm4, %xmm5
cmplesd %xmm2, %xmm5
movapd %xmm5, %xmm6
andpd %xmm4, %xmm6
andnpd %xmm2, %xmm5
orpd %xmm6, %xmm5
movapd %xmm3, %xmm4
subsd %xmm5, %xmm4
movlpd %xmm3, (%rdx)
xorpd %xmm5, %xmm5
ucomisd %xmm5, %xmm4
jbe 0x49be
ucomisd %xmm0, %xmm3
jne 0x49c7
jp 0x49c7
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
divsd %xmm4, %xmm0
ucomisd %xmm1, %xmm2
jbe 0x49f5
addsd 0xb8a4(%rip), %xmm0     # 0x10260
jmp 0x49f5
andq $0x0, (%rsi)
andq $0x0, (%rdi)
retq
ucomisd %xmm1, %xmm3
jne 0x49e5
jp 0x49e5
subsd %xmm0, %xmm2
divsd %xmm4, %xmm2
addsd 0xb879(%rip), %xmm2     # 0x10258
movapd %xmm2, %xmm0
jmp 0x49f5
subsd %xmm1, %xmm0
divsd %xmm4, %xmm0
addsd 0xb85b(%rip), %xmm0     # 0x10250
mulsd 0xb86b(%rip), %xmm0     # 0x10268
movsd %xmm0, (%rdi)
divsd %xmm3, %xmm4
movsd %xmm4, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Hsv2Rgb(double*, double*, double*, double, double, double)
void Hsv2Rgb(num *R, num *G, num *B, num H, num S, num V)
{
	num C = S * V;
	num Min = V - C;
	num X;
	
	
	H -= 360*floor(H/360);
	H /= 60;
	X = C*(1 - fabs(H - 2*floor(H/2) - 1));
	
	switch((int)H)
	{
	case 0:
		*R = Min + C;
		*G = Min + X;
		*B = Min;
		break;
	case 1:
		*R = Min + X;
		*G = Min + C;
		*B = Min;
		break;
	case 2:
		*R = Min;
		*G = Min + C;
		*B = Min + X;
		break;
	case 3:
		*R = Min;
		*G = Min + X;
		*B = Min + C;
		break;
	case 4:
		*R = Min + X;
		*G = Min;
		*B = Min + C;
		break;
	case 5:
		*R = Min + C;
		*G = Min;
		*B = Min + X;
		break;
	default:
		*R = *G = *B = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, (%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
divsd 0xb83b(%rip), %xmm0     # 0x10270
callq 0x2260
movapd %xmm0, %xmm1
mulsd 0xb832(%rip), %xmm1     # 0x10278
addsd (%rsp), %xmm1
divsd 0xb815(%rip), %xmm1     # 0x10268
movapd %xmm1, (%rsp)
movsd 0xb6c8(%rip), %xmm0     # 0x10128
mulsd %xmm1, %xmm0
callq 0x2260
movapd (%rsp), %xmm3
cvttsd2si %xmm3, %eax
cmpl $0x5, %eax
ja 0x4b43
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm1
addsd %xmm0, %xmm0
subsd %xmm0, %xmm3
addsd 0xb7e1(%rip), %xmm3     # 0x10280
andpd 0xba49(%rip), %xmm3     # 0x104f0
movsd 0xb7d9(%rip), %xmm0     # 0x10288
subsd %xmm3, %xmm0
mulsd %xmm2, %xmm0
leaq 0xbb62(%rip), %rcx      # 0x10620
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addsd %xmm1, %xmm2
movsd %xmm2, (%r15)
addsd %xmm1, %xmm0
movsd %xmm0, (%r14)
jmp 0x4b25
addsd %xmm1, %xmm0
movsd %xmm0, (%r15)
movsd %xmm1, (%r14)
jmp 0x4b09
movsd %xmm1, (%r15)
addsd %xmm1, %xmm2
movsd %xmm2, (%r14)
jmp 0x4b39
movsd %xmm1, (%r15)
addsd %xmm1, %xmm0
movsd %xmm0, (%r14)
addsd %xmm1, %xmm2
movsd %xmm2, (%rbx)
jmp 0x4b4f
addsd %xmm1, %xmm0
movsd %xmm0, (%r15)
addsd %xmm1, %xmm2
movsd %xmm2, (%r14)
movsd %xmm1, (%rbx)
jmp 0x4b4f
addsd %xmm1, %xmm2
movsd %xmm2, (%r15)
movsd %xmm1, (%r14)
addsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
jmp 0x4b4f
andq $0x0, (%rbx)
andq $0x0, (%r14)
andq $0x0, (%r15)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Rgb2Hsl(double*, double*, double*, double, double, double)
void Rgb2Hsl(num *H, num *S, num *L, num R, num G, num B)
{
	num Max = MAX3(R, G, B);
	num Min = MIN3(R, G, B);
	num C = Max - Min;
	
	
	*L = (Max + Min)/2;
	
	if(C > 0)
	{
		if(Max == R)
		{
			*H = (G - B) / C;
			
			if(G < B)
				*H += 6;
		}
		else if(Max == G)
			*H = 2 + (B - R) / C;
		else
			*H = 4 + (R - G) / C;
		
		*H *= 60;
		*S = (*L <= 0.5) ? (C/(2*(*L))) : (C/(2 - 2*(*L)));
	}
	else
		*H = *S = 0;
}

// Assembly:
movapd %xmm1, %xmm3
cmplesd %xmm0, %xmm3
movapd %xmm3, %xmm4
andpd %xmm0, %xmm4
andnpd %xmm1, %xmm3
orpd %xmm4, %xmm3
movapd %xmm2, %xmm4
cmplesd %xmm3, %xmm4
movapd %xmm4, %xmm5
andpd %xmm3, %xmm5
andnpd %xmm2, %xmm4
orpd %xmm5, %xmm4
movapd %xmm0, %xmm3
cmplesd %xmm1, %xmm3
movapd %xmm3, %xmm5
andpd %xmm0, %xmm5
andnpd %xmm1, %xmm3
orpd %xmm5, %xmm3
movapd %xmm3, %xmm5
cmplesd %xmm2, %xmm5
movapd %xmm5, %xmm6
andpd %xmm3, %xmm6
andnpd %xmm2, %xmm5
orpd %xmm6, %xmm5
movapd %xmm4, %xmm3
subsd %xmm5, %xmm3
addsd %xmm4, %xmm5
mulsd 0xb557(%rip), %xmm5     # 0x10128
movsd %xmm5, (%rdx)
xorpd %xmm5, %xmm5
ucomisd %xmm5, %xmm3
jbe 0x4c03
ucomisd %xmm0, %xmm4
jne 0x4c0c
jp 0x4c0c
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
divsd %xmm3, %xmm0
ucomisd %xmm1, %xmm2
jbe 0x4c3a
addsd 0xb65f(%rip), %xmm0     # 0x10260
jmp 0x4c3a
andq $0x0, (%rsi)
andq $0x0, (%rdi)
retq
ucomisd %xmm1, %xmm4
jne 0x4c2a
jp 0x4c2a
subsd %xmm0, %xmm2
divsd %xmm3, %xmm2
addsd 0xb634(%rip), %xmm2     # 0x10258
movapd %xmm2, %xmm0
jmp 0x4c3a
subsd %xmm1, %xmm0
divsd %xmm3, %xmm0
addsd 0xb616(%rip), %xmm0     # 0x10250
mulsd 0xb626(%rip), %xmm0     # 0x10268
movsd %xmm0, (%rdi)
movsd (%rdx), %xmm0
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
movsd 0xb5fe(%rip), %xmm2     # 0x10258
subsd %xmm1, %xmm2
cmpnlesd 0xb4c1(%rip), %xmm0     # 0x10128
movapd %xmm0, %xmm4
andnpd %xmm1, %xmm4
andpd %xmm2, %xmm0
orpd %xmm4, %xmm0
divsd %xmm0, %xmm3
movsd %xmm3, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Hsl2Rgb(double*, double*, double*, double, double, double)
void Hsl2Rgb(num *R, num *G, num *B, num H, num S, num L)
{
	num C = (L <= 0.5) ? (2*L*S) : ((2 - 2*L)*S);
	num Min = L - 0.5*C;
	num X;
	
	
	H -= 360*floor(H/360);
	H /= 60;
	X = C*(1 - fabs(H - 2*floor(H/2) - 1));
	
	switch((int)H)
	{
	case 0:
		*R = Min + C;
		*G = Min + X;
		*B = Min;
		break;
	case 1:
		*R = Min + X;
		*G = Min + C;
		*B = Min;
		break;
	case 2:
		*R = Min;
		*G = Min + C;
		*B = Min + X;
		break;
	case 3:
		*R = Min;
		*G = Min + X;
		*B = Min + C;
		break;
	case 4:
		*R = Min + X;
		*G = Min;
		*B = Min + C;
		break;
	case 5:
		*R = Min + C;
		*G = Min;
		*B = Min + X;
		break;
	default:
		*R = *G = *B = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, (%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
divsd 0xb5c5(%rip), %xmm0     # 0x10270
callq 0x2260
mulsd 0xb5c0(%rip), %xmm0     # 0x10278
addsd (%rsp), %xmm0
divsd 0xb5a3(%rip), %xmm0     # 0x10268
movapd %xmm0, (%rsp)
mulsd 0xb456(%rip), %xmm0     # 0x10128
callq 0x2260
movapd (%rsp), %xmm5
cvttsd2si %xmm5, %eax
cmpl $0x5, %eax
ja 0x4de6
movsd 0x18(%rsp), %xmm4
movapd %xmm4, %xmm2
addsd %xmm4, %xmm2
movsd 0xb559(%rip), %xmm3     # 0x10258
subsd %xmm2, %xmm3
movapd %xmm4, %xmm1
cmpnlesd 0xb418(%rip), %xmm1     # 0x10128
andpd %xmm1, %xmm3
andnpd %xmm2, %xmm1
orpd %xmm3, %xmm1
mulsd 0x10(%rsp), %xmm1
movsd 0xb416(%rip), %xmm2     # 0x10140
mulsd %xmm1, %xmm2
addsd %xmm4, %xmm2
addsd %xmm0, %xmm0
subsd %xmm0, %xmm5
addsd 0xb53e(%rip), %xmm5     # 0x10280
andpd 0xb7a6(%rip), %xmm5     # 0x104f0
movsd 0xb536(%rip), %xmm0     # 0x10288
subsd %xmm5, %xmm0
mulsd %xmm1, %xmm0
leaq 0xb8d7(%rip), %rcx      # 0x10638
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addsd %xmm2, %xmm1
movsd %xmm1, (%r15)
addsd %xmm2, %xmm0
movsd %xmm0, (%r14)
jmp 0x4dc8
addsd %xmm2, %xmm0
movsd %xmm0, (%r15)
movsd %xmm2, (%r14)
jmp 0x4dac
movsd %xmm2, (%r15)
addsd %xmm2, %xmm1
movsd %xmm1, (%r14)
jmp 0x4ddc
movsd %xmm2, (%r15)
addsd %xmm2, %xmm0
movsd %xmm0, (%r14)
addsd %xmm2, %xmm1
movsd %xmm1, (%rbx)
jmp 0x4df2
addsd %xmm2, %xmm0
movsd %xmm0, (%r15)
addsd %xmm2, %xmm1
movsd %xmm1, (%r14)
movsd %xmm2, (%rbx)
jmp 0x4df2
addsd %xmm2, %xmm1
movsd %xmm1, (%r15)
movsd %xmm2, (%r14)
addsd %xmm2, %xmm0
movsd %xmm0, (%rbx)
jmp 0x4df2
andq $0x0, (%rbx)
andq $0x0, (%r14)
andq $0x0, (%r15)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Rgb2Hsi(double*, double*, double*, double, double, double)
void Rgb2Hsi(num *H, num *S, num *I, num R, num G, num B)
{
	num alpha = 0.5*(2*R - G - B);
	num beta = 0.866025403784439*(G - B);
	
	
	*I = (R + G + B)/3;
	
	if(*I > 0)
	{
		*S = 1 - MIN3(R,G,B) / *I;
		*H = atan2(beta, alpha)*(180/M_PI);
		
		if(*H < 0)
			*H += 360;
	}
	else
		*H = *S = 0;
}

// Assembly:
pushq %rbx
movapd %xmm0, %xmm3
movq %rdi, %rbx
movapd %xmm0, %xmm5
addsd %xmm1, %xmm5
addsd %xmm2, %xmm5
divsd 0xb478(%rip), %xmm5     # 0x10290
movsd %xmm5, (%rdx)
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm5
jbe 0x4ebd
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
mulsd 0xb45e(%rip), %xmm0     # 0x10298
movapd %xmm3, %xmm4
addsd %xmm3, %xmm4
subsd %xmm1, %xmm4
subsd %xmm2, %xmm4
mulsd 0xb2d6(%rip), %xmm4     # 0x10128
movapd %xmm3, %xmm6
cmplesd %xmm1, %xmm6
andpd %xmm6, %xmm3
andnpd %xmm1, %xmm6
orpd %xmm3, %xmm6
movapd %xmm6, %xmm1
cmplesd %xmm2, %xmm1
movapd %xmm1, %xmm3
andpd %xmm6, %xmm3
andnpd %xmm2, %xmm1
orpd %xmm3, %xmm1
divsd %xmm5, %xmm1
movsd 0xb3fc(%rip), %xmm2     # 0x10288
subsd %xmm1, %xmm2
movsd %xmm2, (%rsi)
movapd %xmm4, %xmm1
callq 0x2060
mulsd 0xb3fb(%rip), %xmm0     # 0x102a0
movsd %xmm0, (%rbx)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x4ec5
addsd 0xb3b5(%rip), %xmm0     # 0x10270
jmp 0x4ec1
andq $0x0, (%rsi)
movsd %xmm0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Hsi2Rgb(double*, double*, double*, double, double, double)
void Hsi2Rgb(num *R, num *G, num *B, num H, num S, num I)
{
	H -= 360*floor(H/360);
	
	if(H < 120)
	{
		*B = I*(1 - S);
		*R = I*(1 + S*cos(H*(M_PI/180))/cos((60 - H)*(M_PI/180)));
		*G = 3*I - *R - *B;
	}
	else if(H < 240)
	{
		H -= 120;
		*R = I*(1 - S);
		*G = I*(1 + S*cos(H*(M_PI/180))/cos((60 - H)*(M_PI/180)));
		*B = 3*I - *R - *G;
	}
	else
	{
		H -= 240;
		*G = I*(1 - S);
		*B = I*(1 + S*cos(H*(M_PI/180))/cos((60 - H)*(M_PI/180)));
		*R = 3*I - *G - *B;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
divsd 0xb37d(%rip), %xmm0     # 0x10270
callq 0x2260
movapd %xmm0, %xmm1
mulsd 0xb374(%rip), %xmm1     # 0x10278
addsd 0x10(%rsp), %xmm1
movsd 0xb396(%rip), %xmm0     # 0x102a8
ucomisd %xmm1, %xmm0
jbe 0x4fad
movsd 0xb364(%rip), %xmm0     # 0x10288
subsd 0x8(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rbx)
movapd %xmm1, %xmm0
mulsd 0xb380(%rip), %xmm0     # 0x102c0
movsd %xmm1, 0x10(%rsp)
callq 0x22c0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xb309(%rip), %xmm0     # 0x10268
subsd 0x10(%rsp), %xmm0
mulsd 0xb353(%rip), %xmm0     # 0x102c0
callq 0x22c0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
addsd 0xb304(%rip), %xmm1     # 0x10288
movsd 0x18(%rsp), %xmm0
mulsd %xmm0, %xmm1
movsd %xmm1, (%r15)
mulsd 0xb2f5(%rip), %xmm0     # 0x10290
subsd %xmm1, %xmm0
subsd (%rbx), %xmm0
movsd %xmm0, (%r14)
jmp 0x50da
movsd 0xb2fb(%rip), %xmm0     # 0x102b0
ucomisd %xmm1, %xmm0
movsd 0xb2c7(%rip), %xmm0     # 0x10288
subsd 0x8(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
jbe 0x5059
addsd 0xb2ed(%rip), %xmm1     # 0x102c8
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, (%r15)
mulsd 0xb2d2(%rip), %xmm1     # 0x102c0
movapd %xmm1, %xmm0
callq 0x22c0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xb25d(%rip), %xmm0     # 0x10268
subsd 0x10(%rsp), %xmm0
mulsd 0xb2a7(%rip), %xmm0     # 0x102c0
callq 0x22c0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
addsd 0xb258(%rip), %xmm1     # 0x10288
movsd 0x18(%rsp), %xmm0
mulsd %xmm0, %xmm1
movsd %xmm1, (%r14)
mulsd 0xb249(%rip), %xmm0     # 0x10290
subsd (%r15), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
jmp 0x50da
addsd 0xb257(%rip), %xmm1     # 0x102b8
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, (%r14)
mulsd 0xb24c(%rip), %xmm1     # 0x102c0
movapd %xmm1, %xmm0
callq 0x22c0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xb1d7(%rip), %xmm0     # 0x10268
subsd 0x10(%rsp), %xmm0
mulsd 0xb221(%rip), %xmm0     # 0x102c0
callq 0x22c0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
addsd 0xb1d2(%rip), %xmm1     # 0x10288
movsd 0x18(%rsp), %xmm0
mulsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
mulsd 0xb1c4(%rip), %xmm0     # 0x10290
subsd (%r14), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%r15)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Rgb2Xyz(double*, double*, double*, double, double, double)
void Rgb2Xyz(num *X, num *Y, num *Z, num R, num G, num B)
{
	R = INVGAMMACORRECTION(R);
	G = INVGAMMACORRECTION(G);
	B = INVGAMMACORRECTION(B);
	*X = (num)(0.4123955889674142161*R + 0.3575834307637148171*G + 0.1804926473817015735*B);
	*Y = (num)(0.2125862307855955516*R + 0.7151703037034108499*G + 0.07220049864333622685*B);
	*Z = (num)(0.01929721549174694484*R + 0.1191838645808485318*G + 0.9504971251315797660*B);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movapd %xmm1, %xmm4
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movsd 0xb1ce(%rip), %xmm1     # 0x102d0
ucomisd %xmm0, %xmm1
movsd %xmm2, 0x10(%rsp)
jae 0x5141
addsd 0xb1ca(%rip), %xmm0     # 0x102e0
divsd 0xb1ca(%rip), %xmm0     # 0x102e8
movsd 0xb1ca(%rip), %xmm1     # 0x102f0
movsd %xmm4, 0x8(%rsp)
callq 0x2280
movsd 0xb197(%rip), %xmm1     # 0x102d0
movsd 0x8(%rsp), %xmm4
jmp 0x5149
divsd 0xb18f(%rip), %xmm0     # 0x102d8
movsd %xmm0, 0x18(%rsp)
ucomisd %xmm4, %xmm1
jae 0x5184
addsd 0xb183(%rip), %xmm4     # 0x102e0
divsd 0xb183(%rip), %xmm4     # 0x102e8
movsd 0xb183(%rip), %xmm1     # 0x102f0
movapd %xmm4, %xmm0
callq 0x2280
movsd 0xb152(%rip), %xmm1     # 0x102d0
movapd %xmm0, %xmm4
jmp 0x518c
divsd 0xb14c(%rip), %xmm4     # 0x102d8
movsd 0x10(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jae 0x51c3
addsd 0xb140(%rip), %xmm0     # 0x102e0
divsd 0xb140(%rip), %xmm0     # 0x102e8
movsd 0xb140(%rip), %xmm1     # 0x102f0
movsd %xmm4, 0x8(%rsp)
callq 0x2280
movsd 0x8(%rsp), %xmm4
jmp 0x51cb
divsd 0xb10d(%rip), %xmm0     # 0x102d8
movsd 0xb125(%rip), %xmm2     # 0x102f8
mulsd %xmm4, %xmm2
movsd 0xb121(%rip), %xmm1     # 0x10300
movsd 0x18(%rsp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0xb113(%rip), %xmm2     # 0x10308
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%r15)
movsd 0xb106(%rip), %xmm2     # 0x10310
mulsd %xmm4, %xmm2
movsd 0xb102(%rip), %xmm1     # 0x10318
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0xb0fa(%rip), %xmm2     # 0x10320
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
mulsd 0xb0f2(%rip), %xmm4     # 0x10328
movsd %xmm2, (%r14)
mulsd 0xb0ed(%rip), %xmm3     # 0x10330
addsd %xmm4, %xmm3
mulsd 0xb0e9(%rip), %xmm0     # 0x10338
addsd %xmm3, %xmm0
movsd %xmm0, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Xyz2Rgb(double*, double*, double*, double, double, double)
void Xyz2Rgb(num *R, num *G, num *B, num X, num Y, num Z)
{	
	num R1, B1, G1, Min;
	
	
	R1 = (num)( 3.2406*X - 1.5372*Y - 0.4986*Z);
	G1 = (num)(-0.9689*X + 1.8758*Y + 0.0415*Z);
	B1 = (num)( 0.0557*X - 0.2040*Y + 1.0570*Z);
	
	Min = MIN3(R1, G1, B1);
	
	/* Force nonnegative values so that gamma correction is well-defined. */
	if(Min < 0)
	{
		R1 -= Min;
		G1 -= Min;
		B1 -= Min;
	}

	/* Transform from RGB to R'G'B' */
	*R = GAMMACORRECTION(R1);
	*G = GAMMACORRECTION(G1);
	*B = GAMMACORRECTION(B1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movapd %xmm0, %xmm3
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movapd %xmm1, %xmm0
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
mulpd 0xb279(%rip), %xmm0     # 0x10500
movapd %xmm3, %xmm4
unpcklpd %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0]
mulpd 0xb279(%rip), %xmm4     # 0x10510
addpd %xmm0, %xmm4
movapd %xmm2, %xmm0
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
mulpd 0xb275(%rip), %xmm0     # 0x10520
mulsd 0xb08d(%rip), %xmm1     # 0x10340
mulsd 0xb08d(%rip), %xmm3     # 0x10348
addpd %xmm4, %xmm0
addsd %xmm1, %xmm3
mulsd 0xb085(%rip), %xmm2     # 0x10350
addsd %xmm3, %xmm2
movapd %xmm0, %xmm6
unpckhpd %xmm0, %xmm6            # xmm6 = xmm6[1],xmm0[1]
movapd %xmm0, %xmm1
cmplesd %xmm6, %xmm1
movapd %xmm1, %xmm3
andpd %xmm0, %xmm3
andnpd %xmm6, %xmm1
orpd %xmm3, %xmm1
movapd %xmm1, %xmm3
cmplesd %xmm2, %xmm3
movapd %xmm3, %xmm4
andpd %xmm1, %xmm4
andnpd %xmm2, %xmm3
orpd %xmm4, %xmm3
xorpd %xmm4, %xmm4
ucomisd %xmm3, %xmm4
movapd %xmm2, %xmm1
subsd %xmm3, %xmm1
movapd %xmm3, %xmm5
cmpltsd %xmm4, %xmm5
andpd %xmm5, %xmm1
andnpd %xmm2, %xmm5
jbe 0x5334
subsd %xmm3, %xmm0
subsd %xmm3, %xmm6
orpd %xmm1, %xmm5
movsd 0xb018(%rip), %xmm1     # 0x10358
ucomisd %xmm0, %xmm1
movapd %xmm5, (%rsp)
jae 0x537e
movsd 0xb00d(%rip), %xmm1     # 0x10360
movapd %xmm6, 0x10(%rsp)
callq 0x2280
movsd 0xaff2(%rip), %xmm1     # 0x10358
movapd 0x10(%rsp), %xmm6
mulsd 0xaf74(%rip), %xmm0     # 0x102e8
addsd 0xafec(%rip), %xmm0     # 0x10368
jmp 0x5386
mulsd 0xaf52(%rip), %xmm0     # 0x102d8
movsd %xmm0, (%r15)
ucomisd %xmm6, %xmm1
jae 0x53c0
movsd 0xafc7(%rip), %xmm1     # 0x10360
movapd %xmm6, %xmm0
callq 0x2280
movsd 0xafae(%rip), %xmm1     # 0x10358
movapd %xmm0, %xmm6
mulsd 0xaf32(%rip), %xmm6     # 0x102e8
addsd 0xafaa(%rip), %xmm6     # 0x10368
jmp 0x53c8
mulsd 0xaf10(%rip), %xmm6     # 0x102d8
movapd (%rsp), %xmm0
movsd %xmm6, (%r14)
ucomisd %xmm0, %xmm1
jae 0x53f7
movsd 0xaf80(%rip), %xmm1     # 0x10360
callq 0x2280
mulsd 0xaefb(%rip), %xmm0     # 0x102e8
addsd 0xaf73(%rip), %xmm0     # 0x10368
jmp 0x53ff
mulsd 0xaed9(%rip), %xmm0     # 0x102d8
movsd %xmm0, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Xyz2Lab(double*, double*, double*, double, double, double)
void Xyz2Lab(num *L, num *a, num *b, num X, num Y, num Z)
{
	X /= WHITEPOINT_X;
	Y /= WHITEPOINT_Y;
	Z /= WHITEPOINT_Z;
	X = LABF(X);
	Y = LABF(Y);
	Z = LABF(Z);
	*L = 116*Y - 16;
	*a = 500*(X - Y);
	*b = 200*(Y - Z);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movapd %xmm2, %xmm3
movapd %xmm1, %xmm2
movq %rdx, %rbx
movq %rsi, %r14
divsd 0xaf44(%rip), %xmm0     # 0x10370
movq %rdi, %r15
ucomisd 0xaf49(%rip), %xmm0     # 0x10380
jae 0x544b
mulsd 0xaf4f(%rip), %xmm0     # 0x10390
addsd 0xaf4f(%rip), %xmm0     # 0x10398
jmp 0x5470
movsd 0xaf35(%rip), %xmm1     # 0x10388
movsd %xmm2, 0x10(%rsp)
movsd %xmm3, 0x8(%rsp)
callq 0x2280
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
divsd 0xaf00(%rip), %xmm3     # 0x10378
ucomisd 0xaf00(%rip), %xmm2     # 0x10380
movsd %xmm0, 0x18(%rsp)
jae 0x549a
mulsd 0xaf00(%rip), %xmm2     # 0x10390
addsd 0xaf00(%rip), %xmm2     # 0x10398
jmp 0x54bb
movsd 0xaee6(%rip), %xmm1     # 0x10388
movapd %xmm2, %xmm0
movsd %xmm3, 0x8(%rsp)
callq 0x2280
movsd 0x8(%rsp), %xmm3
movapd %xmm0, %xmm2
ucomisd 0xaebd(%rip), %xmm3     # 0x10380
jae 0x54d7
mulsd 0xaec3(%rip), %xmm3     # 0x10390
addsd 0xaec3(%rip), %xmm3     # 0x10398
jmp 0x54f8
movsd 0xaea9(%rip), %xmm1     # 0x10388
movapd %xmm3, %xmm0
movsd %xmm2, 0x10(%rsp)
callq 0x2280
movsd 0x10(%rsp), %xmm2
movapd %xmm0, %xmm3
movsd 0xaea0(%rip), %xmm0     # 0x103a0
mulsd %xmm2, %xmm0
addsd 0xabc4(%rip), %xmm0     # 0x100d0
movsd %xmm0, (%r15)
movsd 0x18(%rsp), %xmm0
subsd %xmm2, %xmm0
mulsd 0xae85(%rip), %xmm0     # 0x103a8
movsd %xmm0, (%r14)
subsd %xmm3, %xmm2
mulsd 0xae7c(%rip), %xmm2     # 0x103b0
movsd %xmm2, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Lab2Xyz(double*, double*, double*, double, double, double)
void Lab2Xyz(num *X, num *Y, num *Z, num L, num a, num b)
{
	L = (L + 16)/116;
	a = L + a/500;
	b = L - b/200;
	*X = WHITEPOINT_X*LABINVF(a);
	*Y = WHITEPOINT_Y*LABINVF(L);
	*Z = WHITEPOINT_Z*LABINVF(b);
}

// Assembly:
addsd 0xab4e(%rip), %xmm0     # 0x10098
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
divpd 0xafda(%rip), %xmm0     # 0x10530
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm0, %xmm4
divsd 0xae4e(%rip), %xmm2     # 0x103b8
addsd %xmm0, %xmm2
movapd %xmm4, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm4, %xmm5
movsd 0xae3e(%rip), %xmm1     # 0x103c0
movsd 0xae46(%rip), %xmm3     # 0x103d0
movapd %xmm3, %xmm6
cmpnlesd %xmm4, %xmm6
movapd %xmm4, %xmm7
addsd %xmm1, %xmm7
movsd 0xae25(%rip), %xmm4     # 0x103c8
mulsd %xmm4, %xmm7
andpd %xmm6, %xmm7
andnpd %xmm5, %xmm6
orpd %xmm7, %xmm6
mulsd 0xadb5(%rip), %xmm6     # 0x10370
movsd %xmm6, (%rdi)
movapd %xmm0, %xmm5
mulsd %xmm0, %xmm5
mulsd %xmm0, %xmm5
movapd %xmm3, %xmm6
cmpnlesd %xmm0, %xmm6
addsd %xmm1, %xmm0
mulsd %xmm4, %xmm0
andpd %xmm6, %xmm0
andnpd %xmm5, %xmm6
orpd %xmm0, %xmm6
movlpd %xmm6, (%rsi)
movapd %xmm2, %xmm0
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm1
cmpnlesd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
mulsd 0xad5f(%rip), %xmm3     # 0x10378
movsd %xmm3, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Xyz2Luv(double*, double*, double*, double, double, double)
void Xyz2Luv(num *L, num *u, num *v, num X, num Y, num Z)
{	
	num u1, v1, Denom;
	

	if((Denom = X + 15*Y + 3*Z) > 0)
	{
		u1 = (4*X) / Denom;
		v1 = (9*Y) / Denom;
	}
	else
		u1 = v1 = 0;

	Y /= WHITEPOINT_Y;
	Y = LABF(Y);
	*L = 116*Y - 16;
	*u = 13*(*L)*(u1 - WHITEPOINT_U);
	*v = 13*(*L)*(v1 - WHITEPOINT_V);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movapd %xmm1, %xmm3
movapd %xmm0, %xmm1
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movsd 0xad98(%rip), %xmm0     # 0x103d8
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
mulsd 0xac40(%rip), %xmm2     # 0x10290
addsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jbe 0x567c
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd 0xaee6(%rip), %xmm1     # 0x10550
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm1
addpd 0xaec6(%rip), %xmm1     # 0x10540
jmp 0x5684
movapd 0xaebc(%rip), %xmm1     # 0x10540
ucomisd 0xacf4(%rip), %xmm3     # 0x10380
jae 0x56a0
mulsd 0xacfa(%rip), %xmm3     # 0x10390
addsd 0xacfa(%rip), %xmm3     # 0x10398
jmp 0x56bf
movapd %xmm1, (%rsp)
movsd 0xacdb(%rip), %xmm1     # 0x10388
movapd %xmm3, %xmm0
callq 0x2280
movapd (%rsp), %xmm1
movapd %xmm0, %xmm3
mulsd 0xacd9(%rip), %xmm3     # 0x103a0
addsd 0xaa01(%rip), %xmm3     # 0x100d0
movsd %xmm3, (%r14)
movsd 0xad04(%rip), %xmm0     # 0x103e0
mulsd %xmm0, %xmm3
mulsd %xmm1, %xmm3
movsd %xmm3, (%r15)
mulsd (%r14), %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
mulsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Luv2Xyz(double*, double*, double*, double, double, double)
void Luv2Xyz(num *X, num *Y, num *Z, num L, num u, num v)
{
	*Y = (L + 16)/116;
	*Y = WHITEPOINT_Y*LABINVF(*Y);
	
	if(L != 0)
	{
		u /= L;
		v /= L;
	}
	
	u = u/13 + WHITEPOINT_U;
	v = v/13 + WHITEPOINT_V;
	*X = (*Y) * ((9*u)/(4*v));
	*Z = (*Y) * ((3 - 0.75*u)/v - 5);
}

// Assembly:
movsd 0xa98c(%rip), %xmm4     # 0x10098
addsd %xmm0, %xmm4
divsd 0xac88(%rip), %xmm4     # 0x103a0
movapd %xmm4, %xmm5
mulsd %xmm4, %xmm5
mulsd %xmm4, %xmm5
movsd 0xac94(%rip), %xmm6     # 0x103c0
addsd %xmm4, %xmm6
mulsd 0xac90(%rip), %xmm6     # 0x103c8
movsd 0xac90(%rip), %xmm3     # 0x103d0
cmpnlesd %xmm4, %xmm3
movapd %xmm3, %xmm4
andnpd %xmm5, %xmm4
andpd %xmm6, %xmm3
orpd %xmm4, %xmm3
movlpd %xmm3, (%rsi)
xorpd %xmm4, %xmm4
cmpneqsd %xmm0, %xmm4
movq %xmm4, %rax
andl $0x1, %eax
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movd %eax, %xmm2
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
pslld $0x1f, %xmm2
psrad $0x1f, %xmm2
movdqa %xmm2, %xmm4
pandn %xmm1, %xmm4
divpd %xmm0, %xmm1
andpd %xmm2, %xmm1
orpd %xmm4, %xmm1
divpd 0xadbf(%rip), %xmm1     # 0x10560
addpd 0xadc7(%rip), %xmm1     # 0x10570
movapd 0xadcf(%rip), %xmm0     # 0x10580
mulpd %xmm1, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
divsd %xmm2, %xmm0
mulsd %xmm3, %xmm0
movsd 0xac1b(%rip), %xmm2     # 0x103e8
mulsd %xmm1, %xmm2
addsd 0xaab7(%rip), %xmm2     # 0x10290
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
divsd %xmm1, %xmm2
addsd 0xac07(%rip), %xmm2     # 0x103f0
movsd %xmm0, (%rdi)
mulsd (%rsi), %xmm2
movsd %xmm2, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: Xyz2Lch(double*, double*, double*, double, double, double)
void Xyz2Lch(num *L, num *C, num *H, num X, num Y, num Z)
{
	num a, b;
	
	
	Xyz2Lab(L, &a, &b, X, Y, Z);
	*C = sqrt(a*a + b*b);
	*H = atan2(b, a)*180.0/M_PI;
	
	if(*H < 0)
		*H += 360;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x540d
movsd (%r15), %xmm1
movsd (%r12), %xmm0
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
sqrtsd %xmm3, %xmm2
movsd %xmm2, (%r14)
callq 0x2060
mulsd 0xaba7(%rip), %xmm0     # 0x103f8
divsd 0xaba7(%rip), %xmm0     # 0x10400
movsd 0xaa0f(%rip), %xmm1     # 0x10270
addsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
movlpd %xmm3, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/colorspace.h
// Function: ApplyColorTransform(colortransform, double*, double*, double*, double, double, double)
void ApplyColorTransform(colortransform Trans, 
	num *D0, num *D1, num *D2, num S0, num S1, num S2)
{
	switch(Trans.NumStages)
	{
	case 1:
		Trans.Fun[0](D0, D1, D2, S0, S1, S2);
		break;
	case 2:
		{
			num T0, T1, T2;
			Trans.Fun[0](&T0, &T1, &T2, S0, S1, S2);
			Trans.Fun[1](D0, D1, D2, T0, T1, T2);
		}
		break;
	default:
		*D0 = S0;
		*D1 = S1;
		*D2 = S2;
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x50(%rsp), %r12
movl (%r12), %eax
cmpl $0x2, %eax
je 0x6267
cmpl $0x1, %eax
jne 0x62a1
movq 0x8(%r12), %rax
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq %rsp, %rdi
leaq 0x10(%rsp), %r13
leaq 0x8(%rsp), %rbp
movq %r13, %rsi
movq %rbp, %rdx
callq *0x8(%r12)
movq %rsp, %rax
movsd (%rax), %xmm0
movsd (%r13), %xmm1
movsd (%rbp), %xmm2
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq *0x10(%r12)
jmp 0x62af
movsd %xmm0, (%r15)
movsd %xmm1, (%r14)
movsd %xmm2, (%rbx)
addq $0x18, %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_to_bw(char const*, char const*, int, int)
void ImageProc::color_to_bw(const char *infile, const char *outfile, int width, int height)
{
	Image img_color("color", width, height);	//object for input color image
	Image img_bw("bw", width, height);			//object for output b-&-w image

	img_color.read_image(infile, img_color.cols, img_color.rows);	//reading input image from file

	for(int i = 0; i < img_bw.rows; i++)
		for(int j = 0; j < img_bw.cols; j++)
			for(int k = 0; k < img_bw.channels; k++)
				img_bw.setvalue(i,j,k,((img_color.getvalue(i,j,0)*0.21)\
									  +(img_color.getvalue(i,j,1)*0.72)\
									  +(img_color.getvalue(i,j,2)*0.07))); //using Luminosity formula: grayscale_value = 0.21*R + 0.72*G + 0.07*B

	img_bw.write_image(outfile, img_bw.cols, img_bw.rows);	//writing image to output file
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
leaq 0xa3e8(%rip), %rsi      # 0x106c8
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x3fd6
leaq 0xb3c0(%rip), %rsi      # 0x116b4
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x3fd6
movl 0x8(%r12), %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4032
movl 0x8(%r13), %eax
movl 0xc(%r13), %ecx
movl 0x10(%r13), %edx
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edi
movq 0x18(%r13), %r8
xorl %r9d, %r9d
testl %edx, %edx
movl $0x0, %r10d
cmovgl %edx, %r10d
testl %eax, %eax
movl $0x0, %r11d
cmovgl %eax, %r11d
testl %ecx, %ecx
cmovlel %r9d, %ecx
movl %ecx, 0xc(%rsp)
imull %edx, %eax
movl %eax, 0x4(%rsp)
movsd 0xa130(%rip), %xmm0     # 0x10498
movsd 0xa130(%rip), %xmm1     # 0x104a0
movsd 0xa130(%rip), %xmm2     # 0x104a8
xorl %r14d, %r14d
cmpl 0xc(%rsp), %r14d
je 0x63f9
movl %r14d, %r15d
imull 0x8(%rsp), %r15d
movl %r9d, %r12d
xorl %r13d, %r13d
cmpq %r11, %r13
je 0x63ef
movslq %r12d, %rbx
addq %r8, %rbx
leal (%r15,%r13), %eax
imull %edi, %eax
movslq %eax, %rbp
xorl %eax, %eax
cmpq %rax, %r10
je 0x63e7
movzbl (%rsi,%rbp), %ecx
cvtsi2sd %ecx, %xmm3
movzbl 0x1(%rsi,%rbp), %ecx
cvtsi2sd %ecx, %xmm4
mulsd %xmm0, %xmm4
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movzbl 0x2(%rsi,%rbp), %ecx
cvtsi2sd %ecx, %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %ecx
movb %cl, (%rbx,%rax)
incq %rax
jmp 0x63a8
incq %r13
addl %edx, %r12d
jmp 0x6391
incl %r14d
addl 0x4(%rsp), %r9d
jmp 0x637b
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x411c
addq $0x58, %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::oil_painting(char const*, char const*, int, int, int)
void ImageProc::oil_painting(const char *infile, const char *outfile, int width, int height, int window_size)
{
	Image img_orig("color", width, height);
	Image img_oil("color", width, height);

	img_orig.read_image(infile, img_orig.cols, img_orig.rows);
	oil_paint_filter(img_orig, img_oil, window_size);

	img_oil.write_image(outfile, img_oil.cols, img_oil.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 0x9ba8(%rip), %r13      # 0x106c8
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 0x6b7c
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::film_special_effect(char const*, char const*, int, int)
void ImageProc::film_special_effect(const char *infile, const char *outfile, int width, int height)
{
	Image img_orig("color", width, height);
	Image img_film("color", width, height);

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

	img_film.write_image(outfile, img_film.cols, img_film.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 0x984f(%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 0x6ed0
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::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
xorl %eax, %eax
movl $0x1, %ecx
movl 0xc(%rsi), %edx
cmpl %edx, %eax
jge 0x6f3e
xorl %edx, %edx
xorl %r8d, %r8d
cmpl 0x8(%rsi), %r8d
jge 0x6f38
xorl %r9d, %r9d
movl 0x10(%rsi), %r10d
cmpl %r10d, %r9d
jge 0x6f31
movl 0x8(%rdi), %r11d
imull %ecx, %r11d
addl %edx, %r11d
imull 0x10(%rdi), %r11d
movslq %r11d, %r11
addq 0x18(%rdi), %r11
movb (%r9,%r11), %r11b
notb %r11b
movl 0x8(%rsi), %ebx
imull %eax, %ebx
addl %r8d, %ebx
imull %ebx, %r10d
movslq %r10d, %r10
addq 0x18(%rsi), %r10
movb %r11b, (%r9,%r10)
incq %r9
jmp 0x6eed
incl %r8d
decl %edx
jmp 0x6ee4
incl %eax
incl %ecx
jmp 0x6ed8
movsd 0x964a(%rip), %xmm0     # 0x10590
movsd %xmm0, -0x10(%rsp)
movl $0x3f20a0a1, -0x8(%rsp) # imm = 0x3F20A0A1
xorl %eax, %eax
leaq 0x9733(%rip), %rcx      # 0x10690
cmpl %edx, %eax
jge 0x6fc3
xorl %edx, %edx
cmpl 0x8(%rsi), %edx
jge 0x6fbc
movq %rcx, %rdi
xorl %r8d, %r8d
movslq 0x10(%rsi), %r9
cmpq %r9, %r8
jge 0x6fb8
movl 0x8(%rsi), %r10d
imull %eax, %r10d
addl %edx, %r10d
imull %r9d, %r10d
movslq %r10d, %r9
addq 0x18(%rsi), %r9
movzbl (%r8,%r9), %r10d
cvtsi2ss %r10d, %xmm0
cvtsi2ssl (%rdi), %xmm1
mulss -0x10(%rsp,%r8,4), %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %r10d
movb %r10b, (%r8,%r9)
incq %r8
addq $0x4, %rdi
jmp 0x6f6e
incl %edx
jmp 0x6f63
incl %eax
movl 0xc(%rsi), %edx
jmp 0x6f5d
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x82f2
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leal (%rbx,%r14), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %r12d
movl %eax, %edx
callq 0x82a0
leal 0x1(%r12), %esi
movq %r15, %rdi
movl %ebx, %edx
callq 0x82a0
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r12d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x840c
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8317
sarl %esi
movslq %esi, %rax
movl -0x4(%rdi,%rax,4), %ecx
addl (%rdi,%rax,4), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x7e16(%rip), %xmm0     # 0x10128
cvttsd2si %xmm0, %eax
retq
pushq $0x2
popq %rcx
movl %esi, %eax
cltd
idivl %ecx
cltq
movl (%rdi,%rax,4), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
movl 0x8(%rdi), %edx
movl 0xc(%rdi), %eax
movq 0x18(%rsi), %r8
movl 0x8(%rsi), %ebp
movq %rsi, 0x10(%rsp)
movl 0x10(%rsi), %r9d
movq 0x18(%rdi), %r10
movl 0x10(%rdi), %edi
xorl %r11d, %r11d
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
movq %rcx, (%rsp)
testl %eax, %eax
cmovlel %r11d, %eax
imull %edi, %edx
movl %ebp, 0xc(%rsp)
imull %r9d, %ebp
xorps %xmm0, %xmm0
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl %eax, %r15d
je 0x83ca
movl %r11d, %r12d
movl %r14d, %r13d
movq (%rsp), %rbx
subq $0x1, %rbx
jb 0x83bf
movslq %r12d, %r12
movzbl (%r8,%r12), %esi
movslq %r13d, %r13
movzbl (%r10,%r13), %ecx
subl %ecx, %esi
cvtsi2sd %esi, %xmm2
mulsd %xmm2, %xmm2
cvtss2sd %xmm0, %xmm1
addsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm0
addl %edi, %r13d
addl %r9d, %r12d
jmp 0x838b
incl %r15d
addl %edx, %r14d
addl %ebp, %r11d
jmp 0x837c
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
imull 0xc(%rax), %ecx
cvtsi2ss %ecx, %xmm1
divss %xmm1, %xmm0
movss %xmm0, (%rsp)
movq 0xcbe5(%rip), %rdi      # 0x14fd0
callq 0x2100
movq %rax, %rdi
callq 0x20c0
movss (%rsp), %xmm0
addq $0x18, %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::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 %rbx
subq $0x48, %rsp
movabsq $0x100000000, %r9       # imm = 0x100000000
leal 0x1(%rcx), %r11d
movslq %esi, %rax
movq %rax, %r8
shlq $0x20, %r8
leaq (%rsp,%rax,4), %r10
addq $-0x80, %r10
cmpl %ecx, %esi
movslq %esi, %rsi
jg 0x8471
cmpl %edx, %r11d
jg 0x8471
movl (%rdi,%rsi,4), %ebx
movslq %r11d, %r14
movl (%rdi,%r14,4), %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl %ebp, %ebx
setge %r14b
setl %r15b
cmovll %ebx, %ebp
addl %r15d, %esi
addl %r14d, %r11d
movl %ebp, (%r10)
addq %r9, %r8
addq $0x4, %r10
jmp 0x8436
movslq %r11d, %r11
movslq %ecx, %rcx
cmpq %rcx, %rsi
jg 0x848e
movl (%rdi,%rsi,4), %ebx
movl %ebx, (%r10)
incq %rsi
addq %r9, %r8
addq $0x4, %r10
jmp 0x8477
movslq %edx, %rcx
cmpq %rcx, %r11
jg 0x84a9
movl (%rdi,%r11,4), %edx
movl %edx, (%r10)
incq %r11
addq %r9, %r8
addq $0x4, %r10
jmp 0x8491
sarq $0x20, %r8
cmpq %r8, %rax
jge 0x84be
movl -0x80(%rsp,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
incq %rax
jmp 0x84ad
addq $0x48, %rsp
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_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 0x7a85(%rip), %rbx      # 0x106c8
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3fd6
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x3fd6
movq %rbp, %rdi
movq %r13, %rsi
callq 0x4032
movq %rbp, %rdi
movq %r14, %rsi
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x90(%rsp), %r8d
movl 0x98(%rsp), %r9d
callq 0x8cb4
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x411c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop