LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/attractivechaos[P]udb2/tsl_hopscotch_map/./hopscotch_hash.h
// Function: tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::ValueSelect::value_type& tsl::detail_hopscotch_hash::hopscotch_hash<std::pair<unsigned int const, unsigned int>, tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::KeySelect, tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::ValueSelect, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>, std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>>::operator[]<unsigned int, tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::ValueSelect, (void*)0>(unsigned int&&)
typename U::value_type& operator[](K&& key) {
        using T = typename U::value_type;
        
        const std::size_t hash = hash_key(key);
        const std::size_t ibucket_for_hash = bucket_for_hash(hash);
        
        T* value = find_value_impl(key, hash, m_buckets + ibucket_for_hash);
        if(value != nullptr) {
            return *value;
        }
        else {
            return insert_value(ibucket_for_hash, hash, std::piecewise_construct, 
                                                        std::forward_as_tuple(std::forward<K>(key)), 
                                                        std::forward_as_tuple()).first.value();
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, %r14
movl (%rsi), %ebx
movl (%rdi), %r15d
andl %ebx, %r15d
movq %r15, %rcx
shlq $0x4, %rcx
addq 0x50(%rdi), %rcx
movq %rbx, %rdx
callq 0x1f48
testq %rax, %rax
jne 0x1cbf
leaq 0x10(%rsp), %r9
movq %r12, (%r9)
leaq 0xf(%rsp), %rax
movq %rax, (%rsp)
leaq 0x149f(%rip), %r8       # 0x312e
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1ccc
movq (%r12), %rcx
movq 0x10(%r12), %rax
leaq 0xc(%rcx), %rdx
addq $0x24, %rax
cmpq 0x8(%r12), %rcx
cmovneq %rdx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/attractivechaos[P]udb2/tsl_hopscotch_map/./hopscotch_hash.h
// Function: tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::ValueSelect::value_type const* tsl::detail_hopscotch_hash::hopscotch_hash<std::pair<unsigned int const, unsigned int>, tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::KeySelect, tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::ValueSelect, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>, std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>>::find_value_impl<unsigned int, tsl::bhopscotch_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 62u, false, tsl::hh::power_of_two_growth_policy<2ul>>::ValueSelect, (void*)0>(unsigned int const&, unsigned long, tsl::detail_hopscotch_hash::hopscotch_bucket<std::pair<unsigned int const, unsigned int>, 62u, false> const*) const
const typename U::value_type* find_value_impl(const K& key, std::size_t hash, 
                                                  const hopscotch_bucket* bucket_for_hash) const 
    {
        const hopscotch_bucket* bucket_found = find_in_buckets(key, hash, bucket_for_hash);
        if(bucket_found != nullptr) {
            return std::addressof(ValueSelect()(bucket_found->value()));
        }
        
        if(bucket_for_hash->has_overflow()) {
            auto it_overflow = find_in_overflow(key);
            if(it_overflow != m_overflow_elements.end()) {
                return std::addressof(ValueSelect()(*it_overflow));
            }
        }
        
        return nullptr;
    }

// Assembly:
movq %rcx, %rax
movq (%rcx), %rcx
cmpq $0x4, %rcx
jb 0x1f7c
movq %rcx, %rdx
shrq $0x2, %rdx
movl (%rsi), %r8d
testb $0x1, %dl
je 0x1f69
cmpl %r8d, 0x8(%rax)
je 0x1f7e
addq $0x10, %rax
movq %rdx, %r9
shrq %r9
cmpq $0x1, %rdx
movq %r9, %rdx
ja 0x1f5e
xorl %eax, %eax
testq %rax, %rax
je 0x1f88
addq $0xc, %rax
retq
testb $0x2, %cl
je 0x1fd8
movq 0x30(%rdi), %rax
addq $0x28, %rdi
movq %rdi, %rcx
testq %rax, %rax
je 0x1fba
movl (%rsi), %edx
movq %rdi, %rcx
xorl %r8d, %r8d
cmpl %edx, 0x20(%rax)
setb %r8b
cmovaeq %rax, %rcx
movq 0x10(%rax,%r8,8), %rax
testq %rax, %rax
jne 0x1fa2
movq %rdi, %rax
cmpq %rdi, %rcx
je 0x1fce
movl (%rsi), %eax
cmpl 0x20(%rcx), %eax
cmovbq %rdi, %rcx
movq %rcx, %rax
cmpq %rdi, %rax
je 0x1fd8
addq $0x24, %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/trainhmmst.cpp
// Function: read_and_structure_data(char const*, _IO_FILE*)
bool read_and_structure_data(const char *filename, FILE *fid_console) {
    bool readok = true;
    if(task.binaryinput==0) {
        readok = InputUtilSt::readTxt(filename, &task);
    } else {
        readok = InputUtilSt::readBin(filename, &task);
    }
    if(! readok ) {
        return false;
    }
    
	NDAT t = 0;
	NCAT k;
    
	// Pass A, find first and last instance of null skill
	for(t=0; t<task.N; t++) {
        if(task.multiskill==0)
            k = task.dat_skill[t];//[t];
        else
            k = task.dat_skill_stacked[ task.dat_skill_rix[t] ]; // first skill of multi-skill

		// null skill : just count
		if( k < 0 ) {
            task.N_null++;
            if(task.first_null_skill==-1) task.first_null_skill = t; // update once
            task.last_null_skill = t; // update always
			continue;
		}
	}

    return true;
}

// Assembly:
pushq %rbx
cmpl $0x0, 0x17aeb(%rip)     # 0x1d2d0
je 0x57f5
leaq 0x17a6a(%rip), %rsi     # 0x1d258
callq 0xd346
jmp 0x5801
leaq 0x17a5c(%rip), %rsi     # 0x1d258
callq 0xbe8a
testb %al, %al
je 0x587d
movslq 0x18344(%rip), %rcx     # 0x1db50
testq %rcx, %rcx
jle 0x587d
movl 0x18358(%rip), %r8d     # 0x1db70
movl 0x1834e(%rip), %edx     # 0x1db6c
movb 0x18353(%rip), %sil     # 0x1db78
movq 0x182cc(%rip), %rdi     # 0x1daf8
movq 0x182d5(%rip), %r9      # 0x1db08
movq 0x182b6(%rip), %r10     # 0x1daf0
xorl %r11d, %r11d
movq %r10, %rbx
testb %sil, %sil
je 0x584d
movslq (%r9,%r11,4), %rbx
leaq (%rdi,%rbx,4), %rbx
cmpl $0x0, (%rbx)
jns 0x5871
incl %edx
movl %edx, 0x18312(%rip)     # 0x1db6c
cmpl $-0x1, %r8d
jne 0x586a
movl %r11d, 0x18309(%rip)    # 0x1db70
movl %r11d, %r8d
movl %r11d, 0x18303(%rip)    # 0x1db74
incq %r11
addq $0x4, %r10
cmpq %r11, %rcx
jne 0x583d
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::CFramework()
CFramework::CFramework() {
  PRINT_VERBOSE("CFramework created\n");
  CFramework::CFramework_verbose = false;
  this->unique_index_counter = 1;
  CFramework::CFramework_ref = this;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7ea1(%rip), %rax      # 0xbcb8
movq %rax, (%rdi)
leaq 0x10(%rdi), %rax
movl $0x0, 0x10(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movq %rcx, 0x30(%rdi)
cmpb $0x1, 0x8483(%rip)      # 0xc2c1
jne 0x3e4c
leaq 0x42e1(%rip), %rdi      # 0x8128
callq 0x3400
movb $0x0, 0x846e(%rip)      # 0xc2c1
movl $0x1, 0x38(%rbx)
movq %rbx, 0x8467(%rip)      # 0xc2c8
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::~CFramework()
CFramework::~CFramework() {
  PRINT_VERBOSE("Cleaning up %d matrices\n", (int)this->mmatrices.size());
  //
  if (CFramework_verbose)
    this->print_matrix_list();
  //
  while (this->mmatrices.size() != 0) {
    map<int, MatrixInfo*>::iterator it = this->mmatrices.begin();
    MatrixInfo *matrix_info = it->second;
    this->delete_matrix(matrix_info->id);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7e49(%rip), %rax      # 0xbcb8
movq %rax, (%rdi)
cmpb $0x1, 0x8448(%rip)      # 0xc2c1
jne 0x3e8c
movl 0x30(%rbx), %esi
leaq 0x417f(%rip), %rdi      # 0x8004
xorl %eax, %eax
callq 0x3070
cmpb $0x1, 0x842e(%rip)      # 0xc2c1
jne 0x3e9d
movq %rbx, %rdi
callq 0x3ece
cmpq $0x0, 0x30(%rbx)
je 0x3eb9
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x3f4c
jmp 0x3e9d
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x453e
movq %rax, %rdi
callq 0x44cf
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::print_matrix_list()
void CFramework::print_matrix_list() {
  printf("\nFramework matrix list (%d matrices):\n", (int)this->mmatrices.size());
  printf("--------------------------------------------\n");
  map<int, MatrixInfo*>::iterator end = this->mmatrices.end(); 
  int i = 1;
  for (map<int, MatrixInfo*>::iterator it = this->mmatrices.begin(); it != end; ++it) {
    MatrixInfo *matrix_info = it->second;
    printf("%d) Matrix M_%d data at %p\n", i, matrix_info->id, matrix_info->data);
    i++;
  }
  printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x30(%rdi), %esi
leaq 0x413b(%rip), %rdi      # 0x801d
xorl %eax, %eax
callq 0x3070
leaq 0x424b(%rip), %rdi      # 0x813b
callq 0x3400
movq 0x20(%rbx), %r14
addq $0x10, %rbx
cmpq %rbx, %r14
je 0x3f37
movl $0x1, %ebp
leaq 0x4136(%rip), %r15      # 0x8044
movq 0x28(%r14), %rax
movl 0x8(%rax), %edx
movq 0x18(%rax), %rcx
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x3070
incl %ebp
movq %r14, %rdi
callq 0x31d0
movq %rax, %r14
cmpq %rbx, %rax
jne 0x3f0e
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3360
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::delete_matrix(int)
void CFramework::delete_matrix(int id) {
  MatrixInfo *matrix_info = CFramework::find_matrix(id);
  if (matrix_info == NULL) {
    PRINT_ERROR("matrix M_%d not in memory!\n", id);
    exit(-1);
  }
  PRINT_VERBOSE("Deleting matrix M_%d at %p, data at %p\n", id, matrix_info, matrix_info->data);
  delete[] matrix_info->data;
  this->mmatrices.erase(id);
  delete matrix_info;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, 0x4(%rsp)
callq 0x4186
testq %rax, %rax
je 0x3fc1
movq %rax, %rbx
cmpb $0x1, 0x8356(%rip)      # 0xc2c1
jne 0x3f86
movl 0x4(%rsp), %esi
movq 0x18(%rbx), %rcx
leaq 0x415b(%rip), %rdi      # 0x80d7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3070
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3f94
callq 0x3350
addq $0x8, %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x47d6
movq %r14, %rdi
movq %rax, %rsi
callq 0x484e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4(%rsp), %rdi
callq 0x3540
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::create_matrix(int, int*, int&)
float *CFramework::create_matrix(int num_dims, int *N, int &out_id) {
  int product_dims = 1;
  for (int i = 0; i < num_dims; i++)
    product_dims *= N[i];

  float *data = new float[product_dims];
  int id = this->unique_index_counter++;
  MatrixInfo *matrix_info = new MatrixInfo(id, num_dims, N, data);
  this->mmatrices[id] = matrix_info;
  out_id = id;

  PRINT_VERBOSE("Created matrix M_%d at %p, data at %p\n", id, matrix_info, matrix_info->data);
  return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %r12d
movl $0x1, %eax
testl %esi, %esi
jle 0x4052
xorl %ecx, %ecx
imull (%r15,%rcx,4), %eax
incq %rcx
cmpq %rcx, %r12
jne 0x4045
cltq
leaq (,%rax,4), %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x3030
movq %rax, 0x8(%rsp)
movl 0x38(%r14), %r13d
leal 0x1(%r13), %eax
movl %eax, 0x38(%r14)
movl %r13d, 0x4(%rsp)
movl $0x20, %edi
callq 0x3250
movq %rax, %rbx
leaq 0x7c50(%rip), %rax      # 0xbce8
movq %rax, (%rbx)
movl %r13d, 0x8(%rbx)
movl %ebp, 0xc(%rbx)
movslq %ebp, %rdi
shlq $0x2, %rdi
testl %ebp, %ebp
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
testl %ebp, %ebp
jle 0x40d5
shlq $0x2, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3210
movq 0x8(%rsp), %r12
movq %r12, 0x18(%rbx)
addq $0x8, %r14
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x44da
movq %rbx, (%rax)
movl (%r15), %esi
movq 0x10(%rsp), %rax
movl %esi, (%rax)
cmpb $0x0, 0x81bb(%rip)      # 0xc2c1
je 0x411d
movq 0x18(%rbx), %rcx
leaq 0x3f4d(%rip), %rdi      # 0x8060
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3070
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x3260
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::find_matrix(int)
MatrixInfo *CFramework::find_matrix(int id) {
  if (this->mmatrices.find(id) != this->mmatrices.end())
    return this->mmatrices[id];
  else
    return NULL;
}

// Assembly:
pushq %rax
movl %esi, 0x4(%rsp)
movq 0x18(%rdi), %rdx
leaq 0x10(%rdi), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x41b6
movq %rax, %rcx
xorl %r8d, %r8d
cmpl %esi, 0x20(%rdx)
setl %r8b
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%r8,8), %rdx
testq %rdx, %rdx
jne 0x419e
movq %rax, %rdx
cmpq %rax, %rcx
je 0x41c8
cmpl %esi, 0x20(%rcx)
cmovgq %rax, %rcx
movq %rcx, %rdx
cmpq %rax, %rdx
je 0x41e0
addq $0x8, %rdi
leaq 0x4(%rsp), %rsi
callq 0x44da
movq (%rax), %rax
jmp 0x41e2
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::find_matrix(float*)
int CFramework::find_matrix(float *data) {
  map<int, MatrixInfo*>::iterator end = this->mmatrices.end(); 
  for (map<int, MatrixInfo*>::iterator it = this->mmatrices.begin(); it != end; ++it) {
    MatrixInfo *matrix_info = it->second;
    if (matrix_info->data == data)
      return matrix_info->id;
  }
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x20(%rdi), %rax
addq $0x10, %r15
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq %r15, %rax
je 0x4229
movq %rsi, %r14
movq 0x28(%rax), %rdx
movq 0x18(%rdx), %rcx
cmpq %r14, %rcx
jne 0x4213
movl 0x8(%rdx), %ebp
cmpq %r14, %rcx
je 0x4227
movq %rax, %rdi
callq 0x31d0
cmpq %r15, %rax
jne 0x4203
jmp 0x4229
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::find_matrix_by_list_pos(int)
MatrixInfo *CFramework::find_matrix_by_list_pos(int pos) {
  map<int, MatrixInfo*>::iterator end = this->mmatrices.end(); 
  int i = 1;
  for (map<int, MatrixInfo*>::iterator it = this->mmatrices.begin(); it != end; ++it) {
    MatrixInfo *matrix_info = it->second;
    if (i == pos)
      return matrix_info;
    i++;
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x20(%rdi), %rax
addq $0x10, %r14
cmpq %r14, %rax
je 0x4276
movl %esi, %ebx
movl $0x1, %ecx
cmpl %ebx, %ecx
jne 0x4260
movq 0x28(%rax), %r15
movl %ecx, %ebp
jmp 0x4263
leal 0x1(%rcx), %ebp
cmpl %ebx, %ecx
je 0x4279
movq %rax, %rdi
callq 0x31d0
movl %ebp, %ecx
cmpq %r14, %rax
jne 0x4254
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::save_matrix(MatrixInfo*, char*)
void CFramework::save_matrix(MatrixInfo *matrix, char *filename) {
  FILE *fp = fopen(filename, "wb");

  int num_elements = 1;
  for (int i = 0; i < matrix->num_dims; i++)
    num_elements *= matrix->N[i];

  fwrite(&matrix->num_dims, sizeof(matrix->num_dims), 1, fp);
  for (int i = 0; i < matrix->num_dims; i++)
    fwrite(&matrix->N[i], sizeof(matrix->N[0]), 1, fp);

  size_t written = fwrite(matrix->data, sizeof(matrix->data[0]), num_elements, fp);
  if (written != num_elements) {
    fprintf(stderr, "Write error!\n");
    exit(-1);
  }

  fclose(fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rdi
movq %rsi, %r14
leaq 0x3e61(%rip), %rsi      # 0x80ff
callq 0x32f0
movq %rax, %rbx
movslq 0xc(%r14), %rax
testq %rax, %rax
jle 0x42d0
movq 0x10(%r14), %rcx
movl $0x1, %r15d
xorl %edx, %edx
movslq (%rcx,%rdx,4), %rsi
movslq %r15d, %r15
imulq %rsi, %r15
incq %rdx
cmpq %rdx, %rax
jne 0x42bb
jmp 0x42d6
movl $0x1, %r15d
leaq 0xc(%r14), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x3510
cmpl $0x0, 0xc(%r14)
jle 0x4322
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%r14), %rdi
addq %r12, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x3510
incq %r13
movslq 0xc(%r14), %rax
addq $0x4, %r12
cmpq %rax, %r13
jl 0x42f9
movq 0x18(%r14), %rdi
movl $0x4, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3510
cmpq %r15, %rax
jne 0x434c
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3240
callq 0x3584
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::load_matrix(MatrixInfo*, char*)
int CFramework::load_matrix(MatrixInfo *matrix, char *filename) {
  FILE *fp = fopen(filename, "rb");
  if (fp == NULL)
    return -1;

  // Read number of dimensions
  int num_dims; 
  size_t dummy = fread(&num_dims, sizeof(matrix->num_dims), 1, fp);

  // Check number of dimensions
  if (num_dims != matrix->num_dims) {
    fclose(fp);
    return -2;
  }

  // Read matrix size
  dummy = fread(matrix->N, sizeof(matrix->N[0]), num_dims, fp);

  // Get number of elements
  int num_elements = 1;
  for (int i = 0; i < num_dims; i++)
    num_elements *= matrix->N[i];

  // Get matrix name and delete it
  delete[] matrix->data;
  matrix->data = new float[num_elements];

  // Read data
  size_t read = fread(matrix->data, sizeof(matrix->N[0]), num_elements, fp);
  if (read != num_elements) {
    fprintf(stderr, "Read error!\n");
    return -3;
  }
  
  fclose(fp);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rdi
movq %rsi, %r14
leaq 0x3daa(%rip), %rsi      # 0x8110
callq 0x32f0
testq %rax, %rax
je 0x43c8
movq %rax, %rbx
leaq 0x4(%rsp), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x33d0
movslq (%r15), %r15
cmpl 0xc(%r14), %r15d
jne 0x43cf
movq 0x10(%r14), %rdi
movl $0x4, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33d0
testl %r15d, %r15d
jle 0x43de
movq 0x10(%r14), %rax
movl $0x1, %ebp
xorl %ecx, %ecx
imull (%rax,%rcx,4), %ebp
incq %rcx
cmpq %rcx, %r15
jne 0x43ba
jmp 0x43e3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4435
movq %rbx, %rdi
callq 0x3240
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x4435
movl $0x1, %ebp
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x43f1
callq 0x3350
movslq %ebp, %r15
leaq (,%r15,4), %rax
testl %r15d, %r15d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq %rax, 0x18(%r14)
movl $0x4, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33d0
cmpq %r15, %rax
jne 0x4440
movq %rbx, %rdi
callq 0x3240
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x35a9
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x4435
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::print_backtrace(_IO_FILE*)
void CFramework::print_backtrace(FILE *out) {
    const size_t max_depth = 100;
    size_t stack_depth;
    void *stack_addrs[max_depth];
    char **stack_strings;

    stack_depth = backtrace(stack_addrs, max_depth);
    stack_strings = backtrace_symbols(stack_addrs, stack_depth);

    for (size_t i = 1; i < stack_depth; i++)
        fprintf(out, "    %s\n", stack_strings[i]);

    free(stack_strings); // malloc()ed by backtrace_symbols
    fflush(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x64, %esi
callq 0x33b0
movl %eax, %ebp
movq %r14, %rdi
movl %eax, %esi
callq 0x33c0
movq %rax, %r14
cmpl $0x2, %ebp
jb 0x44ad
movslq %ebp, %r12
movl $0x1, %r13d
leaq 0x3c8c(%rip), %r15      # 0x8120
movq (%r14,%r13,8), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3380
incq %r13
cmpq %r13, %r12
jne 0x4494
movq %r14, %rdi
callq 0x3300
movq %rbx, %rdi
callq 0x32e0
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::create_channels(int, int, int)
void CImage::create_channels(int num_channels, int Nx, int Ny) {
  CFramework *fw = CFramework::get_framework();

  this->channels_id = new int[num_channels];

  int N[2] = {Nx, Ny};  
  for (int ch = 0; ch < num_channels; ch++) {
    int id_matrix;
    fw->create_matrix(2, N, id_matrix);
    this->channels_id[ch] = id_matrix;
    PRINT_VERBOSE("I_%d creates matrix M_%d\n", this->id, id_matrix);
  }
  this->num_channels = num_channels;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %ebx
movq %rdi, %r14
callq 0x3fe4
movq %rax, %r15
movl %ebx, 0x8(%rsp)
movslq %ebx, %rbx
leaq (,%rbx,4), %rax
testl %ebx, %ebx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq %rax, 0x10(%r14)
movl %r12d, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
testl %ebx, %ebx
jle 0x4e9a
movl 0x8(%rsp), %ebx
leaq 0xc(%rsp), %r13
leaq 0x746f(%rip), %rbp      # 0xc2c1
xorl %r12d, %r12d
movq %r15, %rdi
movl $0x2, %esi
leaq 0x10(%rsp), %rdx
movq %r13, %rcx
callq 0x401c
movl 0xc(%rsp), %eax
movq 0x10(%r14), %rcx
movl %eax, (%rcx,%r12,4)
cmpb $0x1, (%rbp)
jne 0x4e92
movl 0xc(%r14), %esi
movl 0xc(%rsp), %edx
leaq 0x33b7(%rip), %rdi      # 0x8242
xorl %eax, %eax
callq 0x3070
incq %r12
cmpq %r12, %rbx
jne 0x4e55
movl 0x8(%rsp), %eax
movl %eax, 0x18(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::CImage()
CImage::CImage() {
  this->unique_id++;
  this->id = this->unique_id;
  this->channels_id = NULL;
  PRINT_VERBOSE("CImage created, I_%d\n", this->id);
}

// Assembly:
movl 0x741c(%rip), %esi      # 0xc2d4
incl %esi
movl %esi, 0x7414(%rip)      # 0xc2d4
movl %esi, 0xc(%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x73ef(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x4ee5
leaq 0x337e(%rip), %rdi      # 0x825c
xorl %eax, %eax
jmp 0x3070
retq
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::CImage(int, int, int, int)
CImage::CImage(int Nx, int Ny,
               int bits, int num_channels) {
  this->unique_id++;
  this->id = this->unique_id;
  //
  this->Nx = Nx;
  this->Ny = Ny;
  this->bits = bits;
  //
  PRINT_VERBOSE("CImage I_%d, %dx%d, %d bits, %d channels created\n",
    this->id, this->Nx, this->Ny, this->bits, num_channels);

  // Create data channels
  this->create_channels(num_channels, Nx, Ny);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movl 0x73d6(%rip), %esi      # 0xc2d4
incl %esi
movl %esi, 0x73ce(%rip)      # 0xc2d4
movl %esi, 0xc(%rdi)
movl %r14d, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
leaq 0x73a8(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x4f37
movl %ecx, %r8d
leaq 0x334a(%rip), %rdi      # 0x8272
movl %r14d, %edx
movl %ebx, %ecx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x3070
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4df0
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::~CImage()
CImage::~CImage() {
  PRINT_VERBOSE("CImage I_%d destroy\n", this->id);
  CFramework *fw = CFramework::get_framework();
  for (int ch = 0; ch < this->get_num_channels(); ch++) {
    int id_channel = this->channels_id[ch];
    fw->delete_matrix(id_channel);
  }
  if (this->channels_id != NULL)
    delete[] this->channels_id;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x7362(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x4f75
movl 0xc(%rbx), %esi
leaq 0x3336(%rip), %rdi      # 0x82a4
xorl %eax, %eax
callq 0x3070
callq 0x3fe4
cmpl $0x0, 0x18(%rbx)
jle 0x4fa2
movq %rax, %r14
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0x3f4c
incq %r15
movslq 0x18(%rbx), %rax
cmpq %rax, %r15
jl 0x4f86
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x4fb5
popq %rbx
popq %r14
popq %r15
jmp 0x3350
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4fbd
movq %rax, %rdi
callq 0x44cf
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::get_file_type(char*)
int CImage::get_file_type(char *filename) {
  const char *exts[] = {".RGB", ".PNG", ".LUM"};

  int type = -1;
  int i = 0;
  char *ext = (char*)exts[0];
  while (ext != NULL) {
    int indexCmp = strlen(filename) - strlen(ext);
    if (indexCmp >= 0) {
      char *extFile = (char*)&filename[indexCmp];
      if (strcasecmp(ext, extFile) == 0) {
        type = i;
  break;
      }
    }
    i++;
    ext = (char*)exts[i];
  }
  //
  if (type == -1) {
    PRINT_ERROR("Error: unknown file extension.\n");
    exit(-1);
  }
  return type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ebp, %ebp
leaq 0x32d3(%rip), %r15      # 0x82b9
leaq 0x365b(%rip), %r13      # 0x8648
testq %r15, %r15
je 0x504a
movq %r14, %rdi
callq 0x3160
movq %rax, %r12
movq %r15, %rdi
callq 0x3160
subq %rax, %r12
testl %r12d, %r12d
js 0x502e
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
addq %r14, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32a0
xorl %ecx, %ecx
testl %eax, %eax
sete %al
cmovel %ebp, %ebx
je 0x5043
movslq %ebp, %rax
incl %ebp
movslq 0x4(%r13,%rax,4), %r15
addq %r13, %r15
xorl %eax, %eax
testl %eax, %eax
je 0x4fed
jmp 0x504a
movb %al, %cl
leal (%rcx,%rcx,2), %eax
jmp 0x503d
cmpl $-0x1, %ebx
je 0x5060
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x363b
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::load(char*)
void CImage::load(char *filename) {
  // Obtain format by extension of file
  int type = get_file_type(filename);

  //////////////////////// read format
  switch (type) {
    case CIMAGE_FLOAT_RGB:
      this->load_float_RGB(filename);
      break;
    case CIMAGE_PNG:
      this->load_PNG(filename);
      break;
    case CIMAGE_LUM:
      this->load_LUM(filename);
      break;
    default:
      PRINT_ERROR("CImage: unknown file type: %s\n", filename);
      exit(-1);
  }
  PRINT_VERBOSE("Loaded image \"%s\", %dx%d, %d channels, %d bits in I_%d\n",
    filename, this->Nx, this->Ny,
    this->get_num_channels(), this->get_bits_per_channel(),
    this->id);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4fca
cmpl $0x2, %eax
je 0x509d
cmpl $0x1, %eax
je 0x5090
testl %eax, %eax
jne 0x50e3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x50ec
jmp 0x50a8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5268
jmp 0x50a8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x55c8
leaq 0x7212(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x50db
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x18(%r14), %r8d
movl 0x8(%r14), %r9d
movl 0xc(%r14), %eax
movl %eax, (%rsp)
leaq 0x324d(%rip), %rdi      # 0x831e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3070
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x367b
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::load_float_RGB(char*)
void CImage::load_float_RGB(char *filename) {
  int num_channels;
  size_t dummy;
  
  CFramework *fw = CFramework::get_framework();

  FILE *infile = fopen(filename, "rb");
  if (!infile) {
    PRINT_ERROR("CImage: error opening float RGB file %s\n!", filename);
    exit(-1);
  }

  dummy = fread(&this->Nx, sizeof(this->Nx), 1, infile);
  dummy += fread(&this->Ny, sizeof(this->Ny), 1, infile);
  dummy += fread(&num_channels, sizeof(num_channels), 1, infile);
  dummy = dummy; // To prevent the warning

  this->bits = 16;
  PRINT_VERBOSE("CImage load RGB (%dx%d), %d channels, in I_%d\n",
    this->Nx, this->Ny, num_channels, this->id);

  int id_data_all;
  float *data_ALL = fw->create_array(num_channels*this->Nx*this->Ny, id_data_all);
  dummy = fread(data_ALL, sizeof(float), num_channels*this->Nx*this->Ny, infile);
  fclose(infile);

  // Create data channels
  create_channels(num_channels, Nx, Ny);

  int idx_data = 0;
  for (int ch = 0; ch < num_channels; ch++) {
    float *m = this->get_channel(ch);
    for (int y = 0; y < Ny; y++) {
        for (int x = 0; x < Nx; x++) {
          m[y*this->Nx+x] = data_ALL[idx_data];
          idx_data++;
        }
    }
  }

  fw->delete_matrix(id_data_all);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3fe4
movq %rax, %r14
leaq 0x3004(%rip), %rsi      # 0x8110
movq %r15, %rdi
callq 0x32f0
testq %rax, %rax
je 0x525f
movq %rax, %r13
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x33d0
leaq 0x4(%rbx), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x33d0
movq %rsp, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x33d0
movl $0x10, 0x8(%rbx)
leaq 0x7153(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x518d
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movl (%rsp), %ecx
movl 0xc(%rbx), %r8d
leaq 0x3248(%rip), %rdi      # 0x83ce
xorl %eax, %eax
callq 0x3070
movslq (%rsp), %r15
movl (%rbx), %esi
imull %r15d, %esi
imull 0x4(%rbx), %esi
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
callq 0x4156
movq %rax, %r12
movslq (%rbx), %rax
imulq %r15, %rax
movslq 0x4(%rbx), %rdx
imulq %rax, %rdx
movl $0x4, %esi
movq %r12, %rdi
movq %r13, %rcx
callq 0x33d0
movq %r13, %rdi
callq 0x3240
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4df0
testq %r15, %r15
jle 0x5244
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %rbx, %rdi
movl %r13d, %esi
callq 0x5cc2
movslq 0x4(%rbx), %rcx
testq %rcx, %rcx
jle 0x523c
movl (%rbx), %edx
leaq (,%rdx,4), %rsi
xorl %edi, %edi
testl %edx, %edx
jle 0x5231
movslq %ebp, %r8
leaq (%r12,%r8,4), %r9
xorl %r8d, %r8d
movss (%r9,%r8,4), %xmm0
movss %xmm0, (%rax,%r8,4)
incq %r8
cmpq %r8, %rdx
jne 0x521a
addl %r8d, %ebp
incq %rdi
addq %rsi, %rax
cmpq %rcx, %rdi
jne 0x520c
incl %r13d
cmpl %r15d, %r13d
jne 0x51ec
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x3f4c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x36c2
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::save(char*, int)
void CImage::save(char *filename, int bits_per_channel) {
  // Obtain format by extension of file
  int type = get_file_type(filename);

  //////////////////////// read format
  switch (type) {
    case CIMAGE_FLOAT_RGB:
      this->save_float_RGB(filename);
      break;
    case CIMAGE_PNG:
      this->save_PNG(filename, bits_per_channel);
      break;
    case CIMAGE_LUM:
      PRINT_ERROR("CImage: can't save LUM images\n");
      exit(-1);
      break;
    default:
      PRINT_ERROR("CImage: unknown file type: %s\n", filename);
      exit(-1);
  }
  PRINT_VERBOSE("Saved image \"%s\", %dx%d, %d channels, %d bits\n",
    filename, this->Nx, this->Ny,
    this->get_num_channels(), this->get_bits_per_channel());
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4fca
testl %eax, %eax
je 0x57b3
cmpl $0x1, %eax
jne 0x57f3
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x58f2
jmp 0x57be
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5806
leaq 0x6afc(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x57ee
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x18(%r14), %r8d
movl 0x8(%r14), %r9d
leaq 0x2b95(%rip), %rdi      # 0x8375
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x3070
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x2, %eax
jne 0x57fd
callq 0x392d
movq %rbx, %rdi
callq 0x396f
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::save_float_RGB(char*)
void CImage::save_float_RGB(char *filename) {
  int num_channels;
  size_t dummy;

  FILE *outfile = fopen(filename, "wb");
  if (!outfile) {
    PRINT_ERROR("CImage: error creating float RGB file %s\n!", filename);
    exit(-1);
  }

  num_channels = this->get_num_channels();
  
  dummy = fwrite(&this->Nx, sizeof(this->Nx), 1, outfile);
  dummy += fwrite(&this->Ny, sizeof(this->Ny), 1, outfile);
  dummy += fwrite(&num_channels, sizeof(num_channels), 1, outfile);
  dummy = dummy; // To prevent the warning
  this->bits = this->get_bits_per_channel();
  PRINT_VERBOSE("CImage save RGB (%d, %d), %d channels, id %d\n",
    this->Nx, this->Ny, num_channels, this->id);

  for (int ch = 0; ch < num_channels; ch++) {
    float *m = this->get_channel(ch);
    dummy = fwrite(m, sizeof(float), this->Nx * this->Ny, outfile);
  }
  fclose(outfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28e5(%rip), %rsi      # 0x80ff
movq %r15, %rdi
callq 0x32f0
testq %rax, %rax
je 0x58ea
movq %rax, %r14
movl 0x18(%rbx), %eax
leaq 0x4(%rsp), %r15
movl %eax, (%r15)
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x3510
leaq 0x4(%rbx), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3510
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x3510
leaq 0x6a41(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x58a0
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movl 0x4(%rsp), %ecx
movl 0xc(%rbx), %r8d
leaq 0x2d5d(%rip), %rdi      # 0x85f6
xorl %eax, %eax
callq 0x3070
movl 0x4(%rsp), %r15d
testl %r15d, %r15d
jle 0x58d8
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5cc2
movslq (%rbx), %rcx
movslq 0x4(%rbx), %rdx
imulq %rcx, %rdx
movl $0x4, %esi
movq %rax, %rdi
movq %r14, %rcx
callq 0x3510
incl %ebp
cmpl %ebp, %r15d
jne 0x58ac
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3240
movq %r15, %rdi
callq 0x39b6
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::get_channel(int)
float *CImage::get_channel(int channel) {
  if (channel < 0 || channel > this->get_num_channels()) {
    PRINT_ERROR("invalid channel %d for image id %d\n", channel, this->id);
    exit(-1);
  }
  CFramework *fw = CFramework::get_framework();

  int channel_id = this->channels_id[channel];
  float *m = fw->find_matrix(channel_id)->data;  
  return m;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
js 0x5cf7
cmpl %ebx, 0x18(%r14)
jl 0x5cf7
callq 0x3fe4
movq 0x10(%r14), %rcx
movl %ebx, %edx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x4186
movq 0x18(%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movl %ebx, %esi
callq 0x3bd0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::read_tokens(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int CInspector::read_tokens(vector<string> *tokens, string input) {
  tokens->clear();

  istringstream iss(input);
  do {
    string sub;
    iss >> sub;
    if (sub.c_str() != NULL && sub != "")
      tokens->push_back(sub);
  } while (iss);

  return tokens->size();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rsi
callq 0x70f2
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x3470
leaq 0x10(%rsp), %r13
movq %rsp, %r15
leaq 0x2cf5(%rip), %r12      # 0x8a43
movq %r13, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3340
cmpq $0x0, (%rsp)
je 0x5d8c
movq %r15, %rdi
movq %r12, %rsi
callq 0x3100
testl %eax, %eax
je 0x5d8c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c8c
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x5da2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x40(%rsp,%rax)
je 0x5d4e
movq 0x8(%rbx), %r14
subq (%rbx), %r14
shrq $0x5, %r14
movq 0x61e4(%rip), %rsi      # 0xbfa8
leaq 0x20(%rsp), %rdi
callq 0x3370
leaq 0x98(%rsp), %rdi
callq 0x3120
movl %r14d, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x5e08
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x6199(%rip), %rsi      # 0xbfa8
leaq 0x20(%rsp), %rdi
callq 0x3370
leaq 0x98(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: list_of_ints(char*, char const*, int*, int)
void list_of_ints(char *dest, const char *separator, int *numbers, int N) {
  char buffer[1024];
  strcpy(dest, "");
  for (int i = 0; i < N; i++) {
    sprintf(buffer, "%d", numbers[i]);
    strcat(dest, buffer);
    if (i != N-1)
      strcat(dest, separator);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, 0x8(%rsp)
movb $0x0, (%rdi)
testl %ecx, %ecx
jle 0x5e99
movq %rdx, %rbx
movq %rdi, %r15
leal -0x1(%rcx), %ebp
movl %ecx, %r14d
leaq 0x10(%rsp), %r13
xorl %r12d, %r12d
movl (%rbx,%r12,4), %edx
movq %r13, %rdi
leaq 0x27e7(%rip), %rsi      # 0x8654
xorl %eax, %eax
callq 0x30a0
movq %r15, %rdi
movq %r13, %rsi
callq 0x34c0
cmpq %r12, %rbp
je 0x5e91
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x34c0
incq %r12
cmpq %r12, %r14
jne 0x5e5f
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::describe_matrix(MatrixInfo*)
void CInspector::describe_matrix(MatrixInfo *matrix) {
  if (matrix == NULL) {
    printf("No matrix chosen yet.\n");
    return;
  }
  //
  char dims_str[1024];
  list_of_ints(dims_str, " x ", matrix->N, matrix->num_dims);
  printf("Matrix id=%d, data at %p, %d dims: (%s).\n", matrix->id, matrix->data, matrix->num_dims, dims_str);
}

// Assembly:
testq %rdi, %rdi
je 0x5efd
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
movq 0x10(%rdi), %rdx
movl 0xc(%rdi), %ecx
leaq 0x278b(%rip), %rsi      # 0x8657
movq %rsp, %r14
movq %r14, %rdi
callq 0x5e2e
movq 0x18(%rbx), %rdx
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %ecx
leaq 0x2773(%rip), %rdi      # 0x865b
movq %r14, %r8
xorl %eax, %eax
callq 0x3070
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
leaq 0x2bcf(%rip), %rdi      # 0x8ad3
jmp 0x3400
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::get_pos_by_coordinates(int*, MatrixInfo*)
int CInspector::get_pos_by_coordinates(int *x, MatrixInfo *matrix) {
  int pos = 0;
  for (int i = 0; i < matrix->num_dims; i++) {
    pos += CInspector::prod_dims[i] * x[i];
  }

  return pos;
}

// Assembly:
movslq 0xc(%rsi), %rcx
testq %rcx, %rcx
jle 0x5fa5
xorl %edx, %edx
movq 0x635a(%rip), %rsi      # 0xc2e8
xorl %eax, %eax
movl (%rdi,%rdx,4), %r8d
imull (%rsi,%rdx,4), %r8d
addl %r8d, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x5f90
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::trim_right(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline string CInspector::trim_right (const string & s, const string & t)
{
    string d (s);
    string::size_type i (d.find_last_not_of (t));
    if (i == string::npos)
        return "";
    else
        return d.erase (d.find_last_not_of (t) + 1) ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x6fd2
movq (%r14), %rsi
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x3420
cmpq $-0x1, %rax
je 0x6f56
movq (%r14), %rsi
movq 0x8(%r14), %rcx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x3420
incq %rax
movq 0x8(%r14), %rcx
cmpq %rax, %rcx
jb 0x6f95
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rcx
movb $0x0, (%rcx,%rax)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x6fd2
jmp 0x6f6f
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1adf(%rip), %rdx      # 0x8a43
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x7062
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6f86
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1abc(%rip), %rdi      # 0x8a58
leaq 0x1aa1(%rip), %rsi      # 0x8a44
movq %rax, %rdx
xorl %eax, %eax
callq 0x33e0
jmp 0x6faf
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6fc9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./framework/framework.cpp
// Function: main
int main(int argc, char **argv) {
  CFramework *fw = CFramework::get_framework();  
  try {
    algorithm(argc, argv);
    delete fw;
  }
  catch(...) {    
    printf("A exception raised while running the algorithm.\n");
    printf("Backtrace:\n");
    fw->print_backtrace(stdout);
    // [ToDo]: call user handler for the exception
    exit(-1);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
callq 0x3fe4
movq %rax, %rbx
movl %ebp, %edi
movq %r14, %rsi
callq 0x75f9
testq %rbx, %rbx
je 0x73b1
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x3150
leaq 0x17b5(%rip), %rdi      # 0x8b7c
callq 0x3400
leaq 0x174d(%rip), %rdi      # 0x8b20
callq 0x3400
movq 0x4ba1(%rip), %rax      # 0xbf80
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x444c
callq 0x3c2e
movq %rax, %rbx
callq 0x3440
movq %rbx, %rdi
callq 0x34b0
movq %rax, %rdi
callq 0x44cf
nop
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./algo.cpp
// Function: computeHistogram(CImage&, unsigned int*)
void computeHistogram(CImage &input, unsigned *hist){
  // Compute number of pixels
  long int N = input.get_width() * input.get_height();
  int i = 0;

  // Initialize array
  for(i = 0; i <= MAX_INTENSITY; i++) hist[i] = 0;

  // Use first channel
  float *in = input.get_channel(0);
  // Iterate image
  for (i = 0; i < N; i++) {
    int value = (int) in[i];
    hist[value]++;
  }

  printf("Total # of pixels: %ld\n", N);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5d06
movl %eax, %r15d
movq %r14, %rdi
callq 0x5d02
movl %eax, %ebp
imull %r15d, %ebp
cmpl $0x0, 0x4e7e(%rip)      # 0xc2b0
js 0x7452
movq $-0x1, %rax
movl $0x0, 0x4(%rbx,%rax,4)
movslq 0x4e66(%rip), %rcx      # 0xc2b0
incq %rax
cmpq %rcx, %rax
jl 0x743b
movq %r14, %rdi
xorl %esi, %esi
callq 0x5cc2
testl %ebp, %ebp
jle 0x7477
movl %ebp, %ecx
xorl %edx, %edx
cvttss2si (%rax,%rdx,4), %esi
movslq %esi, %rsi
incl (%rbx,%rsi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x7464
movslq %ebp, %rsi
leaq 0x172f(%rip), %rdi      # 0x8bb0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3070
// File: /workspace/github_cpp_makefile_star2_O1/jpbalarini[P]otsus/./algo.cpp
// Function: segmentImage(CImage&, CImage*, int)
void segmentImage(CImage &input, CImage *output, int threshold) {
  // Compute number of pixels
  long int N = input.get_width() * input.get_height();
  // Modify output image
  // Use first channel
  float *in = input.get_channel(0);
  float *out = output->get_channel(0);
  // Iterate image
  for (int i = 0; i < N; i++) {
    int value = (int) in[i];
    // Build the segmented image
    if (value > threshold){
      out[i] = 255.0f;
    }else{
      out[i] = 0.0f;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
callq 0x5d06
movl %eax, %r12d
movq %r14, %rdi
callq 0x5d02
movl %eax, %ebp
imull %r12d, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x5cc2
movq %rax, %r14
movq %r15, %rdi
xorl %esi, %esi
callq 0x5cc2
testl %ebp, %ebp
jle 0x74fc
movl %ebp, %ecx
xorl %edx, %edx
movss 0x16cd(%rip), %xmm0     # 0x8bac
cvttss2si (%r14,%rdx,4), %esi
movaps %xmm0, %xmm1
cmpl %ebx, %esi
jg 0x74ef
xorps %xmm1, %xmm1
movss %xmm1, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x74df
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq