LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jpbalarini[P]otsus/./framework/CFramework.cpp
// Function: CFramework::print_backtrace(_IO_FILE*)
void CFramework::print_backtrace(FILE *out) {
    const size_t max_depth = 100;
    size_t stack_depth;
    void *stack_addrs[max_depth];
    char **stack_strings;

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

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

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

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

  this->channels_id = new int[num_channels];

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

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

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x73de(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x4ef9
movl 0xc(%rbx), %esi
leaq 0x33b2(%rip), %rdi      # 0x82a4
xorl %eax, %eax
callq 0x3070
callq 0x3fd8
cmpl $0x0, 0x18(%rbx)
jle 0x4f26
movq %rax, %r14
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0x3f3e
incq %r15
movslq 0x18(%rbx), %rax
cmpq %rax, %r15
jl 0x4f0a
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x4f39
popq %rbx
popq %r14
popq %r15
jmp 0x3350
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4f41
movq %rax, %rdi
callq 0x4491
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x334d(%rip), %r12      # 0x82b9
xorl %r14d, %r14d
leaq 0x36b2(%rip), %r13      # 0x8628
movq %r12, %rdi
callq 0x3160
movq %r15, %rsi
subq %rax, %rsi
testl %esi, %esi
js 0x4f9d
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addq %rbx, %rsi
movq %r12, %rdi
callq 0x32a0
testl %eax, %eax
je 0x4faa
movslq 0x4(%r13,%r14,4), %r12
addq %r13, %r12
incq %r14
jmp 0x4f76
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4f4e
cmpl $0x2, %eax
je 0x4fef
cmpl $0x1, %eax
je 0x4fe2
testl %eax, %eax
jne 0x5035
movq %r14, %rdi
movq %rbx, %rsi
callq 0x503e
jmp 0x4ffa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x51ba
jmp 0x4ffa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x551a
leaq 0x72c0(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x502d
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x18(%r14), %r8d
movl 0x8(%r14), %r9d
movl 0xc(%r14), %eax
movl %eax, (%rsp)
leaq 0x32db(%rip), %rdi      # 0x82fe
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3070
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x3670
nop
// File: /workspace/github_cpp_makefile_star2_O3/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::load_float_RGB(char*)
void CImage::load_float_RGB(char *filename) {
  int num_channels;
  size_t dummy;
  
  CFramework *fw = CFramework::get_framework();

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

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

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

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

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

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

  fw->delete_matrix(id_data_all);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3fd8
movq %rax, %r14
leaq 0x30b2(%rip), %rsi      # 0x8110
movq %r15, %rdi
callq 0x32f0
testq %rax, %rax
je 0x51b2
movq %rax, %r13
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x33d0
leaq 0x4(%rbx), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x33d0
leaq 0x4(%rsp), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r13, %rcx
callq 0x33d0
movl $0x10, 0x8(%rbx)
leaq 0x71fc(%rip), %rax      # 0xc2c1
movslq (%r15), %r15
cmpb $0x1, (%rax)
jne 0x50e7
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movl 0xc(%rbx), %r8d
leaq 0x32d1(%rip), %rdi      # 0x83ae
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3070
movl (%rbx), %esi
imull %r15d, %esi
imull 0x4(%rbx), %esi
movq %rsp, %rdx
movq %r14, %rdi
callq 0x4148
movq %rax, %r12
movslq (%rbx), %rax
imulq %r15, %rax
movslq 0x4(%rbx), %rdx
imulq %rax, %rdx
movl $0x4, %esi
movq %r12, %rdi
movq %r13, %rcx
callq 0x33d0
movq %r13, %rdi
callq 0x3240
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4d78
testl %r15d, %r15d
jle 0x5198
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %rbx, %rdi
movl %r13d, %esi
callq 0x5bd6
movslq 0x4(%rbx), %rcx
testq %rcx, %rcx
jle 0x5190
movl (%rbx), %edx
leaq (,%rdx,4), %rsi
xorl %edi, %edi
testl %edx, %edx
jle 0x5185
movslq %ebp, %r8
leaq (%r12,%r8,4), %r9
xorl %r8d, %r8d
movss (%r9,%r8,4), %xmm0
movss %xmm0, (%rax,%r8,4)
incq %r8
cmpq %r8, %rdx
jne 0x516e
addl %r8d, %ebp
incq %rdi
addq %rsi, %rax
cmpq %rcx, %rdi
jne 0x5160
incl %r13d
cmpl %r15d, %r13d
jne 0x5140
movl (%rsp), %esi
movq %r14, %rdi
callq 0x3f3e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x36b7
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4f4e
testl %eax, %eax
je 0x570d
cmpl $0x1, %eax
jne 0x574d
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x584a
jmp 0x5718
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5760
leaq 0x6ba2(%rip), %rax      # 0xc2c1
cmpb $0x1, (%rax)
jne 0x5748
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x18(%r14), %r8d
movl 0x8(%r14), %r9d
leaq 0x2c1b(%rip), %rdi      # 0x8355
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 0x5757
callq 0x3922
movq %rbx, %rdi
callq 0x3964
nop
// File: /workspace/github_cpp_makefile_star2_O3/jpbalarini[P]otsus/./framework/CImage.cpp
// Function: CImage::save_float_RGB(char*)
void CImage::save_float_RGB(char *filename) {
  int num_channels;
  size_t dummy;

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

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

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

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

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

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

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

  return tokens->size();
}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, 0x8(%rsp)
movb $0x0, (%rdi)
testl %ecx, %ecx
jle 0x5dad
movq %rdx, %rbx
movq %rdi, %r15
leal -0x1(%rcx), %ebp
movl %ecx, %r14d
leaq 0x10(%rsp), %r13
xorl %r12d, %r12d
movl (%rbx,%r12,4), %edx
movq %r13, %rdi
leaq 0x28b3(%rip), %rsi      # 0x8634
xorl %eax, %eax
callq 0x30a0
movq %r15, %rdi
movq %r13, %rsi
callq 0x34c0
cmpq %r12, %rbp
je 0x5da5
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x34c0
incq %r12
cmpq %r12, %r14
jne 0x5d73
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5e11
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
movq 0x10(%rdi), %rdx
movl 0xc(%rdi), %ecx
leaq 0x2857(%rip), %rsi      # 0x8637
movq %rsp, %r14
movq %r14, %rdi
callq 0x5d42
movq 0x18(%rbx), %rdx
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %ecx
leaq 0x283f(%rip), %rdi      # 0x863b
movq %r14, %r8
xorl %eax, %eax
callq 0x3070
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
leaq 0x2c9b(%rip), %rdi      # 0x8ab3
jmp 0x3400
nop
// File: /workspace/github_cpp_makefile_star2_O3/jpbalarini[P]otsus/./framework/CInspector.cpp
// Function: CInspector::get_pos_by_coordinates(int*, MatrixInfo*)
int CInspector::get_pos_by_coordinates(int *x, MatrixInfo *matrix) {
  int pos = 0;
  for (int i = 0; i < matrix->num_dims; i++) {
    pos += CInspector::prod_dims[i] * x[i];
  }

  return pos;
}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x6e58
movq (%r14), %rsi
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x3420
cmpq $-0x1, %rax
je 0x6ddc
movq (%r14), %rsi
movq 0x8(%r14), %rcx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x3420
incq %rax
movq 0x8(%r14), %rcx
cmpq %rax, %rcx
jb 0x6e1b
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rcx
movb $0x0, (%rcx,%rax)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x6e58
jmp 0x6df5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1c39(%rip), %rdx      # 0x8a23
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x6eee
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e0c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1c16(%rip), %rdi      # 0x8a38
leaq 0x1bfb(%rip), %rsi      # 0x8a24
movq %rax, %rdx
xorl %eax, %eax
callq 0x33e0
jmp 0x6e35
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e4f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3fd8
movq %rax, %rbx
movl %ebp, %edi
movq %r14, %rsi
callq 0x745d
testq %rbx, %rbx
je 0x720d
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 0x1939(%rip), %rdi      # 0x8b5c
callq 0x3400
leaq 0x18d1(%rip), %rdi      # 0x8b00
callq 0x3400
movq 0x4d45(%rip), %rax      # 0xbf80
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x440e
callq 0x3c23
movq %rax, %rbx
callq 0x3440
movq %rbx, %rdi
callq 0x34b0
movq %rax, %rdi
callq 0x4491
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5c1a
movl %eax, %r15d
movq %r14, %rdi
callq 0x5c16
movl %eax, %ebp
imull %r15d, %ebp
cmpl $0x0, 0x5022(%rip)      # 0xc2b0
js 0x72ae
movq $-0x1, %rax
movl $0x0, 0x4(%rbx,%rax,4)
movslq 0x500a(%rip), %rcx      # 0xc2b0
incq %rax
cmpq %rcx, %rax
jl 0x7297
movq %r14, %rdi
xorl %esi, %esi
callq 0x5bd6
testl %ebp, %ebp
jle 0x72d3
movl %ebp, %ecx
xorl %edx, %edx
cvttss2si (%rax,%rdx,4), %esi
movslq %esi, %rsi
incl (%rbx,%rsi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x72c0
movslq %ebp, %rsi
leaq 0x18b3(%rip), %rdi      # 0x8b90
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3070
// File: /workspace/github_cpp_makefile_star2_O3/jpbalarini[P]otsus/./algo.cpp
// Function: segmentImage(CImage&, CImage*, int)
void segmentImage(CImage &input, CImage *output, int threshold) {
  // Compute number of pixels
  long int N = input.get_width() * input.get_height();
  // Modify output image
  // Use first channel
  float *in = input.get_channel(0);
  float *out = output->get_channel(0);
  // Iterate image
  for (int i = 0; i < N; i++) {
    int value = (int) in[i];
    // Build the segmented image
    if (value > threshold){
      out[i] = 255.0f;
    }else{
      out[i] = 0.0f;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
callq 0x5c1a
movl %eax, %r12d
movq %r14, %rdi
callq 0x5c16
movl %eax, %ebp
imull %r12d, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x5bd6
movq %rax, %r14
movq %r15, %rdi
xorl %esi, %esi
callq 0x5bd6
testl %ebp, %ebp
jle 0x7358
movl %ebp, %ecx
xorl %edx, %edx
movss 0x1851(%rip), %xmm0     # 0x8b8c
cvttss2si (%r14,%rdx,4), %esi
movaps %xmm0, %xmm1
cmpl %ebx, %esi
jg 0x734b
xorps %xmm1, %xmm1
movss %xmm1, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x733b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5c1a
movl %eax, %r12d
movq %r14, %rdi
callq 0x5c16
testl %ebp, %ebp
jne 0x7448
movl 0x4f1e(%rip), %edx      # 0xc2b0
testl %edx, %edx
js 0x7446
imull %r12d, %eax
movq %rdx, %rcx
incq %rcx
xorps %xmm0, %xmm0
xorl %esi, %esi
movl (%r15,%rsi,4), %edi
imull %esi, %edi
xorps %xmm1, %xmm1
cvtsi2ss %edi, %xmm1
addss %xmm1, %xmm0
incq %rsi
cmpq %rsi, %rcx
jne 0x73a9
testl %edx, %edx
js 0x7446
xorps %xmm1, %xmm1
xorl %edx, %edx
xorl %ebp, %ebp
xorps %xmm2, %xmm2
xorl %esi, %esi
movl (%r15,%rdx,4), %edi
addl %edi, %esi
je 0x743c
movl %eax, %r8d
subl %esi, %r8d
je 0x7448
imull %edx, %edi
xorps %xmm3, %xmm3
cvtsi2ss %edi, %xmm3
addss %xmm3, %xmm1
movaps %xmm0, %xmm3
subss %xmm1, %xmm3
movd %r8d, %xmm4
movd %esi, %xmm5
punpckldq %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
cvtdq2ps %xmm5, %xmm4
movaps %xmm1, %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 %xmm2, %xmm3
maxss %xmm2, %xmm3
cmoval %edx, %ebp
movaps %xmm3, %xmm2
incq %rdx
cmpq %rdx, %rcx
jne 0x73d3
jmp 0x7448
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x72ee
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %rdi, %r14
movq %rsi, 0x8(%rsp)
movl 0x20(%rsi), %eax
movl %eax, 0x64(%rdi)
xorl %eax, %eax
movl %eax, 0x60(%rdi)
movl %eax, 0xf8(%rdi)
movl $0x200, %edi            # imm = 0x200
callq 0x2160
movq %rax, %r15
leaq 0x9afd(%rip), %rsi      # 0xc034
movq %rax, %rdi
movl $0x10, %edx
callq 0x2180
leaq 0x28(%rsp), %rbx
movq %r15, -0x8(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x52fe
movaps -0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%rbx)
movq 0xa0(%r14), %rdi
movups %xmm0, 0x98(%r14)
testq %rdi, %rdi
je 0x258b
callq 0x4002
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x258b
callq 0x4002
movq 0x8(%rsp), %rax
cmpl $0x0, 0x20(%rax)
jle 0x2698
leaq 0xe0(%r14), %r12
xorl %ebp, %ebp
movq 0x98(%r14), %rbx
movq 0xa0(%r14), %r15
testq %r15, %r15
je 0x25cd
movq 0xea0b(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x25c8
incl 0x8(%r15)
jmp 0x25cd
lock
incl 0x8(%r15)
movl $0x40, %edi
callq 0x2160
movq %rax, %r13
incl %ebp
movl %ebp, %edi
callq 0x60d4
movq %rbx, 0x10(%rsp)
movq %r15, 0x18(%rsp)
testq %r15, %r15
je 0x2609
movq 0xe9cf(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x2604
incl 0x8(%r15)
jmp 0x2609
lock
incl 0x8(%r15)
movq %r13, %rdi
movl $0x1, %esi
leaq 0x10(%rsp), %rdx
callq 0x3c1e
movq %r13, 0x20(%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x262f
callq 0x4002
movl $0xe8, %edi
callq 0x2160
movq %rax, %r13
movq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3c7a
movq %r13, 0x30(%rsp)
movq %r12, %rdi
leaq 0x30(%rsp), %rsi
callq 0x539e
leaq 0xeb3e(%rip), %rax      # 0x111a0
movq %r14, (%rax)
movl $0x60, %edi
callq 0x2160
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
callq 0x500a
testq %r15, %r15
je 0x268a
movq %r15, %rdi
callq 0x4002
movq 0x8(%rsp), %rax
cmpl 0x20(%rax), %ebp
jl 0x25a3
movl $0x28, %esi
movq 0x8(%rsp), %rdi
callq 0x2170
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
callq 0x2170
jmp 0x2719
jmp 0x2709
movq %rax, %r14
jmp 0x26e1
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x26e1
callq 0x4002
movl $0x40, %esi
jmp 0x26f0
movq %rax, %r14
movl $0xe8, %esi
movq %r13, %rdi
jmp 0x2702
jmp 0x2709
movq %rax, %r14
movl $0x60, %esi
movq %rbx, %rdi
callq 0x2170
jmp 0x270c
movq %rax, %r14
testq %r15, %r15
je 0x2719
movq %r15, %rdi
callq 0x4002
movq %r14, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xd442(%rip), %r12      # 0x10fd0
leaq 0x868d(%rip), %rsi      # 0xc222
movl $0x5, %edx
movq %r12, %rdi
callq 0x21a0
leaq 0x20(%rbx), %r15
movsd 0x20(%rbx), %xmm0
movq %r12, %rdi
callq 0x2230
leaq 0x866e(%rip), %rsi      # 0xc228
movl $0xf, %edx
movq %rax, %rdi
callq 0x21a0
leaq 0xa8(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5f74
testq %rax, %rax
je 0x3c12
movq 0x10(%rax), %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x5fb2
movq (%r14), %rax
movq %r14, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq *0x20(%rax)
movl $0x28, %esi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2170
leaq 0x8685(%rip), %rdi      # 0xc29e
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O3/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: InitObj::InitObj(double, bool, std::shared_ptr<std::basic_ofstream<char, std::char_traits<char>>>)
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:
leaq 0xd563(%rip), %rax      # 0x11188
movq (%rax), %rcx
movq %rcx, (%rdi)
incq %rcx
movq %rcx, (%rax)
xorps %xmm1, %xmm1
movups %xmm1, 0x8(%rdi)
movq $0x0, 0x18(%rdi)
leaq 0xd559(%rip), %rax      # 0x111a0
movq (%rax), %rax
testq %rax, %rax
je 0x3c56
leaq 0x8(%rdi), %rcx
movq %rax, (%rcx)
movups %xmm1, 0x30(%rdi)
movb %sil, 0x20(%rdi)
movsd %xmm0, 0x28(%rdi)
movq (%rdx), %rax
movq %rax, 0x30(%rdi)
addq $0x38, %rdi
addq $0x8, %rdx
movq %rdx, %rsi
jmp 0x407c
// File: /workspace/github_cpp_makefile_star2_O3/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 0xcb03(%rip), %rax      # 0x10bd8
movq %rax, (%rdi)
leaq 0xd0b9(%rip), %rax      # 0x11198
movq (%rax), %rcx
movq %rcx, 0x8(%rdi)
incq %rcx
movq %rcx, (%rax)
leaq 0xd0ad(%rip), %r15      # 0x111a0
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)
movq $0x0, 0x58(%rdi)
movl $0x10, %edi
callq 0x2160
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x30(%rbx)
movl $0x10, %edi
callq 0x2160
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x40(%rbx)
movl $0x10, %edi
callq 0x2160
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x38(%rbx)
movl $0x10, %edi
callq 0x2160
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x48(%rbx)
movl $0x48, %edi
callq 0x2160
movq %rax, %r14
leaq 0xcadf(%rip), %rax      # 0x10c58
movq %rax, (%r14)
movq %rbx, 0x18(%r14)
movq %r14, %rdi
callq 0x4856
movq %r14, 0x20(%rbx)
cmpq $0x0, (%r15)
jne 0x4199
cmpq $0x0, 0x8(%rbx)
jne 0x41a0
movq $0x0, (%r15)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x48, %esi
movq %r14, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xcdb7(%rip), %rcx      # 0x111a0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x4488
movq %rdx, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x4411
testq %rbx, %rbx
sete %cl
cmpq %rdi, %rsi
setne %dl
orb %cl, %dl
je 0x4422
jmp 0x4488
cmpq %rdi, %rsi
jne 0x4488
testq %rbx, %rbx
je 0x4488
cmpq $0x0, 0x8(%rdi)
jne 0x4488
cmpq %rsi, 0x10(%rbx)
jne 0x4488
movq 0x48(%rdi), %r14
movq (%r14), %rax
testq %rax, %rax
je 0x4456
xorl %ecx, %ecx
movl $0x1, %edx
cmpq %rbx, (%rax)
movq 0x8(%rax), %rsi
cmovel %edx, %ecx
movq %rsi, %rax
testq %rsi, %rsi
jne 0x443b
movl $0x1, %eax
testl %ecx, %ecx
jne 0x4488
movl $0x10, %edi
callq 0x2160
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
movq 0x8(%r14), %rcx
xorl %edx, %edx
testq %rcx, %rcx
cmoveq %r14, %rcx
setne %dl
movq %rax, 0x8(%rcx)
movq %rax, (%r14,%rdx,8)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
leaq 0xcd05(%rip), %rcx      # 0x111a0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x44d6
movq %rdx, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x44bf
testq %rbx, %rbx
sete %cl
cmpq %rdi, %rsi
setne %dl
orb %cl, %dl
je 0x44d0
jmp 0x44d6
cmpq %rdi, %rsi
jne 0x44d6
testq %rbx, %rbx
je 0x44d6
cmpq $0x0, 0x8(%rdi)
jne 0x44d6
cmpq %rsi, 0x18(%rbx)
je 0x44de
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x1, 0x10(%rbx)
movq 0x38(%rdi), %r14
movq (%r14), %rcx
testq %rcx, %rcx
je 0x450e
xorl %eax, %eax
movl $0x1, %edx
cmpq %rbx, (%rcx)
movq 0x8(%rcx), %rsi
cmovel %edx, %eax
movq %rsi, %rcx
testq %rsi, %rsi
jne 0x44f8
testl %eax, %eax
jne 0x453b
movl $0x10, %edi
callq 0x2160
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
movq 0x8(%r14), %rcx
xorl %edx, %edx
testq %rcx, %rcx
setne %dl
cmoveq %r14, %rcx
movq %rax, 0x8(%rcx)
movq %rax, (%r14,%rdx,8)
movq 0x20(%rbx), %rax
movq (%rax), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x44d6
movq (%rcx), %rdx
movq %rbx, 0x28(%rdx)
movq 0x8(%rcx), %rcx
jmp 0x4547
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0xcc36(%rip), %rax      # 0x111a0
xorl %ebx, %ebx
cmpq $0x0, (%rax)
je 0x45a5
movq %rdx, %r14
cmpq $0x0, 0x10(%rdi)
je 0x458e
testq %r14, %r14
sete %al
cmpq %rdi, %rsi
setne %cl
orb %al, %cl
je 0x459f
jmp 0x45a5
cmpq %rdi, %rsi
jne 0x45a5
testq %r14, %r14
je 0x45a5
cmpq $0x0, 0x8(%rdi)
jne 0x45a5
cmpq %rsi, 0x10(%r14)
je 0x45b1
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x48(%rdi), %r12
movq (%r12), %r15
movl $0x1, %ebx
testq %r15, %r15
je 0x45a5
cmpq %r14, (%r15)
jne 0x45eb
movq 0x8(%r15), %r13
movl $0x10, %esi
movq %r15, %rdi
callq 0x2170
movq %r13, %r15
testq %r13, %r13
jne 0x45c3
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
jmp 0x45a5
movq %r15, (%r12)
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x4624
leaq 0x8(%r15), %rax
cmpq %r14, (%rdi)
je 0x4606
movq %rdi, %r15
jmp 0x4617
movq 0x8(%rdi), %rcx
movq %rcx, (%rax)
movl $0x10, %esi
callq 0x2170
leaq 0x8(%r15), %rax
movq 0x8(%r15), %rdi
testq %rdi, %rdi
jne 0x45fc
movq %r15, 0x8(%r12)
jmp 0x45a5
// File: /workspace/github_cpp_makefile_star2_O3/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::_halt(Subject*, Relay*)
int Subject::_halt(Subject *s, Relay *r)
{
    if (_activeSubject == NULL || (_parent == NULL && _debugID > 0)) {
        if (WARNING) {
            std::cout << "-- Warning! " << _debugID << "called 'freeze' outside of the subjects environment.\n";
        }
    } else {
        if (r == 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 != r->_home) {
                    if (WARNING) {
                        std::cout << "-- Warning! " << _debugID << " cannot call 'freeze' for relay " << r->ID << ".\n";
                    }
                } else {
                    r->_awake = 0;
                    _activeRelays->remove(r);  // freeze relay point r
                    r->_iLinks->halt();        // freeze connections to r
                    if (DEBUG) {
                        std::cout << "-- Subject " << _debugID << " freezes relay " << r->ID << ".\n";
                    }
                    return 1;
                }
            }
        }
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xcb63(%rip), %rcx      # 0x111a0
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x4678
movq %rdx, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x4661
testq %rbx, %rbx
sete %cl
cmpq %rdi, %rsi
setne %dl
orb %cl, %dl
je 0x4672
jmp 0x4678
cmpq %rdi, %rsi
jne 0x4678
testq %rbx, %rbx
je 0x4678
cmpq $0x0, 0x8(%rdi)
jne 0x4678
cmpq %rsi, 0x18(%rbx)
je 0x4684
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x0, 0x10(%rbx)
movq 0x38(%rdi), %r15
movq (%r15), %r14
testq %r14, %r14
je 0x46fa
cmpq %rbx, (%r14)
jne 0x46be
movq 0x8(%r14), %r12
movl $0x10, %esi
movq %r14, %rdi
callq 0x2170
movq %r12, %r14
testq %r12, %r12
jne 0x4697
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
jmp 0x46fa
movq %r14, (%r15)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x46f6
leaq 0x8(%r14), %rax
cmpq %rbx, (%rdi)
je 0x46d8
movq %rdi, %r14
jmp 0x46e9
movq 0x8(%rdi), %rcx
movq %rcx, (%rax)
movl $0x10, %esi
callq 0x2170
leaq 0x8(%r14), %rax
movq 0x8(%r14), %rdi
testq %rdi, %rdi
jne 0x46ce
movq %r14, 0x8(%r15)
movq 0x20(%rbx), %rax
movq (%rax), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x4678
movq (%rcx), %rdx
movq $0x0, 0x28(%rdx)
movq 0x8(%rcx), %rcx
jmp 0x4706
// File: /workspace/github_cpp_makefile_star2_O3/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::idle()
int Subject::idle()
{
    if (_activeSubject == NULL) {
        if (WARNING) {
            std::cout << "-- Warning! Method 'idle' called outside of the subjects environment.\n";
        }
    } else {
        if (_activeSubject != this) {
            if (WARNING) {
                std::cout << "-- Warning! Subject " << _activeSubject->_debugID << " cannot call " << _debugID << "->idle().\n";
            }
        } else {
            return _Relays->idle();
        }
        // return _sink->_oQueue->empty();
    }
    return 0;
}

// Assembly:
leaq 0xca29(%rip), %rcx      # 0x111a0
xorl %eax, %eax
cmpq %rdi, (%rcx)
je 0x477f
retq
movq 0x30(%rdi), %rax
movq (%rax), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x477e
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x47a5
movq 0x38(%rdx), %rdx
xorl %eax, %eax
cmpq $0x0, (%rdx)
sete %al
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
je 0x477e
testl %eax, %eax
jne 0x4790
jmp 0x477e
// File: /workspace/github_cpp_makefile_star2_O3/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::idle(Relay*)
int Subject::idle(Relay *r)
{
    if (_activeSubject == NULL) {
        if (WARNING) {
            std::cout << "-- Warning! Method 'idle' called outside of the subjects environment.\n";
        }
    } else {
        if (r != NULL) {
            if (_activeSubject != r->_home) {
                if (WARNING) {
                    std::cout << "-- Warning! Subject " << _activeSubject->_debugID << " cannot call " << _debugID << "->idle().\n";
                }
            } else {
                return r->_oQueue->empty();
            }
        }
    }
    return 0;
}

// Assembly:
leaq 0xc9e5(%rip), %rax      # 0x111a0
movq (%rax), %rcx
testq %rcx, %rcx
sete %dl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %dl, %dil
jne 0x47d8
cmpq 0x18(%rsi), %rcx
je 0x47d9
retq
movq 0x38(%rsi), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Subject::indeg(Relay*)
int Subject::indeg(Relay *r)
{
    if (_activeSubject == NULL) {
        if (WARNING) {
            std::cout << "-- Warning! Method 'idle' called outside of the subjects environment.\n";
        }
    } else {
        if (r != NULL) {
            if (_activeSubject != r->_home) {
                if (WARNING) {
                    std::cout << "-- Warning! Subject " << _activeSubject->_debugID << " cannot call " << _debugID << "->idle().\n";
                }
            } else {
                return r->_iLinks->count();
            }
        }
    }
    return 0;
}

// Assembly:
leaq 0xc9b1(%rip), %rax      # 0x111a0
movq (%rax), %rcx
testq %rcx, %rcx
sete %dl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %dl, %dil
jne 0x4825
cmpq 0x18(%rsi), %rcx
jne 0x4825
movq 0x20(%rsi), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x4825
xorl %eax, %eax
incl %eax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x481a
retq