LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1e1b0
leaq 0x8aede(%rip), %rax     # 0xa9028
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsd 0x89ecd(%rip), %xmm0    # 0xa8028
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
jmp 0x11910
movl 0x10(%rdi), %eax
incl %eax
cvtsi2sd %eax, %xmm0
mulsd 0x8ae69(%rip), %xmm0    # 0xa8fe0
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 0x89e83(%rip), %xmm0    # 0xa8028
xorps %xmm2, %xmm2
movaps %xmm0, %xmm1
jmp 0x11910
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movl 0x28(%rsi), %esi
movl 0x2c(%r15), %edx
pushq $0x3
popq %rcx
movq %rdi, (%rsp)
callq 0x671d2
movl 0x24(%r15), %eax
xorl %edx, %edx
testl %eax, %eax
jle 0x1e1f0
movq 0x18(%r15), %rcx
movq (%rcx), %r13
cmpl $0x1, %eax
jne 0x1e1f7
xorl %ebp, %ebp
jmp 0x1e206
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0x1e206
movq 0x8(%rcx), %rbp
cmpl $0x3, %eax
jb 0x1e206
movq 0x10(%rcx), %r14
jmp 0x1e209
xorl %r14d, %r14d
leaq 0x10(%rsp), %rbx
movq (%rsp), %rax
cmpl 0x4(%rax), %edx
jge 0x1e2aa
movq %rdx, 0x8(%rsp)
movslq %edx, %r15
xorl %r12d, %r12d
movq (%rsp), %rax
cmpl (%rax), %r12d
jge 0x1e29e
movq 0xb8(%r13), %rax
movslq 0xc8(%r13), %rcx
imulq %r15, %rcx
addq %r12, %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0xb8(%rbp), %rax
movslq 0xc8(%rbp), %rcx
imulq %r15, %rcx
addq %r12, %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0xb8(%r14), %rax
movslq 0xc8(%r14), %rcx
imulq %r15, %rcx
addq %r12, %rcx
movsd (%rax,%rcx,8), %xmm2
movq %rbx, %rdi
callq 0x6bf32
movq (%rsp), %rdi
movl %r12d, %esi
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
callq 0x67560
incq %r12
jmp 0x1e226
movq 0x8(%rsp), %rdx
incl %edx
jmp 0x1e20e
movq (%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rsp), %rdi
callq 0x67414
movq %r14, %rdi
callq 0x11a80
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
cmpl $0x2, 0x24(%rbx)
jg 0x1e2f6
movq %r15, %rdi
xorl %esi, %esi
callq 0x15616
jmp 0x1e2e4
movq (%r15), %rax
cmpq $0x0, (%rax)
jne 0x1e324
movl $0xd0, %edi
callq 0x115c0
movq %rax, %r12
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x57e7c
movq (%r15), %rax
movq %r12, (%rax)
movq (%r15), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1e351
movl $0xd0, %edi
callq 0x115c0
movq %rax, %r12
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x57e7c
movq (%r15), %rax
movq %r12, 0x8(%rax)
movq (%r15), %rax
cmpq $0x0, 0x10(%rax)
jne 0x1e37b
movl $0xd0, %edi
callq 0x115c0
movq %rax, %r12
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
callq 0x57e7c
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)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1e3a7
jmp 0x1e3a7
movq %rax, %rbx
movl $0xd0, %esi
movq %r12, %rdi
callq 0x115d0
movq %rbx, %rdi
callq 0x11a80
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
cmpl %ebp, 0x24(%r14)
jg 0x1e41f
movq %r15, %rdi
xorl %esi, %esi
callq 0x15616
jmp 0x1e40d
movq (%r15), %rax
movslq %ebp, %r13
cmpq $0x0, (%rax,%r13,8)
jne 0x1e44b
movl $0xd0, %edi
callq 0x115c0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x58808
movq (%r15), %rax
movq %r12, (%rax,%r13,8)
cmpl $0x2, %ebp
je 0x1e45e
cmpl $0x3, %ebp
jne 0x1e465
incl 0x1fc(%r14)
jmp 0x1e465
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)
pushq $0x1
popq %rax
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 0x115d0
movq %rbx, %rdi
callq 0x11a80
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1e4fb
movq (%r14), %rax
movq %r14, %rdi
callq *0x108(%rax)
testl %eax, %eax
je 0x1e4fb
movq (%r14), %rax
movq %r14, %rdi
callq *0x110(%rax)
testl %eax, %eax
je 0x1e4fb
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_O2/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 0x1e52b
incl %eax
movl %eax, 0x1f8(%rbx)
pushq $0x1
popq %rbx
jmp 0x1e5f7
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
pushq $0x3
popq %rcx
callq 0x671d2
movq 0x1d8(%rbx), %rcx
testq %rcx, %rcx
je 0x1e5da
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1e573
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x1e573
leaq 0x8a9d3(%rip), %rsi     # 0xa8f38
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x1e580
leaq 0x60(%rsp), %rdi
movq %rcx, %rsi
callq 0x11540
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x66ee4
testl %eax, %eax
je 0x1e5ed
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 0x1e5da
cmpl (%rsp), %ecx
jne 0x1e5b6
cmpl 0x4(%rsp), %eax
je 0x1e5da
leaq 0x8cc13(%rip), %rsi     # 0xab1d0
leaq 0x18(%rsp), %rdi
callq 0x648fc
movl 0x28(%rbx), %edx
movl 0x2c(%rbx), %ecx
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x21f2b
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x178(%rax)
movl %eax, %ebx
jmp 0x1e5ef
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x67414
movl %ebx, %eax
addq $0x1060, %rsp           # imm = 0x1060
popq %rbx
retq
jmp 0x1e606
jmp 0x1e606
movq %rax, %rbx
movq %rsp, %rdi
callq 0x67414
movq %rbx, %rdi
callq 0x11a80
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1ea49
incl %eax
movl %eax, 0x200(%rbx)
pushq $0x1
popq %rbx
jmp 0x1eace
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
callq 0x57e7c
movq 0x1e8(%rbx), %rcx
testq %rcx, %rcx
je 0x1eab1
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1ea8d
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x1ea8d
leaq 0x8a4bc(%rip), %rsi     # 0xa8f38
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x1ea9d
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11540
movq %rsp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x5f7d2
testl %eax, %eax
je 0x1eac4
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x188(%rax)
movl %eax, %ebx
jmp 0x1eac6
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x589c0
movl %ebx, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
retq
jmp 0x1eadb
movq %rax, %rbx
movq %rsp, %rdi
callq 0x589c0
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1eb13
incl %eax
movl %eax, 0x204(%rbx)
pushq $0x1
popq %rbx
jmp 0x1eb98
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
callq 0x57e7c
movq 0x1f0(%rbx), %rcx
testq %rcx, %rcx
je 0x1eb7b
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1eb57
movq 0x48(%rax), %rdx
testq %rdx, %rdx
je 0x1eb57
leaq 0x8a3f2(%rip), %rsi     # 0xa8f38
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x1eb67
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11540
movq %rsp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x5f7d2
testl %eax, %eax
je 0x1eb8e
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x190(%rax)
movl %eax, %ebx
jmp 0x1eb90
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x589c0
movl %ebx, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
retq
jmp 0x1eba5
movq %rax, %rbx
movq %rsp, %rdi
callq 0x589c0
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1ecdf
movq %rdi, %rbx
cmpl $0x3, 0x24(%rdi)
jl 0x1ecdf
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1ec61
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x1ec61
leaq 0x8a2e5(%rip), %rsi     # 0xa8f38
leaq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x1ec6e
leaq 0x30(%rsp), %rdi
movq %rcx, %rsi
callq 0x11540
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %r14
pushq $0x3
popq %rcx
movq %r14, %rdi
callq 0x671d2
xorl %ebp, %ebp
leaq 0x18(%rsp), %r15
cmpl 0x2c(%rbx), %ebp
jge 0x1ecc0
xorl %r12d, %r12d
cmpl 0x28(%rbx), %r12d
jge 0x1ecbc
movq %r15, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %ebp, %ecx
callq 0x1c31e
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movq %r15, %rcx
callq 0x67560
incl %r12d
jmp 0x1ec91
incl %ebp
jmp 0x1ec89
movq 0x1d8(%rbx), %rsi
movq %rsp, %rdi
callq 0x68e0a
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rsp, %rdi
callq 0x67414
movl %ebp, %eax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ecf3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x67414
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1ee13
movq %rdi, %rbx
cmpl $0x4, 0x24(%rdi)
jl 0x1ee13
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1ed5a
movq 0x38(%rax), %rdx
testq %rdx, %rdx
je 0x1ed5a
leaq 0x8a1ef(%rip), %rsi     # 0xa8f38
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x1ed6a
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11540
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
movq %rsp, %rdi
callq 0x58808
movq 0x1e0(%rbx), %rdi
leaq 0x89e34(%rip), %rsi     # 0xa8bbc
callq 0x11140
testq %rax, %rax
je 0x1edf4
movq %rsp, %rdi
movsd 0x8a26b(%rip), %xmm0    # 0xa9008
callq 0x5c2e6
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1edf4
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x1edf4
leaq 0x8991b(%rip), %rsi     # 0xa86d6
movq %r14, %rdi
callq 0x11870
testl %eax, %eax
je 0x1ede4
leaq 0x8a3aa(%rip), %rsi     # 0xa9178
movq %r14, %rdi
callq 0x11870
testl %eax, %eax
jne 0x1edf4
movsd 0x8a236(%rip), %xmm0    # 0xa9018
jmp 0x1edec
movsd 0x8a224(%rip), %xmm0    # 0xa9010
movq %rsp, %rdi
callq 0x5c2e6
movq 0x1e0(%rbx), %rsi
movq %rsp, %rdi
callq 0x604b0
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rsp, %rdi
callq 0x589c0
movl %ebp, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x589c0
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq 0x1e8(%rdi), %r14
xorl %eax, %eax
testq %r14, %r14
je 0x1eea8
movq %rdi, %rbx
cmpl $0x5, 0x24(%rdi)
jl 0x1eea8
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1ee84
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x1ee84
leaq 0x8a0ca(%rip), %rsi     # 0xa8f38
movq %rsp, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x11110
movq 0x1e8(%rbx), %r14
jmp 0x1ee8f
movq %rsp, %rdi
movq %r14, %rsi
callq 0x11540
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rdi
movq %r14, %rsi
callq 0x604b0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq 0x1f0(%rdi), %r14
xorl %eax, %eax
testq %r14, %r14
je 0x1ef28
movq %rdi, %rbx
cmpl $0x6, 0x24(%rdi)
jl 0x1ef28
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1ef04
movq 0x48(%rax), %rdx
testq %rdx, %rdx
je 0x1ef04
leaq 0x8a04a(%rip), %rsi     # 0xa8f38
movq %rsp, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x11110
movq 0x1f0(%rbx), %r14
jmp 0x1ef0f
movq %rsp, %rdi
movq %r14, %rsi
callq 0x11540
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rdi
movq %r14, %rsi
callq 0x604b0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1efeb
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
cmpq $0x2, %r15
ja 0x1efe6
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jge 0x1efe6
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x1efe1
movq %r14, %rdi
callq 0x589c0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115d0
movq 0x18(%rbx), %rax
andq $0x0, (%rax,%r15,8)
incq %r15
jmp 0x1efa7
popq %rbx
popq %r14
popq %r15
pushq $0x1
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x1fc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x1fc(%rdi)
pushq $0x1
popq %rbp
cmpl $0x1, %eax
jg 0x1f041
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x4, 0x24(%rdi)
jl 0x1f043
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %r14
testq %r14, %r14
je 0x1f043
movq %r14, %rdi
callq 0x589c0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115d0
movq 0x18(%rbx), %rax
andq $0x0, 0x18(%rax)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x200(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x200(%rdi)
pushq $0x1
popq %rbp
cmpl $0x1, %eax
jg 0x1f099
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x5, 0x24(%rdi)
jl 0x1f09b
movq 0x18(%rbx), %rcx
movq 0x20(%rcx), %r14
testq %r14, %r14
je 0x1f09b
movq %r14, %rdi
callq 0x589c0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115d0
movq 0x18(%rbx), %rax
andq $0x0, 0x20(%rax)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x204(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x204(%rdi)
pushq $0x1
popq %rbp
cmpl $0x1, %eax
jg 0x1f0f1
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x6, 0x24(%rdi)
jl 0x1f0f3
movq 0x18(%rbx), %rcx
movq 0x28(%rcx), %r14
testq %r14, %r14
je 0x1f0f3
movq %r14, %rdi
callq 0x589c0
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115d0
movq 0x18(%rbx), %rax
andq $0x0, 0x28(%rax)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x11710
testq %r14, %r14
je 0x1f176
cmpb $0x2d, (%r14)
jne 0x1f16c
cmpb $0x0, 0x1(%r14)
je 0x1f176
movq %r14, %rdi
callq 0x6e59d
jmp 0x1f178
xorl %eax, %eax
movq %rax, 0x1d8(%rbx)
testq %r14, %r14
je 0x1f1d9
cmpq $0x0, 0x1d0(%rbx)
jne 0x1f1d9
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112e0
pushq $0x2f
popq %rsi
movq %r15, %rdi
callq 0x11650
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x11650
testq %rax, %rax
je 0x1f1ca
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x6e59d
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x11710
testq %r14, %r14
je 0x1f220
cmpb $0x2d, (%r14)
jne 0x1f216
cmpb $0x0, 0x1(%r14)
je 0x1f220
movq %r14, %rdi
callq 0x6e59d
jmp 0x1f222
xorl %eax, %eax
movq %rax, 0x1e0(%rbx)
testq %r14, %r14
je 0x1f290
cmpq $0x0, 0x1d0(%rbx)
jne 0x1f290
cmpb $0x2d, (%r14)
jne 0x1f245
cmpb $0x0, 0x1(%r14)
je 0x1f290
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112e0
pushq $0x2f
popq %rsi
movq %r15, %rdi
callq 0x11650
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x11650
testq %rax, %rax
je 0x1f281
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x6e59d
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x11710
testq %r14, %r14
je 0x1f2d8
cmpb $0x2d, (%r14)
jne 0x1f2ce
cmpb $0x0, 0x1(%r14)
je 0x1f2d8
movq %r14, %rdi
callq 0x6e59d
jmp 0x1f2da
xorl %eax, %eax
movq %rax, 0x1e8(%rbx)
testq %r14, %r14
je 0x1f347
cmpq $0x0, 0x1d0(%rbx)
jne 0x1f347
cmpb $0x2d, (%r14)
jne 0x1f2fd
cmpb $0x0, 0x1(%r14)
je 0x1f347
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112e0
pushq $0x2f
popq %rsi
movq %r15, %rdi
callq 0x11650
movq %rax, %r14
testq %rax, %rax
cmoveq %r15, %r14
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x11650
testq %rax, %rax
je 0x1f338
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x6e59d
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x11710
testq %r14, %r14
je 0x1f38e
cmpb $0x2d, (%r14)
jne 0x1f384
cmpb $0x0, 0x1(%r14)
je 0x1f38e
movq %r14, %rdi
callq 0x6e59d
jmp 0x1f390
xorl %eax, %eax
movq %rax, 0x1f0(%rbx)
testq %r14, %r14
je 0x1f3f0
cmpq $0x0, 0x1d0(%rbx)
jne 0x1f3f0
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112e0
pushq $0x2f
popq %rsi
movq %r15, %rdi
callq 0x11650
movq %rax, %r14
testq %rax, %rax
cmoveq %r15, %r14
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x11650
testq %rax, %rax
je 0x1f3e1
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x6e59d
movq %rax, 0x1d0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8a1c7(%rip), %rsi     # 0xa9d38
movq %rsp, %rdi
callq 0x42c50
testl %ebp, %ebp
je 0x1fb89
leaq 0x38(%r15), %rsi
movq %rsp, %rdi
callq 0x442d8
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 0x1fbbf
pushq $0x1
popq %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x57e7c
leaq 0x2f8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x57e7c
leaq 0x228(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x57e7c
leaq 0x158(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x57e7c
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 0x2066c
leaq 0x158(%rsp), %rdi
callq 0x589c0
leaq 0x228(%rsp), %rdi
callq 0x589c0
leaq 0x2f8(%rsp), %rdi
callq 0x589c0
leaq 0x88(%rsp), %rdi
callq 0x589c0
pushq $0x1
popq %rax
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 0x589c0
jmp 0x20113
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x589c0
jmp 0x20125
movq %rax, %rbx
leaq 0x2f8(%rsp), %rdi
callq 0x589c0
jmp 0x20137
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x589c0
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %rbx
andb 0x108(%rdi), %r8b
movq %rsi, %r15
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)
leaq 0x3aab5(%rip), %rsi     # 0xa9564
movq %r13, %rdi
callq 0x11b80
leaq 0x50(%rbx), %rdi
callq 0x79e26
movq 0x30(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x6ead4
movq %rbx, %rdi
callq 0x7b18a
jmp 0x6eac0
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
movq %rbx, %rdi
callq 0x7b1e0
andl $0x0, 0x8baf1(%rip)     # 0xfa5dc
movq %rbx, %rdi
callq 0x6ec1c
movl %eax, %ebp
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6efcc
cmpb $0x1, 0x10c(%rbx)
jne 0x6eb23
cmpq $0x0, 0xf0(%rbx)
je 0x6eb23
pushq $0x2
popq %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6f00a
cmpb $0x1, 0x109(%rbx)
jne 0x6eb89
movzwl 0x8(%r12), %eax
andl $0xfe, %eax
cmpw $0x6, %ax
je 0x6eb89
leaq 0x30(%rsp), %r12
movl $0xd, (%r12)
movq %r15, 0x8(%r12)
movq %r14, 0x10(%r12)
leaq 0x3d46d(%rip), %rsi     # 0xabfc8
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rdi
callq 0x196d0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x6f02c
leaq 0x10(%rsp), %rdi
callq 0x11270
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x11270
movq %rbx, %rdi
callq 0x11a80
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x20, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r14
leaq 0x10(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movq %rsp, %rsi
pushq $-0x1
popq %rdx
movq %rax, %rdi
callq 0x11b10
movzbl %bpl, %ecx
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6ea1c
movl %eax, %ebx
movq %rsp, %rdi
callq 0x11270
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x11270
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6eff7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6f860
cmpl $0xc, (%rbx)
je 0x6efdf
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6f860
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %rdi, %r14
leaq 0x18(%rsp), %rbx
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movups (%rdx), %xmm0
movaps %xmm0, -0x28(%rax)
movq 0x10(%rdx), %rcx
movq %rcx, -0x18(%rax)
movq %rbx, %rdi
callq 0x11300
movq %rsp, %rsi
movq %r15, 0x38(%rsi)
addq $0x50, %r14
movq %r14, %rdi
callq 0x79e72
movq %rbx, %rdi
callq 0x11270
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x11270
movq %r14, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::decodeNumber(Json::Reader::Token&)
bool Reader::decodeNumber(Token& token) {
  Value decoded;
  if (!decodeNumber(token, decoded))
    return false;
  currentValue().swapPayload(decoded);
  currentValue().setOffsetStart(token.start_ - begin_);
  currentValue().setOffsetLimit(token.end_ - begin_);
  return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rdx
andw $0x0, 0x8(%rdx)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
andq $0x0, (%rdx)
callq 0x70002
movl %eax, %ebp
testb %al, %al
je 0x6f6f2
movq 0x30(%r14), %rax
cmpq 0x38(%r14), %rax
jne 0x6f690
movq 0x48(%r14), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movq -0x8(%rax), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6f810
movq 0x30(%r14), %rax
movq 0x38(%r14), %rcx
movq %rax, %rsi
cmpq %rcx, %rax
jne 0x6f6bb
movq 0x48(%r14), %rdx
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rdx), %rsi
movq 0x8(%rbx), %rdi
movq 0xc0(%r14), %rdx
subq %rdx, %rdi
movq -0x8(%rsi), %rsi
movq %rdi, 0x18(%rsi)
cmpq %rcx, %rax
jne 0x6f6e3
movq 0x48(%r14), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movq -0x8(%rax), %rax
movq 0x10(%rbx), %rcx
subq %rdx, %rcx
movq %rcx, 0x20(%rax)
leaq 0x8(%rsp), %rdi
callq 0x74cb0
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x74cb0
movq %rbx, %rdi
callq 0x11a80
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::decodeString(Json::Reader::Token&)
bool Reader::decodeString(Token& token) {
  std::string decoded_string;
  if (!decodeString(token, decoded_string))
    return false;
  Value decoded(decoded_string);
  currentValue().swapPayload(decoded);
  currentValue().setOffsetStart(token.start_ - begin_);
  currentValue().setOffsetLimit(token.end_ - begin_);
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%rsp), %rdx
callq 0x6fdbc
movl %eax, %ebx
testb %al, %al
je 0x6f7e2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x74ac2
movq 0x30(%r15), %rax
cmpq 0x38(%r15), %rax
jne 0x6f776
movq 0x48(%r15), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movq -0x8(%rax), %rdi
leaq 0x28(%rsp), %rsi
callq 0x6f810
movq 0x30(%r15), %rax
movq 0x38(%r15), %rcx
movq %rax, %rsi
cmpq %rcx, %rax
jne 0x6f7a1
movq 0x48(%r15), %rdx
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rdx), %rsi
movq 0x8(%r14), %rdi
movq 0xc0(%r15), %rdx
subq %rdx, %rdi
movq -0x8(%rsi), %rsi
movq %rdi, 0x18(%rsi)
cmpq %rcx, %rax
jne 0x6f7c9
movq 0x48(%r15), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movq -0x8(%rax), %rax
movq 0x10(%r14), %rcx
subq %rdx, %rcx
movq %rcx, 0x20(%rax)
leaq 0x28(%rsp), %rdi
callq 0x74cb0
leaq 0x8(%rsp), %rdi
callq 0x11270
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x6f7fa
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x11270
movq %rbx, %rdi
callq 0x11a80
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::readToken(Json::Reader::Token&)
bool Reader::readToken(Token& token) {
  skipSpaces();
  token.start_ = current_;
  Char c = getNextChar();
  bool ok = true;
  switch (c) {
  case '{':
    token.type_ = tokenObjectBegin;
    break;
  case '}':
    token.type_ = tokenObjectEnd;
    break;
  case '[':
    token.type_ = tokenArrayBegin;
    break;
  case ']':
    token.type_ = tokenArrayEnd;
    break;
  case '"':
    token.type_ = tokenString;
    ok = readString();
    break;
  case '/':
    token.type_ = tokenComment;
    ok = readComment();
    break;
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
  case '-':
    token.type_ = tokenNumber;
    readNumber();
    break;
  case 't':
    token.type_ = tokenTrue;
    ok = match("rue", 3);
    break;
  case 'f':
    token.type_ = tokenFalse;
    ok = match("alse", 4);
    break;
  case 'n':
    token.type_ = tokenNull;
    ok = match("ull", 3);
    break;
  case ',':
    token.type_ = tokenArraySeparator;
    break;
  case ':':
    token.type_ = tokenMemberSeparator;
    break;
  case 0:
    token.type_ = tokenEndOfStream;
    break;
  default:
    ok = false;
    break;
  }
  if (!ok)
    token.type_ = tokenError;
  token.end_ = current_;
  return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x6f9a6
movq 0xd0(%r14), %rax
movq %rax, 0x8(%rbx)
cmpq 0xc8(%r14), %rax
je 0x6f8f8
leaq 0x1(%rax), %rcx
movq %rcx, 0xd0(%r14)
movzbl (%rax), %eax
leal -0x22(%rax), %ecx
cmpl $0x18, %ecx
ja 0x6f8b9
leaq 0x3c208(%rip), %rax     # 0xabaa8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x6, (%rbx)
movq %r14, %rdi
callq 0x6fb0c
jmp 0x6f8fb
testl %eax, %eax
je 0x6f8f8
cmpl $0x5b, %eax
je 0x6f968
cmpl $0x5d, %eax
je 0x6f99b
cmpl $0x66, %eax
je 0x6f970
cmpl $0x6e, %eax
je 0x6f940
cmpl $0x74, %eax
je 0x6f957
cmpl $0x7d, %eax
je 0x6f94f
cmpl $0x7b, %eax
jne 0x6f990
movl $0x1, (%rbx)
jmp 0x6f8fb
andl $0x0, (%rbx)
movq 0xd0(%r14), %rax
movq %rax, 0x10(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xa, (%rbx)
jmp 0x6f8fb
movl $0xb, (%rbx)
jmp 0x6f8fb
movl $0x5, (%rbx)
movq %r14, %rdi
callq 0x6fa02
jmp 0x6f988
movl $0xc, (%rbx)
movq %r14, %rdi
callq 0x6fa50
jmp 0x6f988
movl $0x9, (%rbx)
leaq 0x3cfde(%rip), %rsi     # 0xac92b
jmp 0x6f964
movl $0x2, (%rbx)
jmp 0x6f8fb
movl $0x7, (%rbx)
leaq 0x3caef(%rip), %rsi     # 0xac453
pushq $0x3
jmp 0x6f97f
movl $0x3, (%rbx)
jmp 0x6f8fb
movl $0x8, (%rbx)
leaq 0x3cadb(%rip), %rsi     # 0xac458
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x6fbce
testb %al, %al
jne 0x6f8fb
movl $0xd, (%rbx)
jmp 0x6f8fb
movl $0x4, (%rbx)
jmp 0x6f8fb