// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3TriangleArray.cpp
// Function: gaps::R3TriangleArray::R3TriangleArray(gaps::R3TriangleArray const&)
R3TriangleArray::
R3TriangleArray(const R3TriangleArray& array)
  : vertices(),
    triangles(),
    bbox(array.bbox),
    flags(array.flags),
    vbo_id(0),
    vbo_size(0)
{
    // Copy vertices
    for (int i = 0; i < array.vertices.NEntries(); i++) {
      R3TriangleVertex *oldv = array.vertices.Kth(i);
      R3TriangleVertex *newv = new R3TriangleVertex(*oldv);
      vertices.Insert(newv);
      newv->SetSharedFlag();
      oldv->SetMark(i);
    }

    // Copy triangles
    for (int i = 0; i < array.triangles.NEntries(); i++) {
      R3Triangle *oldt = array.triangles.Kth(i);
      R3TriangleVertex *v0 = vertices.Kth(oldt->V0()->Mark());
      R3TriangleVertex *v1 = vertices.Kth(oldt->V1()->Mark());
      R3TriangleVertex *v2 = vertices.Kth(oldt->V2()->Mark());
      R3Triangle *newt = new R3Triangle(v0, v1, v2);
      triangles.Insert(newt);
    }

    // Update everything
    Update();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x55280
leaq 0x90c92(%rip), %rax     # 0xe3208
movq %rax, (%rbx)
leaq 0x8(%rbx), %r14
movq %r14, %rdi
movq %rbx, 0x10(%rsp)
callq 0x705ec
leaq 0x18(%rbx), %rdi
movq %rdi, 0x20(%rsp)
callq 0x705ec
leaq 0x28(%rbx), %r13
leaq 0x28(%r15), %rsi
movq %r13, %rdi
callq 0x274f0
movq 0x60(%r15), %rax
movq %rax, 0x60(%rbx)
movq $0x0, 0x68(%rbx)
cmpl $0x0, 0x14(%r15)
jle 0x52609
xorl %ebx, %ebx
movq 0x8(%r15), %rax
movq (%rax,%rbx,8), %rbp
movl $0x68, %edi
callq 0xe440
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
callq 0x540c2
movq 0x10(%rsp), %rax
movl 0x14(%rax), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x70682
orb $0x1, 0x5a(%r12)
movl %ebx, 0x60(%rbp)
incq %rbx
movslq 0x14(%r15), %rax
cmpq %rax, %rbx
jl 0x525c1
movq %r13, 0x18(%rsp)
cmpl $0x0, 0x24(%r15)
jle 0x52699
xorl %ebx, %ebx
movq %r14, 0x8(%rsp)
movq %r15, %r13
movq 0x18(%r15), %rax
movq (%rax,%rbx,8), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rdx
movslq 0x60(%rcx), %rcx
movq (%r14), %rsi
movq (%rsi,%rcx,8), %rbp
movslq 0x60(%rdx), %rcx
movq (%rsi,%rcx,8), %r15
movq 0x18(%rax), %rax
movslq 0x60(%rax), %rax
movq (%rsi,%rax,8), %r14
movl $0x88, %edi
callq 0xe440
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x54628
movq 0x10(%rsp), %rax
movl 0x24(%rax), %edx
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x70682
incq %rbx
movslq 0x24(%r13), %rax
cmpq %rax, %rbx
movq 0x8(%rsp), %r14
movq %r13, %r15
jl 0x52620
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
callq *0x248(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x8(%rsp)
jmp 0x526ff
movq %r14, 0x8(%rsp)
movq %rax, %rbx
jmp 0x52719
movq %r14, 0x8(%rsp)
movq %rax, %rbx
jmp 0x52723
movq %rax, %rbx
jmp 0x5272d
movq %rax, %rbx
movl $0x88, %esi
movq %r12, %rdi
callq 0xe450
jmp 0x52702
movq %r14, 0x8(%rsp)
movq %rax, %rbx
movl $0x68, %esi
movq %r12, %rdi
callq 0xe450
jmp 0x52711
movq %rax, %rbx
movq 0x18(%rsp), %r13
jmp 0x52711
movq %r14, 0x8(%rsp)
movq %rax, %rbx
movq %r13, %rdi
callq 0x28348
movq 0x20(%rsp), %rdi
callq 0x70656
movq 0x8(%rsp), %rdi
callq 0x70656
movq 0x10(%rsp), %rdi
callq 0x5528c
movq %rbx, %rdi
callq 0xe7e0
nop