// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::DrawSurfels(int) const
void R3SurfelViewer::
DrawSurfels(int color_scheme) const
{
  // Check surfel visibility
  if (!SurfelVisibility()) return;

  // Set default lighting
  glDisable(GL_LIGHTING);

  // Set point size
  if (color_scheme != R3_SURFEL_VIEWER_COLOR_BY_PICK_INDEX) glPointSize(surfel_size);
  else glPointSize(0.01 * Viewport().Width() + 1);

#if (R3_SURFEL_VIEWER_DRAW_METHOD == R3_SURFEL_VIEWER_DRAW_WITH_VBO)
  if (!shape_draw_flags[R3_SURFEL_DISC_DRAW_FLAG]) {
    // Draw with VBO
    DrawVBO(color_scheme);
    glPointSize(1);    
    return;
  }
#endif

  // Draw resident nodes
  switch (color_scheme) {
  case R3_SURFEL_VIEWER_COLOR_BY_PICK_INDEX:
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      LoadColor(color_scheme, NULL, NULL, node, NULL, NULL);
      DrawSurfels(node);
    }
    break;

  case R3_SURFEL_VIEWER_COLOR_BY_CURRENT_LABEL:
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      R3SurfelObject *object = node->Object(TRUE, TRUE);
      while (object && object->Parent() && (object->Parent() != scene->RootObject())) object = object->Parent();
      R3SurfelLabel *label = (object) ? object->CurrentLabel() : NULL;
      const RNRgb& rgb = (label) ? label->Color() : RNwhite_rgb;
      RNLoadRgb(rgb);
      DrawSurfels(node);
    }
    break;

  case R3_SURFEL_VIEWER_COLOR_BY_GROUND_TRUTH_LABEL:
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      R3SurfelObject *object = node->Object(TRUE, TRUE);
      while (object && object->Parent() && (object->Parent() != scene->RootObject())) object = object->Parent();
      R3SurfelLabel *label = (object) ? object->GroundTruthLabel() : NULL;
      const RNRgb& rgb = (label) ? label->Color() : RNwhite_rgb;
      RNLoadRgb(rgb);
      DrawSurfels(node);
    }
    break;

  case R3_SURFEL_VIEWER_COLOR_BY_SCAN:
    // Draw with colors based on nodes
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      R3SurfelScan *scan = node->Scan();
      int scan_index = (scan) ? scan->SceneIndex() : 0;
      LoadColor(scan_index);
      DrawSurfels(node);
    }
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_OBJECT:
    // Draw with colors based on nodes
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      R3SurfelObject *object = node->Object(TRUE, TRUE);
      while (object && object->Parent() && (object->Parent() != scene->RootObject())) object = object->Parent();
      int object_index = (object) ? object->SceneIndex() : 0;
      LoadColor(object_index);
      DrawSurfels(node);
    }
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_NODE:
    // Draw with colors based on nodes
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      LoadColor(i);
      DrawSurfels(node);
    }
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_BLOCK:
    // Draw with colors based on blocks
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      if (!NodeVisibility(node)) continue;
      for (int j = 0; j < node->NBlocks(); j++) {
        R3SurfelBlock *block = node->Block(j);
        LoadColor(block->DatabaseIndex());
        block->Draw(shape_draw_flags, subsampling_factor);
      }
    }
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_OBJECT_ATTRIBUTES:
    // Draw with colors based on flags encoding object attributes
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      if (!NodeVisibility(node)) continue;
      R3SurfelObject *object = node->Object(TRUE, TRUE);
      while (object && object->Parent() && (object->Parent() != scene->RootObject())) object = object->Parent();
      RNFlags flags = (object) ? object->Flags() : RNFlags(0);
      LoadColor((int) flags);
      DrawSurfels(node);
    }
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_SHADING:
    // Draw with colors based on shading
    glEnable(GL_LIGHTING);
    RNLoadRgb(0.8, 0.8, 0.8);
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      DrawSurfels(node, R3_SURFEL_NORMAL_DRAW_FLAG);
    }
    glDisable(GL_LIGHTING);
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_NORMAL:
    // Draw with colors based on normals
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      if (!NodeVisibility(node)) continue;
      for (int j = 0; j < node->NBlocks(); j++) {
        R3SurfelBlock *block = node->Block(j);
        const R3Point& block_origin = block->PositionOrigin();
        glPushMatrix();
        glTranslated(block_origin.X(), block_origin.Y(), block_origin.Z());
        RNGrfxBegin(RN_GRFX_POINTS);
        for (int k = 0; k < block->NSurfels(); k += subsampling_factor) {
          const R3Surfel *surfel = block->Surfel(k);
          float r = 0.5F + 0.5F * surfel->NX();
          float g = 0.5F + 0.5F * surfel->NY();
          float b = 0.5F + 0.5F * surfel->NZ();
          RNLoadRgb(r, g, b);
          R3LoadPoint(surfel->PositionPtr());
        }
        RNGrfxEnd();
        glPopMatrix();
      }
    }
    break;
    
  case R3_SURFEL_VIEWER_COLOR_BY_Z:
  case R3_SURFEL_VIEWER_COLOR_BY_ELEVATION:
  case R3_SURFEL_VIEWER_COLOR_BY_SURFEL_LABEL:
  case R3_SURFEL_VIEWER_COLOR_BY_CONFIDENCE:
    // Draw with colors based on surfel attributes
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      if (!NodeVisibility(node)) continue;
      for (int j = 0; j < node->NBlocks(); j++) {
        R3SurfelBlock *block = node->Block(j);
        const R3Point& block_origin = block->PositionOrigin();
        glPushMatrix();
        glTranslated(block_origin.X(), block_origin.Y(), block_origin.Z());
        RNGrfxBegin(RN_GRFX_POINTS);
        for (int k = 0; k < block->NSurfels(); k += subsampling_factor) {
          const R3Surfel *surfel = block->Surfel(k);
          if (color_scheme == R3_SURFEL_VIEWER_COLOR_BY_Z) {
            double z = block_origin.Z() + surfel->Z();
            double dz = (z > center_point.Z()) ? z - center_point.Z() : 0;
            double value = 0.5 * sqrt(dz);
            LoadColor(value);
          }
          else if (color_scheme == R3_SURFEL_VIEWER_COLOR_BY_ELEVATION) {
            double elevation = surfel->Elevation();
            double value = (elevation > 0) ? 0.5 * sqrt(elevation) : 0;
            LoadColor(value);
          }
          else if (color_scheme == R3_SURFEL_VIEWER_COLOR_BY_SURFEL_LABEL) {
            int label_identifier = surfel->Attribute() & 0xFF;
            LoadColor(label_identifier);
          }
          else if (color_scheme == R3_SURFEL_VIEWER_COLOR_BY_CONFIDENCE) {
            double confidence = ((surfel->Attribute() >> 8) & 0xFF) / 255.0;
            LoadColor(confidence);
          }
          R3LoadPoint(surfel->PositionPtr());
        }
        RNGrfxEnd();
        glPopMatrix();
      }
    }
    break;
    
  default:
    // Draw with RGB surfel colors
    for (int i = 0; i < resident_nodes.NNodes(); i++) {
      R3SurfelNode *node = resident_nodes.Node(i);
      if (!NodeVisibility(node)) continue;
      DrawSurfels(node, R3_SURFEL_COLOR_DRAW_FLAG);
    }
    break;
  }

  // Reset point size
  glPointSize(1);    
}

