LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3dc9a
movq %r9, %rbp
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rcx, 0x10(%rsp)
movsd 0x98(%rdx), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rsi), %rax
movq %rsi, %rdi
movq %r8, %rsi
callq *0x40(%rax)
movsd %xmm0, (%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 0x6c2ae
leaq 0xf1506(%rip), %rax     # 0x12f0f8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x3dc9a
addsd %xmm0, %xmm0
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6c72a
leaq 0x60(%rsp), %rbp
leaq 0x30(%rsp), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6c9dd
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x6ba51
movq %r13, %rdi
callq 0x6c336
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6c2ae
leaq 0xf14a0(%rip), %rax     # 0x12f0f8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x3dc9a
addq $0x50, %r15
addq $0x30, %r14
movsd 0x8(%rsp), %xmm1
callq 0x220b0
mulsd (%rsp), %xmm0
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3d3cb
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3d360
jmp 0x3dca9
leaq 0xf995f(%rip), %rsi     # 0x137600
movq %rbx, %rdi
callq 0x7c020
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_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3PointLight.cpp
// Function: gaps::R3PointLight::Reflection(gaps::R3Brdf const&, gaps::R3Point const&, gaps::R3Point const&, gaps::R3Vector const&) const
RNRgb R3PointLight::
Reflection(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& Dc = brdf.Diffuse();
    const RNRgb& Sc = brdf.Specular();
    RNScalar s = brdf.Shininess();

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

    // 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);

    // Compute diffuse reflection
    RNRgb rgb = (I * NL) * Dc * Ic;

    // Compute specular reflection
    if (RNIsPositive(VR)) rgb += (I * pow(VR,s)) * Sc * Ic;

    // Return total reflection
    return rgb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x20(%rsi)
je 0x3de3b
movq %r9, %rbp
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rcx, 0x8(%rsp)
movsd 0x98(%rdx), %xmm0
movsd %xmm0, 0x28(%rsp)
movq (%rsi), %rax
movq %rsi, %rdi
movq %r8, %rsi
callq *0x40(%rax)
movsd %xmm0, 0x10(%rsp)
movq (%r14), %rax
leaq 0x60(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0xb0(%rax)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6c2ae
movapd %xmm0, %xmm1
leaq 0xf13c0(%rip), %rax     # 0x12f0f8
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jae 0x3de3b
addq $0x30, %r14
leaq 0x38(%r15), %rax
movq %rax, 0x20(%rsp)
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
movsd %xmm1, 0x18(%rsp)
callq 0x6c72a
leaq 0x90(%rsp), %rbp
leaq 0x60(%rsp), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6c9dd
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x6ba51
movq %r13, %rdi
callq 0x6c336
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6c2ae
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0x3d3cb
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3d360
movsd 0x8(%rsp), %xmm0
leaq 0xf1308(%rip), %rax     # 0x12f0f8
ucomisd (%rax), %xmm0
jbe 0x3de4a
addq $0x50, %r15
movsd 0x28(%rsp), %xmm1
callq 0x220b0
mulsd 0x10(%rsp), %xmm0
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3d3cb
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3d360
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7c0ee
jmp 0x3de4a
leaq 0xf97be(%rip), %rsi     # 0x137600
movq %rbx, %rdi
callq 0x7c020
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3e1cb
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 0x6c99a
movq %r12, %rdi
movq %r13, %rsi
callq 0x6c2ae
leaq 0xf0f6d(%rip), %rax     # 0x12f0f8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x3e1cb
addq $0x30, %r14
addq $0x38, %r15
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movapd %xmm1, %xmm0
callq 0x3d3cb
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3d360
jmp 0x3e1da
leaq 0xf942e(%rip), %rsi     # 0x137600
movq %rbx, %rdi
callq 0x7c020
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3e58e
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 0x220c0
movl %ebx, %edi
movl $0x1202, %esi           # imm = 0x1202
movq %r15, %rdx
callq 0x220c0
movupd 0x50(%r14), %xmm0
cvtpd2ps %xmm0, %xmm0
movapd 0x88760(%rip), %xmm1    # 0xc6ca0
xorpd %xmm1, %xmm0
movlpd %xmm0, (%r15)
cvtsd2ss 0x60(%r14), %xmm0
xorps %xmm1, %xmm0
movss %xmm0, 0x8(%r15)
andl $0x0, 0xc(%r15)
movl %ebx, %edi
movl $0x1203, %esi           # imm = 0x1203
movq %r15, %rdx
callq 0x220c0
movl $0x43340000, (%r15)     # imm = 0x43340000
movss 0x886fd(%rip), %xmm0    # 0xc6c78
movl %ebx, %edi
movl $0x1206, %esi           # imm = 0x1206
callq 0x211c0
movl %ebx, %edi
callq 0x21820
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xe96a7(%rip), %rax     # 0x127db0
movq %rax, (%rdi)
cmpl $0x0, 0x48(%rdi)
jle 0x3e720
leaq 0x885ce(%rip), %rdi     # 0xc6ce7
xorl %eax, %eax
callq 0x7e83e
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3e731
movq %rbx, %rsi
callq 0x27812
movq 0x18(%rbx), %rdi
popq %rbx
jmp 0x21ad0
movq %rax, %rdi
callq 0x3471e
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3dfa4
cmpl %eax, %ebp
jne 0x3e779
pushq $0x68
popq %rdi
callq 0x218d0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3e00e
jmp 0x3e81f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x3d7e4
cmpl %eax, %ebp
jne 0x3e7a7
movl $0x80, %edi
callq 0x218d0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3d84e
jmp 0x3e81f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x3d3fc
cmpl %eax, %ebp
jne 0x3e7d5
movl $0xa8, %edi
callq 0x218d0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3d468
jmp 0x3e81f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x3c48c
cmpl %eax, %ebp
jne 0x3e803
movl $0xb0, %edi
callq 0x218d0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3c4f6
jmp 0x3e81f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
leaq 0x88503(%rip), %rdi     # 0xc6d16
xorl %r14d, %r14d
movl %eax, %esi
xorl %eax, %eax
callq 0x7e764
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0xb0, %esi
jmp 0x3e84b
movq %rax, %rbx
movl $0xa8, %esi
jmp 0x3e84b
movq %rax, %rbx
movl $0x80, %esi
jmp 0x3e84b
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r14, %rdi
callq 0x218f0
movq %rbx, %rdi
callq 0x220e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3eec6
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x3ef3e
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x3efb0
movq %r14, %rdi
callq 0x3ed72
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rdi)
orl $-0x1, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
testq %rsi, %rsi
je 0x3ed62
leaq 0x10(%rbx), %r14
movq %rsi, %rdi
callq 0x7e6a9
movq %rax, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3ed72
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
andq $0x0, 0x28(%rdi)
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
je 0x3ed9b
cmpl $0x0, 0xb0(%rcx)
je 0x3ed9b
movl $0x80, %eax
orq 0xa8(%rcx), %rax
movq %rax, 0x28(%rdi)
jmp 0x3ed9d
xorl %eax, %eax
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x3edba
cmpl $0x0, 0x48(%rcx)
je 0x3edba
orq 0x40(%rcx), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, 0x28(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rdi)
orl $-0x1, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
testq %rdx, %rdx
je 0x3ee1f
movq %rdx, %rdi
callq 0x7e6a9
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x3ed72
// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rdi)
orl $-0x1, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
leaq 0xf5a40(%rip), %rax     # 0x134880
movq %rax, 0x18(%rdi)
movq %rsi, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
testq %rdx, %rdx
je 0x3ee5e
movq %rdx, %rdi
callq 0x7e6a9
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x3ed72
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rdi)
orl $-0x1, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
testq %rcx, %rcx
je 0x3ee97
movq %rcx, %rdi
callq 0x7e6a9
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x3ed72
// File: /workspace/github_cpp_makefile_star2_O2/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
je 0x3eef9
testq %rsi, %rsi
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
jne 0x3ef0a
movl $0x80, %eax
orq 0x28(%rdi), %rax
movq %rax, 0x28(%rdi)
jmp 0x3ef2d
movq $-0x81, %rcx
andq 0x28(%rdi), %rcx
movq %rcx, 0x28(%rdi)
jmp 0x3ef13
testq %rax, %rax
je 0x3ef24
movq 0x28(%rdi), %rcx
movq 0xa8(%rax), %rax
notq %rax
andq %rcx, %rax
movq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x3ef38
movq 0x28(%rdi), %rax
orq 0xa8(%rsi), %rax
movq %rax, 0x28(%rdi)
movq %rsi, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
je 0x3ef71
testq %rsi, %rsi
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
jne 0x3ef82
movl $0x800, %eax            # imm = 0x800
orq 0x28(%rdi), %rax
movq %rax, 0x28(%rdi)
jmp 0x3efa2
movq $-0x801, %rcx           # imm = 0xF7FF
andq 0x28(%rdi), %rcx
movq %rcx, 0x28(%rdi)
jmp 0x3ef8b
testq %rax, %rax
je 0x3ef99
movq 0x28(%rdi), %rcx
movq 0x40(%rax), %rax
notq %rax
andq %rcx, %rax
movq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x3efaa
movq 0x28(%rdi), %rax
orq 0x40(%rsi), %rax
movq %rax, 0x28(%rdi)
movq %rsi, 0x20(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3f011
cmpq %rbx, 0xf51f1(%rip)     # 0x134200
je 0x3f046
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
jne 0x3f021
leaq 0xf529f(%rip), %rdi     # 0x1342c0
movl %ebp, %esi
callq 0x3f8a8
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
jne 0x3f038
leaq 0xf6038(%rip), %rdi     # 0x135070
movl %ebp, %esi
callq 0x3ff54
movq %rbx, 0xf51ba(%rip)     # 0x134200
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rdi, %rbx
leaq 0xe8c92(%rip), %rax     # 0x127e60
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r15
orl $-0x1, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x7c020
leaq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x7c020
leaq 0x50(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x7c03e
leaq 0x68(%rbx), %rdi
movsd 0x85e03(%rip), %xmm0    # 0xc5018
subsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x7c03e
leaq 0x80(%rbx), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x7c03e
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x98(%rbx)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0xa0(%rbx)
andq $0x0, 0xa8(%rbx)
orl $-0x1, 0xb0(%rbx)
testq %r14, %r14
je 0x3f27c
movq %r14, %rdi
callq 0x7e6a9
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3f28e
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movsd %xmm5, 0x30(%rsp)
movsd %xmm4, 0x20(%rsp)
movsd %xmm3, 0x28(%rsp)
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %rdi, %r14
leaq 0xe8b98(%rip), %rax     # 0x127e60
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movsd %xmm0, 0x8(%rsp)
orl $-0x1, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x7c03e
leaq 0x38(%r14), %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0x7c03e
leaq 0x50(%r14), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x7c03e
leaq 0x68(%r14), %rdi
movsd 0x85cf7(%rip), %xmm0    # 0xc5018
subsd 0x20(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x7c03e
leaq 0x80(%r14), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x7c03e
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x98(%r14)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0xa0(%r14)
andq $0x0, 0xa8(%r14)
orl $-0x1, 0xb0(%r14)
testq %rbx, %rbx
je 0x3f38b
movq %rbx, %rdi
callq 0x7e6a9
movq %rax, 0x18(%r14)
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r14
jmp 0x3f28e
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r9, %rbx
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %r14
leaq 0xe8a91(%rip), %rax     # 0x127e60
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
orl $-0x1, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x7c020
leaq 0x38(%r14), %rdi
movq %r13, %rsi
callq 0x7c020
leaq 0x50(%r14), %rdi
movq %r12, %rsi
callq 0x7c020
leaq 0x68(%r14), %rdi
movsd 0x85c0b(%rip), %xmm0    # 0xc5018
subsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x7c03e
leaq 0x80(%r14), %rdi
movq %r15, %rsi
callq 0x7c020
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x98(%r14)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0xa0(%r14)
andq $0x0, 0xa8(%r14)
orl $-0x1, 0xb0(%r14)
testq %rbx, %rbx
je 0x3f46e
movq %rbx, %rdi
callq 0x7e6a9
movq %rax, 0x18(%r14)
movq %r14, %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3f28e
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rdi, %rbx
movq 0x50(%rsp), %r14
leaq 0xe89a7(%rip), %rax     # 0x127e60
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
orl $-0x1, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x7c020
leaq 0x38(%rbx), %rdi
movq %rbp, %rsi
callq 0x7c020
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x7c020
leaq 0x68(%rbx), %rdi
movq %r12, %rsi
callq 0x7c020
leaq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0x7c020
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x98(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rbx)
andq $0x0, 0xa8(%rbx)
orl $-0x1, 0xb0(%rbx)
testq %r14, %r14
je 0x3f542
movq %r14, %rdi
callq 0x7e6a9
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3f28e
// File: /workspace/github_cpp_makefile_star2_O2/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 0x858a4(%rip), %xmm1    # 0xc5018
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
leaq 0xef975(%rip), %rax     # 0x12f0f8
movsd (%rax), %xmm3
movapd 0x85da1(%rip), %xmm4    # 0xc5530
xorpd %xmm3, %xmm4
ucomisd %xmm4, %xmm2
jb 0x3f7a3
xorpd %xmm0, %xmm0
ucomisd %xmm2, %xmm3
jae 0x3f7cf
movsd 0x85d25(%rip), %xmm0    # 0xc54d0
addsd %xmm2, %xmm0
ucomisd %xmm4, %xmm0
jb 0x3f7bb
ucomisd %xmm0, %xmm3
jae 0x3f7d8
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
movapd %xmm2, %xmm0
movapd %xmm2, %xmm1
jne 0x3f7d8
jp 0x3f7d8
andb $-0x21, 0xa8(%rbx)
jmp 0x3f7e3
orb $0x20, 0xa8(%rbx)
movapd %xmm1, %xmm0
movq %rsp, %r14
movq %r14, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x7c03e
addq $0x68, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7c0ce
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0xa8(%rdi)
addq $0x20, %rdi
callq 0x344c4
testl %eax, %eax
jne 0x3f837
orb $0x1, 0xa8(%rbx)
leaq 0x38(%rbx), %rdi
callq 0x344c4
testl %eax, %eax
jne 0x3f84b
orb $0x2, 0xa8(%rbx)
leaq 0x50(%rbx), %rdi
callq 0x344c4
testl %eax, %eax
jne 0x3f85f
orb $0x4, 0xa8(%rbx)
leaq 0x68(%rbx), %rdi
callq 0x344c4
testl %eax, %eax
jne 0x3f873
orb $0x20, 0xa8(%rbx)
leaq 0x80(%rbx), %rdi
callq 0x344c4
testl %eax, %eax
jne 0x3f88a
orb $0x8, 0xa8(%rbx)
movsd 0x98(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3f89e
jnp 0x3f8a5
orb $0x10, 0xa8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::R2Texture(gaps::R2Texture const&, char const*)
R2Texture::
R2Texture(const R2Texture& texture, const char *name)
  : scene(NULL),
    scene_index(-1),
    name(NULL),
    filename((texture.filename) ? RNStrdup(texture.filename) : NULL),
    image(texture.image),
    s_wrap(texture.s_wrap),
    t_wrap(texture.t_wrap),
    min_filter(texture.min_filter),
    mag_filter(texture.mag_filter),
    blend(texture.blend),
    flags(texture.flags),
    id((texture.image) ? -1 : 0)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update texture                                                                                                   
    Update();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, (%rdi)
orl $-0x1, 0x8(%rdi)
movq %rdx, %r14
andq $0x0, 0x10(%rdi)
movq %rsi, %r15
movq 0x18(%rsi), %rdi
xorl %r12d, %r12d
testq %rdi, %rdi
je 0x3fb53
callq 0x7e6a9
jmp 0x3fb55
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movq 0x20(%r15), %rax
movq %rax, 0x20(%rbx)
movups 0x28(%r15), %xmm0
movups %xmm0, 0x28(%rbx)
movl 0x38(%r15), %ecx
movl %ecx, 0x38(%rbx)
movq 0x40(%r15), %rcx
movq %rcx, 0x40(%rbx)
negq %rax
sbbl %r12d, %r12d
movl %r12d, 0x48(%rbx)
testq %r14, %r14
je 0x3fb94
movq %r14, %rdi
callq 0x7e6a9
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3fba8
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::R2Texture(gaps::R2Image const*, gaps::R2TextureWrap, gaps::R2TextureWrap, gaps::R2TextureFilter, gaps::R2TextureFilter, gaps::R2TextureBlend, char const*)
R2Texture::
R2Texture(const R2Image *image,
  R2TextureWrap s_wrap, R2TextureWrap t_wrap,
  R2TextureFilter min_filter, R2TextureFilter mag_filter,
  R2TextureBlend blend,
  const char *name)
  : scene(NULL),
    scene_index(-1),
    name(NULL),
    filename(NULL),
    image(image),
    s_wrap(s_wrap),
    t_wrap(t_wrap),
    min_filter(min_filter),
    mag_filter(mag_filter),
    blend(blend),
    flags(RN_NO_FLAGS),
    id(-1)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Update texture
    Update();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %eax
andq $0x0, (%rbx)
orl $-0x1, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq %rsi, 0x20(%rbx)
movl %edx, 0x28(%rbx)
movl %ecx, 0x2c(%rbx)
movl %r8d, 0x30(%rbx)
movl %r9d, 0x34(%rbx)
movl %eax, 0x38(%rbx)
andq $0x0, 0x40(%rbx)
orl $-0x1, 0x48(%rbx)
testq %rdi, %rdi
je 0x3fbfe
leaq 0x10(%rbx), %r14
callq 0x7e6a9
movq %rax, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3fba8
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::R2Texture(char const*, gaps::R2TextureWrap, gaps::R2TextureWrap, gaps::R2TextureFilter, gaps::R2TextureFilter, gaps::R2TextureBlend, char const*)
R2Texture::
R2Texture(const char *filename,
  R2TextureWrap s_wrap, R2TextureWrap t_wrap,
  R2TextureFilter min_filter, R2TextureFilter mag_filter,
  R2TextureBlend blend,
  const char *name)
  : scene(NULL),
    scene_index(-1),
    name(NULL),
    filename((filename) ? RNStrdup(filename) : NULL),
    image(NULL),
    s_wrap(s_wrap),
    t_wrap(t_wrap),
    min_filter(min_filter),
    mag_filter(mag_filter),
    blend(blend),
    flags(RN_NO_FLAGS),
    id(-1)
{
    // Set name
    if (name) this->name = RNStrdup(name);

    // Create image
    image = new R2Image(filename);
    assert(image);

    // Update 
    if (!image) id = 0;
    Update();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r13d
movl %r8d, %r12d
movl %ecx, %ebp
movl %edx, %r15d
movq %rdi, %rbx
movq 0x58(%rsp), %rdi
movl 0x50(%rsp), %r10d
andq $0x0, (%rbx)
movq %rsi, %r14
orl $-0x1, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
testq %rsi, %rsi
je 0x3fc67
movq %rdi, 0x10(%rsp)
movq %r14, %rdi
movl %r10d, 0xc(%rsp)
callq 0x7e6a9
movl 0xc(%rsp), %r10d
movq 0x10(%rsp), %rdi
jmp 0x3fc69
xorl %eax, %eax
movq %rax, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
movl %r15d, 0x28(%rbx)
movl %ebp, 0x2c(%rbx)
movl %r12d, 0x30(%rbx)
movl %r13d, 0x34(%rbx)
movl %r10d, 0x38(%rbx)
andq $0x0, 0x40(%rbx)
orl $-0x1, 0x48(%rbx)
testq %rdi, %rdi
je 0x3fc9c
callq 0x7e6a9
movq %rax, 0x10(%rbx)
pushq $0x18
popq %rdi
callq 0x218d0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x77628
movq %r15, 0x20(%rbx)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fba8
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x218f0
movq %rbx, %rdi
callq 0x220e0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::~R2Texture()
R2Texture::
~R2Texture(void)
{
  // Unload texture
  if (IsLoaded() > 0) Unload();

  // Remove from scene
  if (scene) scene->RemoveTexture(this);

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

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x48(%rdi)
jle 0x3fcf4
movq %rbx, %rdi
callq 0x3fd20
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3fd04
movq %rbx, %rsi
callq 0x278e4
movq 0x10(%rbx), %rdi
callq 0x21ad0
movq 0x18(%rbx), %rdi
popq %rbx
jmp 0x21ad0
movq %rax, %rdi
callq 0x3471e
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::SetImage(gaps::R2Image const*)
void R2Texture::
SetImage(const R2Image *image)
{
  // Unload previous texture
  if (IsLoaded()) Unload();

  // Set image
  flags.Remove(R2_TEXTURE_TRANSPARENCY_FLAG);
  if ((image) && ((image->NComponents() == 2) || (image->NComponents() == 4)))
    flags.Add(R2_TEXTURE_TRANSPARENCY_FLAG);
  this->image = image;
  this->id = (image) ? -1 : 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x48(%rdi)
jle 0x3fdc0
movq %rbx, %rdi
callq 0x3fd20
movq 0x40(%rbx), %rax
movq %rax, %rcx
andq $-0x101, %rcx           # imm = 0xFEFF
movq %rcx, 0x40(%rbx)
testq %r14, %r14
je 0x3fdef
movl 0x8(%r14), %ecx
cmpl $0x4, %ecx
je 0x3fde5
cmpl $0x2, %ecx
jne 0x3fdef
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x40(%rbx)
movq %r14, 0x20(%rbx)
xorl %eax, %eax
negq %r14
sbbl %eax, %eax
movl %eax, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::UpdateFlags(gaps::RNFlags)
void R2Texture::
UpdateFlags (const RNFlags flags)
{
  // Update flags
  this->flags = flags;
  if ((image) && ((image->NComponents() == 2) || (image->NComponents() == 4)))
    this->flags.Add(R2_TEXTURE_TRANSPARENCY_FLAG);
}

// Assembly:
movq %rsi, 0x40(%rdi)
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x3fe2b
movl 0x8(%rax), %eax
cmpl $0x4, %eax
je 0x3fe20
cmpl $0x2, %eax
jne 0x3fe2b
orq $0x100, %rsi            # imm = 0x100
movq %rsi, 0x40(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::Draw(int) const
void R2Texture::
Draw(RNBoolean force) const
{
  // Check if same texture as last time
  static const R2Texture *R2current_texture = NULL;
  if (!force && (this == R2current_texture)) return;

  // Check if null texture
  if (id == 0) {
    // Disable texture
    glDisable(GL_TEXTURE_2D);

    // Disable polygon offset
    glDisable(GL_POLYGON_OFFSET_FILL);
  }
  else {
    // Load texture
    if (!IsLoaded()) Load();
    
    // Set texture
    glBindTexture(GL_TEXTURE_2D, id);

    // Enable texture
    glEnable(GL_TEXTURE_2D);

    // Enable polygon offset (for decals)
    glPolygonOffset(-1, -1);
    glEnable(GL_POLYGON_OFFSET_FILL);
  }

  // Set blending
  if (IsTransparent()) {
    glDepthMask(FALSE);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_BLEND);
  }
  else {
    glDisable(GL_BLEND);
    glBlendFunc(GL_ONE, GL_ZERO);
    glDepthMask(TRUE);
  }
  
  // Remember current texture
  R2current_texture = this;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
jne 0x3ff6b
cmpq %rbx, 0xf515b(%rip)     # 0x1350c0
je 0x4000f
movl 0x48(%rbx), %esi
testl %esi, %esi
je 0x3ffaf
jg 0x3ff7f
movq %rbx, %rdi
callq 0x3fe2c
movl 0x48(%rbx), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21b70
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21820
movss 0x86e55(%rip), %xmm0    # 0xc6df0
movaps %xmm0, %xmm1
callq 0x21fb0
movl $0x8037, %edi           # imm = 0x8037
callq 0x21820
jmp 0x3ffc3
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21210
movl $0x8037, %edi           # imm = 0x8037
callq 0x21210
testb $0x1, 0x41(%rbx)
jne 0x3ffe8
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x21210
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %esi, %esi
callq 0x216d0
movl %ebp, %edi
callq 0x21520
jmp 0x40008
xorl %edi, %edi
callq 0x21520
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq 0x216d0
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x21820
movq %rbx, 0xf50b1(%rip)     # 0x1350c0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_callbacks.c
// Function: glutDisplayFunc
void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutDisplayFunc" );
    if( !callback )
        fgError( "Fatal error in program.  NULL display callback not "
                 "permitted in GLUT 3.0+ or freeglut 2.0.1+" );
    SET_CALLBACK( Display );
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7b349(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb7eb2
leaq 0x1c3c2(%rip), %rdi     # 0xd4266
leaq 0x1c3fb(%rip), %rsi     # 0xd42a6
xorl %eax, %eax
callq 0xbad73
testq %rbx, %rbx
jne 0xb7ec5
leaq 0x1c3f8(%rip), %rdi     # 0xd42b6
xorl %eax, %eax
callq 0xbad73
leaq 0x7f9c4(%rip), %rax     # 0x137890
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xb7edf
cmpq %rbx, 0x70(%rax)
je 0xb7edf
movq %rbx, 0x70(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_callbacks.c
// Function: glutTimerFunc
void FGAPIENTRY glutTimerFunc( unsigned int timeOut, void (* callback)( int ),
                               int timerID )
{
    SFG_Timer *timer, *node;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutTimerFunc" );

    if( (timer = fgState.FreeTimers.Last) )
    {
        fgListRemove( &fgState.FreeTimers, &timer->Node );
    }
    else
    {
        if( ! (timer = malloc(sizeof(SFG_Timer))) )
            fgError( "Fatal error: "
                     "Memory allocation failure in glutTimerFunc()" );
    }

    timer->Callback  = callback;
    timer->ID        = timerID;
    timer->TriggerTime = fgElapsedTime() + timeOut;

    for( node = fgState.Timers.First; node; node = node->Node.Next )
    {
        if( node->TriggerTime > timer->TriggerTime )
            break;
    }

    fgListInsert( &fgState.Timers, &node->Node, &timer->Node );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movq %rsi, %r12
movl %edi, %ebp
leaq 0x7b1e0(%rip), %rbx     # 0x1331e0
cmpb $0x0, 0x1c(%rbx)
jne 0xb801b
leaq 0x1c259(%rip), %rdi     # 0xd4266
leaq 0x1c33d(%rip), %rsi     # 0xd4351
xorl %eax, %eax
callq 0xbad73
movq 0x60(%rbx), %r15
testq %r15, %r15
je 0xb8032
leaq 0x58(%rbx), %rdi
movq %r15, %rsi
callq 0xbd7d7
jmp 0xb8053
pushq $0x28
popq %rdi
callq 0x21c70
movq %rax, %r15
testq %rax, %rax
jne 0xb8053
leaq 0x1c316(%rip), %rdi     # 0xd435f
xorl %r15d, %r15d
xorl %eax, %eax
callq 0xbad73
movq %r12, 0x18(%r15)
movl %r14d, 0x10(%r15)
callq 0xbad60
movl %ebp, %ecx
addq %rax, %rcx
movq %rcx, 0x20(%r15)
leaq 0x48(%rbx), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
je 0xb807b
cmpq %rcx, 0x20(%rsi)
jle 0xb806d
addq $0x48, %rbx
movq %rbx, %rdi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xbdb79
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_callbacks.c
// Function: glutVisibilityFunc
void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutVisibilityFunc" );
    SET_CALLBACK( Visibility );

    if( callback )
        glutWindowStatusFunc( fghVisibility );
    else
        glutWindowStatusFunc( NULL );
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7b143(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb80b8
leaq 0x1c1bc(%rip), %rdi     # 0xd4266
leaq 0x1c2e8(%rip), %rsi     # 0xd4399
xorl %eax, %eax
callq 0xbad73
leaq 0x7f7d1(%rip), %rax     # 0x137890
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xb80e6
cmpq %rbx, 0xc8(%rax)
je 0xb80d8
movq %rbx, 0xc8(%rax)
testq %rbx, %rbx
je 0xb80e8
leaq 0x54(%rip), %rdi        # 0xb8138
jmp 0xb80ea
popq %rbx
retq
xorl %edi, %edi
popq %rbx
jmp 0xb80f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_callbacks.c
// Function: fghVisibility
static void fghVisibility( int status )
{
    int glut_status = GLUT_VISIBLE;

    FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED ( "Visibility Callback" );
    freeglut_return_if_fail( fgStructure.CurrentWindow );

    if( ( GLUT_HIDDEN == status )  || ( GLUT_FULLY_COVERED == status ) )
        glut_status = GLUT_NOT_VISIBLE;
    INVOKE_WCB( *( fgStructure.CurrentWindow ), Visibility, ( glut_status ) );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x7b09b(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8160
leaq 0x1c3f9(%rip), %rdi     # 0xd454b
leaq 0x1c43b(%rip), %rsi     # 0xd4594
xorl %eax, %eax
callq 0xbad73
leaq 0x7f729(%rip), %r14     # 0x137890
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0xb81a2
cmpq $0x0, 0xc8(%rdi)
je 0xb81a2
testl %ebx, %ebx
setne %al
cmpl $0x3, %ebx
setne %cl
andb %al, %cl
movzbl %cl, %ebx
callq 0xbde17
movq 0x30(%r14), %rax
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0xc8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_callbacks.c
// Function: glutJoystickFunc
void FGAPIENTRY glutJoystickFunc( void (* callback)
                                  ( unsigned int, int, int, int ),
                                  int pollInterval )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickFunc" );
    fgInitialiseJoysticks ();

    SET_CALLBACK( Joystick );
    fgStructure.CurrentWindow->State.JoystickPollRate = pollInterval;

    fgStructure.CurrentWindow->State.JoystickLastPoll =
        fgElapsedTime() - fgStructure.CurrentWindow->State.JoystickPollRate;

    if( fgStructure.CurrentWindow->State.JoystickLastPoll < 0 )
        fgStructure.CurrentWindow->State.JoystickLastPoll = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7af95(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8266
leaq 0x1c00e(%rip), %rdi     # 0xd4266
leaq 0x1c172(%rip), %rsi     # 0xd43d1
xorl %eax, %eax
callq 0xbad73
callq 0xba3a0
leaq 0x7f61e(%rip), %r15     # 0x137890
movq 0x30(%r15), %rax
testq %rax, %rax
je 0xb82ac
cmpq %r14, 0xd8(%rax)
je 0xb828b
movq %r14, 0xd8(%rax)
movslq %ebx, %rcx
movq %rcx, 0x50(%rax)
callq 0xbad60
movq 0x30(%r15), %rcx
subq 0x50(%rcx), %rax
xorl %edx, %edx
testq %rax, %rax
cmovgq %rax, %rdx
movq %rdx, 0x58(%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_display.c
// Function: glutSwapBuffers
void FGAPIENTRY glutSwapBuffers( void )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSwapBuffers" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSwapBuffers" );

    /*
     * "glXSwapBuffers" already performs an implicit call to "glFlush". What
     * about "SwapBuffers"?
     */
    glFlush( );
    if( ! fgStructure.CurrentWindow->Window.DoubleBuffered )
        return;

#if TARGET_HOST_POSIX_X11
    glXSwapBuffers( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle );
#elif TARGET_HOST_MS_WINDOWS
    SwapBuffers( fgStructure.CurrentWindow->Window.Device );
#endif

    /* GLUT_FPS env var support */
    if( fgState.FPSInterval )
    {
        GLint t = glutGet( GLUT_ELAPSED_TIME );
        fgState.SwapCount++;
        if( fgState.SwapTime == 0 )
            fgState.SwapTime = t;
        else if( t - fgState.SwapTime > fgState.FPSInterval )
        {
            float time = 0.001f * ( t - fgState.SwapTime );
            float fps = ( float )fgState.SwapCount / time;
            fprintf( stderr,
                     "freeglut: %d frames in %.2f seconds = %.2f FPS\n",
                     fgState.SwapCount, time, fps );
            fgState.SwapTime = t;
            fgState.SwapCount = 0;
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7a9f7(%rip), %r14     # 0x1331e0
cmpb $0x0, 0x1c(%r14)
jne 0xb8805
leaq 0x1ba6f(%rip), %rdi     # 0xd4266
leaq 0x1bdfe(%rip), %rsi     # 0xd45fc
xorl %eax, %eax
callq 0xbad73
leaq 0x7f084(%rip), %rbx     # 0x137890
cmpq $0x0, 0x30(%rbx)
jne 0xb8828
leaq 0x1bda4(%rip), %rdi     # 0xd45be
leaq 0x1bddb(%rip), %rsi     # 0xd45fc
xorl %eax, %eax
callq 0xbad73
callq 0x21dc0
movq 0x30(%rbx), %rax
cmpl $0x0, 0x30(%rax)
je 0xb88c6
leaq 0x7efae(%rip), %rcx     # 0x1377f0
movq (%rcx), %rdi
movq 0x18(%rax), %rsi
callq 0x22190
cmpl $0x0, 0x30(%r14)
je 0xb88c6
movl $0x2bc, %edi            # imm = 0x2BC
callq 0xbcc17
movl %eax, %ebx
movl 0x34(%r14), %edx
movl 0x38(%r14), %eax
incl %edx
movl %edx, 0x34(%r14)
testl %eax, %eax
je 0xb88c2
movl %ebx, %ecx
subl %eax, %ecx
cmpl 0x30(%r14), %ecx
jbe 0xb88c6
movl %ecx, %eax
cvtsi2ss %rax, %xmm0
mulss 0x1bd1c(%rip), %xmm0    # 0xd45a8
movl %edx, %eax
cvtsi2ss %rax, %xmm1
divss %xmm0, %xmm1
movq 0x75712(%rip), %rax     # 0x12dfb0
movq (%rax), %rdi
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
leaq 0x1bd5c(%rip), %rsi     # 0xd460c
movb $0x2, %al
callq 0x21da0
movl %ebx, 0x38(%r14)
andl $0x0, 0x34(%r14)
jmp 0xb88c6
movl %ebx, 0x38(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq