// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::GLVertexPositionBufferObject() const
unsigned int R3Mesh::
GLVertexPositionBufferObject(void) const
{
  // Check if nothing to be done
  if (NVertices() == 0) return 0;
  
  // Update position buffer
  if (vbo_vertex_position_buffer == 0) {
    glGenBuffers(1, (GLuint *) &vbo_vertex_position_buffer);
    if (vbo_vertex_position_buffer > 0) {
      std::vector<GLfloat> positions;
      for (int i = 0; i < NVertices(); i++) {
        R3MeshVertex *vertex = Vertex(i);
        const R3Point& position = VertexPosition(vertex);
        positions.push_back(position.X());
        positions.push_back(position.Y());
        positions.push_back(position.Z());
      }
      glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_position_buffer);
      glBufferData(GL_ARRAY_BUFFER, positions.size() * sizeof(GLfloat), &positions[0], GL_STATIC_DRAW);
      glBindBuffer(GL_ARRAY_BUFFER, 0);
    }
  }

  // Return position buffer identifier
  return vbo_vertex_position_buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x14(%rdi)
je 0x19363
movq %rdi, %r14
leaq 0x64(%rdi), %rbx
cmpl $0x0, 0x64(%rdi)
je 0x19374
movl (%rbx), %eax
jmp 0x19365
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xcbc0d(%rip), %rax     # 0xe4f88
movl $0x1, %edi
movq %rbx, %rsi
callq *(%rax)
cmpl $0x0, (%rbx)
je 0x1935f
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
cmpl $0x0, 0x14(%r14)
jle 0x19467
xorl %r13d, %r13d
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq 0x8(%r14), %rax
movq (%rax,%r13,8), %rbp
xorps %xmm0, %xmm0
cvtsd2ss 0x18(%rbp), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x193e4
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x193ef
movq %r15, %rdi
movq %r12, %rdx
callq 0x256b8
xorps %xmm0, %xmm0
cvtsd2ss 0x20(%rbp), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x19418
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x19423
movq %r15, %rdi
movq %r12, %rdx
callq 0x256b8
xorps %xmm0, %xmm0
cvtsd2ss 0x28(%rbp), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1944c
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x19457
movq %r15, %rdi
movq %r12, %rdx
callq 0x256b8
incq %r13
movslq 0x14(%r14), %rax
cmpq %rax, %r13
jl 0x193b3
movq 0xcbb3a(%rip), %r14     # 0xe4fa8
movl (%rbx), %esi
movl $0x8892, %edi           # imm = 0x8892
callq *(%r14)
movq 0xcbb41(%rip), %rax     # 0xe4fc0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
subq %rdx, %rsi
movl $0x8892, %edi           # imm = 0x8892
movl $0x88e4, %ecx           # imm = 0x88E4
callq *(%rax)
movl $0x8892, %edi           # imm = 0x8892
xorl %esi, %esi
callq *(%r14)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1935f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xe450
jmp 0x1935f
jmp 0x194c8
jmp 0x194c8
jmp 0x194c8
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x194e2
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xe450
movq %rbx, %rdi
callq 0xe7e0