// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::GLVertexPickColorBufferObject() const
unsigned int R3Mesh::
GLVertexPickColorBufferObject(void) const
{
  // Check if nothing to be done
  if (NVertices() == 0) return 0;

  // Update pick color buffer
  if (vbo_vertex_pick_color_buffer == 0) {
    glGenBuffers(1, (GLuint *) &vbo_vertex_pick_color_buffer);
    if (vbo_vertex_pick_color_buffer > 0) {
      std::vector<GLubyte> pick_colors;
      for (int i = 0; i < NVertices(); i++) {
        unsigned char pick_color[4];
        EncodePickColor(i, 255, pick_color);
        pick_colors.push_back(pick_color[0]);
        pick_colors.push_back(pick_color[1]);
        pick_colors.push_back(pick_color[2]);
        pick_colors.push_back(pick_color[3]);
      }
      glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_pick_color_buffer);
      glBufferData(GL_ARRAY_BUFFER, pick_colors.size() * sizeof(GLubyte), &pick_colors[0], GL_STATIC_DRAW);
      glBindBuffer(GL_ARRAY_BUFFER, 0);
    }
  }

  // Return pick color buffer identifier
  return vbo_vertex_pick_color_buffer;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x135e0
cmpl $0x0, %eax
jne 0x2381a
movl $0x0, 0x64(%rsp)
jmp 0x239a6
movq 0x20(%rsp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x2399a
movq 0x20(%rsp), %rsi
movq 0x14b773(%rip), %rax    # 0x16efa8
movq (%rax), %rax
addq $0x74, %rsi
movl $0x1, %edi
callq *%rax
movq 0x20(%rsp), %rax
cmpl $0x0, 0x74(%rax)
jbe 0x23998
leaq 0x40(%rsp), %rdi
callq 0x38c70
movl $0x0, 0x3c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x3c(%rsp), %eax
movl %eax, 0x18(%rsp)
callq 0x135e0
movl %eax, 0x1c(%rsp)
jmp 0x2387c
movl 0x18(%rsp), %eax
movl 0x1c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x23914
movl 0x3c(%rsp), %edi
movl $0xff, %esi
leaq 0x28(%rsp), %rdx
callq 0xd0f00
jmp 0x238a1
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x38d80
jmp 0x238b2
leaq 0x29(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x38d80
jmp 0x238c3
leaq 0x2a(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x38d80
jmp 0x238d4
leaq 0x2b(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x38d80
jmp 0x238e5
jmp 0x238e7
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x23864
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x38d20
jmp 0x239af
movq 0x20(%rsp), %rcx
movq 0x14b6a0(%rip), %rax    # 0x16efc0
movq (%rax), %rax
movl 0x74(%rcx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *%rax
jmp 0x2392f
movq 0x14b69a(%rip), %rax    # 0x16efd0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x38ce0
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x38d00
movq 0x8(%rsp), %rsi
movq %rax, %rdx
movq 0x10(%rsp), %rax
movl $0x8892, %edi           # imm = 0x8892
movl $0x88e4, %ecx           # imm = 0x88E4
callq *%rax
jmp 0x23979
movq 0x14b640(%rip), %rax    # 0x16efc0
movq (%rax), %rax
movl $0x8892, %edi           # imm = 0x8892
xorl %esi, %esi
callq *%rax
jmp 0x2398e
leaq 0x40(%rsp), %rdi
callq 0x38d20
jmp 0x2399a
movq 0x20(%rsp), %rax
movl 0x74(%rax), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xf890
nopl (%rax)