LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3Camera::Draw(double) const
void R3Camera::
Draw(RNScalar scale) const
{
#if TRUE
    // Draw pyramid to near plane
    // static float pyramid_color[3] = { 1.0, 0.0, 0.0 };
    // R3LoadRgb(pyramid_color);
    R3Point org = Origin() + Towards() * scale;
    R3Vector dx = Right() * scale * tan(xfov);
    R3Vector dy = Up() * scale * tan(yfov);
    R3Point ur = org + dx + dy;
    R3Point lr = org + dx - dy;
    R3Point ul = org - dx + dy;
    R3Point ll = org - dx - dy;
    R3BeginLine();
    R3LoadPoint(ur);
    R3LoadPoint(ul);
    R3LoadPoint(ll);
    R3LoadPoint(lr);
    R3LoadPoint(ur);
    R3LoadPoint(Origin());
    R3LoadPoint(lr);
    R3LoadPoint(ll);
    R3LoadPoint(Origin());
    R3LoadPoint(ul);
    R3EndLine();
#endif

#if FALSE
    // Draw coordinate system 
    // static float cs_color[3] = { 0.0, 1.0, 0.0 };
    // R3LoadRgb(cs_color);
    cs.Draw();
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movsd %xmm0, (%rsp)
movq %rdi, %rbx
leaq 0x48(%rdi), %rsi
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x779e8
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
callq 0x77722
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x76605
leaq 0x18(%rbx), %rsi
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movsd (%rsp), %xmm0
callq 0x77722
movsd 0x60(%rbx), %xmm0
callq 0x214c0
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x77722
leaq 0x30(%rbx), %rsi
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movsd (%rsp), %xmm0
callq 0x77722
movsd 0x68(%rbx), %xmm0
callq 0x214c0
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x77722
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x76605
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x76605
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x76605
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x76ce1
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x76ce1
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x76605
leaq 0x98(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x76ce1
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x76ce1
movl $0x3, %edi
callq 0x21190
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x211b0
movq %rbp, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
movq %rbx, %rdi
callq 0x211b0
movq %r12, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movq %rbx, %rdi
callq 0x211b0
movq %rbp, %rdi
callq 0x211b0
callq 0x21c60
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Camera.cpp
// Function: gaps::R3CompareCameras(void const*, void const*)
int R3CompareCameras(const void *data1, const void *data2)
{
  // Sort the cameras according to highest value first
  R3Camera *camera1 = *((R3Camera **) data1);
  R3Camera *camera2 = *((R3Camera **) data2);
  if (camera1->Value() > camera2->Value()) return -1;
  else if (camera1->Value() < camera2->Value()) return 1;
  return 0;
}

// Assembly:
movq (%rdi), %rax
movq (%rsi), %rcx
movsd 0x80(%rax), %xmm0
movsd 0x80(%rcx), %xmm1
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
seta %cl
ucomisd %xmm1, %xmm0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbel %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3AreaLight.cpp
// Function: gaps::R3AreaLight::RadiusOfInfluence(double) const
RNScalar R3AreaLight::
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 r = (-B + sqrt(B*B - 4.0*A*C)) / (2.0*A);
    return r + Radius();
}

// Assembly:
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmpl $0x0, 0x20(%rdi)
je 0x411c6
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd 0x28(%rdi), %xmm2
leaq 0xfefc8(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm3
movapd 0x9b414(%rip), %xmm4    # 0xdc530
xorpd %xmm3, %xmm4
ucomisd %xmm4, %xmm2
jb 0x41130
ucomisd %xmm2, %xmm3
jae 0x411c1
ucomisd %xmm4, %xmm1
jb 0x41149
ucomisd %xmm1, %xmm3
jb 0x41149
leaq 0xfefa5(%rip), %rax     # 0x1400e8
movsd (%rax), %xmm0
jmp 0x411c1
movsd 0xa8(%rbx), %xmm3
movsd 0x98(%rbx), %xmm0
movsd 0xa0(%rbx), %xmm4
divsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd 0x9b33f(%rip), %xmm1    # 0xdc4b0
mulsd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm4, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x41195
sqrtsd %xmm0, %xmm0
jmp 0x411b0
movsd %xmm3, 0x8(%rsp)
movsd %xmm4, (%rsp)
callq 0x216c0
movsd (%rsp), %xmm4
movsd 0x8(%rsp), %xmm3
subsd %xmm4, %xmm0
addsd %xmm3, %xmm3
divsd %xmm3, %xmm0
addsd 0x70(%rbx), %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3AreaLight.cpp
// Function: gaps::R3AreaLight::Reflection(gaps::R3Brdf const&, gaps::R3Point const&, gaps::R3Point const&, gaps::R3Vector const&) const
RNRgb R3AreaLight::
Reflection(const R3Brdf& brdf, const R3Point& eye, 
    const R3Point& point, const R3Vector& normal) const
{
    // Return total reflection
    RNRgb diffuse = DiffuseReflection(brdf, point, normal);
    RNRgb specular = SpecularReflection(brdf, eye, point, normal);
    return diffuse + specular;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rcx, 0x8(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, 0x10(%rsp)
movq (%rsi), %rax
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r8, %rcx
movq %r9, %r8
callq *0x60(%rax)
movq (%rbp), %rax
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq 0x8(%rsp), %rcx
movq %r15, %r8
movq %r14, %r9
callq *0x68(%rax)
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
addsd (%rbx), %xmm0
addsd 0x8(%rbx), %xmm1
movsd 0x10(%r12), %xmm2
addsd 0x10(%rbx), %xmm2
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x88530
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3AreaLight.cpp
// Function: gaps::R3AreaLight::Draw(int) const
void R3AreaLight::
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] = Position().X();
    buffer[1] = Position().Y();
    buffer[2] = Position().Z();
    buffer[3] = 1.0;
    glLightfv(index, GL_POSITION, buffer);
    buffer[0] = 90.0;
    glLightf(index, GL_SPOT_CUTOFF, buffer[0]);
    glEnable(index);
    buffer[0] = ConstantAttenuation();
    buffer[1] = LinearAttenuation();
    buffer[2] = QuadraticAttenuation();
    glLightf(index, GL_CONSTANT_ATTENUATION, buffer[0]);
    glLightf(index, GL_LINEAR_ATTENUATION, buffer[1]);
    glLightf(index, GL_QUADRATIC_ATTENUATION, buffer[2]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
addl $0x4000, %ebx           # imm = 0x4000
cmpl $0x4007, %ebx           # imm = 0x4007
ja 0x41c4d
movq %rdi, %r15
movupd 0x28(%rdi), %xmm0
movapd %xmm0, %xmm1
shufpd $0x1, %xmm0, %xmm1      # xmm1 = xmm1[1],xmm0[0]
movapd %xmm0, %xmm2
movhpd 0x38(%rdi), %xmm2       # xmm2 = xmm2[0],mem[0]
mulpd %xmm1, %xmm2
cvtpd2ps %xmm2, %xmm1
movq %rsp, %r14
movlpd %xmm1, (%r14)
mulsd 0x40(%rdi), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%r14)
movl $0x3f800000, %ebp       # imm = 0x3F800000
movl %ebp, 0xc(%r14)
movl %ebx, %edi
movl $0x1201, %esi           # imm = 0x1201
movq %r14, %rdx
callq 0x220b0
movl %ebx, %edi
movl $0x1202, %esi           # imm = 0x1202
movq %r14, %rdx
callq 0x220b0
movupd 0x58(%r15), %xmm0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, (%r14)
xorps %xmm0, %xmm0
cvtsd2ss 0x68(%r15), %xmm0
movss %xmm0, 0x8(%r14)
movl %ebp, 0xc(%r14)
movl %ebx, %edi
movl $0x1203, %esi           # imm = 0x1203
movq %r14, %rdx
callq 0x220b0
movl $0x42b40000, (%r14)     # imm = 0x42B40000
movss 0x9c092(%rip), %xmm0    # 0xddc78
movl %ebx, %edi
movl $0x1206, %esi           # imm = 0x1206
callq 0x211c0
movl %ebx, %edi
callq 0x21810
movupd 0x98(%r15), %xmm0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, (%r14)
xorps %xmm1, %xmm1
cvtsd2ss 0xa8(%r15), %xmm1
movss %xmm1, 0x8(%r14)
movl %ebx, %edi
movl $0x1207, %esi           # imm = 0x1207
callq 0x211c0
movss 0x4(%r14), %xmm0
movl %ebx, %edi
movl $0x1208, %esi           # imm = 0x1208
callq 0x211c0
movss 0x8(%r14), %xmm0
movl %ebx, %edi
movl $0x1209, %esi           # imm = 0x1209
callq 0x211c0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SpotLight.cpp
// Function: gaps::R3SpotLight::IntensityAtPoint(gaps::R3Point const&) const
RNScalar R3SpotLight::
IntensityAtPoint(const R3Point& point) const
{
    // Return intensity at point
    RNScalar I = R3PointLight::IntensityAtPoint(point);
    R3Vector ML = point - Position();
    ML.Normalize();
    RNScalar cos_alpha = ML.Dot(Direction());
    if (cos(cutoffangle) > cos_alpha) return 0.0;
    else return (I * pow(cos_alpha, dropoffrate));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4220a
movsd %xmm0, 0x8(%rsp)
leaq 0x50(%rbx), %rdx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7651c
movq %r15, %rdi
callq 0x77074
leaq 0x80(%rbx), %rsi
movq %r15, %rdi
callq 0x76fea
movsd %xmm0, 0x10(%rsp)
movsd 0xa0(%rbx), %xmm0
callq 0x221e0
movsd 0x10(%rsp), %xmm2
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm2, %xmm1
ja 0x41ee9
movsd 0x98(%rbx), %xmm1
movapd %xmm2, %xmm0
callq 0x220a0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x20(%rdi)
je 0x4226d
pushq %rbx
movq %rdi, %rbx
leaq 0x50(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x4ec74
movsd 0x70(%rbx), %xmm1
mulsd %xmm0, %xmm1
addsd 0x68(%rbx), %xmm1
mulsd %xmm0, %xmm0
mulsd 0x78(%rbx), %xmm0
addsd %xmm1, %xmm0
leaq 0xfde93(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm2
movapd 0x9a2df(%rip), %xmm1    # 0xdc530
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
movsd 0x28(%rbx), %xmm1
popq %rbx
jb 0x42267
ucomisd %xmm0, %xmm2
jae 0x42271
divsd %xmm0, %xmm1
jmp 0x42271
xorpd %xmm1, %xmm1
movapd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmpl $0x0, 0x20(%rdi)
je 0x422c6
movsd 0x28(%rdi), %xmm2
leaq 0xfde2e(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm3
movapd 0x9a27a(%rip), %xmm4    # 0xdc530
xorpd %xmm3, %xmm4
ucomisd %xmm4, %xmm2
jb 0x422c7
ucomisd %xmm2, %xmm3
jb 0x422c7
retq
ucomisd %xmm4, %xmm1
jb 0x422df
ucomisd %xmm1, %xmm3
jb 0x422df
leaq 0xfde0e(%rip), %rax     # 0x1400e8
movsd (%rax), %xmm0
retq
movsd 0x78(%rdi), %xmm3
movsd 0x68(%rdi), %xmm0
movsd 0x70(%rdi), %xmm4
divsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd 0x9a1b2(%rip), %xmm1    # 0xdc4b0
mulsd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm4, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x42322
sqrtsd %xmm0, %xmm0
jmp 0x42347
subq $0x18, %rsp
movsd %xmm3, 0x10(%rsp)
movsd %xmm4, 0x8(%rsp)
callq 0x216c0
movsd 0x8(%rsp), %xmm4
movsd 0x10(%rsp), %xmm3
addq $0x18, %rsp
subsd %xmm4, %xmm0
addsd %xmm3, %xmm3
divsd %xmm3, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x20(%rsi)
je 0x42446
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %r14
movq (%rsi), %rax
movq %rsi, %rdi
movq %rcx, %rsi
callq *0x40(%rax)
movsd %xmm0, (%rsp)
movq (%r14), %rax
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq *0xb0(%rax)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x76fea
leaq 0xfdcf9(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x42446
movsd (%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0x38(%r15), %xmm0
mulsd %xmm2, %xmm0
movsd 0x40(%r15), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x48(%r15), %xmm2
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x88530
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd 0x30(%r14), %xmm0
mulsd 0x38(%r14), %xmm1
movsd 0x10(%r15), %xmm2
mulsd 0x40(%r14), %xmm2
movq %rbx, %rdi
callq 0x88530
jmp 0x42455
leaq 0x106193(%rip), %rsi    # 0x1485e0
movq %rbx, %rdi
callq 0x88512
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x20(%rsi)
je 0x425b4
movq %r9, %rbp
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rcx, 0x10(%rsp)
movsd 0x98(%rdx), %xmm0
movsd %xmm0, (%rsp)
movq (%rsi), %rax
movq %rsi, %rdi
movq %r8, %rsi
callq *0x40(%rax)
movsd %xmm0, 0x8(%rsp)
movq (%r14), %rax
leaq 0x30(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0xb0(%rax)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x76fea
leaq 0xfdbfc(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x425b4
addsd %xmm0, %xmm0
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x77722
leaq 0x60(%rsp), %rbp
leaq 0x30(%rsp), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x77a2b
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x7651c
movq %r13, %rdi
callq 0x77074
movq %r13, %rdi
movq %rbp, %rsi
callq 0x76fea
leaq 0xfdb96(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x425b4
movsd (%rsp), %xmm1
callq 0x220a0
movsd 0x8(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0x50(%r15), %xmm0
mulsd %xmm2, %xmm0
movsd 0x58(%r15), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x60(%r15), %xmm2
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x88530
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd 0x30(%r14), %xmm0
mulsd 0x38(%r14), %xmm1
movsd 0x10(%r15), %xmm2
mulsd 0x40(%r14), %xmm2
movq %rbx, %rdi
callq 0x88530
jmp 0x425c3
leaq 0x106025(%rip), %rsi    # 0x1485e0
movq %rbx, %rdi
callq 0x88512
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x20(%rsi)
je 0x42b75
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r14
movsd 0x28(%rsi), %xmm0
movsd %xmm0, 0x8(%rsp)
addq $0x50, %rsi
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x779e8
movq %r12, %rdi
movq %r13, %rsi
callq 0x76fea
leaq 0xfd5cb(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x42b75
movsd 0x8(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0x38(%r15), %xmm0
mulsd %xmm2, %xmm0
movsd 0x40(%r15), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x48(%r15), %xmm2
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x88530
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd 0x30(%r14), %xmm0
mulsd 0x38(%r14), %xmm1
movsd 0x10(%r15), %xmm2
mulsd 0x40(%r14), %xmm2
movq %rbx, %rdi
callq 0x88530
jmp 0x42b84
leaq 0x105a64(%rip), %rsi    # 0x1485e0
movq %rbx, %rdi
callq 0x88512
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
addl $0x4000, %ebx           # imm = 0x4000
cmpl $0x4007, %ebx           # imm = 0x4007
ja 0x42fe0
movq %rdi, %r14
movupd 0x28(%rdi), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
movhpd 0x38(%rdi), %xmm2       # xmm2 = xmm2[0],mem[0]
shufpd $0x1, %xmm0, %xmm1      # xmm1 = xmm1[1],xmm0[0]
mulpd %xmm1, %xmm2
cvtpd2ps %xmm2, %xmm1
movq %rsp, %r15
movlpd %xmm1, (%r15)
mulsd 0x40(%rdi), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%r15)
movl $0x3f800000, 0xc(%r15)  # imm = 0x3F800000
movl %ebx, %edi
movl $0x1201, %esi           # imm = 0x1201
movq %r15, %rdx
callq 0x220b0
movl %ebx, %edi
movl $0x1202, %esi           # imm = 0x1202
movq %r15, %rdx
callq 0x220b0
movupd 0x50(%r14), %xmm0
cvtpd2ps %xmm0, %xmm0
movapd 0x9ad64(%rip), %xmm1    # 0xddcf0
xorpd %xmm1, %xmm0
movlpd %xmm0, (%r15)
xorps %xmm0, %xmm0
cvtsd2ss 0x60(%r14), %xmm0
xorps %xmm1, %xmm0
movss %xmm0, 0x8(%r15)
movl $0x0, 0xc(%r15)
movl %ebx, %edi
movl $0x1203, %esi           # imm = 0x1203
movq %r15, %rdx
callq 0x220b0
movl $0x43340000, (%r15)     # imm = 0x43340000
movss 0x9acf3(%rip), %xmm0    # 0xddcc0
movl %ebx, %edi
movl $0x1206, %esi           # imm = 0x1206
callq 0x211c0
movl %ebx, %edi
callq 0x21810
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
leaq 0xf5c2b(%rip), %rax     # 0x138d90
movq %rax, (%rdi)
cmpl $0x0, 0x48(%rdi)
jle 0x4317c
leaq 0x9abc2(%rip), %rdi     # 0xddd37
xorl %eax, %eax
callq 0x8b53a
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4318d
movq %rbx, %rsi
callq 0x287ba
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x4319c
popq %rbx
jmp 0x21ae0
popq %rbx
retq
movq %rax, %rdi
callq 0x37467
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x78(%rax)
movl %eax, %ebp
callq 0x42920
cmpl %eax, %ebp
jne 0x431dd
movl $0x68, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4298c
jmp 0x43283
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x420a4
cmpl %eax, %ebp
jne 0x4320b
movl $0x80, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42110
jmp 0x43283
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x41cb0
cmpl %eax, %ebp
jne 0x43239
movl $0xa8, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x41d1e
jmp 0x43283
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x40c48
cmpl %eax, %ebp
jne 0x43267
movl $0xb0, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40cb4
jmp 0x43283
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
leaq 0x9aaef(%rip), %rdi     # 0xddd66
xorl %r14d, %r14d
movl %eax, %esi
xorl %eax, %eax
callq 0x8b45e
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0xb0, %esi
jmp 0x432b1
movq %rax, %rbx
movl $0xa8, %esi
jmp 0x432b1
movq %rax, %rbx
movl $0x80, %esi
jmp 0x432b1
movq %rax, %rbx
movl $0x68, %esi
movq %r14, %rdi
callq 0x218e0
movq %rbx, %rdi
callq 0x220d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rsi), %rsi
callq 0x441dc
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x44230
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x4427e
movq %r14, %rdi
callq 0x44074
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
testq %rsi, %rsi
je 0x44064
leaq 0x10(%rbx), %r14
movq %rsi, %rdi
callq 0x8b397
movq %rax, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x44074
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq $0x0, 0x28(%rdi)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x4409e
cmpl $0x0, 0xb0(%rax)
je 0x4409e
movl $0x80, %ecx
orq 0xa8(%rax), %rcx
movq %rcx, 0x28(%rdi)
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x440bf
cmpl $0x0, 0x48(%rax)
je 0x440bf
movq 0x40(%rax), %rax
orq 0x28(%rdi), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, 0x28(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq %rax, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
testq %rdx, %rdx
je 0x44128
movq %rdx, %rdi
callq 0x8b397
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x44074
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq %rax, 0x10(%rdi)
leaq 0x101713(%rip), %rcx    # 0x145860
movq %rcx, 0x18(%rdi)
movq %rsi, 0x20(%rdi)
movq %rax, 0x28(%rdi)
testq %rdx, %rdx
je 0x4416a
movq %rdx, %rdi
callq 0x8b397
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x44074
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq %rax, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
movq %rax, 0x28(%rdi)
testq %rcx, %rcx
je 0x441a5
movq %rcx, %rdi
callq 0x8b397
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x44074
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq 0x18(%rdi), %rax
testq %rax, %rax
sete %cl
testq %rsi, %rsi
setne %dl
orb %cl, %dl
jne 0x441f4
andb $0x7f, 0x28(%rdi)
testq %rsi, %rsi
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
jne 0x44208
orb $-0x80, 0x28(%rdi)
testq %rax, %rax
je 0x4421b
movq 0xa8(%rax), %rax
notq %rax
andq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x4422b
movq 0xa8(%rsi), %rax
orq %rax, 0x28(%rdi)
movq %rsi, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq 0x20(%rdi), %rax
testq %rax, %rax
sete %cl
testq %rsi, %rsi
setne %dl
orb %cl, %dl
jne 0x44248
andb $-0x9, 0x29(%rdi)
testq %rsi, %rsi
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
jne 0x4425c
orb $0x8, 0x29(%rdi)
testq %rax, %rax
je 0x4426c
movq 0x40(%rax), %rax
notq %rax
andq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x44279
movq 0x40(%rsi), %rax
orq %rax, 0x28(%rdi)
movq %rsi, 0x20(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
testl %esi, %esi
jne 0x442e5
cmpq %rbx, 0x100efd(%rip)    # 0x1451e0
je 0x4431a
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
jne 0x442f5
leaq 0x100fab(%rip), %rdi    # 0x1452a0
movl %ebp, %esi
callq 0x44cd0
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
jne 0x4430c
leaq 0x101d44(%rip), %rdi    # 0x146050
movl %ebp, %esi
callq 0x45448
movq %rbx, 0x100ec6(%rip)    # 0x1451e0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xf498a(%rip), %rax     # 0x138e40
movq %rax, (%rdi)
xorl %r12d, %r12d
movq %r12, 0x8(%rdi)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, 0x10(%rdi)
movq %r12, 0x18(%rdi)
addq $0x20, %rdi
callq 0x88512
leaq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x88512
leaq 0x50(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x88530
leaq 0x68(%rbx), %rdi
movsd 0x97b19(%rip), %xmm0    # 0xdc018
subsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x88530
leaq 0x80(%rbx), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x88530
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x98(%rbx)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0xa0(%rbx)
movq %r12, 0xa8(%rbx)
movl %ebp, 0xb0(%rbx)
testq %r14, %r14
je 0x44564
movq %r14, %rdi
callq 0x8b397
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x44b92
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movsd %xmm5, 0x30(%rsp)
movsd %xmm4, 0x20(%rsp)
movsd %xmm3, 0x28(%rsp)
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
leaq 0xf4883(%rip), %rax     # 0x138e40
movq %rax, (%rdi)
xorl %r15d, %r15d
movq %r15, 0x8(%rdi)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, 0x10(%rdi)
movq %r15, 0x18(%rdi)
addq $0x20, %rdi
callq 0x88530
leaq 0x38(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0x88530
leaq 0x50(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x88530
leaq 0x68(%rbx), %rdi
movsd 0x97a03(%rip), %xmm0    # 0xdc018
subsd 0x20(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x88530
leaq 0x80(%rbx), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x88530
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x98(%rbx)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0xa0(%rbx)
movq %r15, 0xa8(%rbx)
movl %ebp, 0xb0(%rbx)
testq %r14, %r14
je 0x4467a
movq %r14, %rdi
callq 0x8b397
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x44b92
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movsd %xmm2, 0x10(%rsp)
movsd %xmm1, (%rsp)
movsd %xmm0, 0x8(%rsp)
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
leaq 0xf477d(%rip), %rax     # 0x138e40
movq %rax, (%rdi)
xorl %ebp, %ebp
movq %rbp, 0x8(%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x10(%rdi)
movq %rbp, 0x18(%rdi)
addq $0x20, %rdi
callq 0x88512
leaq 0x38(%rbx), %rdi
movq %r13, %rsi
callq 0x88512
leaq 0x50(%rbx), %rdi
movq %r12, %rsi
callq 0x88512
leaq 0x68(%rbx), %rdi
movsd 0x97913(%rip), %xmm0    # 0xdc018
subsd (%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x88530
leaq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0x88512
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x98(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rbx)
movq %rbp, 0xa8(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xb0(%rbx)
testq %r14, %r14
je 0x44765
movq %r14, %rdi
callq 0x8b397
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x44b92
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %r9, (%rsp)
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rdi, %rbx
movq 0x50(%rsp), %r14
leaq 0xf468c(%rip), %rax     # 0x138e40
movq %rax, (%rdi)
xorl %r15d, %r15d
movq %r15, 0x8(%rdi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x10(%rdi)
movq %r15, 0x18(%rdi)
addq $0x20, %rdi
callq 0x88512
leaq 0x38(%rbx), %rdi
movq %rbp, %rsi
callq 0x88512
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x88512
leaq 0x68(%rbx), %rdi
movq %r12, %rsi
callq 0x88512
leaq 0x80(%rbx), %rdi
movq (%rsp), %rsi
callq 0x88512
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x98(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rbx)
movq %r15, 0xa8(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xb0(%rbx)
testq %r14, %r14
je 0x44846
movq %r14, %rdi
callq 0x8b397
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x44b92
// File: /workspace/github_cpp_makefile_star2_O1/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:
movsd 0x8(%rsi), %xmm0
xorpd %xmm1, %xmm1
movsd (%rsi), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
movsd 0x10(%rsi), %xmm0
ucomisd %xmm1, %xmm0
setp %cl
setne %dl
orb %cl, %dl
orb %al, %dl
movq 0xa8(%rdi), %rax
andq $-0x2, %rax
movzbl %dl, %ecx
andl $0x1, %ecx
orq %rax, %rcx
movq %rcx, 0xa8(%rdi)
addq $0x20, %rdi
jmp 0x885c2
// File: /workspace/github_cpp_makefile_star2_O1/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:
movsd 0x8(%rsi), %xmm0
xorpd %xmm1, %xmm1
movsd (%rsi), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
movsd 0x10(%rsi), %xmm0
ucomisd %xmm1, %xmm0
setp %cl
setne %dl
orb %cl, %dl
orb %al, %dl
movq 0xa8(%rdi), %rax
andq $-0x3, %rax
movzbl %dl, %ecx
andl $0x1, %ecx
leaq (%rax,%rcx,2), %rax
movq %rax, 0xa8(%rdi)
addq $0x38, %rdi
jmp 0x885c2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movsd 0x8(%rsi), %xmm0
xorpd %xmm1, %xmm1
movsd (%rsi), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
movsd 0x10(%rsi), %xmm0
ucomisd %xmm1, %xmm0
setp %cl
setne %dl
orb %cl, %dl
orb %al, %dl
movq 0xa8(%rdi), %rax
andq $-0x5, %rax
movzbl %dl, %ecx
andl $0x1, %ecx
leaq (%rax,%rcx,4), %rax
movq %rax, 0xa8(%rdi)
addq $0x50, %rdi
jmp 0x885c2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movsd 0x8(%rsi), %xmm0
xorpd %xmm1, %xmm1
movsd (%rsi), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
movsd 0x10(%rsi), %xmm0
ucomisd %xmm1, %xmm0
setp %cl
setne %dl
orb %cl, %dl
orb %al, %dl
movq 0xa8(%rdi), %rax
andq $-0x21, %rax
movzbl %dl, %ecx
andl $0x1, %ecx
shll $0x5, %ecx
orq %rax, %rcx
movq %rcx, 0xa8(%rdi)
addq $0x68, %rdi
jmp 0x885c2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movsd 0x8(%rsi), %xmm0
xorpd %xmm1, %xmm1
movsd (%rsi), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
movsd 0x10(%rsi), %xmm0
ucomisd %xmm1, %xmm0
setp %cl
setne %dl
orb %cl, %dl
orb %al, %dl
movq 0xa8(%rdi), %rax
andq $-0x9, %rax
movzbl %dl, %ecx
andl $0x1, %ecx
leaq (%rax,%rcx,8), %rax
movq %rax, 0xa8(%rdi)
subq $-0x80, %rdi
jmp 0x885c2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movsd 0x97538(%rip), %xmm1    # 0xdc018
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
leaq 0xfb5e9(%rip), %rax     # 0x1400d8
movsd (%rax), %xmm3
movapd 0x97a35(%rip), %xmm4    # 0xdc530
xorpd %xmm3, %xmm4
ucomisd %xmm4, %xmm2
jb 0x44b0f
xorpd %xmm0, %xmm0
ucomisd %xmm2, %xmm3
jae 0x44b35
movsd 0x979b9(%rip), %xmm0    # 0xdc4d0
addsd %xmm2, %xmm0
ucomisd %xmm4, %xmm0
jb 0x44b31
ucomisd %xmm0, %xmm3
movapd %xmm2, %xmm0
jb 0x44b35
movapd %xmm1, %xmm0
jmp 0x44b35
movapd %xmm2, %xmm0
xorpd %xmm1, %xmm1
cmpneqsd %xmm0, %xmm1
movq %xmm1, %rax
andl $0x1, %eax
movq 0xa8(%rbx), %rcx
andq $-0x21, %rcx
shll $0x5, %eax
orq %rcx, %rax
movq %rax, 0xa8(%rbx)
movq %rsp, %r14
movq %r14, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x88530
addq $0x68, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x885c2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Brdf.cpp
// Function: gaps::R3Brdf::UpdateFlags(gaps::RNFlags)
void R3Brdf::
UpdateFlags (const RNFlags flags)
{
    // Update flags
    this->flags = flags;
    if (!ambient.IsBlack()) this->flags.Add(R3_BRDF_AMBIENT_FLAG);
    if (!diffuse.IsBlack()) this->flags.Add(R3_BRDF_DIFFUSE_FLAG);
    if (!specular.IsBlack()) this->flags.Add(R3_BRDF_SPECULAR_FLAG);
    if (!transmission.IsBlack()) this->flags.Add(R3_BRDF_TRANSPARENCY_FLAG);
    if (!emission.IsBlack()) this->flags.Add(R3_BRDF_EMISSION_FLAG);
    if (shininess != 0.0) this->flags.Add(R3_BRDF_SHININESS_FLAG);
}

// Assembly:
movq %rsi, 0xa8(%rdi)
movsd 0x20(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44bc8
jp 0x44bc8
movsd 0x28(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44bc8
jp 0x44bc8
movsd 0x30(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44bc8
jnp 0x44bd3
orq $0x1, %rsi
movq %rsi, 0xa8(%rdi)
movsd 0x38(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44c02
jp 0x44c02
movsd 0x40(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44c02
jp 0x44c02
movsd 0x48(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44c02
jnp 0x44c09
orb $0x2, 0xa8(%rdi)
movsd 0x50(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44c38
jp 0x44c38
movsd 0x58(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44c38
jp 0x44c38
movsd 0x60(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44c38
jnp 0x44c3f
orb $0x4, 0xa8(%rdi)
movsd 0x68(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44c6e
jp 0x44c6e
movsd 0x70(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44c6e
jp 0x44c6e
movsd 0x78(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44c6e
jnp 0x44c75
orb $0x20, 0xa8(%rdi)
movsd 0x80(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44cad
jp 0x44cad
movsd 0x88(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44cad
jp 0x44cad
movsd 0x90(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44cad
jnp 0x44cb4
orb $0x8, 0xa8(%rdi)
movsd 0x98(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44cc8
jnp 0x44ccf
orb $0x10, 0xa8(%rdi)
retq