LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3PointLight.cpp
// Function: gaps::R3PointLight::IntensityAtPoint(gaps::R3Point const&) const
RNScalar R3PointLight::
IntensityAtPoint(const R3Point& point) const
{
    // Return intensity at point
    if (!IsActive()) return 0.0;
    RNLength d = R3Distance(point, position);
    RNScalar denom = constant_attenuation;
    denom += d * linear_attenuation;
    denom += d * d * quadratic_attenuation;
    if (RNIsZero(denom)) return Intensity();
    else return (Intensity() / denom);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x60940
cmpl $0x0, %eax
jne 0x615b0
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0x61660
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rdi
addq $0x50, %rsi
callq 0x779c0
movq 0x8(%rsp), %rax
movsd %xmm0, 0x18(%rsp)
movsd 0x68(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x70(%rax), %xmm2
movsd 0x10(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd 0x78(%rax), %xmm2
movsd 0x10(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
leaq 0x194c7e(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x48790
cmpl $0x0, %eax
je 0x6164a
movq 0x8(%rsp), %rdi
callq 0x60980
movsd %xmm0, 0x30(%rsp)
jmp 0x61660
movq 0x8(%rsp), %rdi
callq 0x60980
divsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3PointLight.cpp
// Function: gaps::R3PointLight::RadiusOfInfluence(double) const
RNScalar R3PointLight::
RadiusOfInfluence(RNScalar intensity_threshhold) const
{
    // Return distance beyond which intensity is below threshold
    // kq*d^2 + kl*d + (kc - 1/a) = 0 (use quadratic formula)
    if (!IsActive()) return 0.0;
    if (RNIsZero(Intensity())) return 0.0;
    if (RNIsZero(intensity_threshhold)) return RN_INFINITY;
    RNScalar A = quadratic_attenuation;
    RNScalar B = linear_attenuation;
    RNScalar C = constant_attenuation - Intensity() / intensity_threshhold;
    RNScalar radius = (-B + sqrt(B*B - 4.0*A*C)) / (2.0*A);
    return radius;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movsd %xmm0, 0x40(%rsp)
movq 0x48(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x60940
cmpl $0x0, %eax
jne 0x616f1
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x6182b
movq 0x18(%rsp), %rdi
callq 0x60980
leaq 0x194ba6(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x48790
cmpl $0x0, %eax
je 0x6171e
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x6182b
movsd 0x40(%rsp), %xmm0
leaq 0x194b7d(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x48790
cmpl $0x0, %eax
je 0x6174f
leaq 0x194b78(%rip), %rax    # 0x1f62b8
movsd (%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x6182b
movq 0x18(%rsp), %rdi
movsd 0x78(%rdi), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x70(%rdi), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x68(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x60980
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd 0x40(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x30(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x30(%rsp), %xmm2
movsd 0x12e4c6(%rip), %xmm1   # 0x18fc90
mulsd 0x38(%rsp), %xmm1
mulsd 0x28(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x22780
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd 0x12c841(%rip), %xmm1   # 0x18e050
mulsd 0x38(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x50(%rsp), %xmm0
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3PointLight.cpp
// Function: gaps::R3PointLight::DiffuseReflection(gaps::R3Brdf const&, gaps::R3Point const&, gaps::R3Vector const&) const
RNRgb R3PointLight::
DiffuseReflection(const R3Brdf& brdf, 
    const R3Point& point, const R3Vector& normal) const
{
    // Check if light is active
    if (!IsActive()) return RNblack_rgb;

    // Get material properties
    const RNRgb& Dc = brdf.Diffuse();

    // Get light properties
    const RNRgb& Ic = Color();
    RNScalar I = IntensityAtPoint(point);
    R3Vector L = DirectionFromPoint(point);

    // Compute geometric stuff
    RNScalar NL = normal.Dot(L);
    if (RNIsNegativeOrZero(NL)) return RNblack_rgb;

    // Return diffuse component of reflection
    return (I * NL) * Dc * Ic;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq 0x88(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x60940
cmpl $0x0, %eax
jne 0x61903
movq 0x8(%rsp), %rdi
leaq 0x19e28f(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x619c4
movq 0x80(%rsp), %rdi
callq 0x48930
movq 0x18(%rsp), %rdi
movq %rax, 0x68(%rsp)
callq 0x2ba40
movq 0x18(%rsp), %rdi
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rsi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x18(%rsp), %rsi
movsd %xmm0, 0x58(%rsp)
movq 0x78(%rsp), %rdx
movq (%rsi), %rax
leaq 0x40(%rsp), %rdi
callq *0xb0(%rax)
movq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xcdfe0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
leaq 0x194934(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x49e40
cmpl $0x0, %eax
je 0x61995
movq 0x8(%rsp), %rdi
leaq 0x19e1fa(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x619c4
movsd 0x58(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
movq 0x68(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x60a00
movq 0x8(%rsp), %rdi
movq 0x60(%rsp), %rdx
leaq 0x20(%rsp), %rsi
callq 0x60990
movq 0x10(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3PointLight.cpp
// Function: gaps::R3PointLight::SpecularReflection(gaps::R3Brdf const&, gaps::R3Point const&, gaps::R3Point const&, gaps::R3Vector const&) const
RNRgb R3PointLight::
SpecularReflection(const R3Brdf& brdf, const R3Point& eye, 
    const R3Point& point, const R3Vector& normal) const
{
    // Check if light is active
    if (!IsActive()) return RNblack_rgb;

    // Get material properties
    const RNRgb& Sc = brdf.Specular();
    RNScalar s = brdf.Shininess();

    // Get light properties
    const RNRgb& Ic = Color();
    RNScalar I = IntensityAtPoint(point);
    R3Vector L = DirectionFromPoint(point);

    // Compute geometric stuff
    RNScalar NL = normal.Dot(L);
    if (RNIsNegativeOrZero(NL)) return RNblack_rgb;
    R3Vector R = (2.0 * NL) * normal - L;
    R3Vector V = eye - point;
    V.Normalize();
    RNScalar VR = V.Dot(R);
    if (RNIsNegativeOrZero(VR)) return RNblack_rgb;

    // Return specular component of reflection
    return (I * pow(VR,s)) * Sc * Ic;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq %rdx, 0xe0(%rsp)
movq %rcx, 0xd8(%rsp)
movq %r8, 0xd0(%rsp)
movq %r9, 0xc8(%rsp)
movq 0xe8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x60940
cmpl $0x0, %eax
jne 0x61a51
movq 0x8(%rsp), %rdi
leaq 0x19e141(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x61c12
movq 0xe0(%rsp), %rdi
callq 0x48980
movq %rax, 0xc0(%rsp)
movq 0xe0(%rsp), %rdi
callq 0x48ae0
movq 0x18(%rsp), %rdi
movsd %xmm0, 0xb8(%rsp)
callq 0x2ba40
movq 0x18(%rsp), %rdi
movq %rax, 0xb0(%rsp)
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x18(%rsp), %rsi
movsd %xmm0, 0xa8(%rsp)
movq 0xd0(%rsp), %rdx
movq (%rsi), %rax
leaq 0x90(%rsp), %rdi
callq *0xb0(%rax)
movq 0xc8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xcdfe0
movsd %xmm0, 0x88(%rsp)
movsd 0x88(%rsp), %xmm0
leaq 0x1947b2(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x49e40
cmpl $0x0, %eax
je 0x61b1a
movq 0x8(%rsp), %rdi
leaq 0x19e078(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x61c12
movsd 0x12c52e(%rip), %xmm0   # 0x18e050
mulsd 0x88(%rsp), %xmm0
movq 0xc8(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x2b630
leaq 0x70(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0xcedc0
movq 0xd8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0xccbd0
leaq 0x40(%rsp), %rdi
callq 0xce130
leaq 0x40(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xcdfe0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
leaq 0x19470e(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x49e40
cmpl $0x0, %eax
je 0x61bbb
movq 0x8(%rsp), %rdi
leaq 0x19dfd4(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x61c12
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x38(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
callq 0x23260
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0xc0(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x60a00
movq 0x8(%rsp), %rdi
movq 0xb0(%rsp), %rdx
leaq 0x20(%rsp), %rsi
callq 0x60990
movq 0x10(%rsp), %rax
addq $0xf8, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3DirectionalLight.cpp
// Function: gaps::R3DirectionalLight::DiffuseReflection(gaps::R3Brdf const&, gaps::R3Point const&, gaps::R3Vector const&) const
RNRgb R3DirectionalLight::
DiffuseReflection(const R3Brdf& brdf, 
    const R3Point& point, const R3Vector& normal) const
{
    // Check if light is active
    if (!IsActive()) return RNblack_rgb;

    // Get material properties
    const RNRgb& Dc = brdf.Diffuse();

    // Get light properties
    const RNRgb& Ic = Color();
    RNScalar I = Intensity();
    R3Vector L = -(Direction());

    // Compute geometric stuff
    RNScalar NL = normal.Dot(L);
    if (RNIsNegativeOrZero(NL)) return RNblack_rgb;

    // Return diffuse component of reflection
    return (I * NL) * Dc * Ic;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq 0x88(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x60940
cmpl $0x0, %eax
jne 0x62543
movq 0x8(%rsp), %rdi
leaq 0x19d64f(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x625fd
movq 0x80(%rsp), %rdi
callq 0x48930
movq 0x18(%rsp), %rdi
movq %rax, 0x68(%rsp)
callq 0x2ba40
movq 0x18(%rsp), %rdi
movq %rax, 0x60(%rsp)
callq 0x60980
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x58(%rsp)
callq 0x2ba50
movq %rax, %rsi
leaq 0x40(%rsp), %rdi
callq 0xcecc0
movq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xcdfe0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
leaq 0x193cfb(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm1
callq 0x49e40
cmpl $0x0, %eax
je 0x625ce
movq 0x8(%rsp), %rdi
leaq 0x19d5c1(%rip), %rsi    # 0x1ffb88
callq 0xef300
jmp 0x625fd
movsd 0x58(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
movq 0x68(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x60a00
movq 0x8(%rsp), %rdi
movq 0x60(%rsp), %rdx
leaq 0x20(%rsp), %rsi
callq 0x60990
movq 0x10(%rsp), %rax
addq $0x98, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3DirectionalLight.cpp
// Function: gaps::R3DirectionalLight::Draw(int) const
void R3DirectionalLight::
Draw(int i) const
{
    // Draw light
    GLenum index = (GLenum) (GL_LIGHT0 + i);
    if (index > GL_LIGHT7) return;
    GLfloat buffer[4];
    buffer[0] = Intensity() * Color().R();
    buffer[1] = Intensity() * Color().G();
    buffer[2] = Intensity() * Color().B();
    buffer[3] = 1.0;
    glLightfv(index, GL_DIFFUSE, buffer);
    glLightfv(index, GL_SPECULAR, buffer);
    buffer[0] = -(Direction().X());
    buffer[1] = -(Direction().Y());
    buffer[2] = -(Direction().Z());
    buffer[3] = 0.0;
    glLightfv(index, GL_POSITION, buffer);
    buffer[0] = 180.0;
    glLightf(index, GL_SPOT_CUTOFF, buffer[0]);
    glEnable(index);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x3c(%rsp), %eax
addl $0x4000, %eax           # imm = 0x4000
movl %eax, 0x38(%rsp)
cmpl $0x4007, 0x38(%rsp)     # imm = 0x4007
jbe 0x62b13
jmp 0x62cd0
movq 0x18(%rsp), %rdi
callq 0x60980
movq 0x18(%rsp), %rdi
movsd %xmm0, (%rsp)
callq 0x2ba40
movq %rax, %rdi
callq 0x2b4a0
movq 0x18(%rsp), %rdi
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
callq 0x60980
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x2ba40
movq %rax, %rdi
callq 0x2b4b0
movq 0x18(%rsp), %rdi
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
callq 0x60980
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x2ba40
movq %rax, %rdi
callq 0x2b4c0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x12b4c4(%rip), %xmm0   # 0x18e088
movss %xmm0, 0x2c(%rsp)
movl 0x38(%rsp), %edi
leaq 0x20(%rsp), %rdx
movl $0x1201, %esi           # imm = 0x1201
callq 0x23270
movl 0x38(%rsp), %edi
leaq 0x20(%rsp), %rdx
movl $0x1202, %esi           # imm = 0x1202
callq 0x23270
movq 0x18(%rsp), %rdi
callq 0x2ba50
movq %rax, %rdi
callq 0x2b910
movq 0x18(%rsp), %rdi
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
callq 0x2ba50
movq %rax, %rdi
callq 0x2b920
movq 0x18(%rsp), %rdi
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
callq 0x2ba50
movq %rax, %rdi
callq 0x2b930
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x2c(%rsp)
movl 0x38(%rsp), %edi
leaq 0x20(%rsp), %rdx
movl $0x1203, %esi           # imm = 0x1203
callq 0x23270
movss 0x12d0cb(%rip), %xmm0   # 0x18fd78
movss %xmm0, 0x20(%rsp)
movl 0x38(%rsp), %edi
movss 0x20(%rsp), %xmm0
movl $0x1206, %esi           # imm = 0x1206
callq 0x221e0
movl 0x38(%rsp), %edi
callq 0x22910
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Light.cpp
// Function: gaps::R3Light::~R3Light()
R3Light::
~R3Light(void)
{
    // Unload
    if (id > 0) { RNFail("Will not get here because id is not used yet.\n"); }

    // Remove light from scene
    if (scene) scene->RemoveLight(this);

    // Free name
    if (name) free(name);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x18be06(%rip), %rcx    # 0x1eed90
addq $0x10, %rcx
movq %rcx, (%rax)
cmpl $0x0, 0x48(%rax)
jle 0x62fa9
leaq 0x12ce38(%rip), %rdi    # 0x18fdd6
xorl %eax, %eax
callq 0xf3b00
jmp 0x62fa7
jmp 0x62fa9
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x62fc7
movq 0x8(%rsp), %rsi
movq 0x8(%rsi), %rdi
callq 0x2cb20
jmp 0x62fc5
jmp 0x62fc7
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x62fe1
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x22c30
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x49a50
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Light.cpp
// Function: gaps::R3Light::Copy() const
R3Light *R3Light::
Copy(void) const
{
  // Return copy of appropriate type
  if (ClassID() == R3DirectionalLight::CLASS_ID()) return new R3DirectionalLight(*((R3DirectionalLight *) this));
  else if (ClassID() == R3PointLight::CLASS_ID()) return new R3PointLight(*((R3PointLight *) this));
  else if (ClassID() == R3SpotLight::CLASS_ID()) return new R3SpotLight(*((R3SpotLight *) this));
  else if (ClassID() == R3AreaLight::CLASS_ID()) return new R3AreaLight(*((R3AreaLight *) this));

  // Should never get here
  RNAbort("Unrecognized light class id: %d\n", ClassID());
  return NULL;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movq (%rdi), %rax
callq *0x78(%rax)
movl %eax, 0x48(%rsp)
callq 0x62130
movl %eax, %ecx
movl 0x48(%rsp), %eax
cmpl %ecx, %eax
jne 0x6307e
movl $0x68, %edi
callq 0x229e0
movq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x38(%rsp)
callq 0x62200
jmp 0x6304d
movq 0x38(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x631f2
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
movl $0x68, %esi
callq 0x22a00
jmp 0x631fc
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
movl %eax, 0x34(%rsp)
callq 0x61290
movl %eax, %ecx
movl 0x34(%rsp), %eax
cmpl %ecx, %eax
jne 0x630ee
movl $0x80, %edi
callq 0x229e0
movq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
callq 0x61360
jmp 0x630bd
movq 0x28(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x631f2
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
movl $0x80, %esi
callq 0x22a00
jmp 0x631fc
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
movl %eax, 0x24(%rsp)
callq 0x60b60
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jne 0x6315e
movl $0xa8, %edi
callq 0x229e0
movq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
callq 0x60c30
jmp 0x6312d
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x631f2
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
movl $0xa8, %esi
callq 0x22a00
jmp 0x631fc
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
movl %eax, 0x14(%rsp)
callq 0x5f070
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jne 0x631c8
movl $0xb0, %edi
callq 0x229e0
movq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x5f140
jmp 0x6319d
movq 0x8(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x631f2
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
movl $0xb0, %esi
callq 0x22a00
jmp 0x631fc
jmp 0x631ca
jmp 0x631cc
jmp 0x631ce
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
movl %eax, %esi
leaq 0x12cc23(%rip), %rdi    # 0x18fe05
movb $0x0, %al
callq 0xf39f0
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x23290
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Light.cpp
// Function: gaps::R3Light::SetName(char const*)
void R3Light::
SetName(const char *name)
{
    // Set name
    if (this->name) free(this->name);
    if (name) this->name = RNStrdup(name);
    else this->name = NULL;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x18(%rax)
je 0x6323b
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x22c30
cmpq $0x0, 0x8(%rsp)
je 0x6325a
movq 0x8(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x63266
movq (%rsp), %rax
movq $0x0, 0x18(%rax)
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::operator=(gaps::R3Material const&)
R3Material& R3Material::
operator=(const R3Material& material)
{
    // Update everything
    SetBrdf(material.brdf);
    SetTexture(material.texture);
    SetName(material.name);
    Update();
    return *this;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x64020
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x64140
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x64260
movq (%rsp), %rdi
callq 0x63c90
movq (%rsp), %rax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::R3Material(char const*)
R3Material::
R3Material(const char *name)
  :   scene(NULL),
      scene_index(-1),
      name(NULL),
      brdf(NULL),
      texture(NULL),
      flags(0)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update flags
    Update();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq $0x0, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
cmpq $0x0, 0x8(%rsp)
je 0x63c77
movq 0x8(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rdi
callq 0x63c90
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::Update()
void R3Material::
Update(void)
{
    // Update flags
    this->flags = RN_NO_FLAGS;
    if ((brdf) && (brdf->ID() != 0)) 
	this->flags.Add(R3_MATERIAL_BRDF_FLAG | brdf->Flags());
    if ((texture) && (texture->ID() != 0)) 
	this->flags.Add(R3_MATERIAL_TEXTURE_FLAG | texture->Flags());
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rax)
cmpq $0x0, 0x18(%rax)
je 0x63d25
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x64440
cmpl $0x0, %eax
je 0x63d25
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rax), %rdi
callq 0x64400
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x2be20
movq %rax, %rsi
orq $0x80, %rsi
leaq 0x30(%rsp), %rdi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x63d8e
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x64460
cmpl $0x0, %eax
je 0x63d8e
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, (%rsp)
movq 0x20(%rax), %rdi
callq 0x64420
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x2be20
movq %rax, %rsi
orq $0x800, %rsi            # imm = 0x800
leaq 0x20(%rsp), %rdi
callq 0x2b520
movq (%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4a400
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::R3Material(gaps::R3Brdf const*, char const*)
R3Material::
R3Material(const R3Brdf *brdf, const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      brdf(brdf),
      texture(NULL), // changed 3/4/18: was &R2null_texture),
      flags(0)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update flags
    Update();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq $0x0, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq $0x0, 0x10(%rdi)
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
cmpq $0x0, 0x10(%rsp)
je 0x63e8f
movq 0x10(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rdi
callq 0x63c90
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::R3Material(gaps::R2Texture const*, char const*)
R3Material::
R3Material(const R2Texture *texture, const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      brdf(&R3white_brdf),
      texture(texture),
      flags(0)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update flags
    Update();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq $0x0, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq $0x0, 0x10(%rdi)
leaq 0x198cd6(%rip), %rax    # 0x1fcbb0
movq %rax, 0x18(%rdi)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rdi)
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
cmpq $0x0, 0x10(%rsp)
je 0x63f12
movq 0x10(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rdi
callq 0x63c90
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::R3Material(gaps::R3Brdf const*, gaps::R2Texture const*, char const*)
R3Material::
R3Material(const R3Brdf *brdf, const R2Texture *texture, const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      brdf(brdf),
      texture(texture),
      flags(0)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update flags
    Update();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
movq $0x0, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq $0x0, 0x10(%rdi)
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rdi)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rdi)
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
cmpq $0x0, 0x8(%rsp)
je 0x63fa3
movq 0x8(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rdi
callq 0x63c90
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::~R3Material()
R3Material::
~R3Material(void)
{
    // Remove from scene
    if (scene) scene->RemoveMaterial(this);
  
    // Free name
    if (name) free(name);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, (%rax)
je 0x63fea
movq 0x8(%rsp), %rsi
movq (%rsi), %rdi
callq 0x2cc20
jmp 0x63fe8
jmp 0x63fea
movq 0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x64004
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x22c30
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x49a50
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::SetBrdf(gaps::R3Brdf const*)
void R3Material::
SetBrdf(const R3Brdf *brdf)
{
    // Set brdf
    if ((this->brdf) && (!brdf)) flags.Remove(R3_MATERIAL_BRDF_FLAG);
    if ((!this->brdf) && (brdf)) flags.Add(R3_MATERIAL_BRDF_FLAG);
    if (this->brdf) flags.Remove(this->brdf->Flags());
    if (brdf) flags.Add(brdf->Flags());
    this->brdf = brdf;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x18(%rax)
je 0x64073
cmpq $0x0, 0x48(%rsp)
jne 0x64073
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x18(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x80, %esi
callq 0x2b520
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4ed40
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x640b3
cmpq $0x0, 0x48(%rsp)
je 0x640b3
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
movl $0x80, %esi
callq 0x2b520
movq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x4a400
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x640ed
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rax), %rdi
callq 0x64400
movq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rsi
callq 0x4ed40
cmpq $0x0, 0x48(%rsp)
je 0x6411f
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
callq 0x64400
movq (%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rsi
callq 0x4a400
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x18(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::SetTexture(gaps::R2Texture const*)
void R3Material::
SetTexture(const R2Texture *texture)
{
    // Set texture
    if ((this->texture) && (!texture)) flags.Remove(R3_MATERIAL_TEXTURE_FLAG);
    if ((!this->texture) && (texture)) flags.Add(R3_MATERIAL_TEXTURE_FLAG);
    if (this->texture) flags.Remove(this->texture->Flags());
    if (texture) flags.Add(texture->Flags());
    this->texture = texture;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rax)
je 0x64193
cmpq $0x0, 0x48(%rsp)
jne 0x64193
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x18(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x2b520
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4ed40
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x641d3
cmpq $0x0, 0x48(%rsp)
je 0x641d3
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x2b520
movq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x4a400
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x6420d
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x8(%rsp)
movq 0x20(%rax), %rdi
callq 0x64420
movq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rsi
callq 0x4ed40
cmpq $0x0, 0x48(%rsp)
je 0x6423f
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
callq 0x64420
movq (%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rsi
callq 0x4a400
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x20(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::Load() const
void R3Material::
Load(void) const
{
    // Load brdf
    if (brdf) brdf->Load();

    // Load texture
    if (texture) texture->Load();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rax)
je 0x642e8
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x64470
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x64302
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x65e40
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::Unload() const
void R3Material::
Unload(void) const
{
    // Unload brdf
    if (brdf) brdf->Unload();

    // Unload texture
    if (texture) texture->Unload();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rax)
je 0x64338
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x64480
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x64352
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x65bd0
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Material.cpp
// Function: gaps::R3Material::Draw(int) const
void R3Material::
Draw(RNBoolean force) const
{
    // Check if same material as last time
    static const R3Material *R3current_material = NULL;
    if (!force && (this == R3current_material)) return;

    // Draw brdf
    if (brdf) brdf->Draw(force);
    else R3default_brdf.Draw(force);

    // Draw texture
    if (texture) texture->Draw(force);
    else R2null_texture.Draw(force);

    // Remember current material
    R3current_material = this;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x6438c
movq (%rsp), %rax
cmpq 0x1981a8(%rip), %rax    # 0x1fc530
jne 0x6438c
jmp 0x643f3
movq (%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x643aa
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movl 0xc(%rsp), %esi
callq 0x65450
jmp 0x643ba
movl 0xc(%rsp), %esi
leaq 0x19823b(%rip), %rdi    # 0x1fc5f0
callq 0x65450
movq (%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x643d8
movq (%rsp), %rax
movq 0x20(%rax), %rdi
movl 0xc(%rsp), %esi
callq 0x660c0
jmp 0x643e8
movl 0xc(%rsp), %esi
leaq 0x198fbd(%rip), %rdi    # 0x1fd3a0
callq 0x660c0
movq (%rsp), %rax
movq %rax, 0x19813d(%rip)    # 0x1fc530
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::R3Brdf(gaps::RNRgb const&, double, double, double, char const*)
R3Brdf::
R3Brdf(const RNRgb& rgb, 
       RNScalar shininess, 
       RNScalar opacity,
       RNScalar indexofrefraction,
       const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      ambient(rgb),
      diffuse(rgb),
      specular(0.0, 0.0, 0.0),
      transmission(1 - opacity, 1 - opacity, 1 - opacity),
      emission(0.0, 0.0, 0.0),
      shininess(shininess),
      indexofrefraction(indexofrefraction),
      flags(RN_NO_FLAGS),
      id(-1)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update brdf flags
    Update();
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm2, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0x18a71b(%rip), %rax    # 0x1eee40
addq $0x10, %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
movq 0x28(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
addq $0x38, %rdi
movq 0x28(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
addq $0x50, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xef340
movq (%rsp), %rdi
addq $0x68, %rdi
movsd 0x129887(%rip), %xmm0   # 0x18e010
subsd 0x18(%rsp), %xmm0
movsd 0x129879(%rip), %xmm1   # 0x18e010
subsd 0x18(%rsp), %xmm1
movsd 0x12986b(%rip), %xmm2   # 0x18e010
subsd 0x18(%rsp), %xmm2
callq 0xef340
movq (%rsp), %rdi
addq $0x80, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xef340
movq (%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x98(%rdi)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rdi)
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
movq (%rsp), %rax
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, 0x8(%rsp)
je 0x64824
movq 0x8(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rdi
callq 0x64840
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::R3Brdf(double, double, double, double, double, double, char const*)
R3Brdf::
R3Brdf(RNScalar red, RNScalar green, RNScalar blue,
       RNScalar shininess, 
       RNScalar opacity,
       RNScalar indexofrefraction,
       const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      ambient(red, green, blue),
      diffuse(red, green, blue),
      specular(0.0, 0.0, 0.0),
      transmission(1 - opacity, 1 - opacity, 1 - opacity),
      emission(0.0, 0.0, 0.0),
      shininess(shininess),
      indexofrefraction(indexofrefraction),
      flags(RN_NO_FLAGS),
      id(-1)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update brdf
    Update();
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm3, 0x20(%rsp)
movsd %xmm4, 0x18(%rsp)
movsd %xmm5, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0x18a57e(%rip), %rax    # 0x1eee40
addq $0x10, %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
callq 0xef340
movq (%rsp), %rdi
addq $0x38, %rdi
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
callq 0xef340
movq (%rsp), %rdi
addq $0x50, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xef340
movq (%rsp), %rdi
addq $0x68, %rdi
movsd 0x1296d0(%rip), %xmm0   # 0x18e010
subsd 0x18(%rsp), %xmm0
movsd 0x1296c2(%rip), %xmm1   # 0x18e010
subsd 0x18(%rsp), %xmm1
movsd 0x1296b4(%rip), %xmm2   # 0x18e010
subsd 0x18(%rsp), %xmm2
callq 0xef340
movq (%rsp), %rdi
addq $0x80, %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xef340
movq (%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x98(%rdi)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rdi)
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
movq (%rsp), %rax
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, 0x8(%rsp)
je 0x649db
movq 0x8(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rdi
callq 0x64840
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::R3Brdf(gaps::RNRgb const&, gaps::RNRgb const&, gaps::RNRgb const&, gaps::RNRgb const&, double, double, double, char const*)
R3Brdf::
R3Brdf(const RNRgb& ambient, 
       const RNRgb& diffuse, 
       const RNRgb& specular,
       const RNRgb& emission, 
       RNScalar shininess, 
       RNScalar opacity,
       RNScalar indexofrefraction,
       const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      ambient(ambient),
      diffuse(diffuse),
      specular(specular),
      transmission(1 - opacity, 1 - opacity, 1 - opacity),
      emission(emission),
      shininess(shininess),
      indexofrefraction(indexofrefraction),
      flags(RN_NO_FLAGS),
      id(-1)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update brdf
    Update();
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd %xmm2, 0x18(%rsp)
movq %r9, 0x10(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x18a40b(%rip), %rax    # 0x1eee40
addq $0x10, %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
movq 0x48(%rsp), %rsi
callq 0xef300
movq 0x8(%rsp), %rdi
addq $0x38, %rdi
movq 0x40(%rsp), %rsi
callq 0xef300
movq 0x8(%rsp), %rdi
addq $0x50, %rdi
movq 0x38(%rsp), %rsi
callq 0xef300
movq 0x8(%rsp), %rdi
addq $0x68, %rdi
movsd 0x129578(%rip), %xmm0   # 0x18e010
subsd 0x20(%rsp), %xmm0
movsd 0x12956a(%rip), %xmm1   # 0x18e010
subsd 0x20(%rsp), %xmm1
movsd 0x12955c(%rip), %xmm2   # 0x18e010
subsd 0x20(%rsp), %xmm2
callq 0xef340
movq 0x8(%rsp), %rdi
addq $0x80, %rdi
movq 0x30(%rsp), %rsi
callq 0xef300
movq 0x8(%rsp), %rdi
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x98(%rdi)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0xa0(%rdi)
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
movq 0x8(%rsp), %rax
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, 0x10(%rsp)
je 0x64b33
movq 0x10(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rdi
callq 0x64840
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::R3Brdf(gaps::RNRgb const&, gaps::RNRgb const&, gaps::RNRgb const&, gaps::RNRgb const&, gaps::RNRgb const&, double, double, char const*)
R3Brdf::
R3Brdf(const RNRgb& ambient, 
       const RNRgb& diffuse, 
       const RNRgb& specular,
       const RNRgb& transmission, 
       const RNRgb& emission, 
       RNScalar shininess, 
       RNScalar indexofrefraction,
       const char *name)
    : scene(NULL),
      scene_index(-1),
      name(NULL),
      ambient(ambient),
      diffuse(diffuse),
      specular(specular),
      transmission(transmission),
      emission(emission),
      shininess(shininess),
      indexofrefraction(indexofrefraction),
      flags(RN_NO_FLAGS),
      id(-1)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update brdf
    Update();
}

// Assembly:
subq $0x48, %rsp
movq 0x50(%rsp), %rax
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0x18a2ad(%rip), %rax    # 0x1eee40
addq $0x10, %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
movq 0x38(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
addq $0x38, %rdi
movq 0x30(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
addq $0x50, %rdi
movq 0x28(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
addq $0x68, %rdi
movq 0x20(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
addq $0x80, %rdi
movq 0x18(%rsp), %rsi
callq 0xef300
movq (%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x98(%rdi)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0xa0(%rdi)
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b520
movq (%rsp), %rax
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
cmpq $0x0, 0x50(%rsp)
je 0x64c65
movq 0x50(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rdi
callq 0x64840
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::~R3Brdf()
R3Brdf::
~R3Brdf(void)
{
    // Remove brdf from scene
    if (scene) scene->RemoveBrdf(this);

    // Free name
    if (name) free(name);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x18a1a6(%rip), %rcx    # 0x1eee40
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x8(%rax)
je 0x64cba
movq 0x8(%rsp), %rsi
movq 0x8(%rsi), %rdi
callq 0x2cd20
jmp 0x64cb8
jmp 0x64cba
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x64cd4
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x22c30
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x49a50
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetAmbient(gaps::RNRgb const&)
void R3Brdf::
SetAmbient(const RNRgb& rgb) 
{
    // Set ambient rgb
    if (rgb.IsBlack()) flags.Remove(R3_BRDF_AMBIENT_FLAG);
    else flags.Add(R3_BRDF_AMBIENT_FLAG);
    ambient = rgb;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x48dd0
cmpl $0x0, %eax
je 0x64dd7
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4ed40
jmp 0x64e03
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x20, %rdi
callq 0xef4c0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetDiffuse(gaps::RNRgb const&)
void R3Brdf::
SetDiffuse(const RNRgb& rgb) 
{
    // Set diffuse rgb
    if (rgb.IsBlack()) flags.Remove(R3_BRDF_DIFFUSE_FLAG);
    else flags.Add(R3_BRDF_DIFFUSE_FLAG);
    diffuse = rgb;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x48dd0
cmpl $0x0, %eax
je 0x64e77
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x2, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4ed40
jmp 0x64ea3
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x38, %rdi
callq 0xef4c0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetSpecular(gaps::RNRgb const&)
void R3Brdf::
SetSpecular(const RNRgb& rgb) 
{
    // Set specular rgb
    if (rgb.IsBlack()) flags.Remove(R3_BRDF_SPECULAR_FLAG);
    else flags.Add(R3_BRDF_SPECULAR_FLAG);
    specular = rgb;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x48dd0
cmpl $0x0, %eax
je 0x64f17
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x4, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4ed40
jmp 0x64f43
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x4, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x50, %rdi
callq 0xef4c0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetTransmission(gaps::RNRgb const&)
void R3Brdf::
SetTransmission(const RNRgb& rgb) 
{
    // Set emission rgb
    if (rgb.IsBlack()) flags.Remove(R3_BRDF_TRANSPARENCY_FLAG);
    else flags.Add(R3_BRDF_TRANSPARENCY_FLAG);
    transmission = rgb;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x48dd0
cmpl $0x0, %eax
je 0x64fb7
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x20, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4ed40
jmp 0x64fe3
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x20, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x68, %rdi
callq 0xef4c0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetEmission(gaps::RNRgb const&)
void R3Brdf::
SetEmission(const RNRgb& rgb) 
{
    // Set emission rgb
    if (rgb.IsBlack()) flags.Remove(R3_BRDF_EMISSION_FLAG);
    else flags.Add(R3_BRDF_EMISSION_FLAG);
    emission = rgb;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x48dd0
cmpl $0x0, %eax
je 0x65057
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x8, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4ed40
jmp 0x65083
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x8, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x80, %rdi
callq 0xef4c0
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetShininess(double)
void R3Brdf::
SetShininess(RNScalar shininess) 
{
    // Set shininess
    if (shininess == 0.0) flags.Remove(R3_BRDF_SHININESS_FLAG);
    else flags.Add(R3_BRDF_SHININESS_FLAG);
    this->shininess = shininess;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x650fa
jp 0x650fa
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x10, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4ed40
jmp 0x65126
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x10, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a400
movq 0x10(%rsp), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x98(%rax)
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::SetOpacity(double)
void R3Brdf::
SetOpacity(RNScalar opacity)
{
    // Set opacity
    RNScalar t = 1 - opacity;
    if (RNIsEqual(t, 0.0)) t = 0.0;
    else if (RNIsEqual(t, 1.0)) t = 1.0;
    if (t == 0.0) flags.Remove(R3_BRDF_TRANSPARENCY_FLAG);    
    else flags.Add(R3_BRDF_TRANSPARENCY_FLAG);
    this->transmission = RNRgb(t, t, t);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movsd %xmm0, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x128eaf(%rip), %xmm0   # 0x18e010
subsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
leaq 0x19112e(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm2
xorps %xmm1, %xmm1
callq 0x656f0
cmpl $0x0, %eax
je 0x65196
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rsp)
jmp 0x651c9
movsd 0x40(%rsp), %xmm0
leaq 0x191105(%rip), %rax    # 0x1f62a8
movsd (%rax), %xmm2
movsd 0x128e61(%rip), %xmm1   # 0x18e010
callq 0x656f0
cmpl $0x0, %eax
je 0x651c7
movsd 0x128e4f(%rip), %xmm0   # 0x18e010
movsd %xmm0, 0x40(%rsp)
jmp 0x651c9
movsd 0x40(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6520a
jp 0x6520a
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %rdi
movl $0x20, %esi
callq 0x2b520
movq 0x8(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x4ed40
jmp 0x65236
movq 0x10(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %rdi
movl $0x20, %esi
callq 0x2b520
movq (%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x4a400
movsd 0x40(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
leaq 0x18(%rsp), %rdi
callq 0xef340
movq 0x10(%rsp), %rdi
addq $0x68, %rdi
leaq 0x18(%rsp), %rsi
callq 0xef4c0
addq $0x58, %rsp
retq
nopw (%rax,%rax)