// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DrawVertices(gaps::RNFlags) const
void R3Mesh::
DrawVertices(const RNFlags draw_flags) const
{
  // Bind position buffer
  if (GLVertexPositionBufferObject() <= 0) return;
  glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_position_buffer);
  glVertexPointer(3, GL_FLOAT, 0, 0);
  glEnableClientState(GL_VERTEX_ARRAY);
  
  // Bind vertex normal buffer
  if (draw_flags[R3_VERTEX_NORMALS_DRAW_FLAG]) {
    if (GLVertexNormalBufferObject() > 0) {
      glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_normal_buffer);
      glNormalPointer(GL_FLOAT, 0, 0);
      glEnableClientState(GL_NORMAL_ARRAY);
    }
  }
  
  // Bind vertex texcoord buffer
  if (draw_flags & R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG) {  
    if (GLVertexTextureCoordBufferObject() > 0) {
      glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_texcoord_buffer);
      glTexCoordPointer(2, GL_FLOAT, 0, 0);
      glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    }
  }
  
  // Bind vertex color buffer
  if (draw_flags[R3_VERTEX_PICK_DRAW_FLAG]) {
    if (GLVertexPickColorBufferObject() > 0) {
      glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_pick_color_buffer);
      glColorPointer(4, GL_UNSIGNED_BYTE, 0, 0);
      glEnableClientState(GL_COLOR_ARRAY);
    }
  }
  else if (draw_flags[R3_VERTEX_COLORS_DRAW_FLAG]) {
    if (GLVertexRgbColorBufferObject() > 0) {
      glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_rgb_color_buffer);
      glColorPointer(4, GL_UNSIGNED_BYTE, 0, 0);
      glEnableClientState(GL_COLOR_ARRAY);
    }
  }
  
  // Draw vertices
  glDrawArrays(GL_POINTS, 0, NVertices());

  // Reset everything
  glBindBuffer(GL_ARRAY_BUFFER, 0);
  glDisableClientState(GL_VERTEX_ARRAY);
  glDisableClientState(GL_NORMAL_ARRAY);
  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
  glDisableClientState(GL_COLOR_ARRAY);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x268(%rax)
testl %eax, %eax
je 0x19d21
movq 0xcb34b(%rip), %r15     # 0xe4fa8
movl 0x64(%rbx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *(%r15)
movl $0x3, %edi
movl $0x1406, %esi           # imm = 0x1406
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe470
movl $0x8074, %edi           # imm = 0x8074
callq 0xe2c0
btl $0x8, %r14d
jae 0x19cbf
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x270(%rax)
testl %eax, %eax
je 0x19cbf
movl 0x68(%rbx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *(%r15)
movl $0x1406, %edi           # imm = 0x1406
xorl %esi, %esi
xorl %edx, %edx
callq 0xe7c0
movl $0x8075, %edi           # imm = 0x8075
callq 0xe2c0
btl $0x9, %r14d
jae 0x19cfe
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x278(%rax)
testl %eax, %eax
je 0x19cfe
movl 0x6c(%rbx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *(%r15)
movl $0x2, %edi
movl $0x1406, %esi           # imm = 0x1406
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe8e0
movl $0x8078, %edi           # imm = 0x8078
callq 0xe2c0
btl $0xb, %r14d
jb 0x19d27
btl $0xa, %r14d
jae 0x19d5f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x280(%rax)
testl %eax, %eax
je 0x19d5f
movl 0x70(%rbx), %esi
jmp 0x19d3a
popq %rbx
popq %r14
popq %r15
retq
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x288(%rax)
testl %eax, %eax
je 0x19d5f
movl 0x74(%rbx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *(%r15)
movl $0x4, %edi
movl $0x1401, %esi           # imm = 0x1401
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe460
movl $0x8076, %edi           # imm = 0x8076
callq 0xe2c0
movl 0x14(%rbx), %edx
xorl %edi, %edi
xorl %esi, %esi
callq 0xe060
movl $0x8892, %edi           # imm = 0x8892
xorl %esi, %esi
callq *(%r15)
movl $0x8074, %edi           # imm = 0x8074
callq 0xe2a0
movl $0x8075, %edi           # imm = 0x8075
callq 0xe2a0
movl $0x8078, %edi           # imm = 0x8078
callq 0xe2a0
movl $0x8076, %edi           # imm = 0x8076
popq %rbx
popq %r14
popq %r15
jmp 0xe2a0