// Assembly:
cmpl $0x0, 0x2f0(%rdi)
je 0x2e3a3
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movl $0xb50, %edi            # imm = 0xB50
callq 0x27200
cmpl $0xe, %r14d
jne 0x2e3a4
cvtsi2sdl 0x118(%rbx), %xmm0
mulsd 0x10cc8f(%rip), %xmm0   # 0x13b028
addsd 0x10cc67(%rip), %xmm0   # 0x13b008
jmp 0x2e3ac
retq
movsd 0x2e8(%rbx), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x270a0
testb $0x10, 0x458(%rbx)
jne 0x2e3e8
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
callq *0x370(%rax)
movss 0x10cc6b(%rip), %xmm0   # 0x13b040
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x270a0
leal -0x1(%r14), %eax
cmpl $0xd, %eax
ja 0x2eaf5
leaq 0x10d128(%rip), %rcx    # 0x13b524
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %ecx, %ecx
movq 0x18(%rbx), %rax
movq %rcx, 0x10(%rsp)
movq (%rax,%rcx,8), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2cf82
testl %eax, %eax
je 0x2e597
cmpl $0x0, 0x4c(%r15)
jle 0x2e597
xorl %ebp, %ebp
movq %r15, 0x8(%rsp)
movq 0x40(%r15), %rax
movq (%rax,%rbp,8), %r13
callq 0x27fd0
movsd 0x10(%r13), %xmm0
movsd 0x18(%r13), %xmm1
movsd 0x20(%r13), %xmm2
callq 0x279c0
xorl %edi, %edi
callq 0x271a0
cmpl $0x0, 0x8(%r13)
jle 0x2e578
xorl %r15d, %r15d
movslq %r15d, %rax
leaq (%rax,%rax,2), %r12
shlq $0x4, %r12
addq (%r13), %r12
cmpl $0xa, %r14d
jg 0x2e4b4
cmpl $0x2, %r14d
je 0x2e4f6
cmpl $0xa, %r14d
jne 0x2e55f
movzbl 0x24(%r12), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x218(%rax)
jmp 0x2e55f
cmpl $0xb, %r14d
je 0x2e52f
cmpl $0xc, %r14d
jne 0x2e55f
movswl 0x2a(%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10cec7(%rip), %xmm0   # 0x13b3a0
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomiss 0x10cff5(%rip), %xmm1   # 0x13b4e0
jbe 0x2e553
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
jmp 0x2e51f
xorps %xmm1, %xmm1
cvtss2sd 0x8(%r12), %xmm1
addsd 0x20(%r13), %xmm1
movsd 0x2c0(%rbx), %xmm0
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
cmpltsd %xmm1, %xmm0
andpd %xmm2, %xmm0
ucomisd 0x10ceb9(%rip), %xmm0   # 0x13b3e0
jb 0x2e546
sqrtsd %xmm0, %xmm0
jmp 0x2e54b
movzbl 0x25(%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10ce2c(%rip), %xmm0   # 0x13b370
jmp 0x2e553
callq 0x27700
mulsd 0x10cabd(%rip), %xmm0   # 0x13b010
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x220(%rax)
movq %r12, %rdi
callq 0x27650
addl 0x48c(%rbx), %r15d
cmpl 0x8(%r13), %r15d
jl 0x2e478
callq 0x27cc0
callq 0x28230
incq %rbp
movq 0x8(%rsp), %r15
movslq 0x4c(%r15), %rax
cmpq %rax, %rbp
jl 0x2e43f
movq 0x10(%rsp), %rcx
incq %rcx
movslq 0x24(%rbx), %rax
cmpq %rax, %rcx
jl 0x2e40d
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
leaq 0x191ba3(%rip), %r12    # 0x1c0168
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x4013a
movq 0x8(%rbx), %rcx
testq %rax, %rax
je 0x2e604
movq %rax, %rdi
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x2e5fd
movq 0x10(%rcx), %rdx
cmpq (%rdx), %rax
jne 0x2e5e3
callq 0x4708c
jmp 0x2e606
xorl %eax, %eax
testq %rax, %rax
jne 0x2e610
movq %r12, %rax
jmp 0x2e614
addq $0x70, %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
callq 0x27ee0
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2e5c5
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2cf82
testl %eax, %eax
je 0x2e6c4
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x4013a
movq 0x8(%rbx), %rcx
testq %rax, %rax
je 0x2e6a5
movq %rax, %rdx
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x2e69d
movq 0x10(%rcx), %rsi
cmpq (%rsi), %rax
jne 0x2e683
movl 0xe8(%rdx), %esi
jmp 0x2e6a7
xorl %esi, %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x218(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2e656
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2cf82
testl %eax, %eax
je 0x2e73f
cmpl $0x0, 0x4c(%r14)
jle 0x2e73f
xorl %r13d, %r13d
movq 0x40(%r14), %rax
movq (%rax,%r13,8), %r15
movl 0xa0(%r15), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x218(%rax)
movq 0x458(%rbx), %rsi
movl 0x48c(%rbx), %edx
movq %r15, %rdi
callq 0x37b06
incq %r13
movslq 0x4c(%r14), %rax
cmpq %rax, %r13
jl 0x2e703
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x2e6e2
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x4013a
movq 0x8(%rbx), %rcx
testq %rax, %rax
je 0x2e79a
movq %rax, %rdx
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x2e795
movq 0x10(%rcx), %rsi
cmpq (%rsi), %rax
jne 0x2e77b
movl 0x10(%rdx), %esi
jmp 0x2e79c
xorl %esi, %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x218(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2e75d
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %ecx, %ecx
movq 0x18(%rbx), %rax
movq %rcx, 0x8(%rsp)
movq (%rax,%rcx,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2cf82
testl %eax, %eax
je 0x2e8ec
cmpl $0x0, 0x4c(%r14)
jle 0x2e8ec
xorl %r13d, %r13d
movq 0x40(%r14), %rax
movq (%rax,%r13,8), %rbp
callq 0x27fd0
movsd 0x10(%rbp), %xmm0
movsd 0x18(%rbp), %xmm1
movsd 0x20(%rbp), %xmm2
callq 0x279c0
xorl %edi, %edi
callq 0x271a0
cmpl $0x0, 0x8(%rbp)
movss 0x10cc98(%rip), %xmm3   # 0x13b4d0
movss 0x10cc9c(%rip), %xmm4   # 0x13b4dc
jle 0x2e8d2
xorl %r12d, %r12d
movq (%rbp), %rax
movslq %r12d, %r12
leaq (%r12,%r12,2), %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %r15
movswl 0x10(%rax,%rcx), %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
mulss %xmm3, %xmm0
movswl 0x12(%rax,%rcx), %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
mulss %xmm4, %xmm0
addss %xmm4, %xmm0
mulss %xmm3, %xmm1
mulss %xmm4, %xmm1
movswl 0x14(%rax,%rcx), %eax
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
addss %xmm4, %xmm1
mulss %xmm3, %xmm2
mulss %xmm4, %xmm2
addss %xmm4, %xmm2
callq 0x28360
movq %r15, %rdi
callq 0x27650
movss 0x10cc23(%rip), %xmm4   # 0x13b4dc
movss 0x10cc0f(%rip), %xmm3   # 0x13b4d0
addl 0x48c(%rbx), %r12d
cmpl 0x8(%rbp), %r12d
jl 0x2e849
callq 0x27cc0
callq 0x28230
incq %r13
movslq 0x4c(%r14), %rax
cmpq %rax, %r13
jl 0x2e804
movq 0x8(%rsp), %rcx
incq %rcx
movslq 0x24(%rbx), %rax
cmpq %rax, %rcx
jl 0x2e7d6
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%r15,8), %r14
movq $0x0, (%rsp)
movq %rbx, %rdi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq *0x228(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2e913
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x40210
movl $0x0, %esi
testq %rax, %rax
je 0x2e98f
movl 0x10(%rax), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x218(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2e96d
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
leaq 0x191797(%rip), %r12    # 0x1c0168
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x4013a
movq 0x8(%rbx), %rcx
testq %rax, %rax
je 0x2ea10
movq %rax, %rdi
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x2ea09
movq 0x10(%rcx), %rdx
cmpq (%rdx), %rax
jne 0x2e9ef
callq 0x47182
jmp 0x2ea12
xorl %eax, %eax
testq %rax, %rax
jne 0x2ea1c
movq %r12, %rax
jmp 0x2ea20
addq $0x70, %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
callq 0x27ee0
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2e9d1
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r14d, %r14d
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%r14,8), %r15
movq %rbx, %rdi
movl %r14d, %esi
callq *0x218(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x278(%rax)
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x2ea62
jmp 0x2e3cd
movl $0xb50, %edi            # imm = 0xB50
callq 0x27860
movsd 0x10c92b(%rip), %xmm0   # 0x13b3d8
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x27ee0
cmpl $0x0, 0x24(%rbx)
jle 0x2eae6
xorl %r14d, %r14d
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%r14,8), %rsi
movl $0x2, %edx
movq %rbx, %rdi
callq *0x278(%rax)
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x2eac1
movl $0xb50, %edi            # imm = 0xB50
callq 0x27200
jmp 0x2e3cd
cmpl $0x0, 0x24(%rbx)
jle 0x2e3cd
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2cf82
testl %eax, %eax
je 0x2eb2d
movq (%rbx), %rax
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq *0x278(%rax)
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0x2eb02
jmp 0x2e3cd