LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x3160
movq %rax, %r15
leaq 0x39af(%rip), %r12      # 0x82b9
xorl %r14d, %r14d
leaq 0x3d34(%rip), %r13      # 0x8648
testq %r12, %r12
je 0x495a
movq %r12, %rdi
callq 0x3160
movq %r15, %rsi
subq %rax, %rsi
testl %esi, %esi
js 0x4940
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addq %rbx, %rsi
movq %r12, %rdi
callq 0x32e0
testl %eax, %eax
je 0x494d
movslq 0x4(%r13,%r14,4), %r12
addq %r13, %r12
incq %r14
jmp 0x4914
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x765f(%rip), %rbx      # 0xbfc0
movq (%rbx), %rdi
leaq 0x371c(%rip), %rsi      # 0x8087
leaq 0x3956(%rip), %rcx      # 0x82c8
pushq $0x6b
popq %rdx
xorl %eax, %eax
callq 0x33c0
movq (%rbx), %rcx
leaq 0x3959(%rip), %rdi      # 0x82df
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x3520
pushq $-0x1
popq %rdi
callq 0x3340
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x48ec
cmpl $0x2, %eax
je 0x49d1
cmpl $0x1, %eax
je 0x49c4
testl %eax, %eax
jne 0x4a17
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4a58
jmp 0x49dc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4c26
jmp 0x49dc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x507a
leaq 0x78e6(%rip), %rax      # 0xc2c9
cmpb $0x1, (%rax)
jne 0x4a0f
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x18(%r14), %r8d
movl 0x8(%r14), %r9d
movl 0xc(%r14), %eax
movl %eax, (%rsp)
leaq 0x3919(%rip), %rdi      # 0x831e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3070
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x75a2(%rip), %r14      # 0xbfc0
movq (%r14), %rdi
leaq 0x365f(%rip), %rsi      # 0x8087
leaq 0x3899(%rip), %rcx      # 0x82c8
movl $0x81, %edx
xorl %eax, %eax
callq 0x33c0
movq (%r14), %rdi
leaq 0x38ba(%rip), %rsi      # 0x82ff
movq %rbx, %rdx
xorl %eax, %eax
callq 0x33c0
pushq $-0x1
popq %rdi
callq 0x3340
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x48ec
testl %eax, %eax
je 0x52e1
cmpl $0x1, %eax
jne 0x5321
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x54c8
jmp 0x52ec
movq %r14, %rdi
movq %rbx, %rsi
callq 0x53a2
leaq 0x6fd6(%rip), %rax      # 0xc2c9
cmpb $0x1, (%rax)
jne 0x531c
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x18(%r14), %r8d
movl 0x8(%r14), %r9d
leaq 0x3067(%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 0x5361
movq 0x6c93(%rip), %rbx      # 0xbfc0
movq (%rbx), %rdi
leaq 0x2d50(%rip), %rsi      # 0x8087
leaq 0x2f8a(%rip), %rcx      # 0x82c8
movl $0x97, %edx
xorl %eax, %eax
callq 0x33c0
movq (%rbx), %rcx
leaq 0x3002(%rip), %rdi      # 0x8356
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x3520
jmp 0x5399
movq 0x6c58(%rip), %r14      # 0xbfc0
movq (%r14), %rdi
leaq 0x2d15(%rip), %rsi      # 0x8087
leaq 0x2f4f(%rip), %rcx      # 0x82c8
movl $0x9b, %edx
xorl %eax, %eax
callq 0x33c0
movq (%r14), %rdi
leaq 0x2f70(%rip), %rsi      # 0x82ff
movq %rbx, %rdx
xorl %eax, %eax
callq 0x33c0
pushq $-0x1
popq %rdi
callq 0x3340
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x2d45(%rip), %rsi      # 0x80ff
movq %r15, %rdi
callq 0x3320
testq %rax, %rax
je 0x5488
movq %rax, %r14
movl 0x18(%rbx), %eax
leaq 0x4(%rsp), %r15
movl %eax, (%r15)
pushq $0x4
popq %r12
pushq $0x1
popq %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3520
leaq 0x4(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3520
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3520
leaq 0x6ead(%rip), %rax      # 0xc2c9
movl (%r15), %ebp
cmpb $0x1, (%rax)
jne 0x543d
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movl 0xc(%rbx), %r8d
leaq 0x31c2(%rip), %rdi      # 0x85f6
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3070
xorl %r15d, %r15d
pushq $0x4
popq %r12
cmpl %ebp, %r15d
jge 0x5472
movq %rbx, %rdi
movl %r15d, %esi
callq 0x598a
movslq (%rbx), %rcx
movslq 0x4(%rbx), %rdx
imulq %rcx, %rdx
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x3520
incl %r15d
jmp 0x5444
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3270
movq 0x6b31(%rip), %rbx      # 0xbfc0
movq (%rbx), %rdi
leaq 0x2bee(%rip), %rsi      # 0x8087
leaq 0x2e28(%rip), %rcx      # 0x82c8
movl $0x1fe, %edx            # imm = 0x1FE
xorl %eax, %eax
callq 0x33c0
movq (%rbx), %rdi
leaq 0x3115(%rip), %rsi      # 0x85cb
movq %r15, %rdx
xorl %eax, %eax
callq 0x33c0
pushq $-0x1
popq %rdi
callq 0x3340
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
js 0x59be
cmpl %ebx, 0x18(%r14)
jl 0x59be
callq 0x38d6
movq 0x10(%r14), %rcx
movl %ebx, %edx
movl (%rcx,%rdx,4), %esi
movq %rax, %rdi
callq 0x3a20
movq 0x18(%rax), %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x65fb(%rip), %r15      # 0xbfc0
movq (%r15), %rdi
leaq 0x26b8(%rip), %rsi      # 0x8087
leaq 0x28f2(%rip), %rcx      # 0x82c8
movl $0x226, %edx            # imm = 0x226
xorl %eax, %eax
callq 0x33c0
movq (%r15), %rdi
movl 0xc(%r14), %ecx
leaq 0x2c34(%rip), %rsi      # 0x8624
movl %ebx, %edx
xorl %eax, %eax
callq 0x33c0
pushq $-0x1
popq %rdi
callq 0x3340
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x661c
leaq 0x20(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3490
leaq 0x10(%rsp), %r13
movq %rsp, %r15
leaq 0x2ffa(%rip), %r12      # 0x8a43
movq %r13, (%rsp)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3370
cmpq $0x0, (%rsp)
je 0x5a84
movq %r15, %rdi
movq %r12, %rsi
callq 0x6624
testb %al, %al
je 0x5a84
movq %rbx, %rdi
movq %r15, %rsi
callq 0x662e
movq %r15, %rdi
callq 0x3170
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x40(%rsp,%rax)
je 0x5a49
movq 0x8(%rbx), %r14
subq (%rbx), %r14
shrq $0x5, %r14
leaq 0x20(%rsp), %rdi
callq 0x3180
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
callq 0x3170
leaq 0x20(%rsp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x34c0
// File: /workspace/github_cpp_makefile_star2_O2/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
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
leal -0x1(%rbx), %r15d
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ebx
movb $0x0, (%rdi)
leaq 0x10(%rsp), %rbp
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x5b52
movl (%r14,%r13,4), %edx
movq %rbp, %rdi
leaq 0x2b2b(%rip), %rsi      # 0x8654
xorl %eax, %eax
callq 0x30a0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x34d0
cmpq %r13, %r15
je 0x5b4d
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x34d0
incq %r13
jmp 0x5b16
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5bb5
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
movq 0x10(%rdi), %rdx
movl 0xc(%rdi), %ecx
leaq 0x2ad3(%rip), %rsi      # 0x8657
movq %rsp, %r14
movq %r14, %rdi
callq 0x5ae2
movq 0x18(%rbx), %rdx
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %ecx
leaq 0x2abb(%rip), %rdi      # 0x865b
movq %r14, %r8
xorl %eax, %eax
callq 0x3070
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
leaq 0x2ecc(%rip), %rdi      # 0x8a88
jmp 0x3430
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl 0xc(%rsi), %ecx
movq 0x66b6(%rip), %rdx      # 0xc2f0
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x5c59
movl (%rdi,%rsi,4), %r8d
imull (%rdx,%rsi,4), %r8d
addl %r8d, %eax
incq %rsi
jmp 0x5c43
retq
// File: /workspace/github_cpp_makefile_star2_O2/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::inspector(CFramework*, char const*, int)
void CInspector::inspector(CFramework *fw, const char *file, int line) {
  printf("\nCLI Inpector called at file %s:%d\n", file, line);
  printf("(C) 2011 Miguel Colom.\n");

  string PROMPT = "> ";
  char buffer[4096];

  string input = "";
  while (input != "q" && input != "quit" && input != "exit") {
    cout << PROMPT;
    cin.getline(buffer, 4096);
    input = string(buffer);
    input = trim(input);
    int err_code = process_input(input, fw);
    if (err_code != INSPECTOR_OK)
      process_error(err_code);
  }
  printf("\nCLI Inpector exiting.\nResuming execution from %s:%d.\n\n", file, line);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10c8, %rsp           # imm = 0x10C8
movq %rdi, 0x18(%rsp)
leaq 0x25ad(%rip), %rdi      # 0x89d4
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
xorl %eax, %eax
callq 0x3070
leaq 0x26a2(%rip), %rdi      # 0x8ae0
callq 0x3430
leaq 0x25ae(%rip), %rsi      # 0x89f8
leaq 0x40(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
callq 0x668a
leaq 0x25e0(%rip), %rsi      # 0x8a43
leaq 0x20(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
callq 0x668a
leaq 0x20(%rsp), %r13
leaq 0xc0(%rsp), %r14
leaq 0xa0(%rsp), %rbx
leaq 0x80(%rsp), %rbp
leaq 0x60(%rsp), %r12
movq %r13, %rdi
leaq 0x255a(%rip), %rsi      # 0x89fb
callq 0x6624
testb %al, %al
je 0x6598
movq %r13, %rdi
leaq 0x2545(%rip), %rsi      # 0x89fd
callq 0x6624
testb %al, %al
je 0x6598
movq %r13, %rdi
leaq 0x2533(%rip), %rsi      # 0x8a02
callq 0x6624
testb %al, %al
je 0x6598
movq 0x5ad5(%rip), %rdi      # 0xbfb8
leaq 0x40(%rsp), %rsi
callq 0x3260
movl $0x1000, %edx           # imm = 0x1000
movq 0x5ae7(%rip), %rdi      # 0xbfe0
movq %r14, %rsi
callq 0x3110
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x668a
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x3170
movq %rbp, %rdi
leaq 0x24db(%rip), %rsi      # 0x8a07
leaq 0xb(%rsp), %rdx
callq 0x668a
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x66c6
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x3170
movq %rbp, %rdi
callq 0x3170
movq %r12, %rdi
movq %r13, %rsi
callq 0x33a0
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x5c5a
movl %eax, %r15d
movq %r12, %rdi
callq 0x3170
testl %r15d, %r15d
je 0x6497
movl %r15d, %edi
callq 0x63da
jmp 0x6497
leaq 0x246d(%rip), %rdi      # 0x8a0c
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x3070
leaq 0x20(%rsp), %rdi
callq 0x3170
leaq 0x40(%rsp), %rdi
callq 0x3170
addq $0x10c8, %rsp           # imm = 0x10C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6609
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x65f3
jmp 0x65fc
jmp 0x65fc
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3170
jmp 0x65ff
jmp 0x65fc
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3170
leaq 0x40(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x33a0
pushq $-0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x34f0
cmpq $-0x1, %rax
je 0x6819
leaq 0x8(%rsp), %r15
pushq $-0x1
popq %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x34f0
leaq 0x1(%rax), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x30d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x33a0
jmp 0x682d
leaq 0x2223(%rip), %rsi      # 0x8a43
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x668a
leaq 0x8(%rsp), %rdi
callq 0x3170
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x6848
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x34c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x38d6
movq %rax, %rbx
movl %ebp, %edi
movq %r14, %rsi
callq 0x6dc0
testq %rbx, %rbx
je 0x6b81
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 0x1f99(%rip), %rdi      # 0x8b30
callq 0x3430
leaq 0x1f32(%rip), %rdi      # 0x8ad5
callq 0x3430
movq 0x53d9(%rip), %rax      # 0xbf88
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3ca4
pushq $-0x1
popq %rdi
callq 0x3340
movq %rax, %rbx
callq 0x3460
movq %rbx, %rdi
callq 0x34c0
movq %rax, %rdi
callq 0x3d1d
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5a06
movl %eax, %r15d
movq %r14, %rdi
callq 0x5a02
movl %eax, %ebp
xorl %eax, %eax
movslq 0x56b4(%rip), %rcx      # 0xc2b8
cmpq %rcx, %rax
jg 0x6c12
andl $0x0, (%rbx,%rax,4)
incq %rax
jmp 0x6bfd
imull %r15d, %ebp
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x598a
testl %ebp, %ebp
movl $0x0, %ecx
cmovgl %ebp, %ecx
cmpq %r15, %rcx
je 0x6c43
cvttss2si (%rax,%r15,4), %edx
movslq %edx, %rdx
incl (%rbx,%rdx,4)
incq %r15
jmp 0x6c2d
movslq %ebp, %rsi
leaq 0x1f17(%rip), %rdi      # 0x8b64
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3070
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r15
callq 0x5a06
movl %eax, %ebp
movq %r15, %rdi
callq 0x5a02
movl %eax, %r14d
imull %ebp, %r14d
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
callq 0x598a
movq %rax, %r15
movq %r12, %rdi
xorl %esi, %esi
callq 0x598a
testl %r14d, %r14d
cmovlel %r13d, %r14d
movss 0x1eb0(%rip), %xmm0     # 0x8b60
cmpq %r13, %r14
je 0x6cd0
cvttss2si (%r15,%r13,4), %ecx
movaps %xmm0, %xmm1
cmpl %ebx, %ecx
jg 0x6cc5
xorps %xmm1, %xmm1
movss %xmm1, (%rax,%r13,4)
incq %r13
jmp 0x6cb0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jpbalarini[P]otsus/./algo.cpp
// Function: computeOtsusSegmentation(CImage&, unsigned int*, CImage*, int)
void computeOtsusSegmentation(CImage &input, unsigned* hist, CImage *output, int overrided_threshold){
  // Compute number of pixels
  long int N = input.get_width() * input.get_height();
  int threshold = 0;

  if (overrided_threshold != 0){
    // If threshold was manually entered
    threshold = overrided_threshold;
  }else{
    // Compute threshold
    // Init variables
    float sum = 0;
    float sumB = 0;
    int q1 = 0;
    int q2 = 0;
    float varMax = 0;

    // Auxiliary value for computing m2
    for (int i = 0; i <= MAX_INTENSITY; i++){
      sum += i * ((int)hist[i]);
    }

    for (int i = 0 ; i <= MAX_INTENSITY ; i++) {
      // Update q1
      q1 += hist[i];
      if (q1 == 0)
        continue;
      // Update q2
      q2 = N - q1;

      if (q2 == 0)
        break;
      // Update m1 and m2
      sumB += (float) (i * ((int)hist[i]));
      float m1 = sumB / q1;
      float m2 = (sum - sumB) / q2;

      // Update the between class variance
      float varBetween = (float) q1 * (float) q2 * (m1 - m2) * (m1 - m2);

      // Update the threshold if necessary
      if (varBetween > varMax) {
        varMax = varBetween;
        threshold = i;
      }
    }
  }

  // Perform the segmentation
  segmentImage(input, output, threshold);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x5a06
movl %eax, %r12d
movq %r14, %rdi
callq 0x5a02
testl %ebp, %ebp
je 0x6d1b
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6c5e
imull %r12d, %eax
movslq 0x5592(%rip), %rcx      # 0xc2b8
xorps %xmm0, %xmm0
xorl %edx, %edx
cmpq %rcx, %rdx
jg 0x6d44
movl (%r15,%rdx,4), %esi
imull %edx, %esi
cvtsi2ss %esi, %xmm1
addss %xmm1, %xmm0
incq %rdx
jmp 0x6d2b
xorps %xmm1, %xmm1
xorl %edx, %edx
xorl %esi, %esi
xorps %xmm2, %xmm2
xorl %ebp, %ebp
cmpq %rcx, %rdx
jg 0x6d06
movl (%r15,%rdx,4), %edi
addl %edi, %esi
je 0x6dbb
movl %eax, %r8d
subl %esi, %r8d
je 0x6d06
imull %edx, %edi
cvtsi2ss %edi, %xmm3
addss %xmm3, %xmm2
movaps %xmm0, %xmm3
subss %xmm2, %xmm3
movd %r8d, %xmm4
movd %esi, %xmm5
punpckldq %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
cvtdq2ps %xmm5, %xmm4
movaps %xmm2, %xmm5
unpcklps %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0],xmm5[1],xmm3[1]
divps %xmm4, %xmm5
movaps %xmm5, %xmm3
shufps $0x55, %xmm5, %xmm3     # xmm3 = xmm3[1,1],xmm5[1,1]
subss %xmm3, %xmm5
movaps %xmm4, %xmm3
shufps $0x55, %xmm4, %xmm3     # xmm3 = xmm3[1,1],xmm4[1,1]
mulss %xmm4, %xmm3
mulss %xmm5, %xmm3
mulss %xmm5, %xmm3
ucomiss %xmm1, %xmm3
maxss %xmm1, %xmm3
cmoval %edx, %ebp
movaps %xmm3, %xmm1
incq %rdx
jmp 0x6d50
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/Supervisor.cpp
// Function: Supervisor::Init(NumObj*)
Action Supervisor::Init(NumObj *num)
{
    total = num->num;
    count = 0;
    printcount = 0;


    std::ofstream *tmpfilestream = new std::ofstream("data.csv");
    csvFile = std::shared_ptr<std::ofstream>(tmpfilestream);

    InitObj *tempObj;
    for (int i = 1; i <= num->num; i++) {
        std::shared_ptr<std::ofstream> tmpfile(csvFile);
        tempObj = new InitObj(h(i), true, tmpfile);
        auto subject = new Node((Object* &) tempObj);
        Subjects.push_back((Subject *) subject);
        _create((Subject *) this, (Subject *) subject);
    }

    delete num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r15
movq %rsi, 0x8(%rsp)
movl 0x20(%rsi), %eax
movl %eax, 0x64(%rdi)
andl $0x0, 0x60(%rdi)
andl $0x0, 0xf8(%rdi)
movl $0x200, %edi            # imm = 0x200
callq 0x2170
movq %rax, %r14
leaq 0x7b7d(%rip), %rsi      # 0xa034
pushq $0x10
popq %rdx
movq %rax, %rdi
callq 0x2190
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a3e
leaq 0x98(%r15), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4ae0
leaq 0x18(%rsp), %rdi
callq 0x3978
leaq 0xe0(%r15), %rbx
pushq $0x1
popq %r14
leaq 0x38(%rsp), %rbp
movq 0x8(%rsp), %rax
cmpl 0x20(%rax), %r14d
jg 0x25af
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x39fe
pushq $0x40
popq %rdi
callq 0x2170
movq %rax, %r12
movl %r14d, %edi
callq 0x5a1c
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x39fe
movq %r12, %rdi
movsd 0x20(%rsp), %xmm0
pushq $0x1
popq %rsi
movq %rbp, %rdx
callq 0x3608
movq %r12, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x3978
movl $0xe8, %edi
callq 0x2170
movq %rax, %r12
movq %rax, %rdi
leaq 0x30(%rsp), %rsi
callq 0x3650
movq %r12, 0x28(%rsp)
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4b0e
movq %r15, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x370c
leaq 0x18(%rsp), %rdi
callq 0x3978
incl %r14d
jmp 0x24fe
pushq $0x28
popq %rsi
movq 0x8(%rsp), %rdi
callq 0x2180
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdi
callq 0x2180
jmp 0x2617
movq %rax, %rbx
movl $0xe8, %esi
jmp 0x2600
jmp 0x260a
jmp 0x260a
movq %rax, %rbx
jmp 0x25fd
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3978
pushq $0x40
popq %rsi
movq %r12, %rdi
callq 0x2180
jmp 0x260d
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3978
movq %rbx, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/Supervisor.cpp
// Function: Supervisor::Node2GDL[abi:cxx11](int, double, bool)
std::string Supervisor::Node2GDL(int id, double num, bool isReal)
{
    std::string result("");
    result += "node: {\n";
    if (isReal) {
        result += "color: 36\n";
    } else {
        result += "color: 37\n";
    }

    // Title attribute
    result += "title: \"";
    std::ostringstream title;
    title << id;
    result += title.str();
    result += "\"\n";

    // Label attribute
    result += "label: \"";
    std::ostringstream label;
    label << num;
    result += label.str();
    result += "\"\n";

    result += "}\n";
    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x320, %rsp            # imm = 0x320
movl %ecx, %r14d
movsd %xmm0, 0x8(%rsp)
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x77da(%rip), %rsi      # 0xa470
leaq 0x1a8(%rsp), %rdx
callq 0x38e2
leaq 0x7393(%rip), %rsi      # 0xa03d
movq %rbx, %rdi
callq 0x22b0
leaq 0x738d(%rip), %rax      # 0xa046
leaq 0x7391(%rip), %rsi      # 0xa051
testb %r14b, %r14b
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x22b0
leaq 0x7386(%rip), %rsi      # 0xa05c
movq %rbx, %rdi
callq 0x22b0
leaq 0x1a8(%rsp), %rdi
callq 0x21c0
leaq 0x1a8(%rsp), %rdi
movl %ebp, %esi
callq 0x2280
leaq 0x1b0(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x2230
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x22d0
leaq 0x30(%rsp), %rdi
callq 0x20a0
leaq 0x733b(%rip), %rsi      # 0xa065
movq %rbx, %rdi
callq 0x22b0
leaq 0x732f(%rip), %rsi      # 0xa068
movq %rbx, %rdi
callq 0x22b0
leaq 0x30(%rsp), %rdi
callq 0x21c0
leaq 0x30(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
callq 0x2240
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2230
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x22d0
leaq 0x10(%rsp), %rdi
callq 0x20a0
leaq 0x72dd(%rip), %rsi      # 0xa065
movq %rbx, %rdi
callq 0x22b0
leaq 0x72da(%rip), %rsi      # 0xa071
movq %rbx, %rdi
callq 0x22b0
leaq 0x30(%rsp), %rdi
callq 0x2040
leaq 0x1a8(%rsp), %rdi
callq 0x2040
movq %rbx, %rax
addq $0x320, %rsp            # imm = 0x320
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x20a0
jmp 0x2dee
jmp 0x2deb
jmp 0x2dfa
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x20a0
jmp 0x2dfd
jmp 0x2dfa
jmp 0x2e0c
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x2040
jmp 0x2dfd
movq %rax, %r14
leaq 0x1a8(%rsp), %rdi
callq 0x2040
jmp 0x2e0f
movq %rax, %r14
movq %rbx, %rdi
callq 0x20a0
movq %r14, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0xca38(%rip), %rdi      # 0xffd0
leaq 0x6c83(%rip), %rsi      # 0xa222
callq 0x2160
leaq 0x20(%rbx), %r15
movsd 0x20(%rbx), %xmm0
movq %rax, %rdi
callq 0x2240
leaq 0x6c6c(%rip), %rsi      # 0xa228
movq %rax, %rdi
callq 0x2160
leaq 0xa8(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x58b0
movq (%rax), %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x58fc
movq (%r14), %rax
movq %r14, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq *0x20(%rax)
pushq $0x28
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
cmpq %rdi, %rsi
je 0x3725
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
xorl %ebx, %ebx
jmp 0x3745
leaq 0xca84(%rip), %rax      # 0x101b0
movq %rsi, (%rax)
pushq $0x60
popq %rdi
callq 0x2170
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x47de
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
pushq $0x60
popq %rsi
movq %rbx, %rdi
callq 0x2180
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Relay::Relay(Identity*&)
Relay::Relay(Identity* &d)
{
    _home = _activeSubject;
    _setup();
    if (_home != NULL) {    // relay generated within subject?
        if (d == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! Cannot establish connection from " << ID << " to NULL.\n";
            }
        } else {
            if (d->_source == NULL) {
                if (WARNING) {
                    std::cout << "-- Warning! Cannot establish connection from " << ID << " to NULL.\n";
                }
            } else {
                if (d->_base == NULL) {
                    if (WARNING) {
                        std::cout << "-- Warning! Private identity not correctly defined or already used.\n";
                    }
                } else {
                    if (d->_sink != NULL && d->_sink->_home != _home) {
                        if (WARNING) {
                            std::cout << "-- Warning! Identity of " << d->_source->ID << " not meant for " << ID << ".\n";
                        }
                    } else {
                        _oLink = d->_source;        // connect to relay point
                        _oLink->_iLinks->add(this);
                        if (d->_sink == NULL) {
                            _private = 0;
                        }
                        _base = d->_base;        // base = d-base
                        delete d;                // destroy identity
                        d = NULL;
                        if (DEBUG) {
                            std::cout << "-- Creating relay point " << ID << " to " << _oLink->ID << " with base " << _base->ID << ".\n";
                        }
                        if (!(_oLink->_awake)) {
                            _oLink = NULL;
                        }
                    }
                }
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc496(%rip), %rax      # 0xfc68
movq %rax, (%rdi)
leaq 0xc9d4(%rip), %rax      # 0x101b0
movq (%rax), %rax
movq %rax, 0x18(%rdi)
callq 0x409c
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x386c
movq (%r14), %rdx
testq %rdx, %rdx
je 0x386c
movq 0x10(%rdx), %rcx
testq %rcx, %rcx
je 0x386c
cmpq $0x0, 0x20(%rdx)
je 0x386c
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x3818
cmpq %rax, 0x18(%rdx)
jne 0x386c
movq %rcx, 0x28(%rbx)
movq 0x20(%rcx), %rdi
movq %rbx, %rsi
callq 0x403c
movq (%r14), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3836
andl $0x0, 0x14(%rbx)
movq 0x20(%rax), %rax
movq %rax, 0x30(%rbx)
movq (%r14), %r15
testq %r15, %r15
je 0x384e
movq %r15, %rdi
callq 0x48a6
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x2180
andq $0x0, (%r14)
movq 0x28(%rbx), %rax
cmpl $0x0, 0x10(%rax)
jne 0x386c
andq $0x0, 0x28(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
leaq 0xc921(%rip), %rax      # 0x101b8
movq (%rax), %r8
movq %r8, (%rdi)
incq %r8
movq %r8, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq %rsi, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
movq (%rcx), %rax
movq %rax, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
andq $0x0, (%rcx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xc10b(%rip), %rax      # 0xfbe8
movq %rax, (%rdi)
leaq 0xc6c1(%rip), %rax      # 0x101a8
movq (%rax), %rcx
movq %rcx, 0x8(%rdi)
incq %rcx
movq %rcx, (%rax)
leaq 0xc6b5(%rip), %r15      # 0x101b0
movq (%r15), %rax
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
andq $0x0, 0x58(%rdi)
pushq $0x10
popq %r14
movq %r14, %rdi
callq 0x2170
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x30(%rbx)
movq %r14, %rdi
callq 0x2170
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x40(%rbx)
movq %r14, %rdi
callq 0x2170
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x2170
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x48(%rbx)
pushq $0x48
popq %rdi
callq 0x2170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3fde
movq %r14, 0x20(%rbx)
cmpq $0x0, (%r15)
jne 0x3b8f
cmpq $0x0, 0x8(%rbx)
jne 0x3b93
andq $0x0, (%r15)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_process()
int Subject::_process()
{
    _Message *m;
    int busy;

    busy = 0;
    if (_child != NULL) {  // relay subject
        busy = _child->_process();
    } else {               // bad relay subject or standard subject
        if (_activeSubjects != NULL) {            // standard subject
            busy = _activeSubjects->process();      // first, process children
            _activeSubject = this;
            busy = busy | _activeRelays->process(); // then active relays
            m = _sink->_oQueue->dequeue();          // then subject itself
            if (m != NULL) {
                if (DEBUG) {
                    std::cout << "-- Executing message " << m->debugID << " in subject " << _debugID << ".\n";
                }
                source = m->source + _debugID;        // create local ID of source
                sink = m->sink;                       // set sink to sink of message
                if (m->ObjPtr != NULL) {
                    m->ObjPtr->_owner = this;    // set new owner of object
                }
                if (m->ObjPtr == NULL || m->ObjPtr->_sink == NULL || m->ObjPtr->_sink->_home == this) {
                    (this->*(m->VerbPtr))(m->ObjPtr);    // execute message
                } else {
                    if (WARNING) {
                        std::cout << "-- Warning! Message " << m->debugID << " not meant for subject " << _debugID << ".\n";
                    }
                }
                delete m;
                busy = 1;
            }
        }
    }
    return busy;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x3c0f
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x3ca7
callq 0x46d0
movl %eax, %r15d
leaq 0xc585(%rip), %rax      # 0x101b0
movq %rbx, (%rax)
movq 0x38(%rbx), %rdi
callq 0x46fc
movl %eax, %ebp
movq 0x20(%rbx), %rax
movq 0x38(%rax), %rdi
callq 0x424a
testq %rax, %rax
je 0x3cab
movq %rax, %r14
movq 0x8(%rbx), %rax
addq 0x8(%r14), %rax
movq %rax, 0x50(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x58(%rbx)
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x3c7e
movq %rbx, 0x8(%rsi)
movq 0x18(%rsi), %rax
testq %rax, %rax
je 0x3c7e
cmpq %rbx, 0x18(%rax)
jne 0x3c97
movq 0x18(%r14), %rax
addq 0x20(%r14), %rbx
testb $0x1, %al
je 0x3c92
movq (%rbx), %rcx
movq -0x1(%rcx,%rax), %rax
movq %rbx, %rdi
callq *%rax
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0x2180
pushq $0x1
popq %rbp
jmp 0x3cae
xorl %ebp, %ebp
jmp 0x3cae
orl %r15d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_kill(Subject*, Subject*)
int Subject::_kill(Subject *s, Subject *t)
{
    if (_activeSubject == NULL || (_parent == NULL && _debugID > 0)) {
        if (WARNING) {
            std::cout << "-- Warning! " << _debugID << "called 'delete' outside of the subjects environment.\n";
        }
    } else {
        if (t == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! " << _debugID << " cannot destruct NULL.\n";
            }
        } else {
            if (s != this) {
                if (WARNING) {
                    std::cout << "-- Warning! " << s->_debugID << " cannot call 'delete' for subject " << _debugID << ".\n";
                }
            } else {
                if (s != t->_parent) {
                    if (WARNING) {
                        std::cout << "-- Warning! " << _debugID << " cannot call 'delete' for subject " << t->_debugID << ".\n";
                    }
                } else {
                    t->_destruct();  // delete subject t
                    return 1;
                }
            }
        }
    }
    return 0;
}

// Assembly:
leaq 0xc4d7(%rip), %rcx      # 0x101b0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x3cfa
cmpq $0x0, 0x10(%rdi)
je 0x3cfb
testq %rdx, %rdx
sete %cl
cmpq %rdi, %rsi
setne %dil
orb %cl, %dil
je 0x3d0c
retq
cmpq %rdi, %rsi
jne 0x3cfa
testq %rdx, %rdx
je 0x3cfa
cmpq $0x0, 0x8(%rdi)
jne 0x3cfa
cmpq %rsi, 0x10(%rdx)
jne 0x3cfa
pushq %rax
movq (%rdx), %rax
movq %rdx, %rdi
callq *0x10(%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_kill(Subject*, Relay*)
int Subject::_kill(Subject *s, Relay *r)
{
    if (_activeSubject == NULL || (_parent == NULL && _debugID > 0)) {
        if (WARNING) {
            std::cout << "-- Warning! " << _debugID << "called 'delete' outside of the subjects environment.\n";
        }
    } else {
        if (r == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! " << _debugID << " cannot destruct NULL.\n";
            }
        } else {
            if (s != this) {
                if (WARNING) {
                    std::cout << "-- Warning! " << s->_debugID << " cannot call 'delete' for subject " << _debugID << ".\n";
                }
            } else {
                if (s != r->_home) {
                    if (WARNING) {
                        std::cout << "-- Warning! " << _debugID << " cannot call 'delete' for relay " << r->ID << ".\n";
                    }
                } else {
                    r->_destruct();  // delete relay r
                    return 1;
                }
            }
        }
    }
    return 0;
}

// Assembly:
leaq 0xc485(%rip), %rcx      # 0x101b0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x3d4c
cmpq $0x0, 0x10(%rdi)
je 0x3d4d
testq %rdx, %rdx
sete %cl
cmpq %rdi, %rsi
setne %dil
orb %cl, %dil
je 0x3d5e
retq
cmpq %rdi, %rsi
jne 0x3d4c
testq %rdx, %rdx
je 0x3d4c
cmpq $0x0, 0x8(%rdi)
jne 0x3d4c
cmpq %rsi, 0x18(%rdx)
jne 0x3d4c
pushq %rax
movq (%rdx), %rax
movq %rdx, %rdi
callq *0x18(%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_wake(Subject*, Subject*)
int Subject::_wake(Subject *s, Subject *t)
{
    if (_activeSubject == NULL || (_parent == NULL && _debugID > 0)) {
        if (WARNING) {
            std::cout << "-- Warning! " << _debugID << "called 'wakeup' outside of the subjects environment.\n";
        }
    } else {
        if (t == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! " << _debugID << " cannot wake up NULL.\n";
            }
        } else {
            if (s != this) {
                if (WARNING) {
                    std::cout << "-- Warning! " << s->_debugID << " cannot call 'wakeup' for subject " << _debugID << ".\n";
                }
            } else {
                if (s != t->_parent) {
                    if (WARNING) {
                        std::cout << "-- Warning! " << _debugID << " cannot call 'wakeup' for subject " << t->_debugID << ".\n";
                    }
                } else {
                    _activeSubjects->add(t);  // wake up subject t
                    return 1;
                }
            }
        }
    }
    return 0;
}

// Assembly:
leaq 0xc433(%rip), %rcx      # 0x101b0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x3d9e
cmpq $0x0, 0x10(%rdi)
je 0x3d9f
testq %rdx, %rdx
sete %cl
cmpq %rdi, %rsi
setne %r8b
orb %cl, %r8b
je 0x3db0
retq
cmpq %rdi, %rsi
jne 0x3d9e
testq %rdx, %rdx
je 0x3d9e
cmpq $0x0, 0x8(%rdi)
jne 0x3d9e
cmpq %rsi, 0x10(%rdx)
jne 0x3d9e
pushq %rax
movq 0x48(%rdi), %rdi
movq %rdx, %rsi
callq 0x4728
pushq $0x1
popq %rax
addq $0x8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_wake(Subject*, Relay*)
int Subject::_wake(Subject *s, Relay *r)
{
    if (_activeSubject == NULL || (_parent == NULL && _debugID > 0)) {
        if (WARNING) {
            std::cout << "-- Warning! " << _debugID << "called 'wakeup' outside of the subjects environment.\n";
        }
    } else {
        if (r == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! " << _debugID << " cannot wake up NULL.\n";
            }
        } else {
            if (s != this) {
                if (WARNING) {
                    std::cout << "-- Warning! " << s->_debugID << " cannot call 'wakeup' for subject " << _debugID << ".\n";
                }
            } else {
                if (s != r->_home) {
                    if (WARNING) {
                        std::cout << "-- Warning! " << _debugID << " cannot call 'wakeup' for relay " << r->ID << ".\n";
                    }
                } else {
                    r->_awake = 1;
                    _activeRelays->add(r);  // wake up relay point r
                    r->_iLinks->wake(r);    // wake up connections to r
                    if (DEBUG) {
                        std::cout << "-- Subject " << _debugID << " wakes up relay " << r->ID << ".\n";
                    }
                    return 1;
                }
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbx
leaq 0xc3dc(%rip), %rcx      # 0x101b0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x3e31
movq %rdx, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x3df8
testq %rbx, %rbx
sete %cl
cmpq %rdi, %rsi
setne %dl
orb %cl, %dl
je 0x3e09
jmp 0x3e31
cmpq %rdi, %rsi
jne 0x3e31
testq %rbx, %rbx
je 0x3e31
cmpq $0x0, 0x8(%rdi)
jne 0x3e31
cmpq %rsi, 0x18(%rbx)
jne 0x3e31
movl $0x1, 0x10(%rbx)
movq 0x38(%rdi), %rdi
movq %rbx, %rsi
callq 0x403c
movq 0x20(%rbx), %rdi
movq %rbx, %rsi
callq 0x4788
pushq $0x1
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_halt(Subject*, Subject*)
int Subject::_halt(Subject *s, Subject *t)
{
    if (_activeSubject == NULL || (_parent == NULL && _debugID > 0)) {
        if (WARNING) {
            std::cout << "-- Warning! " << _debugID << "called 'freeze' outside of the subjects environment.\n";
        }
    } else {
        if (t == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! " << _debugID << " cannot freeze NULL.\n";
            }
        } else {
            if (s != this) {
                if (WARNING) {
                    std::cout << "-- Warning! " << s->_debugID << " cannot call 'freeze' for subject " << _debugID << ".\n";
                }
            } else {
                if (s != t->_parent) {
                    if (WARNING) {
                        std::cout << "-- Warning! " << _debugID << " cannot call 'freeze' for subject " << t->_debugID << ".\n";
                    }
                } else {
                    _activeSubjects->remove(t);  // freezes subject t
                    return 1;
                }
            }
        }
    }
    return 0;
}

// Assembly:
leaq 0xc375(%rip), %rcx      # 0x101b0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x3e5c
cmpq $0x0, 0x10(%rdi)
je 0x3e5d
testq %rdx, %rdx
sete %cl
cmpq %rdi, %rsi
setne %r8b
orb %cl, %r8b
je 0x3e6e
retq
cmpq %rdi, %rsi
jne 0x3e5c
testq %rdx, %rdx
je 0x3e5c
cmpq $0x0, 0x8(%rdi)
jne 0x3e5c
cmpq %rsi, 0x10(%rdx)
jne 0x3e5c
pushq %rax
movq 0x48(%rdi), %rdi
movq %rdx, %rsi
callq 0x45ec
pushq $0x1
popq %rax
addq $0x8, %rsp
retq
nop