// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Triangle.cpp
// Function: gaps::R3Triangle::R3Triangle(gaps::R3Triangle const&)
R3Triangle::
R3Triangle(const R3Triangle& triangle)
  : plane(triangle.plane),
    bbox(triangle.bbox),
    flags(triangle.flags),
    mark(0)
{
    // Copy vertices 
    if (!triangle.v[0] || triangle.v[0]->Flags()[R3_VERTEX_SHARED_FLAG]) v[0] = triangle.v[0];
    else v[0] = new R3TriangleVertex(*(triangle.v[0]));
    if (!triangle.v[1] || triangle.v[1]->Flags()[R3_VERTEX_SHARED_FLAG]) v[1] = triangle.v[1];
    else v[1] = new R3TriangleVertex(*(triangle.v[1]));
    if (!triangle.v[2] || triangle.v[2]->Flags()[R3_VERTEX_SHARED_FLAG]) v[2] = triangle.v[2];
    else v[2] = new R3TriangleVertex(*(triangle.v[2]));

    // Update the triangle
    Update();
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq 0xc0(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x9cbd0
movq 0x70(%rsp), %rdi
leaq 0xd2543(%rip), %rax     # 0x16d4a8
movq %rax, (%rdi)
addq $0x20, %rdi
movq 0xb8(%rsp), %rsi
addq $0x20, %rsi
callq 0x6c140
jmp 0x9af7f
movq 0x70(%rsp), %rdi
addq $0x40, %rdi
movq %rdi, 0x68(%rsp)
movq 0xb8(%rsp), %rsi
addq $0x40, %rsi
callq 0x428c0
jmp 0x9afa0
movq 0x70(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq 0x78(%rcx), %rcx
movq %rcx, 0x78(%rax)
movl $0x0, 0x80(%rax)
movq 0xb8(%rsp), %rcx
movb $0x1, %al
cmpq $0x0, 0x8(%rcx)
movb %al, 0x67(%rsp)
je 0x9b036
movq 0xb8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x9a5a0
movq %rax, 0x58(%rsp)
jmp 0x9afec
movq 0x58(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x98(%rsp), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x13d80
jmp 0x9b00d
movq 0x98(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x13d50
movl %eax, 0x54(%rsp)
jmp 0x9b028
movl 0x54(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x67(%rsp)
movb 0x67(%rsp), %al
testb $0x1, %al
jne 0x9b040
jmp 0x9b08c
movq 0x70(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x9b0ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x9b2fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x9b2f1
movl $0x68, %edi
callq 0xf4c0
movq %rax, 0x48(%rsp)
jmp 0x9b09d
movq 0x48(%rsp), %rdi
movq 0xb8(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x9a850
jmp 0x9b0b5
movq 0x70(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x9b0ed
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
movl $0x68, %esi
callq 0xf4d0
jmp 0x9b2f1
movq 0xb8(%rsp), %rcx
movb $0x1, %al
cmpq $0x0, 0x10(%rcx)
movb %al, 0x47(%rsp)
je 0x9b164
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x9a5a0
movq %rax, 0x38(%rsp)
jmp 0x9b11a
movq 0x38(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x88(%rsp), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x13d80
jmp 0x9b13b
movq 0x88(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x13d50
movl %eax, 0x34(%rsp)
jmp 0x9b156
movl 0x34(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x9b16e
jmp 0x9b185
movq 0x70(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x9b1e6
movl $0x68, %edi
callq 0xf4c0
movq %rax, 0x28(%rsp)
jmp 0x9b196
movq 0x28(%rsp), %rdi
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x9a850
jmp 0x9b1ae
movq 0x70(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x9b1e6
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
movl $0x68, %esi
callq 0xf4d0
jmp 0x9b2f1
movq 0xb8(%rsp), %rcx
movb $0x1, %al
cmpq $0x0, 0x18(%rcx)
movb %al, 0x27(%rsp)
je 0x9b257
movq 0xb8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x9a5a0
movq %rax, 0x18(%rsp)
jmp 0x9b213
movq 0x18(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x78(%rsp), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x13d80
jmp 0x9b231
movq 0x78(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x13d50
movl %eax, 0x14(%rsp)
jmp 0x9b249
movl 0x14(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x9b261
jmp 0x9b278
movq 0x70(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x9b2d6
movl $0x68, %edi
callq 0xf4c0
movq %rax, 0x8(%rsp)
jmp 0x9b289
movq 0x8(%rsp), %rdi
movq 0xb8(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x9a850
jmp 0x9b2a1
movq 0x70(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x9b2d6
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
movl $0x68, %esi
callq 0xf4d0
jmp 0x9b2f1
movq 0x70(%rsp), %rdi
movq (%rdi), %rax
movq 0x250(%rax), %rax
callq *%rax
jmp 0x9b2e9
addq $0xc8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x36a80
movq 0x70(%rsp), %rdi
callq 0x9cc00
movq 0xb0(%rsp), %rdi
callq 0xf890
nopw %cs:(%rax,%rax)