LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageReal.cpp
// Function: ImageReal::rot90CW()
void ImageReal::rot90CW()
{
	ImageReal temp(width_, height_);
	Float_t *tempImgPtr = temp.img_;
	for (int y = 0; y < height_; y++)
		for (int x = 0; x < width_; x++)
			*tempImgPtr++ = img_[((height_ - 1) - x) * width_ + y];
	*this = temp;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movl 0x28(%rdi), %esi
movl 0x2c(%rdi), %edx
movq %rsp, %rdi
callq 0xcfba
movslq 0x2c(%rbx), %rax
testq %rax, %rax
jle 0xd327
movl 0x28(%rbx), %ecx
movslq %ecx, %rdx
leaq -0x1(%rax), %rsi
imulq %rdx, %rsi
shlq $0x3, %rsi
addq 0x38(%rbx), %rsi
movq 0x38(%rsp), %rdi
shlq $0x3, %rdx
negq %rdx
xorl %r8d, %r8d
movq %rcx, %r9
movq %rsi, %r10
testl %ecx, %ecx
jle 0xd31b
movsd (%r10), %xmm0
movsd %xmm0, (%rdi)
addq $0x8, %rdi
addq %rdx, %r10
decq %r9
jne 0xd306
incq %r8
addq $0x8, %rsi
cmpq %rax, %r8
jne 0xd2fc
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcf72
movq %rsp, %rdi
callq 0xd038
addq $0x40, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xd038
movq %rbx, %rdi
callq 0x3500
nop
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageReal.cpp
// Function: ImageReal::rot180()
void ImageReal::rot180()
{
	Float_t temp;
	int halfTotalPixels = totalPixels_ / 2;
	for (int i = 0; i < halfTotalPixels; i++)
	{
		temp = img_[i];
		img_[i] = img_[(totalPixels_ - 1) - i];
		img_[(totalPixels_ - 1) - i] = temp;
	}
}

// Assembly:
movslq 0x30(%rdi), %rdx
cmpq $0x2, %rdx
jl 0xd391
movl %edx, %eax
shrl %eax
movq 0x38(%rdi), %rcx
leaq (%rcx,%rdx,8), %rdx
addq $-0x8, %rdx
negq %rax
xorl %esi, %esi
movsd (%rcx), %xmm0
movsd (%rdx,%rsi,8), %xmm1
movsd %xmm1, (%rcx)
movsd %xmm0, (%rdx,%rsi,8)
addq $0x8, %rcx
decq %rsi
cmpq %rsi, %rax
jne 0xd373
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageReal.cpp
// Function: ImageReal::rot90CCW()
void ImageReal::rot90CCW()
{
	ImageReal temp(width_, height_);
	Float_t *tempImgPtr = temp.img_;
	for (int y = 0; y < height_; y++)
		for (int x = 0; x < width_; x++)
			*tempImgPtr++ = img_
				[x * width_ + ((width_ - 1) - y)];
	*this = temp;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movl 0x28(%rdi), %esi
movl 0x2c(%rdi), %edx
movq %rsp, %rdi
callq 0xcfba
movslq 0x2c(%rbx), %rax
testq %rax, %rax
jle 0xd3fa
movq 0x38(%rsp), %rcx
movl 0x28(%rbx), %edx
movq 0x38(%rbx), %rdi
movslq %edx, %rsi
leaq (%rdi,%rsi,8), %rdi
addq $-0x8, %rdi
shlq $0x3, %rsi
xorl %r8d, %r8d
movq %rdx, %r9
movq %rdi, %r10
testl %edx, %edx
jle 0xd3ee
movsd (%r10), %xmm0
movsd %xmm0, (%rcx)
addq $0x8, %rcx
addq %rsi, %r10
decq %r9
jne 0xd3d9
incq %r8
addq $-0x8, %rdi
cmpq %rax, %r8
jne 0xd3cf
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcf72
movq %rsp, %rdi
callq 0xd038
addq $0x40, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xd038
movq %rbx, %rdi
callq 0x3500
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageReal.cpp
// Function: ImageReal::downsample(ImageReal&, int, int) const
void ImageReal::downsample(ImageReal &imageOut, int startX, int startY) const
{
	assert(width_ % 2 == 0 && height_ % 2 == 0);
	
	int	widthOut = width_ / 2, heightOut = height_ / 2;
	if (imageOut.width() != widthOut || imageOut.height() != heightOut)
		imageOut.resize(widthOut, heightOut);
	
	int imageOutIdx = 0;
	for (int y = startY; y < height_; y += 2)
		for (int x = startX; x < width_; x += 2, ++imageOutIdx)
			imageOut[imageOutIdx] = img_[y * width_ + x];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movl 0x28(%rdi), %esi
testb $0x1, %sil
jne 0xd4da
movq %rdi, %r14
movl 0x2c(%rdi), %r8d
testb $0x1, %r8b
jne 0xd4da
movl %ecx, %ebp
movl %edx, %ebx
sarl %esi
movl %r8d, %edx
sarl %edx
cmpl %esi, 0x28(%r15)
jne 0xd465
cmpl %edx, 0x2c(%r15)
je 0xd472
movq (%r15), %rax
movq %r15, %rdi
callq *0x28(%rax)
movl 0x2c(%r14), %r8d
cmpl %ebp, %r8d
jle 0xd4cf
movslq 0x28(%r14), %rax
movq 0x38(%r15), %rcx
movslq %ebx, %rdx
movslq %ebp, %rsi
movq %rax, %rdi
imulq %rsi, %rdi
shlq $0x3, %rdi
addq 0x38(%r14), %rdi
movslq %r8d, %r8
movq %rax, %r9
shlq $0x4, %r9
xorl %r10d, %r10d
movq %rdx, %r11
cmpl %ebx, %eax
jle 0xd4c3
movsd (%rdi,%r11,8), %xmm0
movl %r10d, %r14d
movsd %xmm0, (%rcx,%r14,8)
addq $0x2, %r11
incl %r10d
cmpq %rax, %r11
jl 0xd4a8
addq $0x2, %rsi
addq %r9, %rdi
cmpq %r8, %rsi
jl 0xd4a1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1daff(%rip), %rdi     # 0x2afe0
leaq 0x1db1c(%rip), %rsi     # 0x2b004
leaq 0x1db23(%rip), %rcx     # 0x2b012
movl $0xbc, %edx
callq 0x31c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageReal.cpp
// Function: ImageReal::upsample(ImageReal&, int, int) const
void ImageReal::upsample(ImageReal &imageOut, int startX, int startY) const
{
	assert(width_ % 2 == 0 && height_ % 2 == 0);
	
	int widthOut = width_ * 2, heightOut = height_ * 2;
	if (imageOut.width() != widthOut || imageOut.height() != heightOut)
		imageOut.resize(widthOut, heightOut);
	
	int imageInIdx = 0;
	for (int y = startY; y < heightOut; y += 2)
		for (int x = startX; x < widthOut; x += 2, ++imageInIdx)
			imageOut[y * widthOut + x] = img_[imageInIdx];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x28(%rdi), %r13d
testb $0x1, %r13b
jne 0xd5ba
movl 0x2c(%rdi), %r14d
testb $0x1, %r14b
jne 0xd5ba
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r12
leal (,%r13,2), %r15d
addl %r14d, %r14d
cmpl %r15d, 0x28(%rsi)
jne 0xd540
cmpl %r14d, 0x2c(%r12)
je 0xd558
movq (%r12), %rax
movq %rdi, (%rsp)
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq *0x28(%rax)
movq (%rsp), %rdi
cmpl %ebx, %r14d
jle 0xd5ab
movq 0x38(%rdi), %rax
movq 0x38(%r12), %rcx
movl %r13d, %edx
imull %ebx, %edx
addl %edx, %edx
shll $0x2, %r13d
xorl %esi, %esi
cmpl %ebp, %r15d
jle 0xd5a0
movslq %esi, %rdi
leaq (%rax,%rdi,8), %rdi
movl %ebp, %r8d
movsd (%rdi), %xmm0
leal (%rdx,%r8), %r9d
movsd %xmm0, (%rcx,%r9,8)
addl $0x2, %r8d
addq $0x8, %rdi
incl %esi
cmpl %r15d, %r8d
jl 0xd583
addl $0x2, %ebx
addl %r13d, %edx
cmpl %r14d, %ebx
jl 0xd574
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1da1f(%rip), %rdi     # 0x2afe0
leaq 0x1da3c(%rip), %rsi     # 0x2b004
leaq 0x1da7b(%rip), %rcx     # 0x2b04a
movl $0xcd, %edx
callq 0x31c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/Image3ChnlReal.cpp
// Function: Image3ChnlReal::Image3ChnlReal(Image3ChnlReal const&)
Image3ChnlReal::Image3ChnlReal(const Image3ChnlReal &ir)
{
	img_.push_back(new ImageReal());
	img_.push_back(new ImageReal());
	img_.push_back(new ImageReal());
	
	*this = ir;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
callq 0xca94
leaq 0x28ca2(%rip), %rax     # 0x36d08
movq %rax, (%rbx)
leaq 0x38(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movq $0x0, 0x48(%rbx)
movl $0x40, %edi
callq 0x3300
movq %rax, %r12
movq %rax, %rdi
callq 0xcf0c
movq %rsp, %rsi
movq %r12, (%rsi)
movq %r14, %rdi
callq 0xf04c
movl $0x40, %edi
callq 0x3300
movq %rax, %r12
movq %rax, %rdi
callq 0xcf0c
movq %rsp, %rsi
movq %r12, (%rsi)
movq %r14, %rdi
callq 0xf04c
movl $0x40, %edi
callq 0x3300
movq %rax, %r12
movq %rax, %rdi
callq 0xcf0c
movq %rsp, %rsi
movq %r12, (%rsi)
movq %r14, %rdi
callq 0xf04c
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe140
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xe118
jmp 0xe102
jmp 0xe102
movq %rax, %r15
movl $0x40, %esi
movq %r12, %rdi
callq 0x3310
jmp 0xe11b
jmp 0xe118
jmp 0xe118
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0xe12f
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x3310
movq %rbx, %rdi
callq 0xcbce
movq %r15, %rdi
callq 0x3500
nop
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/Image3ChnlReal.cpp
// Function: Image3ChnlReal::operator=(Image3ChnlReal const&)
const Image3ChnlReal& Image3ChnlReal::operator=(const Image3ChnlReal &ir)
{
	if (&ir == this)
		return *this;
	
	ImageInterface::operator=(ir);
	
	resize(ir.width_, ir.height_);
	*img_[0] = *ir.img_[0];
	*img_[1] = *ir.img_[1];
	*img_[2] = *ir.img_[2];
	
	return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rdi, %rsi
je 0xe1a5
movq %rsi, %r14
movq %rbx, %rdi
callq 0xcbf6
movl 0x28(%r14), %esi
movl 0x2c(%r14), %edx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movq 0x38(%r14), %rax
movq (%rax), %rsi
movq 0x38(%rbx), %rax
movq (%rax), %rdi
callq 0xcf72
movq 0x38(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0xcf72
movq 0x38(%r14), %rax
movq 0x10(%rax), %rsi
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0xcf72
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/Image3ChnlReal.cpp
// Function: Image3ChnlReal::~Image3ChnlReal()
Image3ChnlReal::~Image3ChnlReal()
{
	assert(img_.size() == 3);
	delete img_[0];
	delete img_[1];
	delete img_[2];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x28a57(%rip), %rax     # 0x36d08
movq %rax, (%rdi)
movq 0x38(%rdi), %rdi
movq 0x40(%rbx), %rax
subq %rdi, %rax
cmpq $0x18, %rax
jne 0xe320
movq (%rdi), %rax
testq %rax, %rax
je 0xe2da
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movq 0x38(%rbx), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0xe2f0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movq 0x38(%rbx), %rdi
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0xe30b
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xe317
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x3310
movq %rbx, %rdi
popq %rbx
jmp 0xcbce
leaq 0x1cf4a(%rip), %rdi     # 0x2b271
leaq 0x1cf54(%rip), %rsi     # 0x2b282
leaq 0x1cf60(%rip), %rcx     # 0x2b295
movl $0x2f, %edx
callq 0x31c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/Image3ChnlReal.cpp
// Function: Image3ChnlReal::operator==(Image3ChnlReal const&) const
bool Image3ChnlReal::operator==(const Image3ChnlReal &im) const
{
	if (&im == this)
		return true;
	
	if (!(ImageInterface::operator==(im)))
		return false;
	
	if (*img_[0] != *im.img_[0])
		return false;
	if (*img_[1] != *im.img_[1])
		return false;
	if (*img_[2] != *im.img_[2])
		return false;
	
	return true;
}

// Assembly:
cmpq %rdi, %rsi
je 0xe3aa
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0xcc2e
testb %al, %al
je 0xe3a0
movq 0x38(%r14), %rax
movq (%rax), %rdi
movq 0x38(%rbx), %rax
movq (%rax), %rsi
callq 0xd0b8
testb %al, %al
jne 0xe3a0
movq 0x38(%r14), %rax
movq 0x8(%rax), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0xd0b8
testb %al, %al
je 0xe3ad
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movb $0x1, %al
retq
movq 0x38(%r14), %rax
movq 0x10(%rax), %rdi
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0xd0b8
xorb $0x1, %al
jmp 0xe3a2
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/Image3ChnlReal.cpp
// Function: Image3ChnlReal::resize(int, int)
bool Image3ChnlReal::resize(int width, int height)
{
	if (!ImageInterface::resize(width, height))
	{
		erase();
		return false;
	}
	
	assert(img_.size() == 3);
	
	img_[0]->resize(width_, height_);
	img_[1]->resize(width_, height_);
	img_[2]->resize(width_, height_);
	
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xceec
movl %eax, %ebx
testb %al, %al
je 0xe43c
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
subq %rax, %rcx
cmpq $0x18, %rcx
jne 0xe44e
movq (%rax), %rdi
movl 0x28(%r14), %esi
movl 0x2c(%r14), %edx
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x38(%r14), %rax
movq 0x8(%rax), %rdi
movl 0x28(%r14), %esi
movl 0x2c(%r14), %edx
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x38(%r14), %rax
movq 0x10(%rax), %rdi
movl 0x28(%r14), %esi
movl 0x2c(%r14), %edx
movq (%rdi), %rax
callq *0x28(%rax)
jmp 0xe444
movq %r14, %rdi
callq 0xe46e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1ce1c(%rip), %rdi     # 0x2b271
leaq 0x1ce26(%rip), %rsi     # 0x2b282
leaq 0x1ce5c(%rip), %rcx     # 0x2b2bf
movl $0x63, %edx
callq 0x31c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/DebayerProcs.cpp
// Function: bilinear_procOnePixel(ImageReal&, Image3ChnlReal&, int, int)
void bilinear_procOnePixel(
	ImageReal &grayImage, Image3ChnlReal &rgbImage,
	int x, int y)
{
	Color color = determineBayerColor(x, y);
	
	Float_t color1 = 0, color2 = 0;
	bilinear_calcMissingColors(grayImage, rgbImage, x, y, color1, color2);
	
	//Fill in the output
	Float_t bayerValue = grayImage(x, y);
	switch (color)
	{
		case R:
			rgbImage(R, x, y) = bayerValue;
			rgbImage(G, x, y) = color1;
			rgbImage(B, x, y) = color2;
			break;
		case G:
			rgbImage(R, x, y) = color1;
			rgbImage(G, x, y) = bayerValue;
			rgbImage(B, x, y) = color2;
			break;
		case B:
			rgbImage(R, x, y) = color1;
			rgbImage(G, x, y) = color2;
			rgbImage(B, x, y) = bayerValue;
			break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r12
movl %edx, %edi
movl %ecx, %esi
callq 0x23198
movl %eax, %r15d
xorl %eax, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
leaq 0x10(%rsp), %r9
movq %rax, (%r9)
movq %r12, %rdi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xf495
movq 0x38(%r12), %rax
movl 0x28(%r12), %ecx
imull %ebx, %ecx
addl %ebp, %ecx
movsd (%rax,%rcx,8), %xmm0
cmpl $0x2, %r15d
je 0xfbc0
cmpl $0x1, %r15d
je 0xfb70
testl %r15d, %r15d
jne 0xfc2a
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %ebx, %ecx
movsd %xmm0, (%rsp)
callq 0xe49a
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0xfb99
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %ebx, %ecx
movsd %xmm0, (%rsp)
callq 0xe49a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
movl $0x1, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xe49a
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0xfc10
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %ebx, %ecx
movsd %xmm0, (%rsp)
callq 0xe49a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
movl $0x1, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xe49a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
movl $0x2, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xe49a
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/DebayerProcs.cpp
// Function: hue_constructGreenChannel(ImageReal&, Image3ChnlReal&, int, int)
void hue_constructGreenChannel(
	ImageReal &grayImage, Image3ChnlReal &rgbImage,
	int x, int y)
{
	assert(determineBayerColor(x, y) != G);
	
	int width = grayImage.width(), height = grayImage.height();
	
	Float_t colorL = 0;
	int divisor = 0;
	if (y > 0)
	{
		colorL += grayImage(x, y - 1);
		divisor++;
	}
	if (x < width - 1)
	{
		colorL += grayImage(x + 1, y);
		divisor++;
	}
	if (y < height - 1)
	{
		colorL += grayImage(x, y + 1);
		divisor++;
	}
	if (x > 0)
	{
		colorL += grayImage(x - 1, y);
		divisor++;
	}
	assert(divisor > 0);
	
	rgbImage(G, x, y) = (Float_t)colorL / (Float_t)divisor;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
movl %edx, %edi
movl %ecx, %esi
callq 0x23198
cmpl $0x1, %eax
je 0xfd70
movl 0x28(%r12), %ecx
testl %ebx, %ebx
jle 0xfcd9
leal -0x1(%rbx), %eax
movq 0x38(%r12), %rdx
imull %ecx, %eax
addl %r14d, %eax
xorpd %xmm1, %xmm1
addsd (%rdx,%rax,8), %xmm1
movl $0x1, %eax
jmp 0xfcdf
xorl %eax, %eax
xorpd %xmm1, %xmm1
movl 0x2c(%r12), %edx
leal -0x1(%rcx), %esi
cmpl %r14d, %esi
jle 0xfd02
movq 0x38(%r12), %rsi
movl %ecx, %edi
imull %ebx, %edi
addl %r14d, %edi
incl %edi
addsd (%rsi,%rdi,8), %xmm1
incl %eax
decl %edx
cmpl %ebx, %edx
jle 0xfd1d
leal 0x1(%rbx), %edx
movq 0x38(%r12), %rsi
imull %ecx, %edx
addl %r14d, %edx
addsd (%rsi,%rdx,8), %xmm1
incl %eax
testl %r14d, %r14d
jle 0xfd38
movq 0x38(%r12), %rdx
imull %ebx, %ecx
addl %r14d, %ecx
decl %ecx
addsd (%rdx,%rcx,8), %xmm1
incl %eax
jmp 0xfd3c
testl %eax, %eax
je 0xfd8f
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq %r15, %rdi
movl $0x1, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0xe49a
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b7f3(%rip), %rdi     # 0x2b56a
leaq 0x1b732(%rip), %rsi     # 0x2b4b0
leaq 0x1b804(%rip), %rcx     # 0x2b589
movl $0x156, %edx            # imm = 0x156
callq 0x31c0
leaq 0x1b769(%rip), %rdi     # 0x2b4ff
leaq 0x1b713(%rip), %rsi     # 0x2b4b0
leaq 0x1b7e5(%rip), %rcx     # 0x2b589
movl $0x170, %edx            # imm = 0x170
callq 0x31c0
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/DebayerProcs.cpp
// Function: bayer(Image3ChnlReal, ImageReal&)
void bayer(Image3ChnlReal rgbImage, ImageReal &grayImage)
{
	cout << endl << "Bayerizing..." << endl;
	
	int width = rgbImage.width(), height = rgbImage.height();
	
	if (grayImage.width() != rgbImage.width() || grayImage.height() != rgbImage.height())
		die("Bayer output isn't same size as bayer input");
	
	for (int y = 0; y < height; y++)
		for (int x = 0; x < width; x++)
		{
			Color color = determineBayerColor(x, y);
			switch (color)
			{
				case R:
					grayImage(x, y) = rgbImage(R, x, y);
					break;
				case G:
					grayImage(x, y) = rgbImage(G, x, y);
					break;
				case B:
					grayImage(x, y) = rgbImage(B, x, y);
					break;
			}
		}
	
	grayImage.setFilename(rgbImage.filename());
	grayImage.appendFilename("_b");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x2534e(%rip), %r15     # 0x36fd0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq %rax, %r15
leaq 0x19dd0(%rip), %rsi     # 0x2ba83
movl $0xd, %edx
movq %rax, %rdi
callq 0x3360
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movl 0x28(%r14), %r12d
movl 0x2c(%r14), %r13d
cmpl %r12d, 0x28(%rbx)
jne 0x11cfb
cmpl %r13d, 0x2c(%rbx)
je 0x11d07
leaq 0x19d50(%rip), %rdi     # 0x2ba52
callq 0x403c
testl %r13d, %r13d
jle 0x11d59
xorl %ebp, %ebp
testl %r12d, %r12d
jle 0x11d52
xorl %r15d, %r15d
movl %r15d, %edi
movl %ebp, %esi
callq 0x23198
cmpl $0x2, %eax
ja 0x11d4a
movq %r14, %rdi
movl %eax, %esi
movl %r15d, %edx
movl %ebp, %ecx
callq 0xe49a
movsd (%rax), %xmm0
movq 0x38(%rbx), %rax
movl 0x28(%rbx), %ecx
imull %ebp, %ecx
addl %r15d, %ecx
movsd %xmm0, (%rax,%rcx,8)
incl %r15d
cmpl %r15d, %r12d
jne 0x11d16
incl %ebp
cmpl %r13d, %ebp
jne 0x11d0e
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa92c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xce40
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11d9c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19cd2(%rip), %rsi     # 0x2ba7e
leaq 0x19ccd(%rip), %rdx     # 0x2ba80
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0xa9c2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xce5a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x11de2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3310
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
jmp 0x11e03
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11e13
movq (%r15), %rsi
incq %rsi
callq 0x3310
movq %rbx, %rdi
callq 0x3500
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: xyz2rgb(double, double, double, double&, double&, double&)
void xyz2rgb(Float_t x, Float_t y, Float_t z,
			Float_t &r, Float_t &g, Float_t &b)
{
	r = x *  3.240479 + y * -1.537150 + z * -0.498535;
	g = x * -0.969256 + y *  1.875992 + z *  0.041556;
	b = x *  0.055648 + y * -0.204043 + z *  1.057311;
	
	if (r < 0)
		r = 0;
	else if (r > 1)
		r = 1;
	
	if (g < 0)
		g = 0;
	else if (g > 1)
		g = 1;
	
	if (b < 0)
		b = 0;
	else if (b > 1)
		b = 1;
}

// Assembly:
movsd 0x19818(%rip), %xmm3    # 0x2bb20
mulsd %xmm1, %xmm3
movsd 0x19814(%rip), %xmm4    # 0x2bb28
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x1980c(%rip), %xmm3    # 0x2bb30
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, (%rdi)
movsd 0x19800(%rip), %xmm3    # 0x2bb38
mulsd %xmm1, %xmm3
movsd 0x197fc(%rip), %xmm4    # 0x2bb40
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x197f4(%rip), %xmm3    # 0x2bb48
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
mulsd 0x197ec(%rip), %xmm1    # 0x2bb50
movsd %xmm3, (%rsi)
mulsd 0x197e8(%rip), %xmm0    # 0x2bb58
addsd %xmm1, %xmm0
mulsd 0x197e4(%rip), %xmm2    # 0x2bb60
addsd %xmm0, %xmm2
movsd %xmm2, (%rdx)
movsd (%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x123a0
movsd 0x17cbe(%rip), %xmm0    # 0x2a058
ucomisd %xmm0, %xmm1
jbe 0x123a4
movsd %xmm0, (%rdi)
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x123c0
movsd 0x17c9e(%rip), %xmm0    # 0x2a058
ucomisd %xmm0, %xmm1
jbe 0x123c4
movsd %xmm0, (%rsi)
movsd (%rdx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x123e0
movsd 0x17c7e(%rip), %xmm0    # 0x2a058
ucomisd %xmm0, %xmm1
jbe 0x123e4
movsd %xmm0, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: xyz2cielab(double, double, double, double&, double&, double&)
void xyz2cielab(Float_t x, Float_t y, Float_t z,
				Float_t &l, Float_t &a, Float_t &b)
{
	//assert(x >= 0 && x <= 1);
	//assert(y >= 0 && y <= 1);
	//assert(z >= 0 && z <= 1);
	
	//----------------------------------------------------------------------
	
	//Taken from http://www.easyrgb.com/math.php
	//and http://en.wikipedia.org/wiki/SRGB_color_space
	//and http://www.mediamacros.com/item/item-1006687658/
	//and http://www.cs.rit.edu/~ncs/color/t_convert.html
	
	//Two degree D65 white point tristimulus values
	x /= 95.047;
	y /= 100.0;
	z /= 108.883;
	
	if (x > 0.008856)
		x = pow(x, 1.0 / 3.0);
	else x = (7.787 * x) + (16.0 / 116.0);
	if (y > 0.008856)
		y = pow(y, 1.0 / 3.0);
	else y = (7.787 * y) + (16.0 / 116.0);
	if (z > 0.008856)
		z = pow(z, 1.0 / 3.0);
	else z = (7.787 * z) + (16.0 / 116.0);
	
	//This resource ( http://www.cs.rit.edu/~ncs/color/t_convert.html ) computes l like this:
	if (y > 0.008856)
		l = (116.0 * y) - 16.0;
	else l = 903.3 * y;
	//l = (116 * y) - 16;
	a = 500.0 * (x - y);
	b = 200.0 * (y - z);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movapd %xmm1, %xmm4
divsd 0x19765(%rip), %xmm0    # 0x2bb68
divsd 0x19765(%rip), %xmm4    # 0x2bb70
movapd %xmm2, %xmm5
ucomisd 0x19769(%rip), %xmm0    # 0x2bb80
jbe 0x12440
movsd 0x19777(%rip), %xmm1    # 0x2bb98
movsd %xmm4, 0x10(%rsp)
movsd %xmm5, 0x8(%rsp)
callq 0x34f0
movsd 0x8(%rsp), %xmm5
movsd 0x10(%rsp), %xmm4
jmp 0x12450
mulsd 0x19740(%rip), %xmm0    # 0x2bb88
addsd 0x19740(%rip), %xmm0    # 0x2bb90
divsd 0x19720(%rip), %xmm5    # 0x2bb78
ucomisd 0x19720(%rip), %xmm4    # 0x2bb80
movsd %xmm0, 0x18(%rsp)
jbe 0x1248b
movsd 0x19728(%rip), %xmm1    # 0x2bb98
movapd %xmm4, %xmm0
movsd %xmm5, 0x8(%rsp)
callq 0x34f0
movsd 0x8(%rsp), %xmm5
movapd %xmm0, %xmm4
jmp 0x1249b
mulsd 0x196f5(%rip), %xmm4    # 0x2bb88
addsd 0x196f5(%rip), %xmm4    # 0x2bb90
ucomisd 0x196dd(%rip), %xmm5    # 0x2bb80
jbe 0x124c8
movsd 0x196eb(%rip), %xmm1    # 0x2bb98
movapd %xmm5, %xmm0
movsd %xmm4, 0x10(%rsp)
callq 0x34f0
movsd 0x10(%rsp), %xmm4
movapd %xmm0, %xmm5
jmp 0x124d8
mulsd 0x196b8(%rip), %xmm5    # 0x2bb88
addsd 0x196b8(%rip), %xmm5    # 0x2bb90
movsd 0x196c0(%rip), %xmm0    # 0x2bba0
movsd 0x196c0(%rip), %xmm1    # 0x2bba8
mulsd %xmm4, %xmm1
addsd 0x196bc(%rip), %xmm1    # 0x2bbb0
mulsd %xmm4, %xmm0
movsd 0x19680(%rip), %xmm2    # 0x2bb80
cmpltsd %xmm4, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm0, %xmm3
andpd %xmm1, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, (%r15)
movsd 0x18(%rsp), %xmm0
subsd %xmm4, %xmm0
mulsd 0x1968c(%rip), %xmm0    # 0x2bbb8
movsd %xmm0, (%r14)
subsd %xmm5, %xmm4
mulsd 0x19683(%rip), %xmm4    # 0x2bbc0
movsd %xmm4, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: cielab2xyz(double, double, double, double&, double&, double&)
void cielab2xyz(Float_t l, Float_t a, Float_t b,
				Float_t &x, Float_t &y, Float_t &z)
{
	y = (l + 16.0) / 116.0;
	x = a / 500.0 + y;
	z = y - b / 200.0;
	
	if (pow(y, 3) > .008856)
		y = pow(y, 3);
	else y = (y - 16.0 / 116.0) / 7.787;
	if (pow(x, 3) > .008856)
		x = pow(x, 3);
	else x = (x - 16.0 / 116.0) / 7.787;
	if (pow(z, 3) > .008856)
		z = pow(z, 3);
	else z = (z - 16.0 / 116.0) / 7.787;
	
	x *= 95.047;
	y *= 100.0;
	z *= 108.883;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addsd 0x19667(%rip), %xmm0    # 0x2bbc8
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
divpd 0x19723(%rip), %xmm1    # 0x2bc90
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movhpd %xmm1, (%rsi)
addsd %xmm1, %xmm0
movsd %xmm0, (%rdi)
divsd 0x19647(%rip), %xmm2    # 0x2bbd0
addsd (%rsi), %xmm2
movsd %xmm2, (%rdx)
movsd (%rsi), %xmm0
movsd 0x1963b(%rip), %xmm1    # 0x2bbd8
callq 0x34f0
ucomisd 0x195d6(%rip), %xmm0    # 0x2bb80
movsd (%r14), %xmm0
jbe 0x125c0
movsd 0x1961f(%rip), %xmm1    # 0x2bbd8
callq 0x34f0
jmp 0x125d0
addsd 0x19618(%rip), %xmm0    # 0x2bbe0
divsd 0x195b8(%rip), %xmm0    # 0x2bb88
movsd %xmm0, (%r14)
movsd (%r15), %xmm0
movsd 0x195f6(%rip), %xmm1    # 0x2bbd8
callq 0x34f0
ucomisd 0x19591(%rip), %xmm0    # 0x2bb80
movsd (%r15), %xmm0
jbe 0x12605
movsd 0x195da(%rip), %xmm1    # 0x2bbd8
callq 0x34f0
jmp 0x12615
addsd 0x195d3(%rip), %xmm0    # 0x2bbe0
divsd 0x19573(%rip), %xmm0    # 0x2bb88
movsd %xmm0, (%r15)
movsd (%rbx), %xmm0
movsd 0x195b2(%rip), %xmm1    # 0x2bbd8
callq 0x34f0
ucomisd 0x1954d(%rip), %xmm0    # 0x2bb80
movsd (%rbx), %xmm0
jbe 0x12648
movsd 0x19597(%rip), %xmm1    # 0x2bbd8
callq 0x34f0
jmp 0x12658
addsd 0x19590(%rip), %xmm0    # 0x2bbe0
divsd 0x19530(%rip), %xmm0    # 0x2bb88
movsd %xmm0, (%rbx)
movsd (%r15), %xmm0
mulsd 0x194ff(%rip), %xmm0    # 0x2bb68
movsd %xmm0, (%r15)
movsd (%r14), %xmm0
mulsd 0x194f5(%rip), %xmm0    # 0x2bb70
movsd %xmm0, (%r14)
movsd (%rbx), %xmm0
mulsd 0x194ec(%rip), %xmm0    # 0x2bb78
movsd %xmm0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: calcNonoutlierMeanPixelValue(ImageReal&, double)
Float_t calcNonoutlierMeanPixelValue(ImageReal &grayImage, Float_t outlierSigmas)
{
	int totalPixels = grayImage.totalPixels();
	
	//Find the mean pixel value
	Float_t meanVal = 0;
	for (int i = 0; i < totalPixels; i++)
		meanVal += grayImage[i];
	meanVal /= totalPixels;
	
	//Find the variance of pixel value
	Float_t variance = 0;
	for (int i = 0; i < totalPixels; i++)
		variance += pow(grayImage[i] - meanVal, 2);
	variance /= (totalPixels * 3);
	
	//Find the standard deviation of pixel value
	Float_t stddev = sqrt(variance);
	
	//Define outliers as some number of standard deviations
	Float_t minOutlier = meanVal - stddev * outlierSigmas;
	Float_t maxOutlier = meanVal + stddev * outlierSigmas;
	
	//Find the mean pixel value of nonoutliers
	Float_t nonOutlierMeanVal = 0;
	int numNonOutliers = 0;
		for (int i = 0; i < totalPixels; i++)
			if (grayImage[i] >= minOutlier && grayImage[i] <= maxOutlier)
			{
				nonOutlierMeanVal += grayImage[i];
				numNonOutliers++;
			}
	nonOutlierMeanVal /= numNonOutliers;
	
	return nonOutlierMeanVal;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movapd %xmm0, %xmm2
movq %rdi, %rbx
movslq 0x30(%rdi), %r14
testq %r14, %r14
jle 0x139b8
movq 0x38(%rbx), %rax
xorpd %xmm3, %xmm3
xorl %ecx, %ecx
addsd (%rax,%rcx,8), %xmm3
incq %rcx
cmpq %rcx, %r14
jne 0x13975
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
divsd %xmm0, %xmm3
testl %r14d, %r14d
jle 0x139cb
movq 0x38(%rbx), %rax
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm1
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rcx
cmpq %rcx, %r14
jne 0x1399d
jmp 0x139cf
cvtsi2sd %r14d, %xmm1
xorpd %xmm0, %xmm0
xorpd %xmm3, %xmm3
divsd %xmm1, %xmm3
jmp 0x139cf
xorpd %xmm0, %xmm0
leal (%r14,%r14,2), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x139ee
sqrtsd %xmm0, %xmm0
jmp 0x13a0b
movsd %xmm2, 0x10(%rsp)
movsd %xmm3, 0x8(%rsp)
callq 0x3240
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
testl %r14d, %r14d
jle 0x13a6d
mulsd %xmm2, %xmm0
movapd %xmm3, %xmm2
subsd %xmm0, %xmm2
addsd %xmm3, %xmm0
movq 0x38(%rbx), %rax
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
xorl %edx, %edx
movsd (%rax,%rcx,8), %xmm3
movapd %xmm2, %xmm4
cmplepd %xmm3, %xmm4
movapd %xmm3, %xmm5
cmplepd %xmm0, %xmm5
andpd %xmm4, %xmm5
movq %xmm5, %rsi
testb $0x1, %sil
je 0x13a56
addsd %xmm3, %xmm1
subl %esi, %edx
incq %rcx
cmpq %rcx, %r14
jne 0x13a2c
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
divsd %xmm0, %xmm1
jmp 0x13a75
movsd 0x1818b(%rip), %xmm1    # 0x2bc00
movapd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: calcNonoutlierMeanPixelValue(Image3ChnlReal&, double)
Float_t calcNonoutlierMeanPixelValue(Image3ChnlReal &rgbImage, Float_t outlierSigmas)
{
	int totalPixels = rgbImage.totalPixels();
	
	//Find the mean pixel value
	Float_t meanVal = 0;
	for (int c = 0; c < 3; c++)
		for (int i = 0; i < totalPixels; i++)
			meanVal += (*rgbImage[c])[i];
	meanVal /= (totalPixels * 3);
	
	//Find the variance of pixel value
	Float_t variance = 0;
	for (int c = 0; c < 3; c++)
		for (int i = 0; i < totalPixels; i++)
			variance += pow((*rgbImage[c])[i] - meanVal, 2);
	variance /= (totalPixels * 3);
	
	//Find the standard deviation of pixel value
	Float_t stddev = sqrt(variance);
	
	//Define outliers as some number of standard deviations
	Float_t minOutlier = meanVal - stddev * outlierSigmas;
	Float_t maxOutlier = meanVal + stddev * outlierSigmas;
	
	//Find the mean pixel value of nonoutliers
	Float_t nonOutlierMeanVal = 0;
	int numNonOutliers = 0;
	for (int c = 0; c < 3; c++)
		for (int i = 0; i < totalPixels; i++)
			if ((*rgbImage[c])[i] >= minOutlier && (*rgbImage[c])[i] <= maxOutlier)
			{
				nonOutlierMeanVal += (*rgbImage[c])[i];
				numNonOutliers++;
			}
	nonOutlierMeanVal /= numNonOutliers;
	
	return nonOutlierMeanVal;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movapd %xmm0, %xmm3
movq %rdi, %rbx
movl 0x30(%rdi), %r14d
movq 0x38(%rdi), %rax
xorpd %xmm4, %xmm4
xorl %ecx, %ecx
testl %r14d, %r14d
jle 0x13ab9
movq (%rax,%rcx,8), %rdx
movq 0x38(%rdx), %rdx
xorl %esi, %esi
addsd (%rdx,%rsi,8), %xmm4
incq %rsi
cmpq %rsi, %r14
jne 0x13aac
incq %rcx
cmpq $0x3, %rcx
jne 0x13a9d
leal (%r14,%r14,2), %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm4
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
testl %r14d, %r14d
jle 0x13afc
movq (%rax,%rcx,8), %rdx
movq 0x38(%rdx), %rdx
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm2
subsd %xmm4, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %r14
jne 0x13ae3
incq %rcx
cmpq $0x3, %rcx
jne 0x13ad4
divsd %xmm1, %xmm0
xorpd %xmm5, %xmm5
ucomisd %xmm5, %xmm0
jb 0x13b19
sqrtsd %xmm0, %xmm0
jmp 0x13b3a
movsd %xmm3, 0x10(%rsp)
movsd %xmm4, 0x8(%rsp)
callq 0x3240
xorpd %xmm5, %xmm5
movsd 0x8(%rsp), %xmm4
movsd 0x10(%rsp), %xmm3
mulsd %xmm3, %xmm0
movapd %xmm4, %xmm1
subsd %xmm0, %xmm1
addsd %xmm4, %xmm0
movq 0x38(%rbx), %rax
xorl %ecx, %ecx
xorl %edx, %edx
testl %r14d, %r14d
jle 0x13b96
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsi), %rsi
xorl %edi, %edi
movsd (%rsi,%rdi,8), %xmm2
movapd %xmm1, %xmm3
cmplepd %xmm2, %xmm3
movapd %xmm2, %xmm4
cmplepd %xmm0, %xmm4
andpd %xmm3, %xmm4
movq %xmm4, %r8
testb $0x1, %r8b
je 0x13b8b
addsd %xmm2, %xmm5
subl %r8d, %edx
incq %rdi
cmpq %rdi, %r14
jne 0x13b61
incq %rcx
cmpq $0x3, %rcx
jne 0x13b52
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
divsd %xmm0, %xmm5
movapd %xmm5, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: assertValidDims(int, int)
bool assertValidDims(int width, int height)
{
	int numOnes = 0;
	for (int bitPos = 0; bitPos < sizeof(int) * 8; bitPos++)
		if (width & (1 << bitPos))
			++numOnes;
	if (width < 16 || numOnes != 1)
		return false;
	
	numOnes = 0;
	for (int bitPos = 0; bitPos < sizeof(int) * 8; bitPos++)
		if (height & (1 << bitPos))
			++numOnes;
	if (height < 16 || numOnes != 1)
		return false;
	
	return true;
}

// Assembly:
movd %edi, %xmm0
pshufd $0x0, %xmm0, %xmm3      # xmm3 = xmm0[0,0,0,0]
pxor %xmm2, %xmm2
movdqa 0x13e17(%rip), %xmm4    # 0x2cba0
movl $0x20, %eax
movaps 0x13e1b(%rip), %xmm0    # 0x2cbb0
movdqa 0x13e23(%rip), %xmm1    # 0x2cbc0
pshuflw $0xfe, %xmm4, %xmm5     # xmm5 = xmm4[2,3,3,3,4,5,6,7]
movdqa %xmm3, %xmm6
psrld %xmm5, %xmm6
pshuflw $0x54, %xmm4, %xmm5     # xmm5 = xmm4[0,1,1,1,4,5,6,7]
movdqa %xmm3, %xmm7
psrld %xmm5, %xmm7
punpcklqdq %xmm6, %xmm7    # xmm7 = xmm7[0],xmm6[0]
pshufd $0xee, %xmm4, %xmm5     # xmm5 = xmm4[2,3,2,3]
pshuflw $0xfe, %xmm5, %xmm6     # xmm6 = xmm5[2,3,3,3,4,5,6,7]
movdqa %xmm3, %xmm8
psrld %xmm6, %xmm8
pshuflw $0x54, %xmm5, %xmm5     # xmm5 = xmm5[0,1,1,1,4,5,6,7]
movdqa %xmm3, %xmm6
psrld %xmm5, %xmm6
punpckhqdq %xmm8, %xmm6    # xmm6 = xmm6[1],xmm8[1]
shufps $0xcc, %xmm6, %xmm7     # xmm7 = xmm7[0,3],xmm6[0,3]
andps %xmm0, %xmm7
paddd %xmm7, %xmm2
paddd %xmm1, %xmm4
addl $-0x4, %eax
jne 0x18d9d
xorl %eax, %eax
cmpl $0x10, %edi
jl 0x18eb5
pshufd $0xee, %xmm2, %xmm3     # xmm3 = xmm2[2,3,2,3]
paddd %xmm2, %xmm3
pshufd $0x55, %xmm3, %xmm2     # xmm2 = xmm3[1,1,1,1]
paddd %xmm3, %xmm2
movd %xmm2, %ecx
cmpl $0x1, %ecx
jne 0x18eb5
movd %esi, %xmm2
pshufd $0x0, %xmm2, %xmm3      # xmm3 = xmm2[0,0,0,0]
pxor %xmm2, %xmm2
movdqa 0x13d6c(%rip), %xmm4    # 0x2cba0
movl $0x20, %eax
pshuflw $0xfe, %xmm4, %xmm5     # xmm5 = xmm4[2,3,3,3,4,5,6,7]
movdqa %xmm3, %xmm6
psrld %xmm5, %xmm6
pshuflw $0x54, %xmm4, %xmm5     # xmm5 = xmm4[0,1,1,1,4,5,6,7]
movdqa %xmm3, %xmm7
psrld %xmm5, %xmm7
punpcklqdq %xmm6, %xmm7    # xmm7 = xmm7[0],xmm6[0]
pshufd $0xee, %xmm4, %xmm5     # xmm5 = xmm4[2,3,2,3]
pshuflw $0xfe, %xmm5, %xmm6     # xmm6 = xmm5[2,3,3,3,4,5,6,7]
movdqa %xmm3, %xmm8
psrld %xmm6, %xmm8
pshuflw $0x54, %xmm5, %xmm5     # xmm5 = xmm5[0,1,1,1,4,5,6,7]
movdqa %xmm3, %xmm6
psrld %xmm5, %xmm6
punpckhqdq %xmm8, %xmm6    # xmm6 = xmm6[1],xmm8[1]
shufps $0xcc, %xmm6, %xmm7     # xmm7 = xmm7[0,3],xmm6[0,3]
andps %xmm0, %xmm7
paddd %xmm7, %xmm2
paddd %xmm1, %xmm4
addl $-0x4, %eax
jne 0x18e39
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
paddd %xmm2, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %eax
cmpl $0x10, %esi
setge %cl
cmpl $0x1, %eax
sete %al
andb %cl, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: doFourierAnalysis(double const*, double*, int, int)
bool doFourierAnalysis(const Float_t *grayImage, Float_t *fourierTransform, int width, int height)
{
	if (!assertValidDims(width, height))
		return false;
	
	int err = fft2dInit(log2(height), log2(width));
	if (err != 0)
		return false;
	
	if (!fourierTransform)
		fourierTransform = new Float_t(width * height * sizeof(Float_t));
	if (fourierTransform != grayImage)
		memcpy(fourierTransform, grayImage, width * height * sizeof(Float_t));
	rfft2d(fourierTransform, log2(height), log2(width));
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %edi
movl %ecx, %esi
callq 0x18d74
testb %al, %al
je 0x19522
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x3510
cvttsd2si %xmm0, %r12
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd %xmm0, (%rsp)
callq 0x3510
cvttsd2si %xmm0, %rsi
movq %r12, %rdi
callq 0x233f4
testl %eax, %eax
je 0x19531
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %rbx, %rbx
jne 0x19574
movl $0x8, %edi
callq 0x3300
movq %rax, %rbx
movl %ebp, %eax
imull %r15d, %eax
cltq
shlq $0x3, %rax
movq %rax, %xmm0
punpckldq 0x10ac4(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x10acc(%rip), %xmm0    # 0x2a030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
cmpq %r14, %rbx
je 0x1958f
imull %r15d, %ebp
movslq %ebp, %rdx
shlq $0x3, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3260
movsd 0x8(%rsp), %xmm0
callq 0x3510
cvttsd2si %xmm0, %r14
movsd (%rsp), %xmm0
callq 0x3510
cvttsd2si %xmm0, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23e14
movb $0x1, %al
jmp 0x19524
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: doFourierAnalysis(ImageReal const&, ImageReal&)
bool doFourierAnalysis(const ImageReal &grayImage, ImageReal &fourierTransform)
{
	int width = grayImage.width(), height = grayImage.height();
	
	if (!assertValidDims(width, height))
		return false;
	
	int err = fft2dInit(log2(height), log2(width));
	if (err != 0)
		return false;
	
	fourierTransform = grayImage;
	rfft2d(fourierTransform.img(), log2(height), log2(width));
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x28(%rdi), %ebp
movl 0x2c(%rdi), %r15d
movl %ebp, %edi
movl %r15d, %esi
callq 0x18d74
testb %al, %al
je 0x1961d
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x3510
cvttsd2si %xmm0, %r15
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x3510
cvttsd2si %xmm0, %rsi
movq %r15, %rdi
callq 0x233f4
testl %eax, %eax
je 0x1962a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcf72
movq 0x38(%rbx), %rbx
movsd 0x10(%rsp), %xmm0
callq 0x3510
cvttsd2si %xmm0, %r14
movsd 0x8(%rsp), %xmm0
callq 0x3510
cvttsd2si %xmm0, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23e14
movb $0x1, %al
jmp 0x1961f
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: multiplyFourierTransforms(double*, double*, int, int, double*)
bool multiplyFourierTransforms(Float_t *ft1, Float_t *ft2,
	int width, int height, Float_t *prod)
{
	if (!assertValidDims(width, height))
		return false;
	
	if (!prod)
		prod = new Float_t[width * height];
	rspect2dprod(ft1, ft2, prod, height, width);
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r13
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %edi
movl %ecx, %esi
callq 0x18d74
movl %eax, %ebx
testb %al, %al
je 0x196cc
testq %r13, %r13
jne 0x196b8
movl %r12d, %eax
imull %ebp, %eax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, %r13
movslq %r12d, %rcx
movslq %ebp, %r8
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x24487
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: multiplyFourierTransformsAndInvert(double*, double*, int, int, double*)
bool multiplyFourierTransformsAndInvert(Float_t *ft1, Float_t *ft2,
	int width, int height, Float_t *convolvedImg)
{
	if (!multiplyFourierTransforms(ft1, ft2, width, height, convolvedImg))
		return false;
	
	int err = fft2dInit(log2(height), log2(width));
	if (err != 0)
		return false;
	
	//Invert the Fourier Transform
	rifft2d(convolvedImg, log2(height), log2(width));
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %ebp
callq 0x19668
testb %al, %al
je 0x1972d
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x3510
cvttsd2si %xmm0, %r14
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, (%rsp)
callq 0x3510
cvttsd2si %xmm0, %rsi
movq %r14, %rdi
callq 0x233f4
testl %eax, %eax
je 0x19738
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movsd 0x8(%rsp), %xmm0
callq 0x3510
cvttsd2si %xmm0, %r14
movsd (%rsp), %xmm0
callq 0x3510
cvttsd2si %xmm0, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24141
movb $0x1, %al
jmp 0x1972f
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: convolveImageWithFilter(double*, double*, int, int, double*)
bool convolveImageWithFilter(Float_t *img, Float_t *filterFT,
	int width, int height, Float_t *imgConv)
{
	if (!assertValidDims(width, height))
		return false;
	
	//Get the Fourier Transform of the image
	Float_t *imgFT = new Float_t[width * height];
	assert(doFourierAnalysis(img, imgFT, width, height));
	
	//Multiplty the Fourier Transforms and invert the FT
	return multiplyFourierTransformsAndInvert(imgFT, filterFT, width, height, imgConv);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
movl %edx, %edi
movl %ecx, %esi
callq 0x18d74
testb %al, %al
je 0x197e4
movl %ebp, %eax
imull %r14d, %eax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x194c7
testb %al, %al
je 0x197f5
movq %r13, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x196dd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13487(%rip), %rdi     # 0x2cc83
leaq 0x133e8(%rip), %rsi     # 0x2cbeb
leaq 0x134a6(%rip), %rcx     # 0x2ccb0
movl $0xfa, %edx
callq 0x31c0
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: embedImageInPow2Bounds(ImageReal const&, int, int, ImageReal&, int&, int&)
bool embedImageInPow2Bounds(const ImageReal &img, int newWidth, int newHeight, ImageReal &imgOut, int &offsetX, int &offsetY)
{
	if (!assertValidDims(newWidth, newHeight))
		return false;
	
	imgOut.resize(newWidth, newHeight);
	int width = img.width(), height = img.height();
	offsetX = (newWidth - width) / 2;
	offsetY = (newHeight - height) / 2;
	
	//By default, an embedded odd-length signal will be positioned such that the center pixel
	//resides at lower right, but I prefer that it be at upper left, so shift it by one.
	if (width % 2 == 1)
		offsetX++;
	if (height % 2 == 1)
		offsetY++;
	
	for (int y = 0; y < height; y++)
		for (int x = 0; x < width; x++)
			imgOut(x + offsetX, y + offsetY) = img(x, y);
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r14
movq %rcx, %r12
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r13
movl %esi, %edi
movl %edx, %esi
callq 0x18d74
movb %al, 0x7(%rsp)
testb %al, %al
je 0x198f5
movq (%r12), %rax
movq %r12, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq *0x28(%rax)
movl 0x28(%r13), %eax
movl 0x2c(%r13), %ecx
subl %eax, %ebx
movl %ebx, %edx
shrl $0x1f, %edx
addl %ebx, %edx
sarl %edx
movl %edx, (%r14)
subl %ecx, %ebp
movl %ebp, %edx
shrl $0x1f, %edx
addl %ebp, %edx
sarl %edx
movl %edx, (%r15)
movl %eax, %edx
andl $0x80000001, %edx       # imm = 0x80000001
cmpl $0x1, %edx
jne 0x19886
incl (%r14)
movl %ecx, %edx
andl $0x80000001, %edx       # imm = 0x80000001
cmpl $0x1, %edx
jne 0x19898
incl (%r15)
jmp 0x1989c
testl %ecx, %ecx
jle 0x198f5
movq 0x38(%r13), %rdx
movl 0x28(%r13), %esi
movq 0x38(%r12), %rdi
movl 0x28(%r12), %r8d
movl (%r15), %r9d
imull %r8d, %r9d
addl (%r14), %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
movq %rax, %rbx
movl %r10d, %ebp
movl %r9d, %r14d
testl %eax, %eax
jle 0x198e7
movl %ebp, %r15d
movsd (%rdx,%r15,8), %xmm0
movl %r14d, %r15d
movsd %xmm0, (%rdi,%r15,8)
incl %r14d
incl %ebp
decq %rbx
jne 0x198cb
incl %r11d
addl %r8d, %r9d
addl %esi, %r10d
cmpl %ecx, %r11d
jne 0x198be
movb 0x7(%rsp), %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: embedImageInPow2Bounds(Image3ChnlReal const&, int, int, Image3ChnlReal&, int&, int&)
bool embedImageInPow2Bounds(const Image3ChnlReal &img, int newWidth, int newHeight, Image3ChnlReal &imgOut, int &offsetX, int &offsetY)
{
	if (!assertValidDims(newWidth, newHeight))
		return false;
	
	imgOut.resize(newWidth, newHeight);
	int width = img.width(), height = img.height();
	offsetX = (newWidth - width) / 2;
	offsetY = (newHeight - height) / 2;
	
	//By default, an embedded odd-length signal will be positioned such that the center pixel
	//resides at lower right, but I prefer that it be at upper left, so shift it by one.
	if (width % 2 == 1)
		offsetX++;
	if (height % 2 == 1)
		offsetY++;
	
	for (int c = 0; c < 3; c++)
		for (int y = 0; y < height; y++)
			for (int x = 0; x < width; x++)
				(*imgOut[c])(x + offsetX, y + offsetY) = (*img[c])(x, y);
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
movl %edx, %r13d
movl %esi, %ebp
movq %rdi, %r12
movl %esi, %edi
movl %edx, %esi
callq 0x18d74
movb %al, 0xf(%rsp)
testb %al, %al
je 0x19a2b
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
movl %ebp, %esi
movl %r13d, %edx
callq *0x28(%rax)
movl 0x28(%r12), %r14d
movl 0x2c(%r12), %ecx
subl %r14d, %ebp
movl %ebp, %eax
shrl $0x1f, %eax
addl %ebp, %eax
sarl %eax
movq 0x10(%rsp), %rdx
movl %eax, (%rdx)
subl %ecx, %r13d
movl %r13d, %eax
shrl $0x1f, %eax
addl %r13d, %eax
sarl %eax
movq 0x18(%rsp), %rdx
movl %eax, (%rdx)
movl %r14d, %eax
andl $0x80000001, %eax       # imm = 0x80000001
cmpl $0x1, %eax
jne 0x19998
movq 0x10(%rsp), %rax
incl (%rax)
movl %ecx, %eax
andl $0x80000001, %eax       # imm = 0x80000001
cmpl $0x1, %eax
jne 0x199ab
movq 0x18(%rsp), %rax
incl (%rax)
xorl %edx, %edx
testl %ecx, %ecx
jle 0x19a22
movq 0x38(%r12), %rsi
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x10(%rsp), %rax
movl (%rax), %r8d
movq 0x18(%rsp), %rax
movl (%rax), %r9d
xorl %r10d, %r10d
testl %r14d, %r14d
jle 0x19a17
movq (%rsi,%rdx,8), %rax
movq 0x38(%rax), %r11
movq (%rdi,%rdx,8), %rbx
movq 0x38(%rbx), %r13
movl 0x28(%rbx), %ebp
imull %r9d, %ebp
addl %r8d, %ebp
movl 0x28(%rax), %ebx
imull %r10d, %ebx
movq %r14, %rax
movl %ebx, %r15d
movsd (%r11,%r15,8), %xmm0
movl %ebp, %r15d
movsd %xmm0, (%r13,%r15,8)
incl %ebp
incl %ebx
decq %rax
jne 0x199fb
incl %r10d
incl %r9d
cmpl %ecx, %r10d
jne 0x199d2
incq %rdx
cmpq $0x3, %rdx
jne 0x199ad
movb 0xf(%rsp), %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FourierTransform.cpp
// Function: cropImage(ImageReal const&, int, int, int, int, ImageReal&)
void cropImage(const ImageReal &img, int newWidth, int newHeight, int offsetX, int offsetY, ImageReal &imgOut)
{
	int width = img.width(), height = img.height();
	assert(offsetX + newWidth <= width && offsetY + newHeight <= height);
	
	imgOut.resize(newWidth, newHeight);
	
	for (int y = 0; y < newHeight; y++)
		for (int x = 0; x < newWidth; x++)
			imgOut(x, y) = img(x + offsetX, y + offsetY);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %esi, %r15d
leal (%rbx,%r15), %eax
cmpl 0x28(%rdi), %eax
jg 0x19ae8
movl %r8d, %r12d
movl %edx, %r14d
movq %rdi, %rbp
leal (%r12,%r14), %eax
cmpl 0x2c(%rdi), %eax
jg 0x19ae8
movq %r9, %r13
movq (%r9), %rax
movq %r9, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq *0x28(%rax)
testl %r14d, %r14d
jle 0x19ad9
movq 0x38(%rbp), %rax
movl 0x28(%rbp), %ecx
movq 0x38(%r13), %rdx
movl 0x28(%r13), %esi
movl %r15d, %edi
imull %ecx, %r12d
addl %r12d, %ebx
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %rdi, %r10
movl %r8d, %r11d
movl %ebx, %ebp
testl %r15d, %r15d
jle 0x19acc
movl %ebp, %r12d
movsd (%rax,%r12,8), %xmm0
movl %r11d, %r12d
movsd %xmm0, (%rdx,%r12,8)
incl %ebp
incl %r11d
decq %r10
jne 0x19ab0
incl %r9d
addl %ecx, %ebx
addl %esi, %r8d
cmpl %r14d, %r9d
jne 0x19aa3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13209(%rip), %rdi     # 0x2ccf8
leaq 0x130f5(%rip), %rsi     # 0x2cbeb
leaq 0x13238(%rip), %rcx     # 0x2cd35
movl $0x134, %edx            # imm = 0x134
callq 0x31c0