LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Line.cpp
// Function: gaps::R3Line::operator==(gaps::R3Line const&) const
const RNBoolean R3Line::
operator==(const R3Line& line) const
{
    // Check if vectors are equal
    if (vector != line.vector) return FALSE;

    // Return whether point lies on this line
    R3Vector v = vector;
    v.Cross(line.Point() - point);
    return v.IsZero();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
addq $0x18, %rsi
movq %r15, %rdi
callq 0x3d2a8
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x3c51a
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3cfd6
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3c78e
movq %r12, %rdi
movq %r15, %rsi
callq 0x3d352
movsd 0x8(%r12), %xmm0
xorpd %xmm1, %xmm1
movsd (%r12), %xmm2
cmpeqpd %xmm1, %xmm2
cmpeqpd %xmm1, %xmm0
andpd %xmm2, %xmm0
movd %xmm0, %eax
movsd 0x10(%r12), %xmm0
ucomisd %xmm1, %xmm0
setnp %cl
sete %dl
andb %cl, %dl
andb %al, %dl
movzbl %dl, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Point.cpp
// Function: gaps::R3Point::Collinear(gaps::R3Point const&, gaps::R3Point const&) const
const RNBoolean R3Point::
Collinear(const R3Point& point1, const R3Point& point2) const
{
    // Check if two of points are same
    if ((*this == point1) || (*this == point2) || (point1 == point2)) return TRUE;

    /// Check if three points are collinear
    R3Vector v = point1 - *this;
    v.Cross(point1 - point2);
    if (RNIsZero(v.Length())) return TRUE;
    return FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd (%rdi), %xmm2
movsd (%rsi), %xmm0
ucomisd %xmm0, %xmm2
jne 0x3c69d
jp 0x3c69d
movsd 0x8(%rdi), %xmm1
ucomisd 0x8(%r14), %xmm1
jne 0x3c69d
jp 0x3c69d
movsd 0x10(%rdi), %xmm1
ucomisd 0x10(%r14), %xmm1
jne 0x3c69d
jnp 0x3c77f
movsd (%rbx), %xmm1
ucomisd %xmm1, %xmm2
jne 0x3c6c9
jp 0x3c6c9
movsd 0x8(%rdi), %xmm3
ucomisd 0x8(%rbx), %xmm3
jne 0x3c6c9
jp 0x3c6c9
movsd 0x10(%rdi), %xmm3
ucomisd 0x10(%rbx), %xmm3
jne 0x3c6c9
jnp 0x3c77f
ucomisd %xmm1, %xmm0
movsd 0x8(%r14), %xmm1
jne 0x3c6f3
jp 0x3c6f3
ucomisd 0x8(%rbx), %xmm1
jne 0x3c6f3
jp 0x3c6f3
movsd 0x10(%r14), %xmm3
ucomisd 0x10(%rbx), %xmm3
jne 0x3c6f3
jnp 0x3c77f
subsd 0x8(%rdi), %xmm1
subsd %xmm2, %xmm0
movsd 0x10(%r14), %xmm2
subsd 0x10(%rdi), %xmm2
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x3cfc6
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
subsd (%rbx), %xmm0
subsd 0x8(%rbx), %xmm1
movsd 0x10(%r14), %xmm2
subsd 0x10(%rbx), %xmm2
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x3cfc6
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3d352
movq %r15, %rdi
callq 0x3d0cc
leaq 0xa9440(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
movapd 0x658bc(%rip), %xmm2    # 0xa2020
xorpd %xmm1, %xmm2
cmplepd %xmm0, %xmm2
cmplepd %xmm1, %xmm0
andpd %xmm2, %xmm0
movd %xmm0, %eax
andl $0x1, %eax
jmp 0x3c784
movl $0x1, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Point.cpp
// Function: gaps::R3Point::Project(gaps::R3Line const&)
void R3Point::
Project(const R3Line& line)
{
    // Move point to closest point on line
    const R3Point *p = &(line.Point());
    const R3Vector *v = &(line.Vector());
    RNScalar denom = v->Dot(*v);
    if (RNIsZero(denom)) return;
    RNScalar t = (v->X() * (X() - p->X()) + v->Y() *(Y() - p->Y()) + v->Z() * (Z() - p->Z())) / denom;
    *this = *p + *v * t;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsi), %r15
movq %r15, %rdi
movq %r15, %rsi
callq 0x3d252
leaq 0xa93b9(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
movapd 0x65835(%rip), %xmm2    # 0xa2020
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x3c7fb
ucomisd %xmm0, %xmm1
jae 0x3c86b
movsd (%rbx), %xmm2
movsd 0x8(%rbx), %xmm1
subsd (%r14), %xmm2
subsd 0x8(%r14), %xmm1
mulsd 0x20(%r14), %xmm1
mulsd 0x18(%r14), %xmm2
addsd %xmm1, %xmm2
movsd 0x10(%rbx), %xmm1
subsd 0x10(%r14), %xmm1
mulsd 0x28(%r14), %xmm1
addsd %xmm2, %xmm1
divsd %xmm0, %xmm1
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movapd %xmm1, %xmm0
callq 0x3d962
movsd 0x10(%r14), %xmm0
addsd 0x10(%r12), %xmm0
movupd (%r14), %xmm1
addpd (%r12), %xmm1
movupd %xmm1, (%rbx)
movsd %xmm0, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Point.cpp
// Function: gaps::R3Point::Rotate(int, double)
void R3Point:: 
Rotate(RNAxis axis, RNAngle radians)
{
    // rotate point around an axis counterclockwise
    switch (axis) {
    case RN_XAXIS: 
	XRotate(radians); 
	break;

    case RN_YAXIS: 
	YRotate(radians); 
	break;

    case RN_ZAXIS: 
	ZRotate(radians); 
	break;

    default: 
	RNWarning("Matrix rotation around undefined axis");
	break;
    }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0x2, %esi
je 0x3cb99
cmpl $0x1, %esi
je 0x3cb43
testl %esi, %esi
jne 0x3cbf5
movsd %xmm0, 0x8(%rsp)
callq 0xe860
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movupd 0x8(%rbx), %xmm1
movapd 0x65512(%rip), %xmm2    # 0xa2020
xorpd %xmm0, %xmm2
movsd 0x10(%rbx), %xmm3
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
movapd 0x10(%rsp), %xmm4
unpcklpd %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
mulpd %xmm3, %xmm2
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
addpd %xmm2, %xmm1
movupd %xmm1, 0x8(%rbx)
jmp 0x3cbef
movsd %xmm0, 0x8(%rsp)
callq 0xe860
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movsd (%rbx), %xmm1
movsd 0x10(%rbx), %xmm2
movapd %xmm0, %xmm3
mulsd %xmm2, %xmm3
movsd 0x10(%rsp), %xmm5
movapd %xmm5, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rbx)
mulsd %xmm2, %xmm5
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm5
movsd %xmm5, 0x10(%rbx)
jmp 0x3cbef
movsd %xmm0, 0x8(%rsp)
callq 0xe860
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movupd (%rbx), %xmm1
movupd 0x8(%rbx), %xmm2
movapd 0x6545b(%rip), %xmm3    # 0xa2020
xorpd %xmm0, %xmm3
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
movapd 0x10(%rsp), %xmm4
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
mulpd %xmm2, %xmm3
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
addpd %xmm3, %xmm1
movupd %xmm1, (%rbx)
addq $0x20, %rsp
popq %rbx
retq
leaq 0x6633a(%rip), %rdi     # 0xa2f36
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x71a8d
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Point.cpp
// Function: gaps::R3Point::Rotate(gaps::R3Vector const&, double)
void R3Point::
Rotate(const R3Vector& axis, RNAngle theta)
{
    // Rotate point counterclockwise around axis through origin by radians ???
    R3Vector v = Vector();
    v.Rotate(axis, theta);
    *this = v.Point();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
movsd 0x10(%rdi), %xmm2
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x3cfc6
movq %r15, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x3d772
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3d0f6
movaps (%rbx), %xmm0
movups %xmm0, (%r14)
movsd 0x10(%rbx), %xmm0
movsd %xmm0, 0x10(%r14)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Point.cpp
// Function: gaps::R3Point::Rotate(gaps::R3Line const&, double)
void R3Point::
Rotate(const R3Line& axis, RNAngle theta)
{
    // Translate axis to origin
    R3Vector v = *this - axis.Point();

    // Rotate point counterclockwise around axis through origin by radians ???
    v.Rotate(axis.Vector(), theta);

    // Translate axis back from origin
    *this = axis.Point() + v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movsd (%rdi), %xmm3
movsd 0x8(%rdi), %xmm1
subsd (%rsi), %xmm3
subsd 0x8(%rsi), %xmm1
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rdi), %xmm2
subsd 0x10(%rsi), %xmm2
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movapd %xmm3, %xmm0
callq 0x3cfc6
leaq 0x18(%r14), %rsi
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x3d772
movsd 0x10(%r14), %xmm0
addsd 0x10(%r15), %xmm0
movupd (%r14), %xmm1
addpd (%r15), %xmm1
movupd %xmm1, (%rbx)
movsd %xmm0, 0x10(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Vector.cpp
// Function: gaps::R3Vector::Sextant() const
const RNSextant R3Vector::
Sextant(void) const
{
    // Return principal direction of vector
    if (fabs(v[0]) >= fabs(v[1])) {
        if (fabs(v[0]) >= fabs(v[2])) {
            if (v[0] >= 0.0) return RN_PX_SEXTANT;
            else return RN_NX_SEXTANT;
        }
        else {
            if (v[2] >= 0.0) return RN_PZ_SEXTANT;
            else return RN_NZ_SEXTANT;
        }
    }
    else {
        if (fabs(v[1]) >= fabs(v[2])) {
            if (v[1] >= 0.0) return RN_PY_SEXTANT;
            else return RN_NY_SEXTANT;
        }
        else {
            if (v[2] >= 0.0) return RN_PZ_SEXTANT;
            else return RN_NZ_SEXTANT;
        }
    }
}

// Assembly:
movdqu (%rdi), %xmm0
movdqa 0x650da(%rip), %xmm2    # 0xa2270
movdqa %xmm0, %xmm3
pand %xmm2, %xmm3
pshufd $0xee, %xmm3, %xmm4     # xmm4 = xmm3[2,3,2,3]
ucomisd %xmm4, %xmm3
movq 0x10(%rdi), %xmm1
pand %xmm1, %xmm2
jae 0x3d1cb
ucomisd %xmm2, %xmm4
jb 0x3d1d1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
pxor %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl $0x3, %eax
jmp 0x3d1de
ucomisd %xmm2, %xmm3
jae 0x3d1e2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
movl $0x5, %eax
sbbl $0x0, %eax
retq
pxor %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setae %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Vector.cpp
// Function: gaps::R3Vector::Octant() const
const RNOctant R3Vector::
Octant(void) const
{
    // Return octant vector points into
    if (v[0] >= 0.0) {
        if (v[1] >= 0.0) {
	    if (v[2] >= 0.0) return RN_PPP_OCTANT;
            else return RN_PPN_OCTANT;
        }
	else {
	    if (v[2] >= 0.0) return RN_PNP_OCTANT;
            else return RN_PNN_OCTANT;
        }
    }
    else {
        if (v[1] >= 0.0) {
	    if (v[2] >= 0.0) return RN_NPP_OCTANT;
            else return RN_NPN_OCTANT;
        }
	else {
	    if (v[2] >= 0.0) return RN_NNP_OCTANT;
            else return RN_NNN_OCTANT;
        }
    }
}

// Assembly:
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd 0x10(%rdi), %xmm0
jae 0x3d21c
ucomisd %xmm2, %xmm1
jae 0x3d231
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setae %al
retq
ucomisd %xmm2, %xmm1
jae 0x3d240
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl $0x5, %eax
jmp 0x3d24d
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl $0x3, %eax
jmp 0x3d24d
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl $0x7, %eax
sbbl $0x0, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Vector.cpp
// Function: gaps::R3Vector::Rotate(int, double)
void R3Vector:: 
Rotate(RNAxis axis, RNAngle radians)
{
    // rotate vector around an axis counterclockwise
    switch (axis) {
    case RN_XAXIS: 
	XRotate(radians); 
	break;

    case RN_YAXIS: 
	YRotate(radians); 
	break;

    case RN_ZAXIS: 
	ZRotate(radians); 
	break;

    default: 
	RNWarning("Matrix rotation around undefined axis");
	break;
    }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0x2, %esi
je 0x3d58f
cmpl $0x1, %esi
je 0x3d539
testl %esi, %esi
jne 0x3d5eb
movsd %xmm0, 0x8(%rsp)
callq 0xe860
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movupd 0x8(%rbx), %xmm1
movapd 0x64b1c(%rip), %xmm2    # 0xa2020
xorpd %xmm0, %xmm2
movsd 0x10(%rbx), %xmm3
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
movapd 0x10(%rsp), %xmm4
unpcklpd %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
mulpd %xmm3, %xmm2
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
addpd %xmm2, %xmm1
movupd %xmm1, 0x8(%rbx)
jmp 0x3d5e5
movsd %xmm0, 0x8(%rsp)
callq 0xe860
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movsd (%rbx), %xmm1
movsd 0x10(%rbx), %xmm2
movapd %xmm0, %xmm3
mulsd %xmm2, %xmm3
movsd 0x10(%rsp), %xmm5
movapd %xmm5, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rbx)
mulsd %xmm2, %xmm5
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm5
movsd %xmm5, 0x10(%rbx)
jmp 0x3d5e5
movsd %xmm0, 0x8(%rsp)
callq 0xe860
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movupd (%rbx), %xmm1
movupd 0x8(%rbx), %xmm2
movapd 0x64a65(%rip), %xmm3    # 0xa2020
xorpd %xmm0, %xmm3
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
movapd 0x10(%rsp), %xmm4
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
mulpd %xmm2, %xmm3
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
addpd %xmm3, %xmm1
movupd %xmm1, (%rbx)
addq $0x20, %rsp
popq %rbx
retq
leaq 0x65944(%rip), %rdi     # 0xa2f36
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x71a8d
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Vector.cpp
// Function: gaps::operator%(gaps::R3Vector const&, gaps::R3Vector const&)
R3Vector 
operator%(const R3Vector& vector1, const R3Vector& vector2)
{
    // Cross product 
    R3Vector v = vector1;
    v.Cross(vector2);
    return v;
}

// Assembly:
movq %rdi, %rax
movsd (%rsi), %xmm0
movsd (%rdx), %xmm1
movupd 0x8(%rsi), %xmm2
movupd 0x8(%rdx), %xmm3
movapd %xmm2, %xmm4
shufpd $0x1, %xmm0, %xmm4      # xmm4 = xmm4[1],xmm0[0]
mulpd %xmm3, %xmm4
mulsd %xmm3, %xmm0
shufpd $0x1, %xmm1, %xmm3      # xmm3 = xmm3[1],xmm1[0]
mulpd %xmm2, %xmm3
subpd %xmm4, %xmm3
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rdi)
movupd %xmm3, (%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Vector.cpp
// Function: gaps::R3RandomDirection()
R3Vector 
R3RandomDirection(void)
{
  RNScalar phi = RN_TWO_PI * RNRandomScalar();
  RNScalar z = RNRandomScalar();
  RNScalar theta = acos(z);
  RNScalar sin_theta = sin(theta);
  RNScalar x = sin_theta * cos(phi);
  RNScalar y = sin_theta * sin(phi);
  R3Vector vector(x, y, z);
  if (RNRandomScalar() < 0.5) vector.Flip();
  return vector;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x6c309(%rip), %r14     # 0xa9fe8
callq 0x715e8
mulsd (%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x715e8
movapd %xmm0, 0x20(%rsp)
callq 0xe3f0
callq 0xe0f0
movapd %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe860
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movapd 0x30(%rsp), %xmm1
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movapd 0x10(%rsp), %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
mulpd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
movupd %xmm2, (%rbx)
movapd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rbx)
callq 0x715e8
movsd 0x642d1(%rip), %xmm1    # 0xa2030
ucomisd %xmm0, %xmm1
jbe 0x3dd8a
movapd 0x642b3(%rip), %xmm0    # 0xa2020
movapd 0x10(%rsp), %xmm1
xorpd %xmm0, %xmm1
movupd %xmm1, (%rbx)
movapd 0x20(%rsp), %xmm1
xorpd %xmm0, %xmm1
movlpd %xmm1, 0x10(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_write
PlyFile *ply_write(
  FILE *fp,
  int nelems,
  char **elem_names,
  int file_type
)
{
  int i;
  PlyFile *plyfile;
  PlyElement *elem;

  /* check for NULL file pointer */
  if (fp == NULL)
    return (NULL);

  if (native_binary_type == -1)
     get_native_binary_type();
  if (!types_checked)
     check_types();
  
  /* create a record for this object */

  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
  if (file_type == PLY_BINARY_NATIVE)
     plyfile->file_type = native_binary_type;
  else
     plyfile->file_type = file_type;
  plyfile->num_comments = 0;
  plyfile->num_obj_info = 0;
  plyfile->nelems = nelems;
  plyfile->version = 1.0;
  plyfile->fp = fp;
  plyfile->other_elems = NULL;

  /* tuck aside the names of the elements */

  plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *) * nelems);
  for (i = 0; i < nelems; i++) {
    elem = (PlyElement *) myalloc (sizeof (PlyElement));
    plyfile->elems[i] = elem;
    elem->name = my_strdup (elem_names[i]);
    elem->num = 0;
    elem->nprops = 0;
  }

  /* return pointer to the file descriptor */
  return (plyfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3de95
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r12
cmpb $0x0, 0x4a8daa(%rip)    # 0x4e6b68
jne 0x3ddc7
movb $0x1, 0x4a8da1(%rip)    # 0x4e6b68
cmpb $0x0, 0x4a8d9e(%rip)    # 0x4e6b6c
jne 0x3ddd5
callq 0x3deb2
leaq 0x6ab0f(%rip), %r13     # 0xa88eb
movl $0x50, %edi
movl $0xad, %esi
movq %r13, %rdx
callq 0x3deec
movq %rax, %r14
movzbl 0x4a8d70(%rip), %eax    # 0x4e6b68
decl %eax
orl $0x3, %eax
cmpl $0x4, %ebp
cmovnel %ebp, %eax
movl %eax, 0x8(%r14)
xorl %ebp, %ebp
movl %ebp, 0x20(%r14)
movl %ebp, 0x30(%r14)
movl %r15d, 0x10(%r14)
movl $0x3f800000, 0xc(%r14)  # imm = 0x3F800000
movq %r12, (%r14)
movq $0x0, 0x48(%r14)
leal (,%r15,8), %edi
movl $0xbb, %esi
movq %r13, %rdx
callq 0x3deec
movq %rax, 0x18(%r14)
testl %r15d, %r15d
jle 0x3de98
movq %rax, %r12
movq %r14, (%rsp)
movl %r15d, %r14d
movq %rbx, %r15
xorl %ebx, %ebx
movl $0x30, %edi
movl $0xbd, %esi
leaq 0x6aa85(%rip), %rdx     # 0xa88eb
callq 0x3deec
movq %rax, %r13
movq %rax, (%r12,%rbx,8)
movq (%r15,%rbx,8), %rdi
callq 0x3df2c
movq %rax, (%r13)
movl %ebp, 0x8(%r13)
movl %ebp, 0x10(%r13)
incq %rbx
cmpq %rbx, %r14
jne 0x3de55
movq (%rsp), %r14
jmp 0x3de98
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: my_alloc(int, int, char*)
char *my_alloc(int size, int lnum, char *fname)
{
  char *ptr;

  ptr = (char *) malloc (size);

  if (ptr == 0) {
    fprintf(stderr, "Memory allocation bombed on line %d in %s\n", lnum, fname);
  }

  return (ptr);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movslq %edi, %rdi
callq 0xe5e0
movq %rax, %r14
testq %rax, %rax
je 0x3df0d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0xa70a4(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x6af44(%rip), %rsi     # 0xa8e62
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xe670
jmp 0x3df05
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: my_strdup(char*)
char *my_strdup(char *str)
{
  // Copy a string (strdup is not part of standard)
  size_t len = strlen(str) + 1;
  void *output = malloc(len);
  if (output == NULL) return NULL;
  return (char *) memcpy (output, str, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe1e0
movq %rax, %r14
incq %r14
movq %r14, %rdi
callq 0xe5e0
testq %rax, %rax
je 0x3df60
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe370
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_open_for_writing
PlyFile *ply_open_for_writing(
  char *filename,
  int nelems,
  char **elem_names,
  int file_type,
  float *version
)
{
  PlyFile *plyfile;
  char *name;
  FILE *fp;

  /* tack on the extension .ply, if necessary */

  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
  strcpy (name, filename);
  if (strlen (name) < 4 ||
      strcmp (name + strlen (name) - 4, ".ply") != 0)
      strcat (name, ".ply");

  /* open the file for writing */

  fp = fopen (name, "w");
  if (fp == NULL) {
    return (NULL);
  }

  /* create the actual PlyFile structure */

  plyfile = ply_write (fp, nelems, elem_names, file_type);
  if (plyfile == NULL)
    return (NULL);

  /* say what PLY file version number we're writing */
  *version = plyfile->version;

  /* return pointer to the file descriptor */
  return (plyfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r13
callq 0xe1e0
leal 0x5(%rax), %edi
leaq 0x6a95b(%rip), %rdx     # 0xa88eb
movl $0xe5, %esi
callq 0x3deec
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xe3d0
movq %r12, %rdi
callq 0xe1e0
cmpq $0x4, %rax
jb 0x3dfce
leaq (%r12,%rax), %rdi
addq $-0x4, %rdi
leaq 0x643a7(%rip), %rsi     # 0xa236c
callq 0xe640
testl %eax, %eax
je 0x3dfe4
movq %r12, %rdi
callq 0xe1e0
movl $0x796c702e, (%r12,%rax) # imm = 0x796C702E
movb $0x0, 0x4(%r12,%rax)
leaq 0x697ce(%rip), %rsi     # 0xa77b9
movq %r12, %rdi
callq 0xe530
testq %rax, %rax
je 0x3e018
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3dd98
testq %rax, %rax
je 0x3e018
movss 0xc(%rax), %xmm0
movss %xmm0, (%rbx)
jmp 0x3e01a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_element
void ply_describe_element(
  PlyFile *plyfile,
  char *elem_name,
  int nelems,
  int nprops,
  PlyProperty *prop_list
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;

  /* look for appropriate element */
  elem = find_element (plyfile, elem_name);
  if (elem == NULL) {
    fprintf(stderr,"ply_describe_element: can't find element '%s'\n",elem_name);
    exit (-1);
  }

  elem->num = nelems;

  /* copy the list of properties */

  elem->nprops = nprops;
  elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *) * nprops);
  elem->store_prop = (char *) myalloc (sizeof (char) * nprops);

  for (i = 0; i < nprops; i++) {
    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
    elem->props[i] = prop;
    elem->store_prop[i] = NAMED_PROP;
    copy_property (prop, &prop_list[i]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r12
callq 0x3e0ee
testq %rax, %rax
je 0x3e0e6
movq %rax, %r14
movl %ebp, 0x8(%rax)
movl %r15d, 0x10(%rax)
leal (,%r15,8), %edi
leaq 0x6a885(%rip), %r12     # 0xa88eb
movl $0x124, %esi            # imm = 0x124
movq %r12, %rdx
callq 0x3deec
movq %rax, 0x18(%r14)
movl %r15d, %edi
movl $0x125, %esi            # imm = 0x125
movq %r12, %rdx
callq 0x3deec
movq %rax, 0x20(%r14)
testl %r15d, %r15d
jle 0x3e0d7
movl %r15d, %r12d
xorl %r13d, %r13d
leaq 0x6a84e(%rip), %r15     # 0xa88eb
movl $0x28, %edi
movl $0x128, %esi            # imm = 0x128
movq %r15, %rdx
callq 0x3deec
movq 0x18(%r14), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x20(%r14), %rcx
movb $0x1, (%rcx,%r13)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3e133
incq %r13
addq $0x28, %rbx
cmpq %r13, %r12
jne 0x3e09d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0xeac5
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: find_element(PlyFile*, char*)
PlyElement *find_element(PlyFile *plyfile, char *element)
{
  int i;

  for (i = 0; i < plyfile->nelems; i++)
    if (equal_strings (element, plyfile->elems[i]->name))
      return (plyfile->elems[i]);

  return (NULL);
}

// Assembly:
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e130
movq 0x18(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %rax
movq (%rax), %r8
xorl %r9d, %r9d
movb (%rsi,%r9), %r10b
movb (%r8,%r9), %r11b
testb %r10b, %r10b
je 0x3e123
testb %r11b, %r11b
je 0x3e123
incq %r9
cmpb %r11b, %r10b
je 0x3e107
jmp 0x3e128
cmpb %r11b, %r10b
je 0x3e132
incq %rdi
cmpq %rcx, %rdi
jne 0x3e0fd
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: copy_property(PlyProperty*, PlyProperty*)
void copy_property(PlyProperty *dest, PlyProperty *src)
{
  dest->name = my_strdup (src->name);
  dest->external_type = src->external_type;
  dest->internal_type = src->internal_type;
  dest->offset = src->offset;

  dest->is_list = src->is_list;
  dest->count_external = src->count_external;
  dest->count_internal = src->count_internal;
  dest->count_offset = src->count_offset;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
callq 0x3df2c
movq %rax, (%r14)
movups 0x8(%rbx), %xmm0
movups %xmm0, 0x8(%r14)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r14)
movl 0x20(%rbx), %eax
movl %eax, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_property
void ply_describe_property(
  PlyFile *plyfile,
  char *elem_name,
  PlyProperty *prop
)
{
  PlyElement *elem;
  PlyProperty *elem_prop;

  /* look for appropriate element */
  elem = find_element (plyfile, elem_name);
  if (elem == NULL) {
    fprintf(stderr, "ply_describe_property: can't find element '%s'\n",
            elem_name);
    return;
  }

  /* create room for new property */

  if (elem->nprops == 0) {
    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
    elem->store_prop = (char *) myalloc (sizeof (char));
    elem->nprops = 1;
  }
  else {
    elem->nprops++;
    elem->props = (PlyProperty **)
                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
    elem->store_prop = (char *)
                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
  }

  /* copy the new property */

  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
  elem->props[elem->nprops - 1] = elem_prop;
  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
  copy_property (elem_prop, prop);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
callq 0x3e0ee
testq %rax, %rax
je 0x3e234
movq %rax, %r14
movslq 0x10(%rax), %rax
testq %rax, %rax
je 0x3e1bd
leaq 0x1(%rax), %rcx
movl %ecx, 0x10(%r14)
movq 0x18(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
movq %rax, 0x18(%r14)
movq 0x20(%r14), %rdi
movslq 0x10(%r14), %rsi
callq 0xe7a0
movq %rax, 0x20(%r14)
jmp 0x3e1f8
leaq 0x6a727(%rip), %r15     # 0xa88eb
movl $0x8, %edi
movl $0x14d, %esi            # imm = 0x14D
movq %r15, %rdx
callq 0x3deec
movq %rax, 0x18(%r14)
movl $0x1, %edi
movl $0x14e, %esi            # imm = 0x14E
movq %r15, %rdx
callq 0x3deec
movq %rax, 0x20(%r14)
movl $0x1, 0x10(%r14)
leaq 0x6a6ec(%rip), %rdx     # 0xa88eb
movl $0x28, %edi
movl $0x15b, %esi            # imm = 0x15B
callq 0x3deec
movq 0x18(%r14), %rcx
movslq 0x10(%r14), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
movq 0x20(%r14), %rcx
movb $0x1, -0x1(%rcx,%rdx)
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3e133
movq 0xa6d7d(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x6a6dd(%rip), %rsi     # 0xa8922
movq %r15, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe670
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_other_properties
void ply_describe_other_properties(
  PlyFile *plyfile,
  PlyOtherProp *other,
  int offset
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;

  /* look for appropriate element */
  elem = find_element (plyfile, other->name);
  if (elem == NULL) {
    fprintf(stderr, "ply_describe_other_properties: can't find element '%s'\n",
            other->name);
    return;
  }

  /* create room for other properties */

  if (elem->nprops == 0) {
    elem->props = (PlyProperty **)
                  myalloc (sizeof (PlyProperty *) * other->nprops);
    elem->store_prop = (char *) myalloc (sizeof (char) * other->nprops);
    elem->nprops = 0;
  }
  else {
    int newsize;
    newsize = elem->nprops + other->nprops;
    elem->props = (PlyProperty **)
                  realloc (elem->props, sizeof (PlyProperty *) * newsize);
    elem->store_prop = (char *)
                  realloc (elem->store_prop, sizeof (char) * newsize);
  }

  /* copy the other properties */

  for (i = 0; i < other->nprops; i++) {
    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
    copy_property (prop, other->props[i]);
    elem->props[elem->nprops] = prop;
    elem->store_prop[elem->nprops] = OTHER_PROP;
    elem->nprops++;
  }

  /* save other info about other properties */
  elem->other_size = other->size;
  elem->other_offset = offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq (%rsi), %r12
movq %r12, %rsi
callq 0x3e0ee
testq %rax, %rax
je 0x3e361
movq %rax, %r15
movl 0x10(%rax), %eax
movl 0xc(%r14), %edi
testl %eax, %eax
je 0x3e2b5
addl %eax, %edi
movq 0x18(%r15), %rax
movslq %edi, %r12
leaq (,%r12,8), %rsi
movq %rax, %rdi
callq 0xe7a0
movq %rax, 0x18(%r15)
movq 0x20(%r15), %rdi
movq %r12, %rsi
callq 0xe7a0
movq %rax, 0x20(%r15)
jmp 0x3e2ed
shll $0x3, %edi
leaq 0x6a62c(%rip), %r12     # 0xa88eb
movl $0x17d, %esi            # imm = 0x17D
movq %r12, %rdx
callq 0x3deec
movq %rax, 0x18(%r15)
movl 0xc(%r14), %edi
movl $0x17e, %esi            # imm = 0x17E
movq %r12, %rdx
callq 0x3deec
movq %rax, 0x20(%r15)
movl $0x0, 0x10(%r15)
cmpl $0x0, 0xc(%r14)
jle 0x3e346
xorl %ebp, %ebp
leaq 0x6a5ee(%rip), %r12     # 0xa88eb
movl $0x28, %edi
movl $0x18d, %esi            # imm = 0x18D
movq %r12, %rdx
callq 0x3deec
movq %rax, %r13
movq 0x10(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %r13, %rdi
callq 0x3e133
movq 0x18(%r15), %rax
movslq 0x10(%r15), %rcx
movq %r13, (%rax,%rcx,8)
movq 0x20(%r15), %rax
movb $0x0, (%rax,%rcx)
incl 0x10(%r15)
incq %rbp
movslq 0xc(%r14), %rax
cmpq %rax, %rbp
jl 0x3e2fd
movl 0x8(%r14), %eax
movl %eax, 0x2c(%r15)
movl %ebx, 0x28(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa6c50(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x6a5e0(%rip), %rsi     # 0xa8952
movq %r12, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe670
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_element_setup
void ply_put_element_setup(PlyFile *plyfile, char *elem_name)
{
  PlyElement *elem;

  elem = find_element (plyfile, elem_name);
  if (elem == NULL) {
    fprintf(stderr, "ply_elements_setup: can't find element '%s'\n", elem_name);
    exit (-1);
  }

  plyfile->which_elem = elem;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3e0ee
testq %rax, %rax
je 0x3e5e9
movq %rax, 0x40(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0xeb53
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: get_stored_item(void*, int, int*, unsigned int*, double*)
void get_stored_item(
  void *ptr,
  int type,
  int *int_val,
  unsigned int *uint_val,
  double *double_val
)
{
  switch (type) {
    case PLY_CHAR:
      *int_val = *((char *) ptr);
      *uint_val = *int_val;
      *double_val = *int_val;
      break;
    case PLY_UCHAR:
      *uint_val = *((unsigned char *) ptr);
      *int_val = *uint_val;
      *double_val = *uint_val;
      break;
    case PLY_SHORT:
      *int_val = *((short int *) ptr);
      *uint_val = (*int_val >= 0) ? *int_val : 0;
      *double_val = *int_val;
      break;
    case PLY_USHORT:
      *uint_val = *((unsigned short int *) ptr);
      *int_val = *uint_val;
      *double_val = *uint_val;
      break;
    case PLY_INT:
      *int_val = *((int *) ptr);
      *uint_val = (*int_val >= 0) ? *int_val : 0;
      *double_val = *int_val;
      break;
    case PLY_UINT:
      *uint_val = *((unsigned int *) ptr);
      *int_val = *uint_val;
      *double_val = *uint_val;
      break;
    case PLY_FLOAT:
      *double_val = *((float *) ptr);
      *int_val = (int) *double_val;
      *uint_val = (*double_val >= 0) ? (unsigned int) *double_val : 0;
      break;
    case PLY_DOUBLE:
      *double_val = *((double *) ptr);
      *int_val = (int) *double_val;
      *uint_val = (*double_val >= 0) ? (unsigned int) *double_val : 0;
      break;
    default:
      fprintf (stderr, "get_stored_item: bad type = %d\n", type);
      exit (-1);
  }
}

// Assembly:
leal -0x1(%rsi), %eax
cmpl $0x7, %eax
ja 0x3e985
leaq 0x69eeb(%rip), %rsi     # 0xa87e0
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movsbl (%rdi), %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
jmp 0x3e94a
movzwl (%rdi), %eax
jmp 0x3e952
movl (%rdi), %eax
movl %eax, (%rdx)
xorl %esi, %esi
testl %eax, %eax
cmovgl %eax, %esi
jmp 0x3e948
movzbl (%rdi), %eax
jmp 0x3e952
movsd (%rdi), %xmm0
movsd %xmm0, (%r8)
cvttsd2si %xmm0, %eax
movl %eax, (%rdx)
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
jmp 0x3e982
movswl (%rdi), %eax
xorl %esi, %esi
testl %eax, %eax
movl %eax, (%rdx)
cmovnsl %eax, %esi
movl %esi, (%rcx)
cvtsi2sdl (%rdx), %xmm0
jmp 0x3e95d
movl (%rdi), %eax
movl %eax, (%rcx)
movl %eax, (%rdx)
movl (%rcx), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, (%r8)
retq
movss (%rdi), %xmm0
cvtss2sd %xmm0, %xmm1
movsd %xmm1, (%r8)
cvttss2si %xmm0, %eax
movl %eax, (%rdx)
xorps %xmm1, %xmm1
maxss %xmm1, %xmm0
cvttss2si %xmm0, %rax
movl %eax, (%rcx)
retq
pushq %rax
movl %esi, %edi
callq 0xeb77
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: write_binary_item(_IO_FILE*, int, int, unsigned int, double, int)
void write_binary_item(
  FILE *fp,
  int file_type,
  int int_val,
  unsigned int uint_val,
  double double_val,
  int type
)
{
  unsigned char uchar_val;
  char char_val;
  unsigned short ushort_val;
  short short_val;
  float float_val;
  void  *value;
  
  switch (type) {
    case PLY_CHAR:
      char_val = int_val;
      value = &char_val;
      break;
    case PLY_SHORT:
      short_val = int_val;
      value = &short_val;
      break;
    case PLY_INT:
      value = &int_val;
      break;
    case PLY_UCHAR:
      uchar_val = uint_val;
      value = &uchar_val;
      break;
    case PLY_USHORT:
      ushort_val = uint_val;
      value = &ushort_val;
      break;
    case PLY_UINT:
      value = &uint_val;
      break;
    case PLY_FLOAT:
      float_val = double_val;
      value = &float_val;
      break;
    case PLY_DOUBLE:
      value = &double_val;
      break;
    default:
      fprintf (stderr, "write_binary_item: bad type = %d\n", type);
      exit (-1);
  }

  if ((file_type != native_binary_type) && (ply_type_size[type] > 1))
     swap_bytes((char *)value, ply_type_size[type]);
  
  fwrite (value, ply_type_size[type], 1, fp);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, %rax
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
leal -0x1(%r8), %edi
cmpl $0x7, %edi
ja 0x3eac7
leaq 0x69df6(%rip), %r9      # 0xa8800
movslq (%r9,%rdi,4), %rdi
addq %r9, %rdi
jmpq *%rdi
leaq 0x4(%rsp), %rdi
movb %dl, (%rdi)
jmp 0x3ea5b
leaq 0x4(%rsp), %rdi
movw %cx, (%rdi)
jmp 0x3ea5b
leaq 0xc(%rsp), %rdi
jmp 0x3ea5b
leaq 0x4(%rsp), %rdi
movb %cl, (%rdi)
jmp 0x3ea5b
leaq 0x10(%rsp), %rdi
jmp 0x3ea5b
leaq 0x4(%rsp), %rdi
movw %dx, (%rdi)
jmp 0x3ea5b
leaq 0x8(%rsp), %rdi
jmp 0x3ea5b
cvtsd2ss %xmm0, %xmm0
leaq 0x4(%rsp), %rdi
movss %xmm0, (%rdi)
movzbl 0x4a8106(%rip), %ecx    # 0x4e6b68
decl %ecx
orl $0x3, %ecx
cmpl %esi, %ecx
setne %dl
movl %r8d, %ecx
leaq 0xa6ffa(%rip), %rsi     # 0xe5a70
movl (%rsi,%rcx,4), %esi
movl %esi, %ecx
cmpl $0x2, %esi
setge %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x3eab2
movl %ecx, %edx
shrl %edx
leaq (%rcx,%rdi), %rsi
decq %rsi
xorl %r8d, %r8d
movb (%rdi,%r8), %r9b
movb (%rsi), %r10b
movb %r10b, (%rdi,%r8)
movb %r9b, (%rsi)
incq %r8
decq %rsi
cmpq %r8, %rdx
jne 0x3ea99
movslq %ecx, %rsi
movl $0x1, %edx
movq %rax, %rcx
callq 0xe8b0
addq $0x18, %rsp
retq
movl %r8d, %edi
callq 0xebbd
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_comment
void ply_put_comment(PlyFile *plyfile, char *comment)
{
  /* (re)allocate space for new comment */
  if (plyfile->num_comments == 0)
    plyfile->comments = (char **) myalloc (sizeof (char *));
  else
    plyfile->comments = (char **) realloc (plyfile->comments,
                         sizeof (char *) * (plyfile->num_comments + 1));

  /* add comment to list */
  plyfile->comments[plyfile->num_comments] = my_strdup (comment);
  plyfile->num_comments++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x20(%rdi), %rax
testq %rax, %rax
je 0x3eaf5
movq 0x28(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3eb0b
leaq 0x69def(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0x294, %esi            # imm = 0x294
callq 0x3deec
movq %rax, 0x28(%rbx)
movq %r14, %rdi
callq 0x3df2c
movq 0x28(%rbx), %rcx
movslq 0x20(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_obj_info
void ply_put_obj_info(PlyFile *plyfile, char *obj_info)
{
  /* (re)allocate space for new info */
  if (plyfile->num_obj_info == 0)
    plyfile->obj_info = (char **) myalloc (sizeof (char *));
  else
    plyfile->obj_info = (char **) realloc (plyfile->obj_info,
                         sizeof (char *) * (plyfile->num_obj_info + 1));

  /* add info to list */
  plyfile->obj_info[plyfile->num_obj_info] = my_strdup (obj_info);
  plyfile->num_obj_info++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x30(%rdi), %rax
testq %rax, %rax
je 0x3eb57
movq 0x38(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3eb6d
leaq 0x69d8d(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0x2ac, %esi            # imm = 0x2AC
callq 0x3deec
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x3df2c
movq 0x38(%rbx), %rcx
movslq 0x30(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: equal_strings
int equal_strings(const char *s1, const char *s2)
{

  while (*s1 && *s2)
    if (*s1++ != *s2++)
      return (0);

  if (*s1 != *s2)
    return (0);
  else
    return (1);
}

// Assembly:
xorl %eax, %eax
movb (%rdi,%rax), %cl
movb (%rsi,%rax), %dl
testb %cl, %cl
je 0x3f13b
testb %dl, %dl
je 0x3f13b
incq %rax
cmpb %dl, %cl
je 0x3f123
xorl %eax, %eax
retq
xorl %eax, %eax
cmpb %dl, %cl
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: add_element(PlyFile*, char**)
void add_element (PlyFile *plyfile, char **words)
{
  PlyElement *elem;

  /* create the new element */
  elem = (PlyElement *) myalloc (sizeof (PlyElement));
  elem->name = my_strdup (words[1]);
  elem->num = atoi (words[2]);
  elem->nprops = 0;

  /* make room for new element in the object's list of elements */
  if (plyfile->nelems == 0)
    plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *));
  else
    plyfile->elems = (PlyElement **) realloc (plyfile->elems,
                     sizeof (PlyElement *) * (plyfile->nelems + 1));

  /* add the new element to the object's list */
  plyfile->elems[plyfile->nelems] = elem;
  plyfile->nelems++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x69796(%rip), %rdx     # 0xa88eb
movl $0x30, %edi
movl $0xa00, %esi            # imm = 0xA00
callq 0x3deec
movq %rax, %r14
movq 0x8(%r15), %rdi
callq 0x3df2c
movq %rax, (%r14)
movq 0x10(%r15), %rdi
callq 0xe700
movl %eax, 0x8(%r14)
movl $0x0, 0x10(%r14)
movslq 0x10(%rbx), %rax
testq %rax, %rax
je 0x3f1a4
movq 0x18(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3f1ba
leaq 0x69740(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0xa07, %esi            # imm = 0xA07
callq 0x3deec
movq %rax, 0x18(%rbx)
movslq 0x10(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: add_property(PlyFile*, char**)
void add_property (PlyFile *plyfile, char **words)
{
  PlyProperty *prop;
  PlyElement *elem;

  /* create the new property */

  prop = (PlyProperty *) myalloc (sizeof (PlyProperty));

  if (equal_strings (words[1], "list")) {       /* is a list */
    prop->count_external = get_prop_type (words[2]);
    prop->external_type = get_prop_type (words[3]);
    prop->name = my_strdup (words[4]);
    prop->is_list = 1;
  }
  else {                                        /* not a list */
    prop->external_type = get_prop_type (words[1]);
    prop->name = my_strdup (words[2]);
    prop->is_list = 0;
  }

  /* add this property to the list of properties of the current element */

  elem = plyfile->elems[plyfile->nelems - 1];

  if (elem->nprops == 0)
    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
  else
    elem->props = (PlyProperty **) realloc (elem->props,
                  sizeof (PlyProperty *) * (elem->nprops + 1));

  elem->props[elem->nprops] = prop;
  elem->nprops++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x69704(%rip), %rdx     # 0xa88eb
movl $0x28, %edi
movl $0xa44, %esi            # imm = 0xA44
callq 0x3deec
movq %rax, %rbx
movq 0x8(%r15), %rdi
xorl %eax, %eax
leaq 0x69c57(%rip), %rcx     # 0xa8e5d
movb (%rdi,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x3f220
testb %sil, %sil
je 0x3f220
incq %rax
cmpb %sil, %dl
je 0x3f206
jmp 0x3f242
cmpb %sil, %dl
jne 0x3f242
movq 0x10(%r15), %rdi
callq 0x40310
movl %eax, 0x18(%rbx)
movq 0x18(%r15), %rdi
movl $0x1, %ebp
movl $0x20, %r12d
jmp 0x3f24a
xorl %ebp, %ebp
movl $0x10, %r12d
callq 0x40310
movl %eax, 0x8(%rbx)
movq (%r15,%r12), %rdi
callq 0x3df2c
movq %rax, (%rbx)
movl %ebp, 0x14(%rbx)
movq 0x18(%r14), %rax
movslq 0x10(%r14), %rcx
movq -0x8(%rax,%rcx,8), %r14
movslq 0x10(%r14), %rax
testq %rax, %rax
je 0x3f28a
movq 0x18(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3f2a0
leaq 0x6965a(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0xa57, %esi            # imm = 0xA57
callq 0x3deec
movq %rax, 0x18(%r14)
movslq 0x10(%r14), %rcx
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_open_for_reading
PlyFile *ply_open_for_reading(
  char *filename,
  int *nelems,
  char ***elem_names,
  int *file_type,
  float *version
)
{
  FILE *fp;
  PlyFile *plyfile;
  char *name;

  /* tack on the extension .ply, if necessary */

  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
  strcpy (name, filename);
  if (strlen (name) < 4 ||
      strcmp (name + strlen (name) - 4, ".ply") != 0)
      strcat (name, ".ply");

  /* open the file for reading */

  fp = fopen (name, "r");
  if (fp == NULL)
    return (NULL);

  /* create the PlyFile data structure */

  plyfile = ply_read (fp, nelems, elem_names);

  /* determine the file type and version */

  *file_type = plyfile->file_type;
  *version = plyfile->version;

  /* return a pointer to the file's information */

  return (plyfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbp
callq 0xe1e0
leal 0x5(%rax), %edi
leaq 0x695d2(%rip), %rdx     # 0xa88eb
movl $0x365, %esi            # imm = 0x365
callq 0x3deec
movq %rax, %r13
movq %rax, %rdi
movq %rbp, %rsi
callq 0xe3d0
movq %r13, %rdi
callq 0xe1e0
cmpq $0x4, %rax
jb 0x3f357
leaq (%rax,%r13), %rdi
addq $-0x4, %rdi
leaq 0x6301e(%rip), %rsi     # 0xa236c
callq 0xe640
testl %eax, %eax
je 0x3f36e
movq %r13, %rdi
callq 0xe1e0
movl $0x796c702e, (%r13,%rax) # imm = 0x796C702E
movb $0x0, 0x4(%r13,%rax)
leaq 0x6ca5e(%rip), %rsi     # 0xabdd3
movq %r13, %rdi
callq 0xe530
testq %rax, %rax
je 0x3f3a1
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3eb93
movl 0x8(%rax), %ecx
movl %ecx, (%r14)
movss 0xc(%rax), %xmm0
movss %xmm0, (%rbx)
jmp 0x3f3a3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_get_element_description
PlyProperty **ply_get_element_description(
  PlyFile *plyfile,
  char *elem_name,
  int *nelems,
  int *nprops
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;
  PlyProperty **prop_list;

  /* find information about the element */
  elem = find_element (plyfile, elem_name);
  if (elem == NULL)
    return (NULL);

  *nelems = elem->num;
  *nprops = elem->nprops;

  /* make a copy of the element's property list */
  prop_list = (PlyProperty **) myalloc (sizeof (PlyProperty *) * elem->nprops);
  for (i = 0; i < elem->nprops; i++) {
    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
    copy_property (prop, elem->props[i]);
    prop_list[i] = prop;
  }

  /* return this duplicate property list */
  return (prop_list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
callq 0x3e0ee
testq %rax, %rax
je 0x3f438
movq %rax, %rbx
movl 0x8(%rax), %eax
movl %eax, (%r15)
movl 0x10(%rbx), %edi
movl %edi, (%r14)
shll $0x3, %edi
leaq 0x69507(%rip), %rdx     # 0xa88eb
movl $0x3a2, %esi            # imm = 0x3A2
callq 0x3deec
movq %rax, %r14
cmpl $0x0, 0x10(%rbx)
jle 0x3f43b
xorl %r13d, %r13d
leaq 0x694ea(%rip), %r15     # 0xa88eb
movl $0x28, %edi
movl $0x3a4, %esi            # imm = 0x3A4
movq %r15, %rdx
callq 0x3deec
movq %rax, %r12
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
callq 0x3e133
movq %r12, (%r14,%r13,8)
incq %r13
movslq 0x10(%rbx), %rax
cmpq %rax, %r13
jl 0x3f401
jmp 0x3f43b
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_get_element_setup
void ply_get_element_setup(
  PlyFile *plyfile,
  char *elem_name,
  int nprops,
  PlyProperty *prop_list
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;
  int index;

  /* find information about the element */
  elem = find_element (plyfile, elem_name);
  plyfile->which_elem = elem;

  /* deposit the property information into the element's description */
  for (i = 0; i < nprops; i++) {

    /* look for actual property */
    prop = find_property (elem, prop_list[i].name, &index);
    if (prop == NULL) {
      fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
               prop_list[i].name, elem_name);
      continue;
    }

    /* store its description */
    prop->internal_type = prop_list[i].internal_type;
    prop->offset = prop_list[i].offset;
    prop->count_internal = prop_list[i].count_internal;
    prop->count_offset = prop_list[i].count_offset;

    /* specify that the user wants this property */
    elem->store_prop[index] = STORE_PROP;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r12
movq %rsi, 0x10(%rsp)
callq 0x3e0ee
movq %rax, 0x40(%r12)
testl %ebp, %ebp
jle 0x3f4e9
movq %rax, %r15
movl %ebp, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %r13
leaq 0xc(%rsp), %r12
xorl %r14d, %r14d
movq (%rbx,%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x3f4f8
testq %rax, %rax
je 0x3f4c7
movq 0xc(%rbx,%r14), %rcx
movq %rcx, 0xc(%rax)
movq 0x1c(%rbx,%r14), %rcx
movq %rcx, 0x1c(%rax)
movq 0x20(%r15), %rax
movslq 0xc(%rsp), %rcx
movb $0x1, (%rax,%rcx)
addq $0x28, %r14
cmpq %r14, %r13
jne 0x3f486
jmp 0x3f4e9
movq 0xa5aea(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x696d9(%rip), %rsi     # 0xa8bb1
movq %rbp, %rdx
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0xe670
jmp 0x3f4bc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq