LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::init_forgy()
void Cloud::init_forgy()
{
    /*!
     * @brief Initializes the centers of this cloud using Forgy method,
	 * that is it samples the centers uniformly from the data points
     */

	// we will pick points from our data 
	int* availablePoints = new int [this->n] ();
	for (int i = 0; i < this->n; i ++){
		availablePoints[i] = 1;
	}

	// we must know what we've chosen so far
	int* chosenPoints = new int [this->k] ();
	int leftCenters = this->k;

	while (leftCenters > 0){
		int randomPoint = rand() % this->n;

		if (availablePoints[randomPoint] > 0){
			availablePoints[randomPoint] = 0;
			chosenPoints[this->k - leftCenters] = randomPoint;
			leftCenters -= 1;
		}
	}

	// we just have to build our centers now!
	Point c;
	for (int i = 0; i < this->k; i ++){
		c.label = i;

		for (int j = 0; j < this->d; j ++){
			c.coords[j] = points[chosenPoints[i]].coords[j];
		}

		this->set_center(c, i);
	}

	delete[] availablePoints;
	availablePoints = NULL;
	delete[] chosenPoints;
	chosenPoints = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movslq 0x4(%rdi), %r12
leaq (,%r12,4), %r14
testq %r12, %r12
movq $-0x1, %rbp
cmovsq %rbp, %r14
movq %r14, %rdi
callq 0x3030
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3130
testq %r12, %r12
jle 0xe9ab
xorl %eax, %eax
movl $0x1, (%rbx,%rax,4)
incq %rax
cmpq %rax, %r12
jne 0xe99c
movslq 0x8(%r15), %r13
leaq (,%r13,4), %r12
testq %r13, %r13
cmovsq %rbp, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
testq %r13, %r13
jle 0xea0b
callq 0x30a0
cltd
idivl 0x4(%r15)
movslq %edx, %rax
cmpl $0x0, (%rbx,%rax,4)
jle 0xea06
movl $0x0, (%rbx,%rax,4)
movslq 0x8(%r15), %rcx
movslq %r13d, %r13
subq %r13, %rcx
movl %eax, (%r14,%rcx,4)
decl %r13d
testl %r13d, %r13d
jg 0xe9db
leaq 0x8(%rsp), %rdi
callq 0x3a20
movslq 0x8(%r15), %rax
testq %rax, %rax
jle 0xea8f
movl (%r15), %ecx
movq 0x10(%r15), %rdx
movq 0x8(%rsp), %rsi
movq 0x18(%r15), %rdi
xorl %r9d, %r9d
movq %r9, %r8
testl %ecx, %ecx
jle 0xea5b
movslq (%r14,%r8,4), %r9
shlq $0x4, %r9
movq (%rdx,%r9), %r9
xorl %r10d, %r10d
movsd (%r9,%r10,8), %xmm0
movsd %xmm0, (%rsi,%r10,8)
incq %r10
cmpq %r10, %rcx
jne 0xea47
testl %ecx, %ecx
jle 0xea81
movq %r8, %r9
shlq $0x4, %r9
movq (%rdi,%r9), %r9
xorl %r10d, %r10d
movsd (%rsi,%r10,8), %xmm0
movsd %xmm0, (%r9,%r10,8)
incq %r10
cmpq %r10, %rcx
jne 0xea6d
leaq 0x1(%r8), %r9
cmpq %rax, %r9
jne 0xea31
movl %r8d, 0x10(%rsp)
movq %rbx, %rdi
callq 0x3360
movq %r14, %rdi
callq 0x3360
leaq 0x8(%rsp), %rdi
callq 0x3a6e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::init_bounding_box()
void Cloud::init_bounding_box()
{
    /*!
     * @brief Initializes the centers of this cloud by using a bounding box over 
	 * all the points
     */

	double* minBox = new double [this->d] ();
	double* maxBox = new double [this->d] ();
	for (int i = 0; i < this->d; i ++){
		minBox[i] = DBL_MAX;
		maxBox[i] = DBL_MIN;
	}

	for (int i = 0; i < this->n; i ++){
		for (int j = 0; j < this->d; j ++){
			if (points[i].coords[j] < minBox[j]){
				minBox[j] = points[i].coords[j];
			}
			if (points[i].coords[j] > maxBox[j]){
				maxBox[j] = points[i].coords[j];
			}
		}
	}

	Point center;
	for (int i = 0; i < this->k; i ++){
		center.label = i;

		for (int j = 0; j < this->d; j ++){
			double randomValue = (double)rand() / RAND_MAX;
			randomValue = minBox[j] + (randomValue * (maxBox[j] - minBox[j]));
			
			center.coords[j] = randomValue;
		}

		this->set_center(center, i);
	}

	delete[] minBox;
	minBox = NULL;
	delete[] maxBox;
	maxBox = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq (%rdi), %r13
leaq (,%r13,8), %rax
testq %r13, %r13
movq $-0x1, %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
testq %r13, %r13
jle 0xeb3c
xorl %eax, %eax
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
movabsq $0x10000000000000, %rdx # imm = 0x10000000000000
movq %rcx, (%r14,%rax,8)
movq %rdx, (%r15,%rax,8)
incq %rax
cmpq %rax, %r13
jne 0xeb2c
movslq 0x4(%rbx), %rax
testq %rax, %rax
jle 0xeb9d
movq 0x10(%rbx), %rcx
movl %r13d, %edx
xorl %esi, %esi
testl %r13d, %r13d
jle 0xeb95
movq %rsi, %rdi
shlq $0x4, %rdi
movq (%rcx,%rdi), %rdi
xorl %r8d, %r8d
movsd (%rdi,%r8,8), %xmm0
movsd (%r14,%r8,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xeb79
movsd %xmm0, (%r14,%r8,8)
movsd (%rdi,%r8,8), %xmm0
ucomisd (%r15,%r8,8), %xmm0
jbe 0xeb8d
movsd %xmm0, (%r15,%r8,8)
incq %r8
cmpq %r8, %rdx
jne 0xeb61
incq %rsi
cmpq %rax, %rsi
jne 0xeb4e
movq %rsp, %rdi
callq 0x3a20
cmpl $0x0, 0x8(%rbx)
jle 0xec42
xorl %r12d, %r12d
movl %r12d, 0x8(%rsp)
movl (%rbx), %eax
testl %eax, %eax
jle 0xec05
xorl %r13d, %r13d
callq 0x30a0
movsd 0x2d33(%rip), %xmm1     # 0x11900
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movsd (%r14,%r13,8), %xmm1
movsd (%r15,%r13,8), %xmm2
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movq (%rsp), %rax
movsd %xmm2, (%rax,%r13,8)
incq %r13
movslq (%rbx), %rax
cmpq %rax, %r13
jl 0xebc0
testl %eax, %eax
jle 0xec32
movq (%rsp), %rcx
movq 0x18(%rbx), %rdx
movq %r12, %rsi
shlq $0x4, %rsi
movq (%rdx,%rsi), %rdx
movl %eax, %eax
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0xec20
incq %r12
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jl 0xebb2
movq %r14, %rdi
callq 0x3360
movq %r15, %rdi
callq 0x3360
movq %rsp, %rdi
callq 0x3a6e
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::init_random_partition()
void Cloud::init_random_partition()
{
    /*!
     * @brief Initializes the centers of this cloud using random partitions,
	 * ie builds centers as the centers of random partitions of the data points
     */

	// random labelization of data points
	int randomCenter = 0;
	for (int i = 0; i < this->n; i ++){
		randomCenter = rand() % this->k;
		points[i].label = randomCenter;
	}

	// centers will be centroids of this partition
	this->set_centroid_centers();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x4(%rdi)
jle 0xef02
movl $0x8, %r14d
xorl %r15d, %r15d
callq 0x30a0
cltd
idivl 0x8(%rbx)
movq 0x10(%rbx), %rax
movl %edx, (%rax,%r14)
incq %r15
movslq 0x4(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0xeee1
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xe6e2
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/PixelStencil.cpp
// Function: kallaballa::PixelPlanes::PixelPlanes(char*)
PixelPlanes::PixelPlanes(char* filename) : img(filename), width(img.width()), height(img.height()) {
	for (int h = 0; h < img.height(); h++) {
		for (int w = 0; w < img.width(); w++) {
			Color p = 0;
			p |= img(w, h, 0, 0) << 16;
			p |= img(w, h, 0, 1) << 8;
			p |= img(w, h, 0, 2);

			planes[p].push_back({w,h});
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x360f4(%rip), %rax     # 0x39c28
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
xorl %r15d, %r15d
movq %r15, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movb $0x0, 0x18(%rdi)
movq %r14, %rdi
callq 0x542c
movslq 0x8(%rbx), %rax
movq %rax, 0x28(%rbx)
movslq 0xc(%rbx), %rax
movq %rax, 0x30(%rbx)
leaq 0x40(%rbx), %rax
movl $0x0, 0x40(%rbx)
movq %r15, 0x48(%rbx)
movq %rax, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %r15, 0x60(%rbx)
cmpl $0x0, 0xc(%rbx)
jle 0x3c47
leaq 0x38(%rbx), %r15
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
movl (%r14), %ecx
testl %ecx, %ecx
jle 0x3c37
xorl %r12d, %r12d
movl $0x0, 0xc(%rsp)
movq 0x20(%rbx), %rax
movl %ecx, %ecx
movl 0xc(%rbx), %edx
movl 0x10(%rbx), %esi
movq %rbp, %rdi
imulq %rcx, %rdi
addq %rax, %rdi
movzbl (%r12,%rdi), %edi
shll $0x10, %edi
movl %edi, 0xc(%rsp)
imulq %rdx, %rsi
leaq (%rsi,%rbp), %rdx
imulq %rcx, %rdx
addq %rax, %rdx
movzbl (%r12,%rdx), %edx
shll $0x8, %edx
orl %edi, %edx
movl %edx, 0xc(%rsp)
leaq (,%rsi,2), %rsi
addq %rbp, %rsi
imulq %rcx, %rsi
addq %rax, %rsi
movzbl (%r12,%rsi), %eax
orl %edx, %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x5050
movl %r12d, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
movq %rax, %rdi
movq %r13, %rsi
callq 0x2b712
incq %r12
movslq (%r14), %rcx
cmpq %rcx, %r12
jl 0x3ba3
incq %rbp
movslq 0xc(%rbx), %rax
cmpq %rax, %rbp
jl 0x3b95
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c58
movq %rax, %r14
movq %r15, %rdi
callq 0x5254
cmpb $0x0, 0x18(%rbx)
jne 0x3c77
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x3c77
callq 0x3380
movq %r14, %rdi
callq 0x34d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: std::pair<KDTree::_Iterator<kallaballa::NamedColor, kallaballa::NamedColor const&, kallaballa::NamedColor const*>, double> KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::find_nearest<kallaballa::NamedColor>(kallaballa::NamedColor const&) const
std::pair<const_iterator, distance_type>
      find_nearest (SearchVal const& __val) const
      {
	if (_M_get_root())
	  {
	    std::pair<const _Node<_Val>*,
	      std::pair<size_type, typename _Acc::result_type> >
	      best = _S_node_nearest (__K, 0, __val,
				      _M_get_root(), &_M_header, _M_get_root(),
				      std::sqrt(_S_accumulate_node_distance
				      (__K, _M_dist, _M_acc, _M_get_root()->_M_value, __val)),
				      _M_cmp, _M_acc, _M_dist,
				      always_true<value_type>());
	    return std::pair<const_iterator, distance_type>
	      (best.first, best.second.second);
	  }
	  return std::pair<const_iterator, distance_type>(end(), 0);
      }

// Assembly:
movq %rdi, %rax
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x51b5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r12
movq %rax, 0x28(%rsp)
leaq 0x10(%rsi), %rax
movq %rax, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
leaq 0x30(%rsi), %r15
movq %rcx, 0x18(%rsp)
leaq 0x18(%rcx), %rbp
xorpd %xmm1, %xmm1
xorl %r14d, %r14d
leaq 0x40(%rsp), %r13
leaq 0xc(%rsp), %rbx
movsd %xmm1, 0x38(%rsp)
movl %r14d, 0x40(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
callq *(%r15)
movsd %xmm0, 0x30(%rsp)
movl %r14d, 0xc(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq *(%r15)
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
subsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm1
incq %r14
cmpq $0x3, %r14
jne 0x5150
movq 0x20(%rsp), %r13
leaq 0x39(%r13), %r14
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x51c5
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0x51ce
addq $0x10, %rsi
movq %rsi, (%rax)
movq $0x0, 0x8(%rax)
retq
movapd %xmm1, %xmm0
callq 0x3210
addq $0x38, %r13
leaq 0x40(%rsp), %rbx
movl $0x3, %esi
movq %rbx, %rdi
xorl %edx, %edx
movq %r12, %rcx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
pushq %r14
pushq %r15
pushq %r13
pushq %r8
callq 0x2b918
addq $0x20, %rsp
movq (%rbx), %rax
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movq %rcx, %rax
movsd 0x10(%rbx), %xmm0
movsd %xmm0, 0x8(%rcx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_erase_subtree(KDTree::_Node<kallaballa::NamedColor>*)
void
      _M_erase_subtree(_Link_type __n)
      {
        while (__n)
          {
            _M_erase_subtree(_S_right(__n));
            _Link_type __t = _S_left(__n);
            _M_delete_node(__n);
            __n = __t;
          }
      }

// Assembly:
testq %rsi, %rsi
je 0x5400
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x53c8
movq 0x8(%r14), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5402
movq %r15, %r14
testq %r15, %r15
jne 0x53d8
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::filenamerand()
inline void srand() {
      static bool is_first_time = true;
      if (is_first_time) {
        const unsigned int t = (unsigned int)cimg::time();
#if cimg_OS==1
        std::srand(t+(unsigned int)getpid());
#elif cimg_OS==2
        std::srand(t+(unsigned int)_getpid());
#else
        std::srand(t);
#endif
        is_first_time = false;
      }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpb $0x1, 0x30831(%rip)     # 0x3a2d0
jne 0x9ae8
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3480
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rbx)
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %rdx
addl %edx, %eax
imull $0x3e8, (%rbx), %ebx    # imm = 0x3E8
addl %eax, %ebx
callq 0x33f0
addl %eax, %ebx
movl %ebx, %edi
callq 0x3280
movb $0x0, 0x307e8(%rip)     # 0x3a2d0
xorl %ebx, %ebx
leaq 0x30827(%rip), %r14     # 0x3a318
callq 0x3080
movslq %eax, %r15
imulq $0x55555556, %r15, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
leal (%rax,%rax,2), %ebp
callq 0x3080
subl %ebp, %r15d
je 0x9b27
cmpl $0x1, %r15d
jne 0x9b33
movl $0x61, %ecx
jmp 0x9b38
movl $0x30, %ecx
movl $0xa, %esi
jmp 0x9b3d
movl $0x41, %ecx
movl $0x1a, %esi
cltd
idivl %esi
addl %ecx, %edx
movb %dl, (%rbx,%r14)
incq %rbx
cmpq $0x8, %rbx
jne 0x9af1
leaq 0x307c2(%rip), %rax     # 0x3a318
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::CImg<unsigned char>::CImg(unsigned int, unsigned int, unsigned int, unsigned int)
explicit CImg(const unsigned int size_x, const unsigned int size_y=1, const unsigned int size_z=1, const unsigned int size_c=1):
      _is_shared(false) {
      const unsigned long siz = (unsigned long)size_x*size_y*size_z*size_c;
      if (siz) {
        _width = size_x; _height = size_y; _depth = size_z; _spectrum = size_c;
        try { _data = new T[siz]; } catch (...) {
          _width = _height = _depth = _spectrum = 0; _data = 0;
          throw CImgInstanceException(_cimg_instance
                                      "CImg(): Failed to allocate memory (%s) for image (%u,%u,%u,%u).",
                                      cimg_instance,
                                      cimg::strbuffersize(sizeof(T)*size_x*size_y*size_z*size_c),size_x,size_y,size_z,size_c);
        }
      } else { _width = _height = _depth = _spectrum = 0; _data = 0; }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r15d
movq %rdi, %rbp
movb $0x0, 0x10(%rdi)
movl %esi, %eax
movl %edx, %ecx
imulq %rax, %rcx
movl %r15d, %eax
movl %r8d, %r13d
imulq %rax, %r13
imulq %rcx, %r13
testq %r13, %r13
je 0x13927
movl %r8d, %r12d
movl %edx, %r14d
movl %esi, %ebx
movl %esi, (%rbp)
movl %edx, 0x4(%rbp)
movl %r15d, 0x8(%rbp)
movl %r8d, 0xc(%rbp)
movq %r13, %rdi
callq 0x3040
movq %rax, 0x18(%rbp)
jmp 0x13936
movq $0x0, 0x18(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x30f0
movq $0x0, 0x18(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, 0x18(%rsp)
movl (%rbp), %eax
movl %eax, 0x14(%rsp)
movl 0x4(%rbp), %eax
movl %eax, 0x10(%rsp)
movl 0x8(%rbp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rbp), %eax
movl %eax, 0x8(%rsp)
movq 0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0x1ca38(%rip), %rax     # 0x303cf
leaq 0x19ae1(%rip), %rcx     # 0x2d47f
cmpb $0x0, 0x10(%rbp)
cmovneq %rax, %rcx
movq %rcx, %rbp
movq %r13, %rdi
callq 0xa128
movq %rax, %r10
leaq 0x19c7f(%rip), %r11     # 0x2d63a
leaq 0x1a8aa(%rip), %rsi     # 0x2e26c
movq 0x18(%rsp), %rdi
movq %rdi, %r13
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x8(%rsp), %r9d
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r10
pushq %r11
pushq %rbp
pushq 0x58(%rsp)
callq 0xa20c
addq $0x40, %rsp
leaq 0x26312(%rip), %rsi     # 0x39d10
movq 0x265d3(%rip), %rdx     # 0x39fd8
movq %r13, %rdi
callq 0x34b0
movq %rax, %rbx
jmp 0x13a1d
movq %rax, %rbx
movq %r13, %rdi
callq 0x31e0
callq 0x34a0
movq %rbx, %rdi
callq 0x34d0
movq %rax, %rdi
callq 0x50b4
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::CImg<float>::vector(float const&, float const&, float const&, float const&, float const&, float const&, float const&, float const&)
static CImg<T> vector(const T& a0, const T& a1, const T& a2, const T& a3,
                          const T& a4, const T& a5, const T& a6, const T& a7) {
      _cimg_static CImg<T> r(1,8); T *ptr = r._data;
      *(ptr++) = a0; *(ptr++) = a1; *(ptr++) = a2; *(ptr++) = a3;
      *(ptr++) = a4; *(ptr++) = a5; *(ptr++) = a6; *(ptr++) = a7;
      return r;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
movb 0x1d2df(%rip), %al      # 0x3a468
testb %al, %al
je 0x1d216
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rdx
leaq 0x1d2a1(%rip), %rsi     # 0x3a448
movq 0x1d2b2(%rip), %rdi     # 0x3a460
movss (%rbp), %xmm0
movss %xmm0, (%rdi)
movss (%r13), %xmm0
movss %xmm0, 0x4(%rdi)
movss (%r12), %xmm0
movss %xmm0, 0x8(%rdi)
movss (%r15), %xmm0
movss %xmm0, 0xc(%rdi)
movss (%r14), %xmm0
movss %xmm0, 0x10(%rdi)
movss (%rdx), %xmm0
movss %xmm0, 0x14(%rdi)
movss (%rcx), %xmm0
movss %xmm0, 0x18(%rdi)
movss (%rax), %xmm0
movss %xmm0, 0x1c(%rdi)
movq %rbx, %rdi
callq 0x1d58a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d24b(%rip), %rdi     # 0x3a468
callq 0x3500
testl %eax, %eax
je 0x1d191
leaq 0x1d217(%rip), %rdi     # 0x3a448
movl $0x1, %esi
movl $0x8, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x133a8
leaq -0xa03e(%rip), %rdi     # 0x13214
leaq 0x1d1ef(%rip), %rsi     # 0x3a448
leaq 0x1d050(%rip), %rdx     # 0x3a2b0
callq 0x3260
leaq 0x1d1fc(%rip), %rdi     # 0x3a468
callq 0x3190
jmp 0x1d191
movq %rax, %rbx
leaq 0x1d1e8(%rip), %rdi     # 0x3a468
callq 0x3180
movq %rbx, %rdi
callq 0x34d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/NamedColorTable.cpp
// Function: kallaballa::colorComponent(kallaballa::NamedColor const&, int const&)
double colorComponent(const NamedColor& color, const int& k) {
  if(k == 0)
    return color.rgb & 0x0000ff;
  else if(k == 1)
    return (color.rgb & 0x00ff00) >> 8;
  else
    return (color.rgb & 0xff0000) >> 16;
}

// Assembly:
movl (%rsi), %ecx
movl (%rdi), %eax
testl %ecx, %ecx
je 0x2c04d
cmpl $0x1, %ecx
jne 0x2c04a
shrl $0x8, %eax
jmp 0x2c04d
shrl $0x10, %eax
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/NamedColorTable.cpp
// Function: kallaballa::getNextLineAndSplitIntoTokens[abi:cxx11](std::istream&)
std::vector<string> getNextLineAndSplitIntoTokens(std::istream& str) {
  std::vector<string> result;
  string line;
  if(!std::getline(str, line))
    return {};

  std::stringstream lineStream(line);
  string cell;

  while (std::getline(lineStream, cell, ',')) {
    result.push_back(cell);
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb $0x0, (%r13)
movq (%rsi), %rax
movq -0x18(%rax), %rdi
addq %rsi, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %edx
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x3520
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x2c0d1
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x2c190
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x18, %edx
callq 0x3450
leaq 0x50(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
leaq 0x60(%rsp), %r14
leaq 0x40(%rsp), %r15
movq %rsp, %r12
movq %r14, %rdi
movq %r15, %rsi
movl $0x2c, %edx
callq 0x3520
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2c132
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c3e0
jmp 0x2c107
movq (%rsp), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2c172
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xde27(%rip), %rsi      # 0x39fa0
leaq 0x60(%rsp), %rdi
callq 0x31f0
leaq 0xe0(%rsp), %rdi
callq 0x30c0
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x2c1a7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rsp, %rdi
callq 0x2c41e
movq %rbx, %rax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c1c6
movq %rax, %rbx
jmp 0x2c203
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2c1e5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xddb4(%rip), %rsi      # 0x39fa0
leaq 0x60(%rsp), %rdi
callq 0x31f0
leaq 0xe0(%rsp), %rdi
callq 0x30c0
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x2c21a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rsp, %rdi
callq 0x2c41e
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/NamedColorTable.cpp
// Function: kallaballa::NamedColorTable::readFromCSV(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void NamedColorTable::readFromCSV(const string& filename) {
  std::ifstream ifs(filename);
  std::vector<string> row;
  NamedColor ralColor;
  while ((row = getNextLineAndSplitIntoTokens(ifs)).size() == 2) {
    ralColor.name = row[0];
    ralColor.rgb = strtol(row[1].substr(1).c_str(), NULL, 16);
    this->insert(ralColor);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rdi, %rbx
leaq 0x80(%rsp), %rdi
movl $0x8, %edx
callq 0x3470
xorl %eax, %eax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x30(%rsp), %r14
leaq 0x68(%rsp), %r12
leaq 0x20(%rsp), %r13
leaq 0x40(%rsp), %rbp
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2c055
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps (%rsp), %xmm0
movq 0x10(%rsp), %rax
movups 0x68(%rsp), %xmm1
movaps %xmm1, (%rsp)
movq 0x78(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x20(%rsp), %xmm1
movaps %xmm0, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movups %xmm1, 0x68(%rsp)
movq $0x0, 0x78(%rsp)
movq %r13, %rdi
callq 0x2c41e
movq 0x8(%rsp), %r15
subq (%rsp), %r15
movq %r12, %rdi
callq 0x2c41e
cmpq $0x40, %r15
jne 0x2c35b
movq (%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x3140
movq (%rsp), %rsi
addq $0x20, %rsi
movl $0x1, %edx
movq %r13, %rdi
movq $-0x1, %rcx
callq 0x32e0
movq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x33a0
movl %eax, 0x40(%rsp)
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c348
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %r13, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2c47a
jmp 0x2c282
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2c377
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rsp, %rdi
callq 0x2c41e
leaq 0x80(%rsp), %rdi
callq 0x3070
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c3a4
jmp 0x2c3a4
jmp 0x2c3a4
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2c3c3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rsp, %rdi
callq 0x2c41e
leaq 0x80(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x34d0
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::insert(kallaballa::NamedColor const&)
iterator
      insert(const_reference __V)
      {
        if (!_M_get_root())
          {
            _Link_type __n = _M_new_node(__V, &_M_header);
            ++_M_count;
            _M_set_root(__n);
            _M_set_leftmost(__n);
            _M_set_rightmost(__n);
            return iterator(__n);
          }
        return _M_insert(_M_get_root(), __V, 0);
      }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rcx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
je 0x2c4a0
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x2c7f2
jmp 0x2c4c7
leaq 0x10(%r14), %rdx
movq %r14, %rdi
movq %rcx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2c716
incq 0x28(%r14)
movq %rax, 0x8(%r14)
movq %rax, 0x18(%r14)
movq %rax, 0x20(%r14)
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_new_node(kallaballa::NamedColor const&, KDTree::_Node_base*, KDTree::_Node_base*, KDTree::_Node_base*)
_Link_type
      _M_new_node(const_reference __V, //  = value_type(),
                  _Base_ptr const __PARENT = NULL,
                  _Base_ptr const __LEFT = NULL,
                  _Base_ptr const __RIGHT = NULL)
      {
         typename _Base::NoLeakAlloc noleak(this);
         _Link_type new_node = noleak.get();
	 _Base::_M_construct_node(new_node, __V, __PARENT, __LEFT, __RIGHT);
         noleak.disconnect();
         return new_node;
      }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movl $0x40, %edi
callq 0x32c0
movq %rax, %rbx
movl (%r13), %eax
leaq 0x8(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%r13), %rsi
movq 0x10(%r13), %rdx
addq %rsi, %rdx
callq 0x52ca
movq %r12, (%rbx)
movq %r15, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movl (%rsp), %eax
movl %eax, 0x18(%rbx)
leaq 0x20(%rbx), %rdi
movq %rbx, %rax
addq $0x30, %rax
movq %rax, 0x20(%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
callq 0x52ca
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2c7ab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2c7dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x2c7dc
movq %rax, %r14
movl $0x40, %esi
movq %rbx, %rdi
callq 0x32d0
movq %r14, %rdi
callq 0x34d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_insert(KDTree::_Node<kallaballa::NamedColor>*, kallaballa::NamedColor const&, unsigned long)
iterator
      _M_insert(_Link_type __N, const_reference __V,
             size_type const __L)
      {
        if (_Node_compare_(__L % __K, _M_acc, _M_cmp)(__V, __N->_M_value))
          {
            if (!_S_left(__N))
              return _M_insert_left(__N, __V);
            return _M_insert(_S_left(__N), __V, __L+1);
          }
        else
          {
            if (!_S_right(__N) || __N == _M_get_rightmost())
              return _M_insert_right(__N, __V);
            return _M_insert(_S_right(__N), __V, __L+1);
          }
      }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %r8, %rax
mulq %rdx
shrq %rdx
leal (%rdx,%rdx,2), %eax
movl %r15d, %ebx
subl %eax, %ebx
movq 0x30(%rsi), %r14
leaq 0x18(%r13), %rbp
leaq 0x24(%rsp), %rsi
movl %ebx, (%rsi)
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
callq *%r14
movsd %xmm0, 0x18(%rsp)
leaq 0x20(%rsp), %rsi
movl %ebx, (%rsi)
movq %rbp, %rdi
callq *%r14
ucomisd 0x18(%rsp), %xmm0
jbe 0x2c881
movq 0x8(%r13), %rdx
testq %rdx, %rdx
jne 0x2c891
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq 0x8(%rsp), %rcx
callq 0x2c8d8
jmp 0x2c8c6
movq 0x10(%r13), %rdx
testq %rdx, %rdx
je 0x2c8ae
cmpq %r13, 0x20(%r12)
je 0x2c8ae
incq %r15
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rcx
movq %r15, %r8
callq 0x2c7f2
jmp 0x2c8c6
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq 0x8(%rsp), %rcx
callq 0x2c91e
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_insert_left(KDTree::_Node<kallaballa::NamedColor>*, kallaballa::NamedColor const&)
iterator
      _M_insert_left(_Link_type __N, const_reference __V)
      {
        _S_set_left(__N, _M_new_node(__V)); ++_M_count;
        _S_set_parent( _S_left(__N), __N );
        if (__N == _M_get_leftmost())
           _M_set_leftmost( _S_left(__N) );
        return iterator(_S_left(__N));
      }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movq %rcx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2c716
movq %rax, 0x8(%rbx)
incq 0x28(%r15)
movq %rbx, (%rax)
cmpq %rbx, 0x18(%r15)
jne 0x2c90d
movq %rax, 0x18(%r15)
movq 0x8(%rbx), %rax
movq %rax, (%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_insert_right(KDTree::_Node<kallaballa::NamedColor>*, kallaballa::NamedColor const&)
iterator
      _M_insert_right(_Link_type __N, const_reference __V)
      {
        _S_set_right(__N, _M_new_node(__V)); ++_M_count;
        _S_set_parent( _S_right(__N), __N );
        if (__N == _M_get_rightmost())
           _M_set_rightmost( _S_right(__N) );
        return iterator(_S_right(__N));
      }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movq %rcx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2c716
movq %rax, 0x10(%rbx)
incq 0x28(%r15)
movq %rbx, (%rax)
cmpq %rbx, 0x20(%r15)
jne 0x2c953
movq %rax, 0x20(%r15)
movq 0x10(%rbx), %rax
movq %rax, (%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::ADDIInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDIInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = (int16_t)constant;
    int32_t result = left + right;
    
    bool overflow = sameSign(left, right) && !sameSign(left, result);
    if (overflow) { throw BadArithmeticOperation("ADDI encountered an overflow"); }
    
    reg.write(rt, result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movswl 0xa(%r14), %ecx
leal (%rax,%rcx), %edx
xorl %eax, %ecx
js 0x7ad8
xorl %edx, %eax
js 0x7aef
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa810
movl $0x48, %edi
callq 0x6100
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x488d(%rip), %rsi      # 0xc399
leaq 0x48a2(%rip), %rdx      # 0xc3b5
leaq 0x8(%rsp), %rdi
callq 0x8e9a
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x65d6
xorl %ebp, %ebp
leaq 0x9202(%rip), %rsi      # 0x10d38
leaq -0x605(%rip), %rdx      # 0x7538
movq %rbx, %rdi
callq 0x6380
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7b67
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6210
jmp 0x7b67
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7b74
movq %rbx, %rdi
callq 0x6190
movq %r14, %rdi
callq 0x63a0
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::ADDIUInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDIUInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = (int16_t)constant;
    int32_t result = left + right;
    reg.write(rt, result);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movswl 0xa(%r14), %edx
addl %eax, %edx
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa810
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::LWLInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void LWLInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t addr = reg.read(rs) + (int16_t)constant;
    uint32_t byteIndex = addr % 4;
    uint32_t wordIndex = addr - byteIndex;
    uint32_t mask = 0xFFFFFFFF;
    
    uint32_t rawWord = mem.read<uint32_t>(wordIndex);
    byte* byteArray = reinterpret_cast<byte*>(&rawWord);
    
    for (int i = byteIndex; i < 4; ++i)
    {
        data <<= 8;
        data |= byteArray[3 - i];
        mask >>= 8;
    }
    data <<= 8 * byteIndex;
    data |= (reg.read(rt) & mask);
    reg.write(rt, data);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movswl 0xa(%r14), %r15d
addl %eax, %r15d
movl %r15d, %esi
andl $-0x4, %esi
movq %r12, %rdi
callq 0x8116
movl %eax, 0xc(%rsp)
movl 0xc(%r14), %eax
movl %r15d, %edx
andl $0x3, %edx
movl $0x4, %ecx
subq %rdx, %rcx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %eax, %edx
shll $0x8, %edx
movzbl 0xb(%rsp,%rcx), %eax
orl %edx, %eax
shrl $0x8, %ebp
decq %rcx
jne 0x7da2
shll $0x3, %r15d
movl %r15d, %ecx
shll %cl, %eax
movl %eax, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
andl %eax, %ebp
orl 0xc(%r14), %ebp
movl %ebp, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa810
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::LWRInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void LWRInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t addr = reg.read(rs) + (int16_t)constant;
    uint32_t byteIndex = addr % 4;
    uint32_t wordIndex = addr - byteIndex;
    uint32_t mask = 0xFFFFFFFF;

    uint32_t rawWord = mem.read<uint32_t>(wordIndex);
    byte* byteArray = reinterpret_cast<byte*>(&rawWord);
    
    for (int i = 0; i <= byteIndex; ++i)
    {
        data <<= 8;
        data |= byteArray[3 - i];
        mask <<= 8;
    }
    data |= (reg.read(rt) & mask);
    reg.write(rt, data);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movl %eax, %r12d
movswl 0xa(%r14), %r13d
leal (%r12,%r13), %esi
andl $-0x4, %esi
movq %r15, %rdi
callq 0x8116
movl %eax, 0x4(%rsp)
movl 0xc(%r14), %eax
addb %r12b, %r13b
movzbl %r13b, %ecx
andl $0x3, %ecx
negq %rcx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x1, %edx
movl %eax, %esi
shll $0x8, %esi
movzbl 0x6(%rsp,%rdx), %eax
orl %esi, %eax
shll $0x8, %ebp
decq %rdx
cmpq %rdx, %rcx
jne 0x7e4c
movl %eax, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
andl %eax, %ebp
orl 0xc(%r14), %ebp
movl %ebp, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa810
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/Instructions.cpp
// Function: Clarkitechture::MIPS::BinaryDecoder::decodeBranchInstruction(unsigned int)
BranchIInstruction* BinaryDecoder::decodeBranchInstruction(uint32_t bin)
{
    byte rs = 0b11111 & (bin >> (32 - (6 + 5)));
    byte cond = 0b11111 & (bin >> (32 - (6 + 5 + 5)));
    uint16_t constant = 0xFFFF & bin;
    
    switch (cond)
    {
        case 0b00001: return new BGEZInstr(rs, cond, constant);
        case 0b10001: return new BGEZALInstr(rs, cond, constant);
        case 0b00000: return new BLTZInstr(rs, cond, constant);
        case 0b10000: return new BLTZALInstr(rs, cond, constant);
        default:
            throw BadInstructionDecode(bin, "invalid or unsupported branch condition - " + toBinStr(cond));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edi, %ebp
movl %edi, %eax
shrl $0x10, %eax
movl %eax, %r14d
andb $0x1f, %r14b
andl $0x1f, %eax
cmpl $0xf, %eax
jg 0x97da
testl %eax, %eax
je 0x97ed
cmpl $0x1, %eax
jne 0x9830
leaq 0x7a40(%rip), %rbx      # 0x11218
jmp 0x97fd
cmpl $0x10, %eax
je 0x97f6
cmpl $0x11, %eax
jne 0x9830
leaq 0x7a75(%rip), %rbx      # 0x11260
jmp 0x97fd
leaq 0x7b44(%rip), %rbx      # 0x11338
jmp 0x97fd
leaq 0x7b83(%rip), %rbx      # 0x11380
addq $0x10, %rbx
movl %ebp, %r15d
shrl $0x15, %r15d
andb $0x1f, %r15b
movl $0x18, %edi
callq 0x6200
movb %r15b, 0x8(%rax)
movb %r14b, 0x9(%rax)
movw %bp, 0xa(%rax)
movq %rbx, (%rax)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x50, %edi
callq 0x6100
movq %rax, %rbx
movzbl %r14b, %esi
leaq 0x8(%rsp), %rdi
callq 0x9a01
leaq 0x3112(%rip), %rsi      # 0xc964
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x9991
movb $0x1, %r15b
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6b82
xorl %r15d, %r15d
leaq 0x7503(%rip), %rsi      # 0x10d80
leaq -0x2180(%rip), %rdx     # 0x7704
movq %rbx, %rdi
callq 0x6380
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x98b2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6210
jmp 0x98b2
movq %rax, %r14
movb $0x1, %r15b
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x98d5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6210
jmp 0x98d5
movq %rax, %r14
movb $0x1, %r15b
testb %r15b, %r15b
je 0x98e2
movq %rbx, %rdi
callq 0x6190
movq %r14, %rdi
callq 0x63a0
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/Instructions.cpp
// Function: Clarkitechture::MIPS::RInstruction::RInstruction(unsigned char, unsigned char, unsigned char, unsigned char)
RInstruction::RInstruction(byte rs, byte rt, byte rd, byte shamt)
{
	this->rs = rs;
	this->rt = rt;
	this->rd = rd;
	this->shamt = shamt;
}

// Assembly:
leaq 0x7b45(%rip), %rax      # 0x11438
movq %rax, (%rdi)
movb %sil, 0x8(%rdi)
movb %dl, 0x9(%rdi)
movb %cl, 0xa(%rdi)
movb %r8b, 0xb(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/Instructions.cpp
// Function: Clarkitechture::MIPS::BranchIInstruction::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void BranchIInstruction::execute(MemoryMap &mem, RegisterMap &reg)
{
    int32_t offset = ((int16_t)constant) << 2;
    branchAddr = reg.PC + offset;
    conditionMet = evaluateCondition(reg);
    if (requiresLink()) { reg.write(31, reg.PC + 4); }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movswl 0xa(%rdi), %eax
shll $0x2, %eax
addl (%rdx), %eax
movl %eax, 0x10(%rdi)
movq (%rdi), %rax
movq %rdx, %rsi
callq *0x18(%rax)
movb %al, 0xc(%r14)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
testb %al, %al
je 0x9979
movl (%rbx), %edx
addl $0x4, %edx
movl $0x1f, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa810
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/MemoryMap.cpp
// Function: Clarkitechture::MIPS::MemoryMap::MemoryMap(Clarkitechture::MIPS::MemoryMap const&)
MemoryMap::MemoryMap(const MemoryMap &a)
{
    memory = a.memory;
    
    instrMemorySize = a.instrMemorySize;
    if (instrMemorySize > 0)
    {
        instrMemory = new byte[instrMemorySize];
        memcpy(instrMemory, a.instrMemory, a.instrMemorySize);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
movq %rax, (%rdi)
movq $0x1, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x3f800000, 0x20(%rdi) # imm = 0x3F800000
movups %xmm0, 0x28(%rdi)
movq $0x0, 0x40(%rdi)
cmpq %rdi, %rsi
je 0x9d73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9e36
movq 0x40(%r14), %rdi
movq %rdi, 0x40(%rbx)
testq %rdi, %rdi
je 0x9da0
callq 0x6030
movq %rax, 0x38(%rbx)
movq 0x38(%r14), %rsi
movq 0x40(%r14), %rdx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x61c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x9dc6
movq %r14, %rdi
callq 0x63a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::ADDInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = reg.read(rt);
    int32_t result = left + right;
    
    bool overflow = sameSign(left, right) && !sameSign(left, result);
    if (overflow) { throw BadArithmeticOperation("ADD encountered an overflow"); }
    
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movl %eax, %r15d
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
leal (%rax,%r15), %edx
xorl %r15d, %eax
js 0xa172
xorl %edx, %r15d
js 0xa189
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa810
movl $0x48, %edi
callq 0x6100
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2878(%rip), %rsi      # 0xca1e
leaq 0x288c(%rip), %rdx      # 0xca39
leaq 0x8(%rsp), %rdi
callq 0x8e9a
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x65d6
xorl %ebp, %ebp
leaq 0x6b68(%rip), %rsi      # 0x10d38
leaq -0x2c9f(%rip), %rdx     # 0x7538
movq %rbx, %rdi
callq 0x6380
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa201
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6210
jmp 0xa201
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0xa20e
movq %rbx, %rdi
callq 0x6190
movq %r14, %rdi
callq 0x63a0
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::ADDUInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDUInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t left = reg.read(rs);
    uint32_t right = reg.read(rt);
    uint32_t result = left + right;
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
addl %eax, %ebp
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0xa810
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::SUBInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void SUBInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = reg.read(rt);
    int32_t result = left - right;
    
    bool overflow = !sameSign(left, right) && !sameSign(left, result);
    if (overflow) { throw BadArithmeticOperation("SUB encountered an overflow"); }
    
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
movl %ebp, %edx
subl %eax, %edx
xorl %ebp, %eax
jns 0xa287
xorl %edx, %ebp
js 0xa29e
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa810
movl $0x48, %edi
callq 0x6100
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x277f(%rip), %rsi      # 0xca3a
leaq 0x2793(%rip), %rdx      # 0xca55
leaq 0x8(%rsp), %rdi
callq 0x8e9a
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x65d6
xorl %ebp, %ebp
leaq 0x6a53(%rip), %rsi      # 0x10d38
leaq -0x2db4(%rip), %rdx     # 0x7538
movq %rbx, %rdi
callq 0x6380
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa316
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6210
jmp 0xa316
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0xa323
movq %rbx, %rdi
callq 0x6190
movq %r14, %rdi
callq 0x63a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::NORInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void NORInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t left = reg.read(rs);
    uint32_t right = reg.read(rt);
    uint32_t result = ~(left | right);
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
orl %eax, %ebp
notl %ebp
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0xa810
// File: /workspace/github_cpp_makefile_star2_O1/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::MULTInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void MULTInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int64_t left = (int32_t)reg.read(rs);
    int64_t right = (int32_t)reg.read(rt);
    int64_t result = left * right;
    reg.lo = 0xFFFFFFFF & result;
    reg.hi = 0xFFFFFFFF & (result >> 32);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0xa7ac
movslq %eax, %r15
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0xa7ac
cltq
imulq %r15, %rax
rorq $0x20, %rax
movq %rax, 0x4(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop