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

  // Update pick color buffer
  if (vbo_pick_color_buffer == 0) {
    glGenBuffers(1, (GLuint *) &vbo_pick_color_buffer);
    if (vbo_pick_color_buffer > 0) {
      std::vector<GLubyte> pick_colors;
      for (int i = 0; i < NPoints(); 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_pick_color_buffer);
      glBufferData(GL_ARRAY_BUFFER, pick_colors.size() * sizeof(GLubyte), &pick_colors[0], GL_STATIC_DRAW);
      glBindBuffer(GL_ARRAY_BUFFER, 0);
    }
  }

  // Return buffer object identifier
  return vbo_pick_color_buffer;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x32400
cmpl $0x0, %eax
jne 0xde01a
movl $0x0, 0x64(%rsp)
jmp 0xde1b5
movq 0x20(%rsp), %rax
cmpl $0x0, 0x114(%rax)
jne 0xde1a6
movq 0x20(%rsp), %rsi
movq 0x14af70(%rip), %rax    # 0x228fa8
movq (%rax), %rax
addq $0x114, %rsi            # imm = 0x114
movl $0x1, %edi
callq *%rax
movq 0x20(%rsp), %rax
cmpl $0x0, 0x114(%rax)
jbe 0xde1a4
leaq 0x40(%rsp), %rdi
callq 0xaf9d0
movl $0x0, 0x3c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x3c(%rsp), %eax
movl %eax, 0x18(%rsp)
callq 0x32400
movl %eax, 0x1c(%rsp)
jmp 0xde085
movl 0x18(%rsp), %eax
movl 0x1c(%rsp), %ecx
cmpl %ecx, %eax
jge 0xde11d
movl 0x3c(%rsp), %edi
movl $0xff, %esi
leaq 0x28(%rsp), %rdx
callq 0x11bcc0
jmp 0xde0aa
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xafab0
jmp 0xde0bb
leaq 0x29(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xafab0
jmp 0xde0cc
leaq 0x2a(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xafab0
jmp 0xde0dd
leaq 0x2b(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xafab0
jmp 0xde0ee
jmp 0xde0f0
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xde06d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xafa50
jmp 0xde1be
movq 0x20(%rsp), %rcx
movq 0x14ae9f(%rip), %rax    # 0x228fc8
movq (%rax), %rax
movl 0x114(%rcx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *%rax
jmp 0xde13b
movq 0x14ae96(%rip), %rax    # 0x228fd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xafa10
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0xafa30
movq 0x8(%rsp), %rsi
movq %rax, %rdx
movq 0x10(%rsp), %rax
movl $0x8892, %edi           # imm = 0x8892
movl $0x88e4, %ecx           # imm = 0x88E4
callq *%rax
jmp 0xde185
movq 0x14ae3c(%rip), %rax    # 0x228fc8
movq (%rax), %rax
movl $0x8892, %edi           # imm = 0x8892
xorl %esi, %esi
callq *%rax
jmp 0xde19a
leaq 0x40(%rsp), %rdi
callq 0xafa50
jmp 0xde1a6
movq 0x20(%rsp), %rax
movl 0x114(%rax), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x24250
nopl (%rax,%rax)