LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x9093(%rip), %rsi      # 0xd152
callq 0x33c0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x40db
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4213
movq -0x28(%rbp), %rcx
leaq -0x2c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x34c0
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
je 0x4117
movq -0x28(%rbp), %rdi
callq 0x32e0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x4213
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x2c(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x4, %esi
callq 0x34c0
movq %rax, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x416c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
imull -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x4143
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x4187
movq -0x50(%rbp), %rdi
callq 0x3440
movslq -0x3c(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x3c(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x4, %esi
callq 0x34c0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpq %rcx, %rax
je 0x4203
movq 0xedcf(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x8f62(%rip), %rsi      # 0xd155
movb $0x0, %al
callq 0x3470
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x4213
movq -0x28(%rbp), %rdi
callq 0x32e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x64, -0x18(%rbp)
leaq -0x340(%rbp), %rdi
movl $0x64, %esi
callq 0x34a0
cltq
movq %rax, -0x20(%rbp)
leaq -0x340(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x34b0
movq %rax, -0x348(%rbp)
movq $0x1, -0x350(%rbp)
movq -0x350(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x42bb
movq -0x10(%rbp), %rdi
movq -0x348(%rbp), %rax
movq -0x350(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x8ec2(%rip), %rsi      # 0xd162
movb $0x0, %al
callq 0x3470
movq -0x350(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x350(%rbp)
jmp 0x4276
movq -0x348(%rbp), %rdi
callq 0x33d0
movq -0x10(%rbp), %rdi
callq 0x33b0
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
nopl (%rax)
// File: jpbalarini[P]otsus/./framework/CFramework.h
// Function: MatrixInfo::MatrixInfo(int, int, int*, float*)
MatrixInfo(int id, int num_dims, int *N, float *data) {
      this->id = id;
      this->num_dims = num_dims;
      //
      this->N = new int[num_dims];
      for (int i = 0; i < num_dims; i++) {
        this->N[i] = N[i];
      }
      //
      this->data = data;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0xe867(%rip), %rcx      # 0x12cc0
addq $0x10, %rcx
movq %rcx, (%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0xc(%rax)
movslq -0x10(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x44d0
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x44a3
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x18(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x3b50
movq %rax, -0x20(%rbp)
movslq -0xc(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x680a
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rdx
movl $0x2, %esi
leaq -0x30(%rbp), %rcx
callq 0x3be0
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %edx
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
leaq 0xcb49(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x67fd
movq -0x38(%rbp), %rax
movl 0xc(%rax), %esi
movl -0x30(%rbp), %edx
leaq 0x6a4e(%rip), %rdi      # 0xd244
movb $0x0, %al
callq 0x3070
jmp 0x67ff
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x67a9
movq -0x38(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x18(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl 0xcb02(%rip), %ecx      # 0x1333c
addl $0x1, %ecx
movl %ecx, 0xcaf9(%rip)      # 0x1333c
movl 0xcaf3(%rip), %ecx      # 0x1333c
movl %ecx, 0xc(%rax)
movq $0x0, 0x10(%rax)
leaq 0xcace(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x6875
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x69f0(%rip), %rdi      # 0xd25e
movb $0x0, %al
callq 0x3070
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0xca95(%rip), %ecx      # 0x1333c
addl $0x1, %ecx
movl %ecx, 0xca8c(%rip)      # 0x1333c
movl 0xca86(%rip), %ecx      # 0x1333c
movl %ecx, 0xc(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x8(%rax)
leaq 0xca58(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x68f8
movq -0x20(%rbp), %rax
movl 0xc(%rax), %esi
movl (%rax), %edx
movl 0x4(%rax), %ecx
movl 0x8(%rax), %r8d
movl -0x18(%rbp), %r9d
leaq 0x6983(%rip), %rdi      # 0xd274
movb $0x0, %al
callq 0x3070
movq -0x20(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
callq 0x6740
addq $0x20, %rsp
popq %rbp
retq
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0xc9fe(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x6949
movq -0x20(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x6968(%rip), %rdi      # 0xd2a6
xorl %eax, %eax
callq 0x3070
jmp 0x6947
jmp 0x6949
callq 0x3b50
movq %rax, -0x28(%rbp)
jmp 0x6954
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x30(%rbp)
callq 0x69f0
movl %eax, -0x2c(%rbp)
jmp 0x6977
movl -0x30(%rbp), %eax
movl -0x2c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x69ae
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x3a30
jmp 0x69a1
jmp 0x69a3
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6963
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x69d6
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x69d4
movq -0x38(%rbp), %rdi
callq 0x3440
jmp 0x69d6
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x4340
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xc2c9(%rip), %rax      # 0x12cf0
movq %rax, -0x30(%rbp)
movq 0xc2c6(%rip), %rax      # 0x12cf8
movq %rax, -0x28(%rbp)
movq 0xc2c3(%rip), %rax      # 0x12d00
movq %rax, -0x20(%rbp)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x6aca
movq -0x10(%rbp), %rdi
callq 0x3190
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
callq 0x3190
movq %rax, %rcx
movq -0x58(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x6ab2
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3370
cmpl $0x0, %eax
jne 0x6ab0
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x6aca
jmp 0x6ab2
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movslq -0x38(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rax
movq %rax, -0x40(%rbp)
jmp 0x6a57
cmpl $-0x1, -0x34(%rbp)
jne 0x6b16
movq 0xc4e1(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x65e8(%rip), %rsi      # 0xd0c9
movl $0x6b, %edx
leaq 0x67dd(%rip), %rcx      # 0xd2ca
movb $0x0, %al
callq 0x3470
movq 0xc4bd(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x67dc(%rip), %rsi      # 0xd2e1
movb $0x0, %al
callq 0x3470
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
movl -0x34(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq -0x10(%rbp), %rsi
callq 0x6a10
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
testl %eax, %eax
je 0x6b64
jmp 0x6b50
movl -0x18(%rbp), %eax
subl $0x1, %eax
je 0x6b73
jmp 0x6b5a
movl -0x18(%rbp), %eax
subl $0x2, %eax
je 0x6b82
jmp 0x6b91
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6c40
jmp 0x6bdb
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6e80
jmp 0x6bdb
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x74b0
jmp 0x6bdb
movq 0xc420(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x6527(%rip), %rsi      # 0xd0c9
movl $0x81, %edx
leaq 0x671c(%rip), %rcx      # 0xd2ca
movb $0x0, %al
callq 0x3470
movq 0xc3fc(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x6737(%rip), %rsi      # 0xd301
movb $0x0, %al
callq 0x3470
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
leaq 0xc747(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x6c38
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl (%rdi), %eax
movl %eax, -0x2c(%rbp)
movl 0x4(%rdi), %eax
movl %eax, -0x28(%rbp)
callq 0x69f0
movq -0x20(%rbp), %rdi
movl %eax, -0x24(%rbp)
callq 0x77a0
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x28(%rbp), %ecx
movl -0x24(%rbp), %r8d
movl %eax, %r9d
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
leaq 0x66f2(%rip), %rdi      # 0xd320
movl %eax, (%rsp)
movb $0x0, %al
callq 0x3070
addq $0x40, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq -0x10(%rbp), %rsi
callq 0x6a10
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
testl %eax, %eax
je 0x7807
jmp 0x77f3
movl -0x1c(%rbp), %eax
subl $0x1, %eax
je 0x7819
jmp 0x77fd
movl -0x1c(%rbp), %eax
subl $0x2, %eax
je 0x782e
jmp 0x7874
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7920
jmp 0x78be
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x7ab0
jmp 0x78be
movq 0xb783(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x588a(%rip), %rsi      # 0xd0c9
movl $0x97, %edx
leaq 0x5a7f(%rip), %rcx      # 0xd2ca
movb $0x0, %al
callq 0x3470
movq 0xb75f(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x5af5(%rip), %rsi      # 0xd358
movb $0x0, %al
callq 0x3470
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
movq 0xb73d(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x5844(%rip), %rsi      # 0xd0c9
movl $0x9b, %edx
leaq 0x5a39(%rip), %rcx      # 0xd2ca
movb $0x0, %al
callq 0x3470
movq 0xb719(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x5a54(%rip), %rsi      # 0xd301
movb $0x0, %al
callq 0x3470
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
leaq 0xba64(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x7911
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movl (%rdi), %eax
movl %eax, -0x34(%rbp)
movl 0x4(%rdi), %eax
movl %eax, -0x30(%rbp)
callq 0x69f0
movq -0x28(%rbp), %rdi
movl %eax, -0x2c(%rbp)
callq 0x77a0
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl %eax, %r9d
leaq 0x5a6d(%rip), %rdi      # 0xd377
movb $0x0, %al
callq 0x3070
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x57fe(%rip), %rsi      # 0xd141
callq 0x33c0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x799d
movq 0xb65e(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x5765(%rip), %rsi      # 0xd0c9
movl $0x1fe, %edx            # imm = 0x1FE
leaq 0x595a(%rip), %rcx      # 0xd2ca
movb $0x0, %al
callq 0x3470
movq 0xb63a(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x5c41(%rip), %rsi      # 0xd5cd
movb $0x0, %al
callq 0x3470
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
movq -0x40(%rbp), %rdi
callq 0x69f0
movq -0x40(%rbp), %rdi
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x35d0
movq -0x40(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x4, %rdi
movq -0x28(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x35d0
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rcx
leaq -0x14(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x35d0
movq -0x40(%rbp), %rdi
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x77a0
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
leaq 0xb902(%rip), %rax      # 0x13329
testb $0x1, (%rax)
je 0x7a4a
movq -0x40(%rbp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movl -0x14(%rbp), %ecx
movl 0xc(%rax), %r8d
leaq 0x5bb5(%rip), %rdi      # 0xd5f8
movb $0x0, %al
callq 0x3070
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7a97
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x81e0
movq -0x40(%rbp), %rcx
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movl (%rcx), %eax
imull 0x4(%rcx), %eax
movslq %eax, %rdx
movq -0x28(%rbp), %rcx
movl $0x4, %esi
callq 0x35d0
movq %rax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x7a51
movq -0x28(%rbp), %rdi
callq 0x32e0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x8215
movq -0x30(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
callq 0x69f0
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
jle 0x8265
movq 0xad9c(%rip), %rax      # 0x12fb8
movq (%rax), %rdi
leaq 0x4ea3(%rip), %rsi      # 0xd0c9
movl $0x226, %edx            # imm = 0x226
leaq 0x5098(%rip), %rcx      # 0xd2ca
movb $0x0, %al
callq 0x3470
movq -0x30(%rbp), %rax
movq 0xad74(%rip), %rcx      # 0x12fb8
movq (%rcx), %rdi
movl -0xc(%rbp), %edx
movl 0xc(%rax), %ecx
leaq 0x53d2(%rip), %rsi      # 0xd626
movb $0x0, %al
callq 0x3470
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
callq 0x3b50
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3dc0
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rsi, -0x1c8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x98c0
movq -0x1c8(%rbp), %rsi
leaq -0x190(%rbp), %rdi
movl $0x8, %edx
callq 0x3530
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x3450
movq -0x1d0(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3430
jmp 0x8343
leaq -0x1b0(%rbp), %rdi
callq 0x3170
cmpq $0x0, %rax
je 0x83b0
leaq 0x5791(%rip), %rsi      # 0xdaed
leaq -0x1b0(%rbp), %rdi
callq 0x98e0
movb %al, -0x1d1(%rbp)
jmp 0x8370
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x837c
jmp 0x83b0
movq -0x8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x9910
jmp 0x838e
jmp 0x83b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x3200
jmp 0x8428
leaq -0x1b0(%rbp), %rdi
callq 0x3200
movq -0x190(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x190(%rbp,%rax), %rdi
callq 0x3420
movb %al, -0x1d2(%rbp)
jmp 0x83dc
movb -0x1d2(%rbp), %al
testb $0x1, %al
jne 0x831b
jmp 0x83ec
movq -0x8(%rbp), %rdi
callq 0x9980
movl %eax, -0x1d8(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x31a0
movl -0x1d8(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x31a0
movq -0x1b8(%rbp), %rdi
callq 0x3560
// File: 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
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x5688(%rip), %rsi      # 0xdaed
callq 0x32d0
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x84e2
leaq -0x420(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x424(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x51ed(%rip), %rsi      # 0xd688
movb $0x0, %al
callq 0x30b0
movq -0x8(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x3580
movl -0x424(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x84cf
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3580
jmp 0x84d1
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x8474
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopl (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x8516
leaq 0x517e(%rip), %rdi      # 0xd68b
movb $0x0, %al
callq 0x3070
jmp 0x8563
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
leaq 0x516f(%rip), %rsi      # 0xd6a2
callq 0x8440
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
leaq -0x410(%rbp), %r8
leaq 0x514a(%rip), %rdi      # 0xd6a6
movb $0x0, %al
callq 0x3070
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x86a1
movq 0xacd3(%rip), %rax      # 0x13350
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x18(%rbp), %rdx
imull (%rcx,%rdx,4), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x866a
movl -0x14(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::process_error(int)
void CInspector::process_error(int err_code) {
  const char *msg = "OK";
  switch (err_code) {
    case INSPECTOR_ERR_BAD_ARGUMENTS:
      msg = "incorrect number of arguments";
      break;
    case INSPECTOR_ERR_NO_MATRIX_ARGUMENT:
      msg = "no matrix identifier specified";
      break;
    case INSPECTOR_ERR_MATRIX_DOES_NOT_EXIST:
      msg = "matrix doesn't exist";
      break;
    case INSPECTOR_ERR_NO_MATRIX_SELECTED_YET:
      msg = "no matrix selected yet";
      break;
    case INSPECTOR_ERR_COORDINATES_ARGUMENT:
      msg = "wrong number of coordinates for the selected matrix";
      break;
    case INSPECTOR_ERR_OUT_OF_BOUNDS:
      msg = "out of bounds";
      break;
    case INSPECTOR_ERR_NO_FILENAME:
      msg = "no filename specified";
      break;
    case INSPECTOR_ERR_MEMORY_INFO:
      msg = "can't get memory information";
      break;
    case INSPECTOR_ERR_READ_ERROR:
      msg = "read error";
      break;
    case INSPECTOR_ERR_INCOMPATIBLE_DIMENSIONS:
      msg = "incompatible dimensions";
      break;
    case INSPECTOR_ERR_CAN_NOT_OPEN_FILE:
      msg = "can't open file";
      break;
    default:
      msg = "Unknown error";
  }

  printf("Error %d: %s.\n", err_code, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
leaq 0x4543(%rip), %rax      # 0xd935
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
addl $0xb, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0xa, %eax
ja 0x94b4
movq -0x18(%rbp), %rax
leaq 0x4246(%rip), %rcx      # 0xd65c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4512(%rip), %rax      # 0xd938
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4520(%rip), %rax      # 0xd956
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x452f(%rip), %rax      # 0xd975
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4537(%rip), %rax      # 0xd98a
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4541(%rip), %rax      # 0xd9a1
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4568(%rip), %rax      # 0xd9d5
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4569(%rip), %rax      # 0xd9e3
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4572(%rip), %rax      # 0xd9f9
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4582(%rip), %rax      # 0xda16
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x4580(%rip), %rax      # 0xda21
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x458b(%rip), %rax      # 0xda39
movq %rax, -0x10(%rbp)
jmp 0x94bf
leaq 0x458e(%rip), %rax      # 0xda49
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x458a(%rip), %rdi      # 0xda57
movb $0x0, %al
callq 0x3070
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x3180
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq $-0x1, %rdx
callq 0x35a0
movq %rax, -0x40(%rbp)
cmpq $-0x1, -0x40(%rbp)
jne 0x9dba
leaq -0x41(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x3570
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq 0x3d63(%rip), %rsi      # 0xdaed
callq 0x9a70
jmp 0x9d91
leaq -0x41(%rbp), %rdi
callq 0x3340
movl $0x1, -0x58(%rbp)
jmp 0x9e1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x3340
jmp 0x9e31
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movq $-0x1, %rdx
movq %rdx, -0x80(%rbp)
callq 0x35a0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rdx
movq %rax, %rsi
incq %rsi
callq 0x30e0
movq %rax, -0x78(%rbp)
jmp 0x9df5
movq -0x78(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x3180
jmp 0x9e04
movl $0x1, -0x58(%rbp)
jmp 0x9e1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x9e31
leaq -0x38(%rbp), %rdi
callq 0x3200
movq -0x60(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3200
movq -0x50(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x3b50
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0xb060
jmp 0xac6d
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xac85
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0xacf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3160
leaq 0x2e8f(%rip), %rdi      # 0xdb32
xorl %eax, %eax
callq 0x3070
jmp 0xacac
leaq 0x2a2d(%rip), %rdi      # 0xd6e0
xorl %eax, %eax
callq 0x3070
jmp 0xacbc
movq -0x18(%rbp), %rdi
movq 0x82b9(%rip), %rax      # 0x12f80
movq (%rax), %rsi
callq 0x4220
jmp 0xacd1
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x33e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3500
jmp 0xacee
jmp 0xacf9
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3560
movq %rax, %rdi
callq 0x4340
nop
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x82d0
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x82b0
movl %eax, %ecx
movl -0x30(%rbp), %eax
imull %ecx, %eax
cltq
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x85be(%rip), %eax      # 0x13318
jg 0xad76
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xad51
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x81e0
movq %rax, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0xadc2
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cvttss2si (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xad8c
movq -0x18(%rbp), %rsi
leaq 0x2d9b(%rip), %rdi      # 0xdb68
movb $0x0, %al
callq 0x3070
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x82d0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x82b0
movl %eax, %ecx
movl -0x3c(%rbp), %eax
imull %ecx, %eax
cltq
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x81e0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x81e0
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movslq -0x34(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xae91
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
cvttss2si (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jle 0xae74
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movss 0x2cf7(%rip), %xmm0     # 0xdb64
movss %xmm0, (%rax,%rcx,4)
jmp 0xae84
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
jmp 0xae86
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xae3b
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: kiudee[P]VAHD-Projekt/Supervisor.cpp
// Function: Supervisor::RemoveRealChild(DoubleObj*)
Action Supervisor::RemoveRealChild(DoubleObj *dob)
{
    std::cout << "Node " << (dob->num) << " leaves. Ciao.\n";
    Relay *subj = subjects.at(dob->num);
    subjects.erase(dob->num);
    delete(subj);
    delete dob;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x1bb91(%rip), %rdi     # 0x20fd0
leaq 0x11dc4(%rip), %rsi     # 0x1720a
callq 0x31b0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
callq 0x3370
movq %rax, %rdi
leaq 0x11daa(%rip), %rsi     # 0x17210
callq 0x31b0
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x5e50
movq -0x28(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x18(%rbp)
addq $0xa8, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x5e80
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x20(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x54cf
movq -0x20(%rbp), %rdi
movl $0x28, %esi
callq 0x31d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_create(Subject*, Subject*)
Subject *Subject::_create(Subject *s, Subject *t)
{
    Subject *rs;  // relay subject

    rs = NULL;
    if (s != this) {
        if (WARNING) {
            std::cout << "-- Warning! " << s->_debugID << " cannot call 'new' for " << _debugID << ".\n";
        }
        t->_destruct();
    } else {
        _activeSubject = s;  // recover _activeSubject (NULL after creation of t)
        rs = new Subject((Subject *) t);
    }
    return rs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, -0x20(%rbp)
cmpq %rax, -0x10(%rbp)
je 0x5752
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x57a5
movq -0x10(%rbp), %rcx
leaq 0x1bab3(%rip), %rax     # 0x21210
movq %rcx, (%rax)
movl $0x60, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
callq 0x8680
jmp 0x577f
movq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x57a5
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x60, %esi
callq 0x31d0
jmp 0x57af
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x3330
nopl (%rax,%rax)
// File: kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Message::_Message(void (Subject::*)(Object*), Object*&)
inline _Message(_SubjectCall c, Object* &p) {
        debugID = _Messages;
        _Messages++;
        source = 0;
        sink = 0;
        if (_Messages > MAXMESSAGES && WARNING) {
            std::cout << "-- Warning! More than " << MAXMESSAGES << " messages.\n";
        }
        VerbPtr = c;
        ObjPtr = p;
        next = NULL;
        p = NULL;  // Object now gone for calling subject
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movq %rdi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rax, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x1b701(%rip), %rcx     # 0x21218
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x1b6f4(%rip), %rcx     # 0x21218
movq (%rcx), %rdx
addq $0x1, %rdx
leaq 0x1b6e6(%rip), %rcx     # 0x21218
movq %rdx, (%rcx)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x1b6cc(%rip), %rax     # 0x21218
cmpq $0x9c40, (%rax)         # imm = 0x9C40
jbe 0x5b8c
xorl %eax, %eax
testb $0x1, %al
jne 0x5b5d
jmp 0x5b8c
movq 0x1b46c(%rip), %rdi     # 0x20fd0
leaq 0x116b5(%rip), %rsi     # 0x17220
callq 0x31b0
movq %rax, %rdi
movl $0x9c40, %esi           # imm = 0x9C40
callq 0x3320
movq %rax, %rdi
leaq 0x116ee(%rip), %rsi     # 0x17275
callq 0x31b0
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq %rdx, 0x20(%rax)
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x28(%rax)
movq $0x0, 0x30(%rax)
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Object::Object()
Object::Object()
{
    _debugID = _numObjects;
    _numObjects++;
    if (WARNING && _numObjects > MAXOBJECTS) {
        std::cout << "-- Warning! More than " << MAXOBJECTS << " objects.\n";
    }
    _owner = NULL;
    _source = NULL;
    _sink = NULL;
    if (_activeSubject == NULL) {
        if (WARNING) {
            std::cout << "--Warning! Object created outside of subjects environment.\n";
        }
    } else {
        _owner = _activeSubject;
        if (DEBUG) {
            std::cout << "-- Creating object " << _debugID << " by subject " << _activeSubject->_debugID << ".\n";
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x1b0a1(%rip), %rcx     # 0x211f8
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq 0x1b094(%rip), %rcx     # 0x211f8
movq (%rcx), %rdx
addq $0x1, %rdx
leaq 0x1b086(%rip), %rcx     # 0x211f8
movq %rdx, (%rcx)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
leaq 0x1b07c(%rip), %rax     # 0x21210
cmpq $0x0, (%rax)
jne 0x619c
jmp 0x61ae
movq -0x10(%rbp), %rax
leaq 0x1b069(%rip), %rcx     # 0x21210
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
popq %rbp
retq
// File: kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::Subject()
Subject::Subject()
{
    _setup();
    _Relays = new _rLinks();
    _Subjects = new _sLinks();
    _activeRelays = new _rLinks();
    _activeSubjects = new _sLinks();
    _sink = new Relay(SINK, (Subject *) this);

    if (_activeSubject == NULL && _debugID > 0) {
        if (WARNING) {
            std::cout << "-- Warning! Subject created outside of the subjects environment.\n";
        }
    } else {
        if (DEBUG) {
            std::cout << "-- Creating subject " << _debugID << ".\n";
        }
        _activeSubject = NULL;  // new subject can only use 'call' in constructor
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
leaq 0x1a885(%rip), %rax     # 0x20bb0
movq %rax, (%rdi)
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl $0x10, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x20(%rbp)
callq 0x6e10
jmp 0x6351
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x30(%rax)
movl $0x10, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
callq 0x6e30
jmp 0x6378
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x40(%rax)
movl $0x10, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x6e10
jmp 0x639f
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x10, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
callq 0x6e30
jmp 0x63c6
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x48(%rax)
movl $0x48, %edi
callq 0x31c0
movq -0x28(%rbp), %rdx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
xorl %esi, %esi
callq 0x6e50
jmp 0x63f3
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x20(%rax)
leaq 0x1ae0a(%rip), %rax     # 0x21210
cmpq $0x0, (%rax)
jne 0x64b3
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0x64b3
jmp 0x64c1
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x31d0
jmp 0x64c7
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x31d0
jmp 0x64c7
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x31d0
jmp 0x64c7
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x31d0
jmp 0x64c7
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x48, %esi
callq 0x31d0
jmp 0x64c7
leaq 0x1ad56(%rip), %rax     # 0x21210
movq $0x0, (%rax)
addq $0x50, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x3330
// File: kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_setup()
void Subject::_setup()
{
    _debugID = _numSubjects;
    _numSubjects++;
    if (_numSubjects > MAXSUBJECTS && WARNING) {
        std::cout << "-- Warning! More than " << MAXSUBJECTS << " subjects.\n";
    }
    _parent = _activeSubject;
    _child = NULL;

    _sink = NULL;
    parent = NULL;
    source = 0;
    sink = 0;

    _Relays = NULL;
    _Subjects = NULL;
    _activeRelays = NULL;
    _activeSubjects = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x1acdd(%rip), %rcx     # 0x21208
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
leaq 0x1accf(%rip), %rax     # 0x21208
movq (%rax), %rcx
addq $0x1, %rcx
leaq 0x1acc1(%rip), %rax     # 0x21208
movq %rcx, (%rax)
leaq 0x1acb7(%rip), %rax     # 0x21208
cmpq $0x2710, (%rax)         # imm = 0x2710
jbe 0x6591
xorl %eax, %eax
testb $0x1, %al
jne 0x6562
jmp 0x6591
movq 0x1aa67(%rip), %rdi     # 0x20fd0
leaq 0x10cb0(%rip), %rsi     # 0x17220
callq 0x31b0
movq %rax, %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x3320
movq %rax, %rdi
leaq 0x10cbb(%rip), %rsi     # 0x17247
callq 0x31b0
movq -0x10(%rbp), %rax
leaq 0x1ac74(%rip), %rcx     # 0x21210
movq (%rcx), %rcx
movq %rcx, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x50(%rax)
movq $0x0, 0x58(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x40(%rax)
movq $0x0, 0x38(%rax)
movq $0x0, 0x48(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)