LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::DrawBBox(int) const
void RGBDImage::
DrawBBox(int color_scheme) const
{
  // Load color
  if (color_scheme == RGBD_NO_COLOR_SCHEME) LoadColor(color_scheme);
  else if (color_scheme == RGBD_HIGHLIGHT_COLOR_SCHEME) LoadColor(color_scheme);
  else if (color_scheme != RGBD_NO_COLOR_SCHEME) LoadColor(RGBD_INDEX_COLOR_SCHEME);

  // Outline bounding box
  WorldBBox().Outline();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
xorl %ecx, %ecx
cmpl $0x4, %esi
sete %cl
addl $0x3, %ecx
testl %esi, %esi
cmovnel %ecx, %esi
callq *0xf0(%rax)
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1d50c
movl $0x1, %esi
movq %r14, %rdi
callq 0x449bc
movq %rsp, %rdi
callq 0x444d0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x444d0
movq %rbx, %rdi
callq 0x11a70
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::LoadColor(int) const
void RGBDImage::
LoadColor(int color_scheme) const
{
  // Check color scheme
  if (color_scheme == RGBD_INDEX_COLOR_SCHEME) {
    // Load color encoding image index
    int k = 65535.0 * (ConfigurationIndex()+1) / configuration->NImages();
    unsigned char r = 0;
    unsigned char g = (k >> 8) & 0xFF;
    unsigned char b = k & 0xFF;
    RNLoadRgb(r, g, b);
  }
  else if (color_scheme == RGBD_RENDER_COLOR_SCHEME) {
    // Load white
    RNLoadRgb(1.0, 1.0, 1.0);
  }
  else if (color_scheme == RGBD_PHOTO_COLOR_SCHEME) {
    // Load white
    RNLoadRgb(1.0, 1.0, 1.0);
  }
  else if (color_scheme == RGBD_HIGHLIGHT_COLOR_SCHEME) {
    // Load highlight color
    RNLoadRgb(1.0, 1.0, 0.0);
  }
}

// Assembly:
decl %esi
cmpl $0x3, %esi
ja 0x1fc00
leaq 0x9e50e(%rip), %rax     # 0xbe0a8
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsd 0x9d47d(%rip), %xmm0    # 0xbd028
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
jmp 0x11900
movl 0x10(%rdi), %eax
incl %eax
cvtsi2sd %eax, %xmm0
mulsd 0x9e499(%rip), %xmm0    # 0xbe060
movq 0x8(%rdi), %rax
cvtsi2sdl 0x14(%rax), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movl %edx, %esi
shrl $0x8, %esi
movl $0xff, %eax
andl %eax, %edx
andl %eax, %esi
xorl %edi, %edi
jmp 0x11580
movsd 0x9d433(%rip), %xmm0    # 0xbd028
xorps %xmm2, %xmm2
movaps %xmm0, %xmm1
jmp 0x11900
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ColorChannels() const
R2Image RGBDImage::
ColorChannels(void) const
{
  // Initialize image
  R2Image image(NPixels(RN_X), NPixels(RN_Y), 3);

  // Fill image
  R2Grid *red_channel = Channel(RGBD_RED_CHANNEL);
  R2Grid *green_channel = Channel(RGBD_GREEN_CHANNEL);
  R2Grid *blue_channel = Channel(RGBD_BLUE_CHANNEL);
  for (int j = 0; j < image.Height(); j++) {
    for (int i = 0; i < image.Width(); i++) {
      RNScalar r = red_channel->GridValue(i, j);
      RNScalar g = green_channel->GridValue(i, j);
      RNScalar b = blue_channel->GridValue(i, j);
      image.SetPixelRGB(i, j, RNRgb(r, g, b));
    }
  }

  // Return image
  return image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl 0x28(%rsi), %esi
movl 0x2c(%r14), %edx
movq %rdi, %rbx
movl $0x3, %ecx
callq 0x70afe
movl 0x24(%r14), %edx
testl %edx, %edx
jle 0x1fc3d
movq 0x18(%r14), %rcx
movq (%rcx), %rax
movq %rax, 0x8(%rsp)
jmp 0x1fc46
movq $0x0, 0x8(%rsp)
cmpl $0x2, %edx
movq %rbx, %rax
jl 0x1fc58
movq 0x18(%r14), %rcx
movq 0x8(%rcx), %rbp
jmp 0x1fc5a
xorl %ebp, %ebp
cmpl $0x3, %edx
jl 0x1fc69
movq 0x18(%r14), %rcx
movq 0x10(%rcx), %r15
jmp 0x1fc6c
xorl %r15d, %r15d
cmpl $0x0, 0x4(%rax)
jle 0x1fd21
movq $0x0, (%rsp)
leaq 0x10(%rsp), %r13
cmpl $0x0, (%rax)
jle 0x1fd0e
movslq (%rsp), %rbx
xorl %r12d, %r12d
movq 0x8(%rsp), %rcx
movq 0xb8(%rcx), %rdx
movslq 0xc8(%rcx), %rcx
imulq %rbx, %rcx
addq %r12, %rcx
movsd (%rdx,%rcx,8), %xmm0
movq 0xb8(%rbp), %rdx
movslq 0xc8(%rbp), %rcx
imulq %rbx, %rcx
addq %r12, %rcx
movsd (%rdx,%rcx,8), %xmm1
movq 0xb8(%r15), %rdx
movslq 0xc8(%r15), %rcx
imulq %rbx, %rcx
addq %r12, %rcx
movsd (%rdx,%rcx,8), %xmm2
movq %rax, %r14
movq %r13, %rdi
callq 0x76088
movq %r14, %rdi
movl %r12d, %esi
movq (%rsp), %rdx
movq %r13, %rcx
callq 0x70eae
incq %r12
cmpl (%r14), %r12d
movq %r14, %rax
jl 0x1fc93
movq (%rsp), %rcx
incl %ecx
movq %rcx, (%rsp)
cmpl 0x4(%rax), %ecx
jl 0x1fc83
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x70d66
movq %rbx, %rdi
callq 0x11a70
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::CreateColorChannels(gaps::R2Image const&)
int RGBDImage::
CreateColorChannels(const R2Image& image)
{
  // Create color channels
  while (channels.NEntries() <= RGBD_BLUE_CHANNEL) channels.Insert(NULL);
  if (!channels[RGBD_RED_CHANNEL]) channels[RGBD_RED_CHANNEL] = new R2Grid(image.Width(), image.Height());
  if (!channels[RGBD_GREEN_CHANNEL]) channels[RGBD_GREEN_CHANNEL] = new R2Grid(image.Width(), image.Height());
  if (!channels[RGBD_BLUE_CHANNEL]) channels[RGBD_BLUE_CHANNEL] = new R2Grid(image.Width(), image.Height());

  // Update resident count
  color_resident_count++;

  // Initialize color channels
  SetColorChannels(image);

  // Set width and height
  this->width = image.Width();
  this->height = image.Height();

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
movl 0x24(%rdi), %edx
cmpl $0x2, %edx
jg 0x1fd70
movq %r15, %rdi
xorl %esi, %esi
callq 0x762aa
movl 0x24(%rbx), %edx
cmpl $0x3, %edx
jl 0x1fd5e
movq (%r15), %rax
cmpq $0x0, (%rax)
jne 0x1fd9b
movl $0xd0, %edi
callq 0x115b0
movq %rax, %r12
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x603d0
movq (%r15), %rax
movq %r12, (%rax)
movq (%r15), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1fdc8
movl $0xd0, %edi
callq 0x115b0
movq %rax, %r12
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x603d0
movq (%r15), %rax
movq %r12, 0x8(%rax)
movq (%r15), %rax
cmpq $0x0, 0x10(%rax)
jne 0x1fdf5
movl $0xd0, %edi
callq 0x115b0
movq %rax, %r12
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x603d0
movq (%r15), %rax
movq %r12, 0x10(%rax)
incl 0x1f8(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x50(%rax)
movq (%r14), %rax
movq %rax, 0x28(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1fe23
jmp 0x1fe23
movq %rax, %rbx
movl $0xd0, %esi
movq %r12, %rdi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a70
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::CreateChannel(int, gaps::R2Grid const&)
int RGBDImage::
CreateChannel(int channel_index, const R2Grid& image)
{
  // Create channel
  while (channels.NEntries() <= channel_index) channels.Insert(NULL);
  if (!channels[channel_index]) channels[channel_index] = new R2Grid(image);

  // Update resident count
  if (channel_index == RGBD_DEPTH_CHANNEL) depth_resident_count++;
  else if (channel_index == RGBD_BLUE_CHANNEL) color_resident_count++;

  // Initialize channel
  SetChannel(channel_index, image);

  // Set width and height
  this->width = image.XResolution();
  this->height = image.YResolution();

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x18(%rdi), %r15
movl 0x24(%rdi), %edx
cmpl %esi, %edx
jg 0x1fea8
movq %r15, %rdi
xorl %esi, %esi
callq 0x762aa
movl 0x24(%r14), %edx
cmpl %ebp, %edx
jle 0x1fe96
movq (%r15), %rax
movslq %ebp, %r13
cmpq $0x0, (%rax,%r13,8)
jne 0x1fed4
movl $0xd0, %edi
callq 0x115b0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x60e18
movq (%r15), %rax
movq %r12, (%rax,%r13,8)
cmpl $0x2, %ebp
je 0x1fee7
cmpl $0x3, %ebp
jne 0x1feee
incl 0x1fc(%r14)
jmp 0x1feee
incl 0x1f8(%r14)
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *0x40(%rax)
movl 0xc0(%rbx), %eax
movl %eax, 0x28(%r14)
movl 0xc4(%rbx), %eax
movl %eax, 0x2c(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xd0, %esi
movq %r12, %rdi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReadChannels()
int RGBDImage::
ReadChannels(void)
{
  // Read all channels
  if (!ReadColorChannels()) return 0;
  if (!ReadDepthChannel()) return 0;
  if (!ReadCategoryChannel()) return 0;
  if (!ReadInstanceChannel()) return 0;
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rax
callq *0x100(%rax)
xorl %ebx, %ebx
testl %eax, %eax
je 0x1ff85
movq (%r14), %rax
movq %r14, %rdi
callq *0x108(%rax)
testl %eax, %eax
je 0x1ff85
movq (%r14), %rax
movq %r14, %rdi
callq *0x110(%rax)
testl %eax, %eax
je 0x1ff85
movq (%r14), %rax
movq %r14, %rdi
callq *0x118(%rax)
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReadColorChannels()
int RGBDImage::
ReadColorChannels(void)
{
  // Check if already resident
  if (color_resident_count > 0) {
    color_resident_count++;
    return 1;
  }

  // Initialize image
  R2Image color_image(width, height, 3);

  // Check filename
  if (color_filename) {
    // Get full filename
    char full_filename[4096];
    const char *dirname = (configuration) ? configuration->ColorDirectory() : NULL;
    if (dirname) sprintf(full_filename, "%s/%s", dirname, color_filename);
    else sprintf(full_filename, "%s", color_filename);

    // Read color image
    if (!color_image.Read(full_filename)) return 0;

    // Resize color image if necessary
    if ((width > 0) && (height > 0) &&
        ((width != color_image.Width()) || (height != color_image.Height()))) {
      R3Matrix tmp(R3identity_matrix);
      RGBDResampleColorImage(color_image, tmp, width, height);
    }
  }

  // Create color channels
  return CreateColorChannels(color_image);
}

// Assembly:
pushq %rbx
subq $0x1060, %rsp           # imm = 0x1060
movq %rdi, %rbx
movl 0x1f8(%rdi), %eax
testl %eax, %eax
jle 0x1ffb7
incl %eax
movl %eax, 0x1f8(%rbx)
movl $0x1, %ebx
jmp 0x20089
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
movl $0x3, %ecx
callq 0x70afe
movq 0x1d8(%rbx), %rcx
testq %rcx, %rcx
je 0x2006c
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1ffe9
movq 0x30(%rax), %rdx
jmp 0x1ffeb
xorl %edx, %edx
testq %rdx, %rdx
je 0x20005
leaq 0x9dfc1(%rip), %rsi     # 0xbdfb8
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x20012
leaq 0x60(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x70800
testl %eax, %eax
je 0x2007f
movl 0x28(%rbx), %ecx
movl 0x2c(%rbx), %eax
testl %ecx, %ecx
setg %dl
testl %eax, %eax
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2006c
cmpl (%rsp), %ecx
jne 0x20048
cmpl 0x4(%rsp), %eax
je 0x2006c
leaq 0xa0259(%rip), %rsi     # 0xc02a8
leaq 0x18(%rsp), %rdi
callq 0x6dfb2
movl 0x28(%rbx), %edx
movl 0x2c(%rbx), %ecx
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x23c43
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x178(%rax)
movl %eax, %ebx
jmp 0x20081
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x70d66
movl %ebx, %eax
addq $0x1060, %rsp           # imm = 0x1060
popq %rbx
retq
jmp 0x20098
jmp 0x20098
movq %rax, %rbx
movq %rsp, %rdi
callq 0x70d66
movq %rbx, %rdi
callq 0x11a70
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReadCategoryChannel()
int RGBDImage::
ReadCategoryChannel(void)
{
  // Check if already resident/update read count
  if (category_resident_count > 0) {
    category_resident_count++;
    return 1;
  }

  // Initialize image
  R2Grid category_image(width, height);

  // Check filename
  if (category_filename) {
    // Get full filename
    char full_filename[4096];
    const char *dirname = (configuration) ? configuration->CategoryDirectory() : NULL;
    if (dirname) sprintf(full_filename, "%s/%s", dirname, category_filename);
    else sprintf(full_filename, "%s", category_filename);

    // Read category image
    if (!category_image.ReadFile(full_filename)) return 0;
  }
  
  // Create category channel
  return CreateCategoryChannel(category_image);
}

// Assembly:
pushq %rbx
subq $0x10d0, %rsp           # imm = 0x10D0
movq %rdi, %rbx
movl 0x200(%rdi), %eax
testl %eax, %eax
jle 0x2052f
incl %eax
movl %eax, 0x200(%rbx)
movl $0x1, %ebx
jmp 0x205b8
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
callq 0x603d0
movq 0x1e8(%rbx), %rcx
testq %rcx, %rcx
je 0x2059b
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x20558
movq 0x40(%rax), %rdx
jmp 0x2055a
xorl %edx, %edx
testq %rdx, %rdx
je 0x20577
leaq 0x9da52(%rip), %rsi     # 0xbdfb8
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x20587
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq %rsp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x688d2
testl %eax, %eax
je 0x205ae
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x188(%rax)
movl %eax, %ebx
jmp 0x205b0
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x60ff0
movl %ebx, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
retq
jmp 0x205c5
movq %rax, %rbx
movq %rsp, %rdi
callq 0x60ff0
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReadInstanceChannel()
int RGBDImage::
ReadInstanceChannel(void)
{
  // Check if already resident/update read count
  if (instance_resident_count > 0) {
    instance_resident_count++;
    return 1;
  }

  // Initialize image
  R2Grid instance_image(width, height);

  // Check filename
  if (instance_filename) {
    // Get full filename
    char full_filename[4096];
    const char *dirname = (configuration) ? configuration->InstanceDirectory() : NULL;
    if (dirname) sprintf(full_filename, "%s/%s", dirname, instance_filename);
    else sprintf(full_filename, "%s", instance_filename);

    // Read instance image
    if (!instance_image.ReadFile(full_filename)) return 0;
  }
  
  // Create instance channel
  return CreateInstanceChannel(instance_image);
}

// Assembly:
pushq %rbx
subq $0x10d0, %rsp           # imm = 0x10D0
movq %rdi, %rbx
movl 0x204(%rdi), %eax
testl %eax, %eax
jle 0x205ff
incl %eax
movl %eax, 0x204(%rbx)
movl $0x1, %ebx
jmp 0x20688
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
callq 0x603d0
movq 0x1f0(%rbx), %rcx
testq %rcx, %rcx
je 0x2066b
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x20628
movq 0x48(%rax), %rdx
jmp 0x2062a
xorl %edx, %edx
testq %rdx, %rdx
je 0x20647
leaq 0x9d982(%rip), %rsi     # 0xbdfb8
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x20657
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq %rsp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x688d2
testl %eax, %eax
je 0x2067e
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x190(%rax)
movl %eax, %ebx
jmp 0x20680
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x60ff0
movl %ebx, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
retq
jmp 0x20695
movq %rax, %rbx
movq %rsp, %rdi
callq 0x60ff0
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::WriteChannels()
int RGBDImage::
WriteChannels(void)
{
  // Write all channels
  if (!WriteColorChannels()) return 0;
  if (!WriteDepthChannel()) return 0;
  if (!WriteCategoryChannel()) return 0;
  if (!WriteInstanceChannel()) return 0;
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rax
callq *0x128(%rax)
xorl %ebx, %ebx
testl %eax, %eax
je 0x206f1
movq (%r14), %rax
movq %r14, %rdi
callq *0x130(%rax)
testl %eax, %eax
je 0x206f1
movq (%r14), %rax
movq %r14, %rdi
callq *0x138(%rax)
testl %eax, %eax
je 0x206f1
movq (%r14), %rax
movq %r14, %rdi
callq *0x140(%rax)
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::WriteColorChannels()
int RGBDImage::
WriteColorChannels(void)
{
  // Check filename
  if (!color_filename) return 0;
  if (NChannels() <= RGBD_BLUE_CHANNEL) return 0;

  // Get full filename
  char full_filename[4096];
  const char *dirname = (configuration) ? configuration->ColorDirectory() : NULL;
  if (dirname) sprintf(full_filename, "%s/%s", dirname, color_filename);
  else sprintf(full_filename, "%s", color_filename);

  // Compute color image
  R2Image rgb_image(width, height, 3);
  for (int iy = 0; iy < height; iy++) {
    for (int ix = 0; ix < width; ix++) {
      RNRgb rgb = PixelColor(ix, iy);
      rgb_image.SetPixelRGB(ix, iy, rgb);
    }
  }

  // Write color image
  if (!rgb_image.Write(color_filename)) return 0;

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1030, %rsp           # imm = 0x1030
movq 0x1d8(%rdi), %rcx
xorl %ebp, %ebp
testq %rcx, %rcx
je 0x207dd
movq %rdi, %rbx
cmpl $0x3, 0x24(%rdi)
jl 0x207dd
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x20739
movq 0x30(%rax), %rdx
jmp 0x2073b
xorl %edx, %edx
testq %rdx, %rdx
je 0x20755
leaq 0x9d871(%rip), %rsi     # 0xbdfb8
leaq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x20762
leaq 0x30(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
movl $0x3, %ecx
callq 0x70afe
cmpl $0x0, 0x2c(%rbx)
jle 0x207be
xorl %ebp, %ebp
leaq 0x18(%rsp), %r14
movq %rsp, %r15
cmpl $0x0, 0x28(%rbx)
jle 0x207b7
xorl %r12d, %r12d
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %ebp, %ecx
callq 0x1d9d8
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
movq %r14, %rcx
callq 0x70eae
incl %r12d
cmpl 0x28(%rbx), %r12d
jl 0x2078e
incl %ebp
cmpl 0x2c(%rbx), %ebp
jl 0x20785
movq 0x1d8(%rbx), %rsi
movq %rsp, %rdi
callq 0x72938
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rsp, %rdi
callq 0x70d66
movl %ebp, %eax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x207f1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x70d66
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::WriteDepthChannel()
int RGBDImage::
WriteDepthChannel(void)
{
  // Check filename
  if (!depth_filename) return 0;
  if (NChannels() <= RGBD_DEPTH_CHANNEL) return 0;

  // Get full filename
  char full_filename[4096];
  const char *dirname = (configuration) ? configuration->DepthDirectory() : NULL;
  if (dirname) sprintf(full_filename, "%s/%s", dirname, depth_filename);
  else sprintf(full_filename, "%s", depth_filename);
  
  // Get depth image  
  R2Grid depth_image(*(channels[RGBD_DEPTH_CHANNEL]));
  if (strstr(depth_filename, ".png")) {
    depth_image.Multiply(1000.0);
    if (configuration && configuration->DatasetFormat()) {
      if (!strcmp(configuration->DatasetFormat(), "matterport")) {
        depth_image.Multiply(4);
      }
      else if (!strcmp(configuration->DatasetFormat(), "tum")) {
        depth_image.Multiply(5);
      }
    }
  }
    
  // Write depth image  
  if (!depth_image.WriteFile(depth_filename)) return 0;

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10d0, %rsp           # imm = 0x10D0
movq 0x1e0(%rdi), %rcx
xorl %ebp, %ebp
testq %rcx, %rcx
je 0x20915
movq %rdi, %rbx
cmpl $0x4, 0x24(%rdi)
jl 0x20915
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2083d
movq 0x38(%rax), %rdx
jmp 0x2083f
xorl %edx, %edx
testq %rdx, %rdx
je 0x2085c
leaq 0x9d76d(%rip), %rsi     # 0xbdfb8
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x2086c
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
movq %rsp, %rdi
callq 0x60e18
movq 0x1e0(%rbx), %rdi
leaq 0x9d3b2(%rip), %rsi     # 0xbdc3c
callq 0x11140
testq %rax, %rax
je 0x208f6
movq %rsp, %rdi
movsd 0x9d7e9(%rip), %xmm0    # 0xbe088
callq 0x64eb6
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x208f6
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x208f6
leaq 0x9ce99(%rip), %rsi     # 0xbd756
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x208e6
leaq 0x9d928(%rip), %rsi     # 0xbe1f8
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
jne 0x208f6
movsd 0x9d7b4(%rip), %xmm0    # 0xbe098
jmp 0x208ee
movsd 0x9d7a2(%rip), %xmm0    # 0xbe090
movq %rsp, %rdi
callq 0x64eb6
movq 0x1e0(%rbx), %rsi
movq %rsp, %rdi
callq 0x696f6
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rsp, %rdi
callq 0x60ff0
movl %ebp, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x60ff0
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::WriteCategoryChannel()
int RGBDImage::
WriteCategoryChannel(void)
{
  // Check filename
  if (!category_filename) return 0;
  if (NChannels() <= RGBD_CATEGORY_CHANNEL) return 0;

  // Get full filename
  char full_filename[4096];
  const char *dirname = (configuration) ? configuration->CategoryDirectory() : NULL;
  if (dirname) sprintf(full_filename, "%s/%s", dirname, category_filename);
  else sprintf(full_filename, "%s", category_filename);
  
  // Write category image  
  if (!channels[RGBD_CATEGORY_CHANNEL]->WriteFile(category_filename)) return 0;

  // Return success
  return 1;
}

// Assembly:
movq 0x1e8(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x209ae
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
cmpl $0x5, 0x24(%rdi)
jl 0x209a6
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x20964
movq 0x40(%rax), %rdx
jmp 0x20966
xorl %edx, %edx
testq %rdx, %rdx
je 0x2097e
leaq 0x9d646(%rip), %rsi     # 0xbdfb8
movq %rsp, %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x20989
movq %rsp, %rdi
movq %rcx, %rsi
callq 0x11530
movq 0x18(%rbx), %rax
movq 0x1e8(%rbx), %rsi
movq 0x20(%rax), %rdi
callq 0x696f6
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::WriteInstanceChannel()
int RGBDImage::
WriteInstanceChannel(void)
{
  // Check filename
  if (!instance_filename) return 0;
  if (NChannels() <= RGBD_INSTANCE_CHANNEL) return 0;

  // Get full filename
  char full_filename[4096];
  const char *dirname = (configuration) ? configuration->InstanceDirectory() : NULL;
  if (dirname) sprintf(full_filename, "%s/%s", dirname, instance_filename);
  else sprintf(full_filename, "%s", instance_filename);
  
  // Write instance image  
  if (!channels[RGBD_INSTANCE_CHANNEL]->WriteFile(instance_filename)) return 0;

  // Return success
  return 1;
}

// Assembly:
movq 0x1f0(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x20a28
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
cmpl $0x6, 0x24(%rdi)
jl 0x20a20
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x209de
movq 0x48(%rax), %rdx
jmp 0x209e0
xorl %edx, %edx
testq %rdx, %rdx
je 0x209f8
leaq 0x9d5cc(%rip), %rsi     # 0xbdfb8
movq %rsp, %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x20a03
movq %rsp, %rdi
movq %rcx, %rsi
callq 0x11530
movq 0x18(%rbx), %rax
movq 0x1f0(%rbx), %rsi
movq 0x28(%rax), %rdi
callq 0x696f6
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReleaseChannels()
int RGBDImage::
ReleaseChannels(void)
{
  // Release all channels
  if (!ReleaseColorChannels()) return 0;
  if (!ReleaseDepthChannel()) return 0;
  if (!ReleaseCategoryChannel()) return 0;
  if (!ReleaseInstanceChannel()) return 0;
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rax
callq *0x150(%rax)
xorl %ebx, %ebx
testl %eax, %eax
je 0x20a73
movq (%r14), %rax
movq %r14, %rdi
callq *0x158(%rax)
testl %eax, %eax
je 0x20a73
movq (%r14), %rax
movq %r14, %rdi
callq *0x160(%rax)
testl %eax, %eax
je 0x20a73
movq (%r14), %rax
movq %r14, %rdi
callq *0x168(%rax)
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReleaseColorChannels()
int RGBDImage::
ReleaseColorChannels(void)
{
  // Check/update read count
  if (--color_resident_count > 0) return 1;

  // Write color channel before releasing it ???
  // if (!WriteColorChannels()) return 0;

  // Delete color channels
  for (int channel_index = RGBD_RED_CHANNEL; channel_index <= RGBD_BLUE_CHANNEL; channel_index++) {
    if (NChannels() <= channel_index) break;
    if (!channels[channel_index]) continue;
    delete channels[channel_index];
    channels[channel_index] = NULL;
  }

  // Return success;
  return 1;
}

// Assembly:
movl 0x1f8(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x1f8(%rdi)
cmpl $0x1, %eax
jg 0x20ae8
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x24(%rdi)
jle 0x20ae3
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x20ad1
movq %r14, %rdi
callq 0x60ff0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115c0
movq 0x18(%rbx), %rax
movq $0x0, (%rax,%r15,8)
cmpq $0x1, %r15
ja 0x20ae3
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x20aa3
popq %rbx
popq %r14
popq %r15
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReleaseDepthChannel()
int RGBDImage::
ReleaseDepthChannel(void)
{
  // Check/update read count
  if (--depth_resident_count > 0) return 1;

  // Write depth channel before releasing it ???
  // if (!WriteDepthChannels()) return 0;

  // Delete depth channel
  if (NChannels() <= RGBD_DEPTH_CHANNEL) return 0;
  if (!channels[RGBD_DEPTH_CHANNEL]) return 0;
  delete channels[RGBD_DEPTH_CHANNEL];
  channels[RGBD_DEPTH_CHANNEL] = NULL;

  // Return success;
  return 1;
}

// Assembly:
movl 0x1fc(%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x1fc(%rdi)
movl $0x1, %eax
cmpl $0x1, %ecx
jg 0x20b50
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x4, 0x24(%rdi)
jl 0x20b49
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %r14
testq %r14, %r14
je 0x20b49
movq %r14, %rdi
callq 0x60ff0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115c0
movq 0x18(%rbx), %rax
movq $0x0, 0x18(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReleaseCategoryChannel()
int RGBDImage::
ReleaseCategoryChannel(void)
{
  // Check/update read count
  if (--category_resident_count > 0) return 1;

  // Write category channel before releasing it ???
  // if (!WriteCategoryChannels()) return 0;

  // Delete category channel
  if (NChannels() <= RGBD_CATEGORY_CHANNEL) return 0;
  if (!channels[RGBD_CATEGORY_CHANNEL]) return 0;
  delete channels[RGBD_CATEGORY_CHANNEL];
  channels[RGBD_CATEGORY_CHANNEL] = NULL;

  // Return success;
  return 1;
}

// Assembly:
movl 0x200(%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x200(%rdi)
movl $0x1, %eax
cmpl $0x1, %ecx
jg 0x20bb4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x5, 0x24(%rdi)
jl 0x20bad
movq 0x18(%rbx), %rcx
movq 0x20(%rcx), %r14
testq %r14, %r14
je 0x20bad
movq %r14, %rdi
callq 0x60ff0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115c0
movq 0x18(%rbx), %rax
movq $0x0, 0x20(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReleaseInstanceChannel()
int RGBDImage::
ReleaseInstanceChannel(void)
{
  // Check/update read count
  if (--instance_resident_count > 0) return 1;

  // Write instance channel before releasing it ???
  // if (!WriteInstanceChannels()) return 0;

  // Delete instance channel
  if (NChannels() <= RGBD_INSTANCE_CHANNEL) return 0;
  if (!channels[RGBD_INSTANCE_CHANNEL]) return 0;
  delete channels[RGBD_INSTANCE_CHANNEL];
  channels[RGBD_INSTANCE_CHANNEL] = NULL;

  // Return success;
  return 1;
}

// Assembly:
movl 0x204(%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x204(%rdi)
movl $0x1, %eax
cmpl $0x1, %ecx
jg 0x20c18
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x6, 0x24(%rdi)
jl 0x20c11
movq 0x18(%rbx), %rcx
movq 0x28(%rcx), %r14
testq %r14, %r14
je 0x20c11
movq %r14, %rdi
callq 0x60ff0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115c0
movq 0x18(%rbx), %rax
movq $0x0, 0x28(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetColorFilename(char const*)
void RGBDImage::
SetColorFilename(const char *filename)
{
  // Set filename
  if (color_filename) free(color_filename);
  if (filename && strcmp(filename, "-")) color_filename = RNStrdup(filename);
  else color_filename = NULL;

  // Set name
  if (!name && filename) {
    char buffer[1024];
    strncpy(buffer, filename, 1023);
    char *startp = strrchr(buffer, '/');
    if (startp) startp++;
    else startp = buffer;
    char *endp = strrchr(startp, '.');
    if (endp) *endp = '\0';
    name = RNStrdup(startp);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1d8(%rdi), %rdi
testq %rdi, %rdi
je 0x20c8b
callq 0x11720
testq %r14, %r14
je 0x20cad
leaq 0x9c695(%rip), %rsi     # 0xbd32c
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x20cad
movq %r14, %rdi
callq 0x78eef
jmp 0x20caf
xorl %eax, %eax
movq %rax, 0x1d8(%rbx)
testq %r14, %r14
je 0x20d14
cmpq $0x0, 0x1d0(%rbx)
jne 0x20d14
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20d05
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x78eef
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetDepthFilename(char const*)
void RGBDImage::
SetDepthFilename(const char *filename)
{
  // Set filename
  if (depth_filename) free(depth_filename);
  if (filename && strcmp(filename, "-")) depth_filename = RNStrdup(filename);
  else depth_filename = NULL;

  // Set name
  if (!name && filename && strcmp(filename, "-")) {
    char buffer[1024];
    strncpy(buffer, filename, 1023);
    char *startp = strrchr(buffer, '/');
    if (startp) startp++;
    else startp = buffer;
    char *endp = strrchr(startp, '.');
    if (endp) *endp = '\0';
    name = RNStrdup(startp);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1e0(%rdi), %rdi
testq %rdi, %rdi
je 0x20d45
callq 0x11720
testq %r14, %r14
je 0x20d67
leaq 0x9c5db(%rip), %rsi     # 0xbd32c
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x20d67
movq %r14, %rdi
callq 0x78eef
jmp 0x20d69
xorl %eax, %eax
movq %rax, 0x1e0(%rbx)
testq %r14, %r14
je 0x20de1
cmpq $0x0, 0x1d0(%rbx)
jne 0x20de1
leaq 0x9c5a6(%rip), %rsi     # 0xbd32c
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x20de1
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20dd2
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x78eef
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetCategoryFilename(char const*)
void RGBDImage::
SetCategoryFilename(const char *filename)
{
  // Set filename
  if (category_filename) free(category_filename);
  if (filename && strcmp(filename, "-")) category_filename = RNStrdup(filename);
  else category_filename = NULL;

  // Set name
  if (!name && filename && strcmp(filename, "-")) {
    char buffer[1024];
    strncpy(buffer, filename, 1023);
    char *startp = strrchr(buffer, '/');
    if (!startp) startp = buffer;
    char *endp = strrchr(startp, '.');
    if (endp) *endp = '\0';
    name = RNStrdup(startp);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1e8(%rdi), %rdi
testq %rdi, %rdi
je 0x20e11
callq 0x11720
testq %r14, %r14
je 0x20e33
leaq 0x9c50f(%rip), %rsi     # 0xbd32c
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x20e33
movq %r14, %rdi
callq 0x78eef
jmp 0x20e35
xorl %eax, %eax
movq %rax, 0x1e8(%rbx)
testq %r14, %r14
je 0x20eac
cmpq $0x0, 0x1d0(%rbx)
jne 0x20eac
leaq 0x9c4da(%rip), %rsi     # 0xbd32c
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x20eac
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
movq %rax, %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20e9d
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x78eef
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetInstanceFilename(char const*)
void RGBDImage::
SetInstanceFilename(const char *filename)
{
  // Set filename
  if (instance_filename) free(instance_filename);
  if (filename && strcmp(filename, "-")) instance_filename = RNStrdup(filename);
  else instance_filename = NULL;

  // Set name
  if (!name && filename) {
    char buffer[1024];
    strncpy(buffer, filename, 1023);
    char *startp = strrchr(buffer, '/');
    if (!startp) startp = buffer;
    char *endp = strrchr(startp, '.');
    if (endp) *endp = '\0';
    name = RNStrdup(startp);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1f0(%rdi), %rdi
testq %rdi, %rdi
je 0x20edd
callq 0x11720
testq %r14, %r14
je 0x20eff
leaq 0x9c443(%rip), %rsi     # 0xbd32c
movq %r14, %rdi
callq 0x11850
testl %eax, %eax
je 0x20eff
movq %r14, %rdi
callq 0x78eef
jmp 0x20f01
xorl %eax, %eax
movq %rax, 0x1f0(%rbx)
testq %r14, %r14
je 0x20f65
cmpq $0x0, 0x1d0(%rbx)
jne 0x20f65
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
movq %rax, %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20f56
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x78eef
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDUtil.cpp
// Function: gaps::RGBDCreatePositionChannels(gaps::RGBDImage*, gaps::R2Grid&, gaps::R2Grid&, gaps::R2Grid&, int)
int RGBDCreatePositionChannels(RGBDImage *image,
  R2Grid& output_px_image, R2Grid& output_py_image, R2Grid& output_pz_image,
  RNBoolean world_coordinates)
{
  R4Matrix camera_to_world = R4identity_matrix;
  if (world_coordinates) camera_to_world = image->CameraToWorld().Matrix();
  return RGBDCreatePositionChannels(*(image->DepthChannel()),
    output_px_image, output_py_image, output_pz_image,
    image->Intrinsics(), camera_to_world);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x9d793(%rip), %rsi     # 0xbee08
movq %rsp, %rdi
callq 0x48742
testl %ebp, %ebp
je 0x2168d
leaq 0x38(%r15), %rsi
movq %rsp, %rdi
callq 0x4a326
movq 0x18(%r15), %rax
movq 0x18(%rax), %rdi
addq $0x140, %r15            # imm = 0x140
movq %rsp, %r9
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x216c5
movl $0x1, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDUtil.cpp
// Function: gaps::RGBDCreateNormalChannels(gaps::R2Grid const&, gaps::R2Grid const&, gaps::R2Grid const&, gaps::R2Grid const&, gaps::R2Grid const&, gaps::R2Grid&, gaps::R2Grid&, gaps::R2Grid&, gaps::R2Grid&, gaps::R3Point const&, gaps::R3Vector const&, gaps::R3Vector const&, double, int, int)
int RGBDCreateNormalChannels(const R2Grid& input_depth_image, 
  const R2Grid& input_px_image, const R2Grid& input_py_image, const R2Grid& input_pz_image,
  const R2Grid& input_boundary_image,
  R2Grid& output_nx_image, R2Grid& output_ny_image, R2Grid& output_nz_image, R2Grid& output_radius_image,
  const R3Point& viewpoint, const R3Vector& towards, const R3Vector& up,
  RNLength neighborhood_world_radius, int neighborhood_pixel_radius, RNBoolean neighborhood_search)
{
  // Create normal images
  R2Grid tx_image, ty_image, tz_image, r2_image;
  return RGBDCreateTangentChannels(input_depth_image, input_px_image, input_py_image, input_pz_image, input_boundary_image,
    output_nx_image, output_ny_image, output_nz_image, tx_image, ty_image, tz_image, output_radius_image, r2_image,
    viewpoint, towards, up, neighborhood_world_radius, neighborhood_pixel_radius, neighborhood_search);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
movsd %xmm0, 0x80(%rsp)
movq %r9, 0x68(%rsp)
movq %r8, %r13
movq %rcx, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x603d0
leaq 0x2f8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x603d0
leaq 0x228(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x603d0
leaq 0x158(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x603d0
movl 0x438(%rsp), %eax
movl 0x430(%rsp), %ecx
movq 0x418(%rsp), %rdx
movq 0x410(%rsp), %rsi
movq 0x408(%rsp), %rdi
movq 0x400(%rsp), %r8
movl %eax, 0x58(%rsp)
movl %ecx, 0x50(%rsp)
movq %rdx, 0x38(%rsp)
movq %r15, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x18(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq %r8, (%rsp)
movq %r13, %r8
movq 0x68(%rsp), %r9
movq %rbp, %rdi
movq %r12, %rsi
movq 0x70(%rsp), %rdx
movq 0x78(%rsp), %rcx
movsd 0x80(%rsp), %xmm0
callq 0x2229f
leaq 0x158(%rsp), %rdi
callq 0x60ff0
leaq 0x228(%rsp), %rdi
callq 0x60ff0
leaq 0x2f8(%rsp), %rdi
callq 0x60ff0
leaq 0x88(%rsp), %rdi
callq 0x60ff0
movl $0x1, %eax
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x60ff0
jmp 0x21c4e
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x60ff0
jmp 0x21c60
movq %rax, %rbx
leaq 0x2f8(%rsp), %rdi
callq 0x60ff0
jmp 0x21c72
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x60ff0
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Json::Value&, bool)
bool
Reader::parse(const std::string& document, Value& root, bool collectComments) {
  document_ = document;
  const char* begin = document_.c_str();
  const char* end = begin + document_.length();
  return parse(begin, end, root, collectComments);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
addq $0xa0, %rdi
callq 0x11300
movq 0xa0(%r15), %rsi
movq 0xa8(%r15), %rdx
addq %rsi, %rdx
movq %r15, %rdi
movq %r14, %rcx
movl %ebx, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x793f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::parse(char const*, char const*, Json::Value&, bool)
bool Reader::parse(const char* beginDoc,
                   const char* endDoc,
                   Value& root,
                   bool collectComments) {
  if (!features_.allowComments_) {
    collectComments = false;
  }

  begin_ = beginDoc;
  end_ = endDoc;
  collectComments_ = collectComments;
  current_ = begin_;
  lastValueEnd_ = 0;
  lastValue_ = 0;
  commentsBefore_ = "";
  errors_.clear();
  while (!nodes_.empty())
    nodes_.pop();
  nodes_.push(&root);

  stackDepth_g = 0;  // Yes, this is bad coding, but options are limited.
  bool successful = readValue();
  Token token;
  skipCommentTokens(token);
  if (collectComments_ && !commentsBefore_.empty())
    root.setComment(commentsBefore_, commentAfter);
  if (features_.strictRoot_) {
    if (!root.isArray() && !root.isObject()) {
      // Set error location to start of doc, ideally should be first token found
      // in doc
      token.type_ = tokenError;
      token.start_ = beginDoc;
      token.end_ = endDoc;
      addError(
          "A valid JSON document must be either an array or an object value.",
          token);
      return false;
    }
  }
  return successful;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
andb 0x108(%rdi), %r8b
movq %rsi, 0xc0(%rdi)
movq %rdx, 0xc8(%rdi)
movb %r8b, 0x10c(%rdi)
movq %rsi, 0xd0(%rdi)
leaq 0xe8(%rdi), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rdi)
movq 0xf0(%rdi), %rdx
leaq 0x451eb(%rip), %rcx     # 0xbe637
movq %r13, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x11920
leaq 0x50(%rbx), %rdi
callq 0x89868
movq 0x30(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x79476
movq %rbx, %rdi
callq 0x8aef8
jmp 0x79462
movq %rsp, %rsi
movq %r12, (%rsi)
movq %rbx, %rdi
callq 0x8af44
movl $0x0, 0x9013e(%rip)     # 0x1095cc
movq %rbx, %rdi
callq 0x7962e
movl %eax, %ebp
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x79b14
cmpb $0x1, 0x10c(%rbx)
jne 0x794cb
movq 0xf0(%rbx), %rdx
testq %rdx, %rdx
je 0x794cb
movq (%r13), %rsi
movq %r12, %rdi
movl $0x2, %ecx
callq 0x84a66
cmpb $0x1, 0x109(%rbx)
jne 0x79546
movzwl 0x8(%r12), %eax
andl $0xfe, %eax
cmpw $0x6, %ax
je 0x79546
leaq 0x20(%rsp), %r12
movl $0xd, (%r12)
movq %r15, 0x8(%r12)
movq %r14, 0x10(%r12)
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x47b9c(%rip), %rsi     # 0xc10a8
leaq 0x47bd6(%rip), %rdx     # 0xc10e9
movq %rsp, %r14
movq %r14, %rdi
callq 0x1ab58
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x79b74
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x79544
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x79570
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a70
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::parse(std::istream&, Json::Value&, bool)
bool Reader::parse(std::istream& sin, Value& root, bool collectComments) {
  // std::istream_iterator<char> begin(sin);
  // std::istream_iterator<char> end;
  // Those would allow streamed input from a file, if parse() were a
  // template function.

  // Since std::string is reference-counted, this at least does not
  // create an extra copy.
  std::string doc;
  std::getline(sin, doc, (char)EOF);
  return parse(doc, root, collectComments);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x11b00
leaq 0xa0(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x11300
movq 0xa0(%r14), %rsi
movq 0xa8(%r14), %rdx
addq %rsi, %rdx
movzbl %bpl, %r8d
movq %r14, %rdi
movq %rbx, %rcx
callq 0x793f0
movl %eax, %ebx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x795fe
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x79625
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a70
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::skipCommentTokens(Json::Reader::Token&)
void Reader::skipCommentTokens(Token& token) {
  if (features_.allowComments_) {
    do {
      readToken(token);
    } while (token.type_ == tokenComment);
  } else {
    readToken(token);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, 0x108(%rdi)
jne 0x79b3f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7a768
cmpl $0xc, (%rbx)
je 0x79b27
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7a768
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::addError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Json::Reader::Token&, char const*)
bool
Reader::addError(const std::string& message, Token& token, Location extra) {
  ErrorInfo info;
  info.token_ = token;
  info.message_ = message;
  info.extra_ = extra;
  errors_.push_back(info);
  return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rcx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movups (%rdx), %xmm0
movaps %xmm0, -0x28(%r15)
movq 0x10(%rdx), %rax
movq %rax, -0x18(%r15)
callq 0x11300
movq %rsp, %rsi
movq %r14, 0x38(%rsi)
addq $0x50, %rbx
movq %rbx, %rdi
callq 0x898ce
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x79bdc
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x115c0
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x79c02
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a70