LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::~RGBDImage()
RGBDImage::
~RGBDImage(void)
{
  // Delete opengl texture
  if (opengl_texture_id >= 0) {
    GLuint i = opengl_texture_id;
    glDeleteTextures(1, &i);
  }
  
  // Remove from configuration
  if (configuration) {
    configuration->RemoveImage(this);
  }

  // Delete channels
  for (int i = 0; i < channels.NEntries(); i++) {
    if (channels[i]) delete channels[i];
  }

  // Delete filenames
  if (name) free(name);
  if (color_filename) free(color_filename);
  if (depth_filename) free(depth_filename);
  if (category_filename) free(category_filename);
  if (instance_filename) free(instance_filename);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x1845be(%rip), %rcx    # 0x1ace98
addq $0x10, %rcx
movq %rcx, (%rax)
cmpl $0x0, 0x1c8(%rax)
jl 0x2890c
movq 0x20(%rsp), %rax
movl 0x1c8(%rax), %eax
movl %eax, 0x2c(%rsp)
movl $0x1, %edi
leaq 0x2c(%rsp), %rsi
callq 0x12990
jmp 0x2890a
jmp 0x2890c
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2892e
movq 0x20(%rsp), %rsi
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x2892c
jmp 0x2892e
movl $0x0, 0x28(%rsp)
movq 0x20(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, 0x18(%rsp)
addq $0x18, %rdi
callq 0x19e00
movl %eax, 0x1c(%rsp)
jmp 0x28952
movl 0x18(%rsp), %eax
movl 0x1c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x289d8
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movl 0x28(%rsp), %esi
callq 0x277c0
movq %rax, 0x10(%rsp)
jmp 0x28977
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
je 0x289c6
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movl 0x28(%rsp), %esi
callq 0x277c0
movq %rax, 0x8(%rsp)
jmp 0x2899b
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x289c4
movq (%rsp), %rdi
callq 0xb3390
movq (%rsp), %rdi
movl $0xd0, %esi
callq 0x126e0
jmp 0x289c6
jmp 0x289c8
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x28936
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1d0(%rax)
je 0x289f8
movq 0x20(%rsp), %rax
movq 0x1d0(%rax), %rdi
callq 0x12870
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1d8(%rax)
je 0x28a18
movq 0x20(%rsp), %rax
movq 0x1d8(%rax), %rdi
callq 0x12870
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1e0(%rax)
je 0x28a38
movq 0x20(%rsp), %rax
movq 0x1e0(%rax), %rdi
callq 0x12870
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1e8(%rax)
je 0x28a58
movq 0x20(%rsp), %rax
movq 0x1e8(%rax), %rdi
callq 0x12870
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1f0(%rax)
je 0x28a78
movq 0x20(%rsp), %rax
movq 0x1f0(%rax), %rdi
callq 0x12870
movq 0x20(%rsp), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0x19b90
movq 0x20(%rsp), %rdi
addq $0x30, %rdi
callq 0x7fc50
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x27790
addq $0x38, %rsp
retq
movq %rax, %rdi
callq 0x22300
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ProjectionMatrix(double, double) const
R4Matrix RGBDImage::
ProjectionMatrix(RNScalar neardist, RNScalar fardist) const
{
  // Return projection transformation from camera coordinates to normalized image coordinates
  RNScalar fx = Intrinsics()[0][0];
  RNScalar fy = Intrinsics()[1][1];
  RNScalar cx = Intrinsics()[0][2];
  RNScalar cy = Intrinsics()[1][2];
  RNScalar W = NPixels(RN_X);
  RNScalar H = NPixels(RN_Y);
  return R4Matrix(
    2*fx/W, 0, -2*(cx/W)+1, 0,
    0, 2*fy/H, -2*(cy/H)+1, 0,
    0, 0, -(fardist + neardist) / (fardist - neardist),  -2.0 * neardist * fardist / (fardist - neardist),
    0, 0, -1, 0 );
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movsd %xmm0, 0x90(%rsp)
movsd %xmm1, 0x88(%rsp)
movq 0x98(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x226a0
movq %rax, %rdi
xorl %esi, %esi
callq 0x238a0
movq 0x40(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
callq 0x226a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x238a0
movq 0x40(%rsp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
callq 0x226a0
movq %rax, %rdi
xorl %esi, %esi
callq 0x238a0
movq 0x40(%rsp), %rdi
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
callq 0x226a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x238a0
movq 0x40(%rsp), %rdi
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
xorl %esi, %esi
callq 0x1af30
movq 0x40(%rsp), %rdi
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x60(%rsp)
movl $0x1, %esi
callq 0x1af30
movq 0x48(%rsp), %rdi
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x13d92a(%rip), %xmm0   # 0x166558
mulsd 0x80(%rsp), %xmm0
divsd 0x60(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
divsd 0x60(%rsp), %xmm1
addsd %xmm1, %xmm1
movsd 0x13d3db(%rip), %xmm2   # 0x166030
subsd %xmm1, %xmm2
movsd 0x13d8f7(%rip), %xmm5   # 0x166558
mulsd 0x78(%rsp), %xmm5
divsd 0x58(%rsp), %xmm5
movsd 0x68(%rsp), %xmm1
divsd 0x58(%rsp), %xmm1
addsd %xmm1, %xmm1
movsd 0x13d3ab(%rip), %xmm6   # 0x166030
subsd %xmm1, %xmm6
movsd 0x88(%rsp), %xmm1
addsd 0x90(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm11
movsd 0x88(%rsp), %xmm1
subsd 0x90(%rsp), %xmm1
divsd %xmm1, %xmm11
movsd 0x13e326(%rip), %xmm10  # 0x166ff8
mulsd 0x90(%rsp), %xmm10
mulsd 0x88(%rsp), %xmm10
movsd 0x88(%rsp), %xmm1
subsd 0x90(%rsp), %xmm1
divsd %xmm1, %xmm10
xorps %xmm8, %xmm8
movsd 0x13d30e(%rip), %xmm9   # 0x166018
movaps %xmm8, %xmm1
movaps %xmm8, %xmm3
movaps %xmm8, %xmm4
movaps %xmm8, %xmm7
movsd %xmm8, (%rsp)
movsd %xmm8, 0x8(%rsp)
movsd %xmm11, 0x10(%rsp)
movsd %xmm10, 0x18(%rsp)
movsd %xmm8, 0x20(%rsp)
movsd %xmm8, 0x28(%rsp)
movsd %xmm9, 0x30(%rsp)
movsd %xmm8, 0x38(%rsp)
callq 0x84370
movq 0x50(%rsp), %rax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::PixelColor(int, int) const
RNRgb RGBDImage::
PixelColor(int ix, int iy) const
{
  // Return color of pixel
  if (NChannels() < 3) return RNblack_rgb;
  RNScalar r = PixelChannelValue(ix, iy, RGBD_RED_CHANNEL);
  RNScalar g = PixelChannelValue(ix, iy, RGBD_GREEN_CHANNEL);
  RNScalar b = PixelChannelValue(ix, iy, RGBD_BLUE_CHANNEL);
  return RNRgb(r, g, b);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl %edx, 0x34(%rsp)
movl %ecx, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x30430
cmpl $0x3, %eax
jge 0x29468
movq (%rsp), %rdi
leaq 0x18b56f(%rip), %rsi    # 0x1b49d0
callq 0xdb190
jmp 0x294d7
movq 0x10(%rsp), %rdi
movl 0x34(%rsp), %esi
movl 0x30(%rsp), %edx
xorl %ecx, %ecx
callq 0x30450
movq 0x10(%rsp), %rdi
movsd %xmm0, 0x28(%rsp)
movl 0x34(%rsp), %esi
movl 0x30(%rsp), %edx
movl $0x1, %ecx
callq 0x30450
movq 0x10(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
movl 0x34(%rsp), %esi
movl 0x30(%rsp), %edx
movl $0x2, %ecx
callq 0x30450
movq (%rsp), %rdi
movsd %xmm0, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0xdb1d0
movq 0x8(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::PixelColor(gaps::R2Point const&) const
RNRgb RGBDImage::
PixelColor(const R2Point& image_position) const
{
  // Return color of pixel
  if (NChannels() < 3) return RNblack_rgb;
  RNScalar r = PixelChannelValue(image_position, RGBD_RED_CHANNEL);
  RNScalar g = PixelChannelValue(image_position, RGBD_GREEN_CHANNEL);
  RNScalar b = PixelChannelValue(image_position, RGBD_BLUE_CHANNEL);
  return RNRgb(r, g, b);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x30430
cmpl $0x3, %eax
jge 0x29885
movq (%rsp), %rdi
leaq 0x18b152(%rip), %rsi    # 0x1b49d0
callq 0xdb190
jmp 0x298eb
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0x1a0a0
movq 0x10(%rsp), %rdi
movsd %xmm0, 0x28(%rsp)
movq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x1a0a0
movq 0x10(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rsi
movl $0x2, %edx
callq 0x1a0a0
movq (%rsp), %rdi
movsd %xmm0, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0xdb1d0
movq 0x8(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::PixelWorldRay(gaps::R2Point const&) const
R3Ray RGBDImage::
PixelWorldRay(const R2Point& image_position) const
{
  // Get/check intrinsics matrix
  const R3Matrix& intrinsics_matrix = Intrinsics();
  if (RNIsZero(intrinsics_matrix[0][0])) return R3null_ray;
  if (RNIsZero(intrinsics_matrix[1][1])) return R3null_ray;

  // Get point at depth 1.0 along ray in camera coordinates
  R3Point camera_position;
  camera_position[0] = (image_position[0] - intrinsics_matrix[0][2]) / intrinsics_matrix[0][0];
  camera_position[1] = (image_position[1] - intrinsics_matrix[1][2]) / intrinsics_matrix[1][1];
  camera_position[2] = -1.0;

  // Create ray and transform into world coordinates
  R3Ray ray(R3zero_point, camera_position);
  ray.Transform(camera_to_world);

  // Return ray through pixel in world coordinates
  return ray;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x38(%rsp)
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq 0x78(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x226a0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x238a0
movsd (%rax), %xmm0
leaq 0x18850f(%rip), %rax    # 0x1b1ec0
movsd (%rax), %xmm1
callq 0x1a370
cmpl $0x0, %eax
je 0x299d5
movq 0x38(%rsp), %rdi
leaq 0x189235(%rip), %rsi    # 0x1b2c00
callq 0x8a260
jmp 0x29b31
movq 0x68(%rsp), %rdi
movl $0x1, %esi
callq 0x238a0
movsd 0x8(%rax), %xmm0
leaq 0x1884d0(%rip), %rax    # 0x1b1ec0
movsd (%rax), %xmm1
callq 0x1a370
cmpl $0x0, %eax
je 0x29a14
movq 0x38(%rsp), %rdi
leaq 0x1891f6(%rip), %rsi    # 0x1b2c00
callq 0x8a260
jmp 0x29b31
leaq 0x50(%rsp), %rdi
callq 0x8a990
movq 0x70(%rsp), %rdi
xorl %esi, %esi
callq 0x1a280
movsd %xmm0, 0x8(%rsp)
movq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x238a0
movsd 0x8(%rsp), %xmm0
subsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x238a0
movsd 0x10(%rsp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0x19c00
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x70(%rsp), %rdi
movl $0x1, %esi
callq 0x1a280
movsd %xmm0, 0x20(%rsp)
movq 0x68(%rsp), %rdi
movl $0x1, %esi
callq 0x238a0
movsd 0x20(%rsp), %xmm0
subsd 0x10(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x68(%rsp), %rdi
movl $0x1, %esi
callq 0x238a0
movsd 0x28(%rsp), %xmm0
divsd 0x8(%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x50(%rsp), %rdi
movl $0x1, %esi
callq 0x19c00
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x50(%rsp), %rdi
movl $0x2, %esi
callq 0x19c00
movq 0x38(%rsp), %rdi
movsd 0x13c50f(%rip), %xmm0   # 0x166018
movsd %xmm0, (%rax)
leaq 0x18938c(%rip), %rsi    # 0x1b2ea0
leaq 0x50(%rsp), %rdx
callq 0x8a2d0
movq 0x48(%rsp), %rsi
movq 0x38(%rsp), %rdi
addq $0x30, %rsi
callq 0x8a480
movq 0x40(%rsp), %rax
addq $0x88, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetPixelDepth(int, int, double)
void RGBDImage::
SetPixelDepth(int ix, int iy, RNScalar depth)
{
  // Set pixel depth
  SetPixelChannelValue(ix, iy, RGBD_DEPTH_CHANNEL, depth);

  // Update bounding box
  R3Point world_position;
  R2Point image_position(ix+0.5, iy+0.5);
  if (RGBDTransformImageToWorld(image_position, world_position, this)) {
    world_bbox.Union(world_position);
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movsd %xmm0, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
movsd 0x30(%rsp), %xmm0
movq (%rdi), %rax
movl $0x3, %ecx
callq *0x38(%rax)
leaq 0x18(%rsp), %rdi
callq 0x8a990
cvtsi2sdl 0x3c(%rsp), %xmm0
movsd 0x13c0c7(%rip), %xmm1   # 0x166028
addsd %xmm1, %xmm0
cvtsi2sdl 0x38(%rsp), %xmm1
movsd 0x13c0b5(%rip), %xmm2   # 0x166028
addsd %xmm2, %xmm1
leaq 0x8(%rsp), %rdi
callq 0xcfd80
movq (%rsp), %rdx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1ae00
cmpl $0x0, %eax
je 0x29fae
movq (%rsp), %rdi
addq $0x188, %rdi            # imm = 0x188
leaq 0x18(%rsp), %rsi
callq 0x76f60
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetPixelChannelValue(int, int, int, double)
void RGBDImage::
SetPixelChannelValue(int ix, int iy, int channel_index, RNScalar value)
{
  // Check channel
  if (!channels[channel_index]) {
    RNFail("RGBD channel is not resident in memory -- cannot set value\n");
    return;
  }
  
  // Set channel value at pixel
  if ((channel_index < 0) || (channel_index >= channels.NEntries())) return;
  if ((ix < 0) || (ix >= channels[channel_index]->XResolution())) return;
  if ((iy < 0) || (iy >= channels[channel_index]->YResolution())) return;
  channels[channel_index]->SetGridValue(ix, iy, value);

  // Update bounding box
  if (channel_index == RGBD_DEPTH_CHANNEL) {
    R3Point world_position;
    R2Point image_position(ix+0.5, iy+0.5);
    if (RGBDTransformImageToWorld(image_position, world_position, this)) {
      world_bbox.Union(world_position);
    }
  }

  // Invalidate opengl
  if ((channel_index >= RGBD_RED_CHANNEL) && (channel_index <= RGBD_BLUE_CHANNEL)) InvalidateOpenGL();
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movl %edx, 0x58(%rsp)
movl %ecx, 0x54(%rsp)
movsd %xmm0, 0x48(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
addq $0x18, %rdi
movl 0x54(%rsp), %esi
callq 0x277c0
cmpq $0x0, (%rax)
jne 0x2a08b
leaq 0x13cfd1(%rip), %rdi    # 0x167050
movb $0x0, %al
callq 0xdf990
jmp 0x2a1db
cmpl $0x0, 0x54(%rsp)
jl 0x2a0b2
movq 0x18(%rsp), %rdi
movl 0x54(%rsp), %eax
movl %eax, 0x14(%rsp)
addq $0x18, %rdi
callq 0x19e00
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jl 0x2a0b7
jmp 0x2a1db
cmpl $0x0, 0x5c(%rsp)
jl 0x2a0ea
movq 0x18(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x10(%rsp)
addq $0x18, %rdi
movl 0x54(%rsp), %esi
callq 0x277c0
movq (%rax), %rdi
callq 0x27940
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jl 0x2a0ef
jmp 0x2a1db
cmpl $0x0, 0x58(%rsp)
jl 0x2a122
movq 0x18(%rsp), %rdi
movl 0x58(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0x18, %rdi
movl 0x54(%rsp), %esi
callq 0x277c0
movq (%rax), %rdi
callq 0x27960
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jl 0x2a127
jmp 0x2a1db
movq 0x18(%rsp), %rdi
addq $0x18, %rdi
movl 0x54(%rsp), %esi
callq 0x277c0
movq (%rax), %rdi
movl 0x5c(%rsp), %esi
movl 0x58(%rsp), %edx
movsd 0x48(%rsp), %xmm0
callq 0x1a1b0
cmpl $0x3, 0x54(%rsp)
jne 0x2a1bf
leaq 0x30(%rsp), %rdi
callq 0x8a990
cvtsi2sdl 0x5c(%rsp), %xmm0
movsd 0x13beba(%rip), %xmm1   # 0x166028
addsd %xmm1, %xmm0
cvtsi2sdl 0x58(%rsp), %xmm1
movsd 0x13bea8(%rip), %xmm2   # 0x166028
addsd %xmm2, %xmm1
leaq 0x20(%rsp), %rdi
callq 0xcfd80
movq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1ae00
cmpl $0x0, %eax
je 0x2a1bd
movq 0x18(%rsp), %rdi
addq $0x188, %rdi            # imm = 0x188
leaq 0x30(%rsp), %rsi
callq 0x76f60
jmp 0x2a1bf
cmpl $0x0, 0x54(%rsp)
jl 0x2a1db
cmpl $0x2, 0x54(%rsp)
jg 0x2a1db
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x1c8(%rax)
addq $0x68, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetChannel(int, gaps::R2Grid const&)
void RGBDImage::
SetChannel(int channel_index, const R2Grid& image)
{
  // Check channel
  if (!channels[channel_index]) {
    RNFail("RGBD channel is not resident in memory -- cannot set\n");
    return;
  }
  
  // Copy channel
  *(channels[channel_index]) = image;
  
  // Set width and height
  this->width = image.XResolution();
  this->height = image.YResolution();

  // Invalidate bounding box
  if (channel_index == RGBD_DEPTH_CHANNEL) InvalidateWorldBBox();

  // Invalidate opengl
  if ((channel_index >= RGBD_RED_CHANNEL) && (channel_index <= RGBD_BLUE_CHANNEL)) InvalidateOpenGL();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x18, %rdi
movl 0x1c(%rsp), %esi
callq 0x277c0
cmpq $0x0, (%rax)
jne 0x2a222
leaq 0x13ce76(%rip), %rdi    # 0x16708c
movb $0x0, %al
callq 0xdf990
jmp 0x2a2a2
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
addq $0x18, %rdi
movl 0x1c(%rsp), %esi
callq 0x277c0
movq (%rsp), %rsi
movq (%rax), %rdi
callq 0xb2f20
movq 0x10(%rsp), %rdi
callq 0x27940
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x10(%rsp), %rdi
callq 0x27960
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x2c(%rax)
cmpl $0x3, 0x1c(%rsp)
jne 0x2a286
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x1c0(%rax)
cmpl $0x0, 0x1c(%rsp)
jl 0x2a2a2
cmpl $0x2, 0x1c(%rsp)
jg 0x2a2a2
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x1c8(%rax)
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetDepthChannel(gaps::R2Grid const&)
void RGBDImage::
SetDepthChannel(const R2Grid& image)
{
  // Check if color channels are resident
  if (depth_resident_count == 0) {
    RNFail("Unable to set depth channel -- it has not been created\n");
    return;
  }

  // Set depth channel
  SetChannel(RGBD_DEPTH_CHANNEL, image);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x1fc(%rax)
jne 0x2a4b0
leaq 0x13cc1b(%rip), %rdi    # 0x1670c2
movb $0x0, %al
callq 0xdf990
jmp 0x2a4c4
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq (%rdi), %rax
movl $0x3, %esi
callq *0x40(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetCategoryChannel(gaps::R2Grid const&)
void RGBDImage::
SetCategoryChannel(const R2Grid& image)
{
  // Check if color channels are resident
  if (category_resident_count == 0) {
    RNFail("Unable to set category channel -- it has not been created\n");
    return;
  }

  // Set category channel
  SetChannel(RGBD_CATEGORY_CHANNEL, image);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x200(%rax)
jne 0x2a500
leaq 0x13cc03(%rip), %rdi    # 0x1670fa
movb $0x0, %al
callq 0xdf990
jmp 0x2a514
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq (%rdi), %rax
movl $0x4, %esi
callq *0x40(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetInstanceChannel(gaps::R2Grid const&)
void RGBDImage::
SetInstanceChannel(const R2Grid& image)
{
  // Check if color channels are resident
  if (instance_resident_count == 0) {
    RNFail("Unable to set instance channel -- it has not been created\n");
    return;
  }

  // Set instance channel
  SetChannel(RGBD_INSTANCE_CHANNEL, image);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x204(%rax)
jne 0x2a550
leaq 0x13cbee(%rip), %rdi    # 0x167135
movb $0x0, %al
callq 0xdf990
jmp 0x2a564
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq (%rdi), %rax
movl $0x5, %esi
callq *0x40(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::Transform(gaps::R3Transformation const&)
void RGBDImage::
Transform(const R3Transformation& transformation)
{
  // Update camera_to_world transformation
  R3Affine t = R3identity_affine;
  t.Transform(transformation);
  t.Transform(camera_to_world);
  camera_to_world = t;

  // Invalidate bounding box
  InvalidateWorldBBox();
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x187fe5(%rip), %rsi    # 0x1b2690
leaq 0x28(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1a4e0
movq 0x10(%rsp), %rdi
movq 0x138(%rsp), %rsi
callq 0x80940
jmp 0x2a6ce
movq 0x8(%rsp), %rsi
addq $0x30, %rsi
leaq 0x28(%rsp), %rdi
callq 0x7ff20
jmp 0x2a6e3
movq 0x8(%rsp), %rdi
addq $0x30, %rdi
leaq 0x28(%rsp), %rsi
callq 0x30500
jmp 0x2a6f8
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq 0x1c0(%rax), %rax
callq *%rax
jmp 0x2a70b
leaq 0x28(%rsp), %rdi
callq 0x7fc50
addq $0x148, %rsp            # imm = 0x148
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7fc50
movq 0x20(%rsp), %rdi
callq 0x12c20
nop
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::TransformWorldToCamera(gaps::R3Point const&, gaps::R3Point&) const
int RGBDImage::
TransformWorldToCamera(const R3Point& world_position, R3Point& camera_position) const
{
  // Transform from position in world coordinates to camera coordinates
  camera_position = world_position;
  camera_position.InverseTransform(CameraToWorld());
  if (RNIsPositiveOrZero(camera_position[2])) return 0;
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x8b030
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x22710
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x8b640
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x19c00
movsd (%rax), %xmm0
leaq 0x187169(%rip), %rax    # 0x1b1ec0
movsd (%rax), %xmm1
callq 0x1a400
cmpl $0x0, %eax
je 0x2ad6f
movl $0x0, 0x34(%rsp)
jmp 0x2ad77
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::TransformWorldToImage(gaps::R3Point const&, gaps::R2Point&) const
int RGBDImage::
TransformWorldToImage(const R3Point& world_position, R2Point& image_position) const
{
  // Transform from position in world coordinates to image coordinates
  R3Point camera_position;
  if (!TransformWorldToCamera(world_position, camera_position)) return 0;
  if (!TransformCameraToImage(camera_position, image_position)) return 0;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x8a990
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq (%rdi), %rax
leaq 0x10(%rsp), %rdx
callq *0xa8(%rax)
cmpl $0x0, %eax
jne 0x2adce
movl $0x0, 0x44(%rsp)
jmp 0x2adfd
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rdx
movq (%rdi), %rax
leaq 0x10(%rsp), %rsi
callq *0x98(%rax)
cmpl $0x0, %eax
jne 0x2adf5
movl $0x0, 0x44(%rsp)
jmp 0x2adfd
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::DrawCamera(int, double) const
void RGBDImage::
DrawCamera(int color_scheme, RNLength radius) const
{
  // Get useful variables
  R3Point viewpoint = WorldViewpoint();
  R3Vector towards = WorldTowards();
  R3Vector up = WorldUp();

  // 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);

  // Draw camera
  RNGrfxBegin(RN_GRFX_LINES);
  R3LoadPoint(viewpoint);
  R3LoadPoint(viewpoint + radius * towards);
  R3LoadPoint(viewpoint);
  R3LoadPoint(viewpoint + 0.5*radius * up);
  RNGrfxEnd();
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movl %esi, 0xbc(%rsp)
movsd %xmm0, 0xb0(%rsp)
movq 0xc0(%rsp), %rsi
movq %rsi, (%rsp)
leaq 0x98(%rsp), %rdi
callq 0x19db0
movq (%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x1a320
movq (%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x22a50
cmpl $0x0, 0xbc(%rsp)
jne 0x2aeb7
movq (%rsp), %rdi
movl 0xbc(%rsp), %esi
movq (%rdi), %rax
callq *0xf0(%rax)
jmp 0x2aef7
cmpl $0x4, 0xbc(%rsp)
jne 0x2aed7
movq (%rsp), %rdi
movl 0xbc(%rsp), %esi
movq (%rdi), %rax
callq *0xf0(%rax)
jmp 0x2aef5
cmpl $0x0, 0xbc(%rsp)
je 0x2aef3
movq (%rsp), %rdi
movq (%rdi), %rax
movl $0x3, %esi
callq *0xf0(%rax)
jmp 0x2aef5
jmp 0x2aef7
movl $0x1, %edi
callq 0x27c00
leaq 0x98(%rsp), %rdi
callq 0x27c90
movsd 0xb0(%rsp), %xmm0
leaq 0x38(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x227f0
leaq 0x50(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x8af60
leaq 0x50(%rsp), %rdi
callq 0x27c90
leaq 0x98(%rsp), %rdi
callq 0x27c90
movsd 0x13b0c9(%rip), %xmm0   # 0x166028
mulsd 0xb0(%rsp), %xmm0
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x227f0
leaq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x8af60
leaq 0x20(%rsp), %rdi
callq 0x27c90
callq 0x27cd0
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x5c(%rsp)
jne 0x2afe0
movq (%rsp), %rdi
movl 0x5c(%rsp), %esi
movq (%rdi), %rax
callq *0xf0(%rax)
jmp 0x2b017
cmpl $0x4, 0x5c(%rsp)
jne 0x2affa
movq (%rsp), %rdi
movl 0x5c(%rsp), %esi
movq (%rdi), %rax
callq *0xf0(%rax)
jmp 0x2b015
cmpl $0x0, 0x5c(%rsp)
je 0x2b013
movq (%rsp), %rdi
movq (%rdi), %rax
movl $0x3, %esi
callq *0xf0(%rax)
jmp 0x2b015
jmp 0x2b017
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x28d70
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1a6b0
jmp 0x2b036
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x78570
jmp 0x2b047
leaq 0x20(%rsp), %rdi
callq 0x19b90
addq $0x68, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x19b90
movq 0x10(%rsp), %rdi
callq 0x12c20
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x3, 0x1c(%rsp)
jne 0x2cc65
movq 0x8(%rsp), %rdi
callq 0x30680
movl %eax, %ecx
movq 0x8(%rsp), %rax
addl $0x1, %ecx
cvtsi2sd %ecx, %xmm1
movsd 0x13a40e(%rip), %xmm0   # 0x167010
mulsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movq 0x8(%rax), %rdi
callq 0x19c40
movsd (%rsp), %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x18(%rsp)
movb $0x0, 0x17(%rsp)
movl 0x18(%rsp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, 0x16(%rsp)
movl 0x18(%rsp), %eax
andl $0xff, %eax
movb %al, 0x15(%rsp)
movb 0x17(%rsp), %cl
movb 0x16(%rsp), %al
movzbl %cl, %edi
movzbl %al, %esi
movzbl 0x15(%rsp), %edx
callq 0x27ef0
jmp 0x2ccbd
cmpl $0x2, 0x1c(%rsp)
jne 0x2cc81
movsd 0x1393bc(%rip), %xmm2   # 0x166030
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x27f20
jmp 0x2ccbb
cmpl $0x1, 0x1c(%rsp)
jne 0x2cc9d
movsd 0x1393a0(%rip), %xmm2   # 0x166030
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x27f20
jmp 0x2ccb9
cmpl $0x4, 0x1c(%rsp)
jne 0x2ccb7
movsd 0x139384(%rip), %xmm1   # 0x166030
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq 0x27f20
jmp 0x2ccb9
jmp 0x2ccbb
jmp 0x2ccbd
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
callq 0x19e00
cmpl 0x2c(%rsp), %eax
jg 0x2d2c4
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x27fb0
jmp 0x2d29c
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x2c(%rsp), %esi
callq 0x277c0
cmpq $0x0, (%rax)
jne 0x2d338
movl $0xd0, %edi
callq 0x126d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
callq 0xb30a0
jmp 0x2d2fc
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x2c(%rsp), %esi
callq 0x277c0
movq (%rsp), %rcx
movq %rcx, (%rax)
jmp 0x2d338
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
movl $0xd0, %esi
callq 0x126e0
jmp 0x2d3b8
cmpl $0x3, 0x2c(%rsp)
jne 0x2d355
movq 0x8(%rsp), %rax
movl 0x1fc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1fc(%rax)
jmp 0x2d372
cmpl $0x2, 0x2c(%rsp)
jne 0x2d370
movq 0x8(%rsp), %rax
movl 0x1f8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1f8(%rax)
jmp 0x2d372
movq 0x8(%rsp), %rdi
movl 0x2c(%rsp), %esi
movq 0x20(%rsp), %rdx
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x20(%rsp), %rdi
callq 0x27940
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x20(%rsp), %rdi
callq 0x27960
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x2c(%rax)
movl $0x1, %eax
addq $0x38, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %rdi, (%rsp)
movq (%rdi), %rax
callq *0x100(%rax)
cmpl $0x0, %eax
jne 0x2d3fa
movl $0x0, 0x14(%rsp)
jmp 0x2d456
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x108(%rax)
cmpl $0x0, %eax
jne 0x2d416
movl $0x0, 0x14(%rsp)
jmp 0x2d456
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x110(%rax)
cmpl $0x0, %eax
jne 0x2d432
movl $0x0, 0x14(%rsp)
jmp 0x2d456
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x118(%rax)
cmpl $0x0, %eax
jne 0x2d44e
movl $0x0, 0x14(%rsp)
jmp 0x2d456
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x1128, %rsp           # imm = 0x1128
movq %rdi, 0x1118(%rsp)
movq 0x1118(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x200(%rax)
jle 0x2e109
movq 0x20(%rsp), %rax
movl 0x200(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x200(%rax)
movl $0x1, 0x1124(%rsp)
jmp 0x2e258
movq 0x20(%rsp), %rax
movl 0x28(%rax), %esi
movl 0x2c(%rax), %edx
leaq 0x1048(%rsp), %rdi
callq 0xb1ee0
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1e8(%rax)
je 0x2e219
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2e161
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x30810
movq %rax, 0x18(%rsp)
jmp 0x2e155
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2e16a
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0x2e16a
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x2e1c2
movq 0x20(%rsp), %rax
leaq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x1e8(%rax), %rcx
leaq 0x138dca(%rip), %rsi    # 0x166f63
movb $0x0, %al
callq 0x12130
jmp 0x2e1e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x1048(%rsp), %rdi
callq 0xb3390
jmp 0x2e267
movq 0x20(%rsp), %rax
leaq 0x40(%rsp), %rdi
movq 0x1e8(%rax), %rdx
leaq 0x13af31(%rip), %rsi    # 0x16910b
movb $0x0, %al
callq 0x12130
leaq 0x1048(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc1a70
movl %eax, 0xc(%rsp)
jmp 0x2e1f9
movl 0xc(%rsp), %eax
cmpl $0x0, %eax
jne 0x2e217
movl $0x0, 0x1124(%rsp)
movl $0x1, 0x28(%rsp)
jmp 0x2e24b
jmp 0x2e219
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq 0x188(%rax), %rax
leaq 0x1048(%rsp), %rsi
callq *%rax
movl %eax, 0x8(%rsp)
jmp 0x2e238
movl 0x8(%rsp), %eax
movl %eax, 0x1124(%rsp)
movl $0x1, 0x28(%rsp)
leaq 0x1048(%rsp), %rdi
callq 0xb3390
movl 0x1124(%rsp), %eax
addq $0x1128, %rsp           # imm = 0x1128
retq
movq 0x30(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x1128, %rsp           # imm = 0x1128
movq %rdi, 0x1118(%rsp)
movq 0x1118(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x204(%rax)
jle 0x2e2c9
movq 0x20(%rsp), %rax
movl 0x204(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x204(%rax)
movl $0x1, 0x1124(%rsp)
jmp 0x2e418
movq 0x20(%rsp), %rax
movl 0x28(%rax), %esi
movl 0x2c(%rax), %edx
leaq 0x1048(%rsp), %rdi
callq 0xb1ee0
movq 0x20(%rsp), %rax
cmpq $0x0, 0x1f0(%rax)
je 0x2e3d9
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2e321
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x30820
movq %rax, 0x18(%rsp)
jmp 0x2e315
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2e32a
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0x2e32a
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x2e382
movq 0x20(%rsp), %rax
leaq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x1f0(%rax), %rcx
leaq 0x138c0a(%rip), %rsi    # 0x166f63
movb $0x0, %al
callq 0x12130
jmp 0x2e3a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x1048(%rsp), %rdi
callq 0xb3390
jmp 0x2e427
movq 0x20(%rsp), %rax
leaq 0x40(%rsp), %rdi
movq 0x1f0(%rax), %rdx
leaq 0x13ad71(%rip), %rsi    # 0x16910b
movb $0x0, %al
callq 0x12130
leaq 0x1048(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc1a70
movl %eax, 0xc(%rsp)
jmp 0x2e3b9
movl 0xc(%rsp), %eax
cmpl $0x0, %eax
jne 0x2e3d7
movl $0x0, 0x1124(%rsp)
movl $0x1, 0x28(%rsp)
jmp 0x2e40b
jmp 0x2e3d9
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq 0x190(%rax), %rax
leaq 0x1048(%rsp), %rsi
callq *%rax
movl %eax, 0x8(%rsp)
jmp 0x2e3f8
movl 0x8(%rsp), %eax
movl %eax, 0x1124(%rsp)
movl $0x1, 0x28(%rsp)
leaq 0x1048(%rsp), %rdi
callq 0xb3390
movl 0x1124(%rsp), %eax
addq $0x1128, %rsp           # imm = 0x1128
retq
movq 0x30(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %rdi, (%rsp)
movq (%rdi), %rax
callq *0x128(%rax)
cmpl $0x0, %eax
jne 0x2e46a
movl $0x0, 0x14(%rsp)
jmp 0x2e4c6
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x130(%rax)
cmpl $0x0, %eax
jne 0x2e486
movl $0x0, 0x14(%rsp)
jmp 0x2e4c6
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x138(%rax)
cmpl $0x0, %eax
jne 0x2e4a2
movl $0x0, 0x14(%rsp)
jmp 0x2e4c6
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x140(%rax)
cmpl $0x0, %eax
jne 0x2e4be
movl $0x0, 0x14(%rsp)
jmp 0x2e4c6
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x1088, %rsp           # imm = 0x1088
movq %rdi, 0x1078(%rsp)
movq 0x1078(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x1d8(%rax)
jne 0x2e506
movl $0x0, 0x1084(%rsp)
jmp 0x2e6b4
movq 0x18(%rsp), %rdi
callq 0x30430
cmpl $0x2, %eax
jg 0x2e525
movl $0x0, 0x1084(%rsp)
jmp 0x2e6b4
movq 0x18(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2e546
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x30720
movq %rax, 0x10(%rsp)
jmp 0x2e54f
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0x2e54f
movq 0x10(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x2e587
movq 0x18(%rsp), %rax
leaq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x1d8(%rax), %rcx
leaq 0x1389e5(%rip), %rsi    # 0x166f63
movb $0x0, %al
callq 0x12130
jmp 0x2e5a6
movq 0x18(%rsp), %rax
leaq 0x70(%rsp), %rdi
movq 0x1d8(%rax), %rdx
leaq 0x13ab6c(%rip), %rsi    # 0x16910b
movb $0x0, %al
callq 0x12130
movq 0x18(%rsp), %rax
movl 0x28(%rax), %esi
movl 0x2c(%rax), %edx
leaq 0x50(%rsp), %rdi
movl $0x3, %ecx
callq 0xd1c40
movl $0x0, 0x4c(%rsp)
movq 0x18(%rsp), %rcx
movl 0x4c(%rsp), %eax
cmpl 0x2c(%rcx), %eax
jge 0x2e65d
movl $0x0, 0x48(%rsp)
movq 0x18(%rsp), %rcx
movl 0x48(%rsp), %eax
cmpl 0x28(%rcx), %eax
jge 0x2e64b
movq 0x18(%rsp), %rsi
movl 0x48(%rsp), %edx
movl 0x4c(%rsp), %ecx
leaq 0x30(%rsp), %rdi
callq 0x29420
jmp 0x2e609
movl 0x48(%rsp), %esi
movl 0x4c(%rsp), %edx
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rcx
callq 0xd2490
jmp 0x2e622
jmp 0x2e624
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x2e5e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xd2160
jmp 0x2e6c3
jmp 0x2e64d
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x2e5c8
movq 0x18(%rsp), %rax
movq 0x1d8(%rax), %rsi
leaq 0x50(%rsp), %rdi
callq 0x27f80
movl %eax, 0xc(%rsp)
jmp 0x2e679
movl 0xc(%rsp), %eax
cmpl $0x0, %eax
jne 0x2e697
movl $0x0, 0x1084(%rsp)
movl $0x1, 0x20(%rsp)
jmp 0x2e6aa
movl $0x1, 0x1084(%rsp)
movl $0x1, 0x20(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xd2160
movl 0x1084(%rsp), %eax
addq $0x1088, %rsp           # imm = 0x1088
retq
movq 0x28(%rsp), %rdi
callq 0x12c20
nopl (%rax)
// File: 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:
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, 0x1028(%rsp)
movq 0x1028(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x1e8(%rax)
jne 0x2e996
movl $0x0, 0x1034(%rsp)
jmp 0x2ea7d
movq 0x10(%rsp), %rdi
callq 0x30430
cmpl $0x4, %eax
jg 0x2e9b5
movl $0x0, 0x1034(%rsp)
jmp 0x2ea7d
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2e9d6
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x30810
movq %rax, 0x8(%rsp)
jmp 0x2e9df
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x2e9df
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x2ea17
movq 0x10(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x1e8(%rax), %rcx
leaq 0x138555(%rip), %rsi    # 0x166f63
movb $0x0, %al
callq 0x12130
jmp 0x2ea36
movq 0x10(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq 0x1e8(%rax), %rdx
leaq 0x13a6dc(%rip), %rsi    # 0x16910b
movb $0x0, %al
callq 0x12130
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movl $0x4, %esi
callq 0x277c0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq (%rcx), %rdi
movq 0x1e8(%rax), %rsi
callq 0xc33a0
cmpl $0x0, %eax
jne 0x2ea72
movl $0x0, 0x1034(%rsp)
jmp 0x2ea7d
movl $0x1, 0x1034(%rsp)
movl 0x1034(%rsp), %eax
addq $0x1038, %rsp           # imm = 0x1038
retq
nopl (%rax)
// File: 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:
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, 0x1028(%rsp)
movq 0x1028(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x1f0(%rax)
jne 0x2eac6
movl $0x0, 0x1034(%rsp)
jmp 0x2ebad
movq 0x10(%rsp), %rdi
callq 0x30430
cmpl $0x5, %eax
jg 0x2eae5
movl $0x0, 0x1034(%rsp)
jmp 0x2ebad
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2eb06
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x30820
movq %rax, 0x8(%rsp)
jmp 0x2eb0f
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x2eb0f
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x2eb47
movq 0x10(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x1f0(%rax), %rcx
leaq 0x138425(%rip), %rsi    # 0x166f63
movb $0x0, %al
callq 0x12130
jmp 0x2eb66
movq 0x10(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq 0x1f0(%rax), %rdx
leaq 0x13a5ac(%rip), %rsi    # 0x16910b
movb $0x0, %al
callq 0x12130
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movl $0x5, %esi
callq 0x277c0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq (%rcx), %rdi
movq 0x1f0(%rax), %rsi
callq 0xc33a0
cmpl $0x0, %eax
jne 0x2eba2
movl $0x0, 0x1034(%rsp)
jmp 0x2ebad
movl $0x1, 0x1034(%rsp)
movl 0x1034(%rsp), %eax
addq $0x1038, %rsp           # imm = 0x1038
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %rdi, (%rsp)
movq (%rdi), %rax
callq *0x150(%rax)
cmpl $0x0, %eax
jne 0x2ebea
movl $0x0, 0x14(%rsp)
jmp 0x2ec46
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x158(%rax)
cmpl $0x0, %eax
jne 0x2ec06
movl $0x0, 0x14(%rsp)
jmp 0x2ec46
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x160(%rax)
cmpl $0x0, %eax
jne 0x2ec22
movl $0x0, 0x14(%rsp)
jmp 0x2ec46
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x168(%rax)
cmpl $0x0, %eax
jne 0x2ec3e
movl $0x0, 0x14(%rsp)
jmp 0x2ec46
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movl 0x1f8(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x1f8(%rcx)
cmpl $0x0, %eax
jle 0x2ec84
movl $0x1, 0x24(%rsp)
jmp 0x2ed2a
movl $0x0, 0x14(%rsp)
cmpl $0x2, 0x14(%rsp)
jg 0x2ed22
movq 0x8(%rsp), %rdi
callq 0x30430
cmpl 0x14(%rsp), %eax
jg 0x2eca9
jmp 0x2ed22
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x14(%rsp), %esi
callq 0x277c0
cmpq $0x0, (%rax)
jne 0x2ecc3
jmp 0x2ed12
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x14(%rsp), %esi
callq 0x277c0
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x2ecf9
movq (%rsp), %rdi
callq 0xb3390
movq (%rsp), %rdi
movl $0xd0, %esi
callq 0x126e0
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movl 0x14(%rsp), %esi
callq 0x277c0
movq $0x0, (%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x2ec8c
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movl 0x1fc(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x1fc(%rcx)
cmpl $0x0, %eax
jle 0x2ed74
movl $0x1, 0x24(%rsp)
jmp 0x2ee0c
movq 0x10(%rsp), %rdi
callq 0x30430
cmpl $0x3, %eax
jg 0x2ed8d
movl $0x0, 0x24(%rsp)
jmp 0x2ee0c
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movl $0x3, %esi
callq 0x277c0
cmpq $0x0, (%rax)
jne 0x2edb0
movl $0x0, 0x24(%rsp)
jmp 0x2ee0c
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movl $0x3, %esi
callq 0x277c0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x2edea
movq 0x8(%rsp), %rdi
callq 0xb3390
movq 0x8(%rsp), %rdi
movl $0xd0, %esi
callq 0x126e0
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movl $0x3, %esi
callq 0x277c0
movq $0x0, (%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)