LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rax
movl $0x3, %ecx
callq *0x38(%rax)
movq %rsp, %r15
movq %r15, %rdi
callq 0x4b600
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd 0x9d272(%rip), %xmm2    # 0xbb020
addsd %xmm2, %xmm0
cvtsi2sd %ebp, %xmm1
addsd %xmm2, %xmm1
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x6f0d6
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x16377
testl %eax, %eax
je 0x1ddeb
addq $0x188, %rbx            # imm = 0x188
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x43906
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq 0x18(%rdi), %rax
movslq %ecx, %rdx
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x1deeb
testl %ecx, %ecx
js 0x1df1b
movl %esi, %r14d
testl %esi, %esi
js 0x1df1b
movq %rdi, %rbx
cmpl %ecx, 0x24(%rdi)
jle 0x1df1b
testl %ebp, %ebp
js 0x1df1b
cmpl %r14d, 0xc0(%rax)
jle 0x1df1b
cmpl %ebp, 0xc4(%rax)
jle 0x1df1b
movq 0xb8(%rax), %rdx
movl 0xc8(%rax), %eax
imull %ebp, %eax
addl %r14d, %eax
cltq
movsd %xmm0, (%rdx,%rax,8)
cmpl $0x3, %ecx
jne 0x1df03
movq %rsp, %r15
movq %r15, %rdi
callq 0x4b600
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd 0x9d174(%rip), %xmm2    # 0xbb020
addsd %xmm2, %xmm0
cvtsi2sd %ebp, %xmm1
addsd %xmm2, %xmm1
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x6f0d6
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x16377
testl %eax, %eax
je 0x1df1b
addq $0x188, %rbx            # imm = 0x188
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x43906
jmp 0x1df1b
leaq 0x9e1d8(%rip), %rdi     # 0xbc0ca
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x77f42
jae 0x1df1b
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x1c8(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x1df73
movq %rdx, %r14
movl %esi, %ebp
movq %rdx, %rsi
callq 0x5ffa2
movl 0xc0(%r14), %eax
movl %eax, 0x28(%rbx)
movl 0xc4(%r14), %eax
movl %eax, 0x2c(%rbx)
cmpl $0x3, %ebp
jne 0x1df85
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *0x1c0(%rax)
leaq 0x9e18c(%rip), %rdi     # 0xbc106
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x77f42
jae 0x1df97
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *0x1c8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %r12
movq %rdi, %rbx
leaq 0xe330b(%rip), %rax     # 0x101500
addq $0x10, %rax
leaq 0x8(%rsp), %r14
movq %rax, -0x8(%r14)
leaq 0xe7287(%rip), %r13     # 0x105490
leaq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x47efe
movl $0x88, %esi
movq %rsp, %r15
addq %rsi, %r15
addq 0xe5db9(%rip), %rsi     # 0x103fe0
movq %r15, %rdi
callq 0x47efe
movq 0x108(%r13), %rax
movq %rsp, %rdi
movq %rax, 0x108(%rdi)
movq %r12, %rsi
callq 0x4624e
leaq 0x30(%rbx), %rsi
movq %rsp, %rdi
callq 0x45dd6
leaq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x49ae2
leaq 0xb8(%rbx), %rdi
movq %r15, %rsi
callq 0x49ae2
movq 0x108(%rsp), %rax
movq %rax, 0x138(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x1c0(%rax)
movq %rsp, %rdi
callq 0x45c68
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x462fc
jmp 0x1e2bb
movq %rax, %rbx
movq %rsp, %rdi
callq 0x45c68
movq %rbx, %rdi
callq 0x11a60
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::TransformImageToCamera(gaps::R2Point const&, gaps::R3Point&) const
int RGBDImage::
TransformImageToCamera(const R2Point& image_position, R3Point& camera_position) const
{
  // Check image position
  int ix = (int) image_position[0];
  if ((ix < 0) || (ix >= NPixels(RN_X))) return 0; 
  int iy = (int) image_position[1];
  if ((iy < 0) || (iy >= NPixels(RN_Y))) return 0; 
  
  // Get/check depth (point sample to avoid interpolation)
  RNScalar depth = PixelDepth(ix, iy);
  if ((RNIsZero(depth)) || (depth == R2_GRID_UNKNOWN_VALUE)) return 0;

  // Get/check intrinsics matrix
  const R3Matrix& intrinsics_matrix = Intrinsics();
  if (RNIsZero(intrinsics_matrix[0][0])) return 0;
  if (RNIsZero(intrinsics_matrix[1][1])) return 0;
  
  // Transform from position in image coordinates to camera coordinates (where camera is looking down -Z, up is +Y, right is +X)
  camera_position[0] = (image_position[0] - intrinsics_matrix[0][2]) * depth / intrinsics_matrix[0][0];
  camera_position[1] = (image_position[1] - intrinsics_matrix[1][2]) * depth / intrinsics_matrix[1][1];
  camera_position[2] = -depth;

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cvttsd2si (%rsi), %eax
xorl %ebx, %ebx
testl %eax, %eax
js 0x1e40c
movq %rdi, %r15
cmpl %eax, 0x28(%rdi)
jle 0x1e40c
movq %rsi, %r12
cvttsd2si 0x8(%rsi), %ecx
testl %ecx, %ecx
js 0x1e40c
cmpl %ecx, 0x2c(%r15)
jle 0x1e40c
movq %rdx, %r14
xorpd %xmm0, %xmm0
cmpl $0x4, 0x24(%r15)
jl 0x1e34b
movq 0x18(%r15), %rdx
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x1e335
imull 0xc8(%rdx), %ecx
movq 0xb8(%rdx), %rdx
addl %eax, %ecx
movslq %ecx, %rax
movsd (%rdx,%rax,8), %xmm0
jmp 0x1e34b
leaq 0x9dbd2(%rip), %rdi     # 0xbbf0e
xorl %eax, %eax
callq 0x77f42
movsd 0x9cccd(%rip), %xmm0    # 0xbb018
ucomisd 0x9ccc5(%rip), %xmm0    # 0xbb018
jne 0x1e35b
jnp 0x1e40c
leaq 0xe6976(%rip), %rax     # 0x104cd8
movsd (%rax), %xmm1
movapd 0x9cce2(%rip), %xmm3    # 0xbb050
xorpd %xmm1, %xmm3
movapd %xmm0, %xmm2
cmplepd %xmm1, %xmm2
movapd %xmm3, %xmm4
cmplepd %xmm0, %xmm4
andpd %xmm2, %xmm4
movd %xmm4, %eax
testb $0x1, %al
jne 0x1e40c
movsd 0x140(%r15), %xmm2
ucomisd %xmm3, %xmm2
jb 0x1e3a5
ucomisd %xmm2, %xmm1
jae 0x1e40c
movsd 0x160(%r15), %xmm4
ucomisd %xmm3, %xmm4
jb 0x1e3ba
ucomisd %xmm4, %xmm1
jae 0x1e40c
movsd (%r12), %xmm1
subsd 0x150(%r15), %xmm1
mulsd %xmm0, %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, (%r14)
movsd 0x8(%r12), %xmm1
subsd 0x168(%r15), %xmm1
mulsd %xmm0, %xmm1
divsd 0x160(%r15), %xmm1
movsd %xmm1, 0x8(%r14)
xorpd 0x9cc4f(%rip), %xmm0    # 0xbb050
movlpd %xmm0, 0x10(%r14)
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::TransformCameraToWorld(gaps::R3Point const&, gaps::R3Point&) const
int RGBDImage::
TransformCameraToWorld(const R3Point& camera_position, R3Point& world_position) const
{
  // Transform from camera coordinates to world coordinates
  world_position = camera_position;
  world_position.Transform(CameraToWorld());
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x4b96a
addq $0x30, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4bf18
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x4b96a
addq $0x30, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4bf2a
movsd 0x10(%rbx), %xmm0
leaq 0xe6799(%rip), %rax     # 0x104cd8
movsd (%rax), %xmm1
xorpd 0x9cb05(%rip), %xmm1    # 0xbb050
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setb %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movsd %xmm0, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r12
leaq 0x38(%rdi), %r13
leaq 0xe75a9(%rip), %rdx     # 0x105ba0
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x49ffa
leaq 0x9e9da(%rip), %rdx     # 0xbcfe8
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x49f82
leaq 0x9e963(%rip), %rdx     # 0xbcf88
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x49f82
movq (%r12), %rax
xorl %esi, %esi
cmpl $0x4, %ebp
sete %sil
addl $0x3, %esi
testl %ebp, %ebp
cmovel %ebp, %esi
movq %r12, %rdi
callq *0xf0(%rax)
movl $0x1, %edi
callq 0x11150
movq %rbx, %rdi
callq 0x11170
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x4ca32
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4b947
movq %r15, %rdi
callq 0x11170
movq %rbx, %rdi
callq 0x11170
movsd 0x8(%rsp), %xmm0
mulsd 0x9c974(%rip), %xmm0    # 0xbb020
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x4ca32
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4b947
movq %r14, %rdi
callq 0x11170
callq 0x117c0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::DrawBBox(int) const
void RGBDImage::
DrawBBox(int color_scheme) const
{
  // Load color
  if (color_scheme == RGBD_NO_COLOR_SCHEME) LoadColor(color_scheme);
  else if (color_scheme == RGBD_HIGHLIGHT_COLOR_SCHEME) LoadColor(color_scheme);
  else if (color_scheme != RGBD_NO_COLOR_SCHEME) LoadColor(RGBD_INDEX_COLOR_SCHEME);

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
xorl %ecx, %ecx
cmpl $0x4, %esi
sete %cl
addl $0x3, %ecx
testl %esi, %esi
cmovnel %ecx, %esi
callq *0xf0(%rax)
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1d25a
movl $0x1, %esi
movq %r14, %rdi
callq 0x44220
movq %rsp, %rdi
callq 0x43d34
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x43d34
movq %rbx, %rdi
callq 0x11a60
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1f97e
leaq 0x9c790(%rip), %rax     # 0xbc0a8
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsd 0x9b6ff(%rip), %xmm0    # 0xbb028
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
jmp 0x118f0
movl 0x10(%rdi), %eax
incl %eax
cvtsi2sd %eax, %xmm0
mulsd 0x9c71b(%rip), %xmm0    # 0xbc060
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 0x9b6b5(%rip), %xmm0    # 0xbb028
xorps %xmm2, %xmm2
movaps %xmm0, %xmm1
jmp 0x118f0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ColorChannels() const
R2Image RGBDImage::
ColorChannels(void) const
{
  // Initialize image
  R2Image image(NPixels(RN_X), NPixels(RN_Y), 3);

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

  // Return image
  return image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl 0x28(%rsi), %esi
movl 0x2c(%r14), %edx
movq %rdi, %rbx
movl $0x3, %ecx
callq 0x6fc8a
movl 0x24(%r14), %edx
testl %edx, %edx
jle 0x1f9c5
movq 0x18(%r14), %rcx
movq (%rcx), %rax
movq %rax, 0x8(%rsp)
cmpl $0x1, %edx
movq %rbx, %r14
jne 0x1f9d8
xorl %ebp, %ebp
jmp 0x1f9e7
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
xorl %r15d, %r15d
movq %rbx, %r14
jmp 0x1f9ea
movq 0x8(%rcx), %rbp
cmpl $0x3, %edx
jb 0x1f9e7
movq 0x10(%rcx), %r15
jmp 0x1f9ea
xorl %r15d, %r15d
movl 0x4(%r14), %ecx
testl %ecx, %ecx
jle 0x1faa3
movl (%r14), %edx
movq $0x0, (%rsp)
leaq 0x10(%rsp), %r13
testl %edx, %edx
jle 0x1fa91
movslq (%rsp), %rbx
xorl %r12d, %r12d
movq 0x8(%rsp), %rcx
movq 0xb8(%rcx), %rdx
movslq 0xc8(%rcx), %rcx
imulq %rbx, %rcx
addq %r12, %rcx
movsd (%rdx,%rcx,8), %xmm0
movq 0xb8(%rbp), %rdx
movslq 0xc8(%rbp), %rcx
imulq %rbx, %rcx
addq %r12, %rcx
movsd (%rdx,%rcx,8), %xmm1
movq 0xb8(%r15), %rdx
movslq 0xc8(%r15), %rcx
imulq %rbx, %rcx
addq %r12, %rcx
movsd (%rdx,%rcx,8), %xmm2
movq %r13, %rdi
callq 0x75244
movq %r14, %rdi
movl %r12d, %esi
movq (%rsp), %rdx
movq %r13, %rcx
callq 0x7003a
movl (%r14), %edx
incq %r12
cmpl %edx, %r12d
jl 0x1fa15
movl 0x4(%r14), %ecx
movq (%rsp), %rsi
incl %esi
movq %rsi, (%rsp)
cmpl %ecx, %esi
jl 0x1fa06
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x6fee4
movq %rbx, %rdi
callq 0x11a60
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::CreateColorChannels(gaps::R2Image const&)
int RGBDImage::
CreateColorChannels(const R2Image& image)
{
  // Create color channels
  while (channels.NEntries() <= RGBD_BLUE_CHANNEL) channels.Insert(NULL);
  if (!channels[RGBD_RED_CHANNEL]) channels[RGBD_RED_CHANNEL] = new R2Grid(image.Width(), image.Height());
  if (!channels[RGBD_GREEN_CHANNEL]) channels[RGBD_GREEN_CHANNEL] = new R2Grid(image.Width(), image.Height());
  if (!channels[RGBD_BLUE_CHANNEL]) channels[RGBD_BLUE_CHANNEL] = new R2Grid(image.Width(), image.Height());

  // Update resident count
  color_resident_count++;

  // Initialize color channels
  SetColorChannels(image);

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

  // Return success
  return 1;
}

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

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

  // Initialize channel
  SetChannel(channel_index, image);

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

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x18(%rdi), %r15
movl 0x24(%rdi), %edx
cmpl %esi, %edx
jg 0x1fc2c
movq %r15, %rdi
xorl %esi, %esi
callq 0x75466
movl 0x24(%r14), %edx
cmpl %ebp, %edx
jle 0x1fc1a
movq (%r15), %rax
movslq %ebp, %r13
cmpq $0x0, (%rax,%r13,8)
jne 0x1fc58
movl $0xd0, %edi
callq 0x115b0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6008c
movq (%r15), %rax
movq %r12, (%rax,%r13,8)
cmpl $0x2, %ebp
je 0x1fc6b
cmpl $0x3, %ebp
jne 0x1fc72
incl 0x1fc(%r14)
jmp 0x1fc72
incl 0x1f8(%r14)
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *0x40(%rax)
movl 0xc0(%rbx), %eax
movl %eax, 0x28(%r14)
movl 0xc4(%rbx), %eax
movl %eax, 0x2c(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xd0, %esi
movq %r12, %rdi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a60
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1fd3b
incl %eax
movl %eax, 0x1f8(%rbx)
movl $0x1, %ebx
jmp 0x1fe09
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
movl $0x3, %ecx
callq 0x6fc8a
movq 0x1d8(%rbx), %rcx
testq %rcx, %rcx
je 0x1fdec
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1fd85
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x1fd85
leaq 0x9c241(%rip), %rsi     # 0xbbfb8
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x1fd92
leaq 0x60(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x6f98c
testl %eax, %eax
je 0x1fdff
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 0x1fdec
cmpl (%rsp), %ecx
jne 0x1fdc8
cmpl 0x4(%rsp), %eax
je 0x1fdec
leaq 0x9e4f1(%rip), %rsi     # 0xbe2c0
leaq 0x18(%rsp), %rdi
callq 0x6d1a2
movl 0x28(%rbx), %edx
movl 0x2c(%rbx), %ecx
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x238f3
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x178(%rax)
movl %eax, %ebx
jmp 0x1fe01
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x6fee4
movl %ebx, %eax
addq $0x1060, %rsp           # imm = 0x1060
popq %rbx
retq
jmp 0x1fe18
jmp 0x1fe18
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6fee4
movq %rbx, %rdi
callq 0x11a60
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x20281
incl %eax
movl %eax, 0x200(%rbx)
movl $0x1, %ebx
jmp 0x20306
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
callq 0x5f630
movq 0x1e8(%rbx), %rcx
testq %rcx, %rcx
je 0x202e9
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x202c5
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x202c5
leaq 0x9bd04(%rip), %rsi     # 0xbbfb8
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x202d5
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq %rsp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x67a4e
testl %eax, %eax
je 0x202fc
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x188(%rax)
movl %eax, %ebx
jmp 0x202fe
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x60264
movl %ebx, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
retq
jmp 0x20313
movq %rax, %rbx
movq %rsp, %rdi
callq 0x60264
movq %rbx, %rdi
callq 0x11a60
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2034d
incl %eax
movl %eax, 0x204(%rbx)
movl $0x1, %ebx
jmp 0x203d2
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
callq 0x5f630
movq 0x1f0(%rbx), %rcx
testq %rcx, %rcx
je 0x203b5
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x20391
movq 0x48(%rax), %rdx
testq %rdx, %rdx
je 0x20391
leaq 0x9bc38(%rip), %rsi     # 0xbbfb8
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x203a1
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq %rsp, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x67a4e
testl %eax, %eax
je 0x203c8
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x190(%rax)
movl %eax, %ebx
jmp 0x203ca
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x60264
movl %ebx, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
retq
jmp 0x203df
movq %rax, %rbx
movq %rsp, %rdi
callq 0x60264
movq %rbx, %rdi
callq 0x11a60
// File: /workspace/github_cpp_makefile_star2_O3/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 0x20529
movq %rdi, %rbx
cmpl $0x3, 0x24(%rdi)
jl 0x20529
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2049b
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x2049b
leaq 0x9bb2b(%rip), %rsi     # 0xbbfb8
leaq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x204a8
leaq 0x30(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movl 0x28(%rbx), %esi
movl 0x2c(%rbx), %edx
movq %rsp, %rdi
movl $0x3, %ecx
callq 0x6fc8a
movl 0x2c(%rbx), %ecx
testl %ecx, %ecx
jle 0x2050a
movl 0x28(%rbx), %eax
xorl %ebp, %ebp
leaq 0x18(%rsp), %r14
movq %rsp, %r15
testl %eax, %eax
jle 0x20504
xorl %r12d, %r12d
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %ebp, %ecx
callq 0x1d72e
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
movq %r14, %rcx
callq 0x7003a
incl %r12d
movl 0x28(%rbx), %eax
cmpl %eax, %r12d
jl 0x204d6
movl 0x2c(%rbx), %ecx
incl %ebp
cmpl %ecx, %ebp
jl 0x204cf
movq 0x1d8(%rbx), %rsi
movq %rsp, %rdi
callq 0x71b08
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rsp, %rdi
callq 0x6fee4
movl %ebp, %eax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2053d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6fee4
movq %rbx, %rdi
callq 0x11a60
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2065d
movq %rdi, %rbx
cmpl $0x4, 0x24(%rdi)
jl 0x2065d
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x205a4
movq 0x38(%rax), %rdx
testq %rdx, %rdx
je 0x205a4
leaq 0x9ba25(%rip), %rsi     # 0xbbfb8
leaq 0xd0(%rsp), %rdi
xorl %eax, %eax
callq 0x11110
jmp 0x205b4
leaq 0xd0(%rsp), %rdi
movq %rcx, %rsi
callq 0x11530
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rsi
movq %rsp, %rdi
callq 0x6008c
movq 0x1e0(%rbx), %rdi
leaq 0x9b66a(%rip), %rsi     # 0xbbc3c
callq 0x11140
testq %rax, %rax
je 0x2063e
movq %rsp, %rdi
movsd 0x9baa1(%rip), %xmm0    # 0xbc088
callq 0x64064
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2063e
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x2063e
leaq 0x9b151(%rip), %rsi     # 0xbb756
movq %r14, %rdi
callq 0x11840
testl %eax, %eax
je 0x2062e
leaq 0x9bbe0(%rip), %rsi     # 0xbc1f8
movq %r14, %rdi
callq 0x11840
testl %eax, %eax
jne 0x2063e
movsd 0x9ba6c(%rip), %xmm0    # 0xbc098
jmp 0x20636
movsd 0x9ba5a(%rip), %xmm0    # 0xbc090
movq %rsp, %rdi
callq 0x64064
movq 0x1e0(%rbx), %rsi
movq %rsp, %rdi
callq 0x68832
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rsp, %rdi
callq 0x60264
movl %ebp, %eax
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x60264
movq %rbx, %rdi
callq 0x11a60
// File: /workspace/github_cpp_makefile_star2_O3/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 0x206f2
movq %rdi, %rbx
cmpl $0x5, 0x24(%rdi)
jl 0x206f2
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x206ce
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x206ce
leaq 0x9b900(%rip), %rsi     # 0xbbfb8
movq %rsp, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x11110
movq 0x1e8(%rbx), %r14
jmp 0x206d9
movq %rsp, %rdi
movq %r14, %rsi
callq 0x11530
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rdi
movq %r14, %rsi
callq 0x68832
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_O3/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 0x20772
movq %rdi, %rbx
cmpl $0x6, 0x24(%rdi)
jl 0x20772
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2074e
movq 0x48(%rax), %rdx
testq %rdx, %rdx
je 0x2074e
leaq 0x9b880(%rip), %rsi     # 0xbbfb8
movq %rsp, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x11110
movq 0x1f0(%rbx), %r14
jmp 0x20759
movq %rsp, %rdi
movq %r14, %rsi
callq 0x11530
movq 0x18(%rbx), %rax
movq 0x28(%rax), %rdi
movq %r14, %rsi
callq 0x68832
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_O3/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 0x2083f
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
testl %eax, %eax
jle 0x2083a
xorl %r15d, %r15d
movq 0x18(%rbx), %rcx
movq (%rcx,%r15,8), %r14
testq %r14, %r14
je 0x20829
movq %r14, %rdi
callq 0x60264
movl $0xd0, %esi
movq %r14, %rdi
callq 0x115c0
movq 0x18(%rbx), %rax
movq $0x0, (%rax,%r15,8)
movl 0x24(%rbx), %eax
cmpq $0x1, %r15
ja 0x2083a
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x207f8
popq %rbx
popq %r14
popq %r15
movl $0x1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ReleaseDepthChannel()
int RGBDImage::
ReleaseDepthChannel(void)
{
  // Check/update read count
  if (--depth_resident_count > 0) return 1;

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

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

  // Return success;
  return 1;
}

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

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

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

  // Return success;
  return 1;
}

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

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

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

  // Return success;
  return 1;
}

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1d8(%rdi), %rdi
testq %rdi, %rdi
je 0x209dd
callq 0x11710
testq %r14, %r14
je 0x20a5d
cmpb $0x2d, (%r14)
jne 0x209f3
cmpb $0x0, 0x1(%r14)
je 0x20a75
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1d8(%rbx)
cmpq $0x0, 0x1d0(%rbx)
jne 0x20a68
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20a4c
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1d0(%rbx)
jmp 0x20a68
movq $0x0, 0x1d8(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x209fb
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetDepthFilename(char const*)
void RGBDImage::
SetDepthFilename(const char *filename)
{
  // Set filename
  if (depth_filename) free(depth_filename);
  if (filename && strcmp(filename, "-")) depth_filename = RNStrdup(filename);
  else depth_filename = NULL;

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1e0(%rdi), %rdi
testq %rdi, %rdi
je 0x20a9d
callq 0x11710
testq %r14, %r14
je 0x20b2e
cmpb $0x2d, (%r14)
jne 0x20ab7
cmpb $0x0, 0x1(%r14)
je 0x20b46
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1e0(%rbx)
cmpq $0x0, 0x1d0(%rbx)
jne 0x20b39
cmpb $0x2d, (%r14)
jne 0x20add
cmpb $0x0, 0x1(%r14)
je 0x20b39
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20b1d
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1d0(%rbx)
jmp 0x20b39
movq $0x0, 0x1e0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x20abf
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetCategoryFilename(char const*)
void RGBDImage::
SetCategoryFilename(const char *filename)
{
  // Set filename
  if (category_filename) free(category_filename);
  if (filename && strcmp(filename, "-")) category_filename = RNStrdup(filename);
  else category_filename = NULL;

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1e8(%rdi), %rdi
testq %rdi, %rdi
je 0x20b71
callq 0x11710
testq %r14, %r14
je 0x20c01
cmpb $0x2d, (%r14)
jne 0x20b8b
cmpb $0x0, 0x1(%r14)
je 0x20c19
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1e8(%rbx)
cmpq $0x0, 0x1d0(%rbx)
jne 0x20c0c
cmpb $0x2d, (%r14)
jne 0x20bb1
cmpb $0x0, 0x1(%r14)
je 0x20c0c
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
movq %rax, %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20bf0
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1d0(%rbx)
jmp 0x20c0c
movq $0x0, 0x1e8(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x20b93
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::SetInstanceFilename(char const*)
void RGBDImage::
SetInstanceFilename(const char *filename)
{
  // Set filename
  if (instance_filename) free(instance_filename);
  if (filename && strcmp(filename, "-")) instance_filename = RNStrdup(filename);
  else instance_filename = NULL;

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1f0(%rdi), %rdi
testq %rdi, %rdi
je 0x20c43
callq 0x11710
testq %r14, %r14
je 0x20cc2
cmpb $0x2d, (%r14)
jne 0x20c59
cmpb $0x0, 0x1(%r14)
je 0x20cda
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1f0(%rbx)
cmpq $0x0, 0x1d0(%rbx)
jne 0x20ccd
movq %rsp, %r15
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rdi
movq %r14, %rsi
callq 0x112d0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x11640
movq %rax, %r14
testq %rax, %rax
cmoveq %r15, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x11640
testq %rax, %rax
je 0x20cb1
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x77da3
movq %rax, 0x1d0(%rbx)
jmp 0x20ccd
movq $0x0, 0x1f0(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x20c61
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9ba4b(%rip), %rsi     # 0xbce08
movq %rsp, %rdi
callq 0x47efe
testl %ebp, %ebp
je 0x213d5
leaq 0x38(%r15), %rsi
movq %rsp, %rdi
callq 0x49ae2
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 0x2140d
movl $0x1, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq