LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4265d
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 0x76a98
movq %r12, %rdi
movq %r13, %rsi
callq 0x760ea
leaq 0xfbae3(%rip), %rax     # 0x13e0d8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x4265d
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 0x87400
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 0x87400
jmp 0x4266c
leaq 0x103f7c(%rip), %rsi    # 0x1465e0
movq %rbx, %rdi
callq 0x873e2
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x42ac8
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 0x220a0
movl %ebx, %edi
movl $0x1202, %esi           # imm = 0x1202
movq %r15, %rdx
callq 0x220a0
movupd 0x50(%r14), %xmm0
cvtpd2ps %xmm0, %xmm0
movapd 0x9927c(%rip), %xmm1    # 0xdbcf0
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 0x220a0
movl $0x43340000, (%r15)     # imm = 0x43340000
movss 0x9920b(%rip), %xmm0    # 0xdbcc0
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_O3/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 0xf4143(%rip), %rax     # 0x136d90
movq %rax, (%rdi)
cmpl $0x0, 0x48(%rdi)
jle 0x42c64
leaq 0x990da(%rip), %rdi     # 0xdbd37
xorl %eax, %eax
callq 0x8a0fe
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x42c75
movq %rbx, %rsi
callq 0x286e8
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x42c84
popq %rbx
jmp 0x21ad0
popq %rbx
retq
movq %rax, %rdi
callq 0x3704d
// File: /workspace/github_cpp_makefile_star2_O3/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 0x42408
cmpl %eax, %ebp
jne 0x42cc5
movl $0x68, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42474
jmp 0x42d6b
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x41b8c
cmpl %eax, %ebp
jne 0x42cf3
movl $0x80, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x41bf8
jmp 0x42d6b
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x41798
cmpl %eax, %ebp
jne 0x42d21
movl $0xa8, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x41806
jmp 0x42d6b
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
movl %eax, %ebp
callq 0x407cc
cmpl %eax, %ebp
jne 0x42d4f
movl $0xb0, %edi
callq 0x218c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40838
jmp 0x42d6b
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x78(%rax)
leaq 0x99007(%rip), %rdi     # 0xdbd66
xorl %r14d, %r14d
movl %eax, %esi
xorl %eax, %eax
callq 0x8a022
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0xb0, %esi
jmp 0x42d99
movq %rax, %rbx
movl $0xa8, %esi
jmp 0x42d99
movq %rax, %rbx
movl $0x80, %esi
jmp 0x42d99
movq %rax, %rbx
movl $0x68, %esi
movq %r14, %rdi
callq 0x218e0
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43bb2
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x43c2a
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x43c9c
movq %r14, %rdi
callq 0x43a4a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43a3a
leaq 0x10(%rbx), %r14
movq %rsi, %rdi
callq 0x89f5f
movq %rax, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x43a4a
nop
// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx
testq %rcx, %rcx
je 0x43a76
cmpl $0x0, 0xb0(%rcx)
je 0x43a76
movl $0x80, %eax
orq 0xa8(%rcx), %rax
movq %rax, 0x28(%rdi)
jmp 0x43a78
xorl %eax, %eax
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x43a95
cmpl $0x0, 0x48(%rcx)
je 0x43a95
orq 0x40(%rcx), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, 0x28(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43afe
movq %rdx, %rdi
callq 0x89f5f
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x43a4a
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xffd3d(%rip), %rcx     # 0x143860
movq %rcx, 0x18(%rdi)
movq %rsi, 0x20(%rdi)
movq %rax, 0x28(%rdi)
testq %rdx, %rdx
je 0x43b40
movq %rdx, %rdi
callq 0x89f5f
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x43a4a
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43b7b
movq %rcx, %rdi
callq 0x89f5f
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x43a4a
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43be5
testq %rsi, %rsi
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
jne 0x43bf6
movl $0x80, %eax
orq 0x28(%rdi), %rax
movq %rax, 0x28(%rdi)
jmp 0x43c19
movq $-0x81, %rcx
andq 0x28(%rdi), %rcx
movq %rcx, 0x28(%rdi)
jmp 0x43bff
testq %rax, %rax
je 0x43c10
movq 0x28(%rdi), %rcx
movq 0xa8(%rax), %rax
notq %rax
andq %rcx, %rax
movq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x43c24
movq 0x28(%rdi), %rax
orq 0xa8(%rsi), %rax
movq %rax, 0x28(%rdi)
movq %rsi, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43c5d
testq %rsi, %rsi
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
jne 0x43c6e
movl $0x800, %eax            # imm = 0x800
orq 0x28(%rdi), %rax
movq %rax, 0x28(%rdi)
jmp 0x43c8e
movq $-0x801, %rcx           # imm = 0xF7FF
andq 0x28(%rdi), %rcx
movq %rcx, 0x28(%rdi)
jmp 0x43c77
testq %rax, %rax
je 0x43c85
movq 0x28(%rdi), %rcx
movq 0x40(%rax), %rax
notq %rax
andq %rcx, %rax
movq %rax, 0x28(%rdi)
testq %rsi, %rsi
je 0x43c96
movq 0x28(%rdi), %rax
orq 0x40(%rsi), %rax
movq %rax, 0x28(%rdi)
movq %rsi, 0x20(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43d03
cmpq %rbx, 0xff4df(%rip)     # 0x1431e0
je 0x43d38
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
jne 0x43d13
leaq 0xff58d(%rip), %rdi     # 0x1432a0
movl %ebp, %esi
callq 0x446f2
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
jne 0x43d2a
leaq 0x100326(%rip), %rdi    # 0x144050
movl %ebp, %esi
callq 0x44e5c
movq %rbx, 0xff4a8(%rip)     # 0x1431e0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xf2f6e(%rip), %rax     # 0x136e40
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 0x873e2
leaq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x873e2
leaq 0x50(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x87400
leaq 0x68(%rbx), %rdi
movsd 0x960fd(%rip), %xmm0    # 0xda018
subsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x87400
leaq 0x80(%rbx), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x87400
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 0x43f80
movq %r14, %rdi
callq 0x89f5f
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x445a0
// File: /workspace/github_cpp_makefile_star2_O3/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 0xf2e67(%rip), %rax     # 0x136e40
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 0x87400
leaq 0x38(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0x87400
leaq 0x50(%rbx), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x87400
leaq 0x68(%rbx), %rdi
movsd 0x95fe7(%rip), %xmm0    # 0xda018
subsd 0x20(%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x87400
leaq 0x80(%rbx), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
callq 0x87400
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 0x44096
movq %r14, %rdi
callq 0x89f5f
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x445a0
// File: /workspace/github_cpp_makefile_star2_O3/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 0xf2d61(%rip), %rax     # 0x136e40
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 0x873e2
leaq 0x38(%rbx), %rdi
movq %r13, %rsi
callq 0x873e2
leaq 0x50(%rbx), %rdi
movq %r12, %rsi
callq 0x873e2
leaq 0x68(%rbx), %rdi
movsd 0x95ef7(%rip), %xmm0    # 0xda018
subsd (%rsp), %xmm0
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x87400
leaq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0x873e2
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 0x44181
movq %r14, %rdi
callq 0x89f5f
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 0x445a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xf2c70(%rip), %rax     # 0x136e40
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 0x873e2
leaq 0x38(%rbx), %rdi
movq %rbp, %rsi
callq 0x873e2
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x873e2
leaq 0x68(%rbx), %rdi
movq %r12, %rsi
callq 0x873e2
leaq 0x80(%rbx), %rdi
movq (%rsp), %rsi
callq 0x873e2
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 0x44262
movq %r14, %rdi
callq 0x89f5f
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 0x445a0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x95b1c(%rip), %xmm1    # 0xda018
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
leaq 0xf9bcd(%rip), %rax     # 0x13e0d8
movsd (%rax), %xmm3
movapd 0x96029(%rip), %xmm4    # 0xda540
xorpd %xmm3, %xmm4
ucomisd %xmm4, %xmm2
jb 0x4452b
xorpd %xmm0, %xmm0
ucomisd %xmm2, %xmm3
jae 0x44557
movsd 0x95f9d(%rip), %xmm0    # 0xda4d0
addsd %xmm2, %xmm0
ucomisd %xmm4, %xmm0
jb 0x44543
ucomisd %xmm0, %xmm3
jae 0x44560
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
movapd %xmm2, %xmm0
movapd %xmm2, %xmm1
jne 0x44560
jp 0x44560
andb $-0x21, 0xa8(%rbx)
jmp 0x4456b
orb $0x20, 0xa8(%rbx)
movapd %xmm1, %xmm0
movq %rsp, %r14
movq %r14, %rdi
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x87400
addq $0x68, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87492
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x445d6
jp 0x445d6
movsd 0x28(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x445d6
jp 0x445d6
movsd 0x30(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x445d6
jnp 0x445e1
orq $0x1, %rsi
movq %rsi, 0xa8(%rdi)
movsd 0x38(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44610
jp 0x44610
movsd 0x40(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44610
jp 0x44610
movsd 0x48(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44610
jnp 0x4461b
orq $0x2, %rsi
movq %rsi, 0xa8(%rdi)
movsd 0x50(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x4464a
jp 0x4464a
movsd 0x58(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x4464a
jp 0x4464a
movsd 0x60(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4464a
jnp 0x44655
orq $0x4, %rsi
movq %rsi, 0xa8(%rdi)
movsd 0x68(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x44684
jp 0x44684
movsd 0x70(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x44684
jp 0x44684
movsd 0x78(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44684
jnp 0x4468f
orq $0x20, %rsi
movq %rsi, 0xa8(%rdi)
movsd 0x80(%rdi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x446c7
jp 0x446c7
movsd 0x88(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0x446c7
jp 0x446c7
movsd 0x90(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x446c7
jnp 0x446d2
orq $0x8, %rsi
movq %rsi, 0xa8(%rdi)
movsd 0x98(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x446e6
jnp 0x446f1
orq $0x10, %rsi
movq %rsi, 0xa8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorl %r12d, %r12d
movq %r12, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
movq %r12, 0x10(%rdi)
movq 0x18(%rsi), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x449af
callq 0x89f5f
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)
movq %rax, %rcx
negq %rcx
sbbl %r12d, %r12d
movl %r12d, 0x48(%rbx)
testq %r14, %r14
je 0x449f5
movq %r14, %rdi
callq 0x89f5f
movq %rax, 0x10(%rbx)
movq 0x20(%rbx), %rax
movq $0x0, 0x40(%rbx)
testq %rax, %rax
je 0x44a17
movl 0x8(%rax), %eax
cmpl $0x4, %eax
je 0x44a0f
cmpl $0x2, %eax
jne 0x44a17
movq $0x100, 0x40(%rbx)      # imm = 0x100
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R2Texture.cpp
// Function: gaps::R2Texture::Update()
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 $0x0, 0x40(%rdi)
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x44a4a
movl 0x8(%rax), %eax
cmpl $0x4, %eax
je 0x44a42
cmpl $0x2, %eax
jne 0x44a4a
movq $0x100, 0x40(%rdi)      # imm = 0x100
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %eax
xorl %r10d, %r10d
movq %r10, (%rbx)
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl %r11d, 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)
movq %r10, 0x40(%rbx)
movl %r11d, 0x48(%rbx)
testq %rdi, %rdi
je 0x44a9f
callq 0x89f5f
movq %rax, 0x10(%rbx)
movq 0x20(%rbx), %rsi
movq $0x0, 0x40(%rbx)
testq %rsi, %rsi
je 0x44ac1
movl 0x8(%rsi), %eax
cmpl $0x4, %eax
je 0x44ab9
cmpl $0x2, %eax
jne 0x44ac1
movq $0x100, 0x40(%rbx)      # imm = 0x100
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rax
movl %r9d, %ebp
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movq 0x48(%rsp), %rdi
movl 0x40(%rsp), %ecx
xorl %eax, %eax
movq %rax, (%rbx)
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
movq %rax, 0x10(%rbx)
testq %rsi, %rsi
je 0x44b10
movq %r14, %rdi
callq 0x89f5f
movl 0x40(%rsp), %ecx
movq 0x48(%rsp), %rdi
movq %rax, 0x18(%rbx)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movl %r15d, 0x28(%rbx)
movl %r13d, 0x2c(%rbx)
movl %r12d, 0x30(%rbx)
movl %ebp, 0x34(%rbx)
movl %ecx, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movl $0xffffffff, 0x48(%rbx) # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x44b45
callq 0x89f5f
movq %rax, 0x10(%rbx)
movl $0x18, %edi
callq 0x218c0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x82260
movq %r15, 0x20(%rbx)
movq $0x0, 0x40(%rbx)
movl 0x8(%r15), %eax
cmpl $0x4, %eax
je 0x44b77
cmpl $0x2, %eax
jne 0x44b7f
movq $0x100, 0x40(%rbx)      # imm = 0x100
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0x218e0
movq %rbx, %rdi
callq 0x220c0
// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x48(%rdi), %eax
testl %eax, %eax
jle 0x44bcd
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl $0x1, %edi
callq 0x21c90
movl $0xffffffff, 0x48(%rbx) # imm = 0xFFFFFFFF
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x44bdd
movq %rbx, %rsi
callq 0x287d2
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x44beb
callq 0x21ad0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x44bf9
callq 0x21ad0
addq $0x10, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x3704d
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x48(%rdi), %eax
testl %eax, %eax
jle 0x44cc4
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movl $0x1, %edi
callq 0x21c90
movq 0x40(%rbx), %rax
movq %rax, %rcx
andq $-0x101, %rcx           # imm = 0xFEFF
movq %rcx, 0x40(%rbx)
testq %r14, %r14
je 0x44cf3
movl 0x8(%r14), %ecx
cmpl $0x4, %ecx
je 0x44ce9
cmpl $0x2, %ecx
jne 0x44cf3
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_O3/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 %rbx
movq %rdi, %rbx
testl %esi, %esi
jne 0x44e71
cmpq %rbx, 0xff235(%rip)     # 0x1440a0
je 0x44f18
movl 0x48(%rbx), %esi
testl %esi, %esi
je 0x44eb5
jg 0x44e85
movq %rbx, %rdi
callq 0x44d30
movl 0x48(%rbx), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21b70
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21810
movss 0x96f9f(%rip), %xmm0    # 0xdbe40
movaps %xmm0, %xmm1
callq 0x21f90
movl $0x8037, %edi           # imm = 0x8037
callq 0x21810
jmp 0x44ec9
movl $0xde1, %edi            # imm = 0xDE1
callq 0x211f0
movl $0x8037, %edi           # imm = 0x8037
callq 0x211f0
testb $0x1, 0x41(%rbx)
jne 0x44ef1
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x211f0
movl $0x1, %edi
xorl %esi, %esi
callq 0x216d0
movl $0x1, %edi
callq 0x21520
jmp 0x44f11
xorl %edi, %edi
callq 0x21520
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq 0x216d0
movl $0xbe2, %edi            # imm = 0xBE2
callq 0x21810
movq %rbx, 0xff188(%rip)     # 0x1440a0
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x75529(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xcccb2
leaq 0x1c912(%rip), %rdi     # 0xe95b6
leaq 0x1c94b(%rip), %rsi     # 0xe95f6
xorl %eax, %eax
callq 0xcfe73
testq %rbx, %rbx
jne 0xcccc5
leaq 0x1c948(%rip), %rdi     # 0xe9606
xorl %eax, %eax
callq 0xcfe73
leaq 0x79ba4(%rip), %rax     # 0x146870
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xcccdf
cmpq %rbx, 0x70(%rax)
je 0xcccdf
movq %rbx, 0x70(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %r15d
movq %rsi, %r12
movl %edi, %ebp
leaq 0x753c0(%rip), %rbx     # 0x1421c0
cmpb $0x0, 0x1c(%rbx)
jne 0xcce1b
leaq 0x1c7a9(%rip), %rdi     # 0xe95b6
leaq 0x1c88d(%rip), %rsi     # 0xe96a1
xorl %eax, %eax
callq 0xcfe73
movq 0x60(%rbx), %r14
testq %r14, %r14
je 0xcce32
leaq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0xd2a70
jmp 0xcce55
movl $0x28, %edi
callq 0x21c60
movq %rax, %r14
testq %rax, %rax
jne 0xcce55
leaq 0x1c864(%rip), %rdi     # 0xe96af
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xcfe73
movq %r12, 0x18(%r14)
movl %r15d, 0x10(%r14)
callq 0xcfe2a
movl %ebp, %ecx
addq %rax, %rcx
movq %rcx, 0x20(%r14)
leaq 0x48(%rbx), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
je 0xcce7d
cmpq %rcx, 0x20(%rsi)
jle 0xcce6f
addq $0x48, %rbx
movq %rbx, %rdi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd2e9b
// File: /workspace/github_cpp_makefile_star2_O3/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 0x75321(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xcceba
leaq 0x1c70a(%rip), %rdi     # 0xe95b6
leaq 0x1c836(%rip), %rsi     # 0xe96e9
xorl %eax, %eax
callq 0xcfe73
leaq 0x799af(%rip), %rax     # 0x146870
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xccee8
cmpq %rbx, 0xc8(%rax)
je 0xcceda
movq %rbx, 0xc8(%rax)
testq %rbx, %rbx
je 0xcceea
leaq 0x54(%rip), %rdi        # 0xccf3a
jmp 0xcceec
popq %rbx
retq
xorl %edi, %edi
popq %rbx
jmp 0xccef2
// File: /workspace/github_cpp_makefile_star2_O3/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 0x75279(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xccf62
leaq 0x1c947(%rip), %rdi     # 0xe989b
leaq 0x1c989(%rip), %rsi     # 0xe98e4
xorl %eax, %eax
callq 0xcfe73
leaq 0x79907(%rip), %r14     # 0x146870
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0xccfa4
cmpq $0x0, 0xc8(%rdi)
je 0xccfa4
testl %ebx, %ebx
setne %al
cmpl $0x3, %ebx
setne %cl
andb %al, %cl
movzbl %cl, %ebx
callq 0xd314d
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_O3/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 0x75173(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xcd068
leaq 0x1c55c(%rip), %rdi     # 0xe95b6
leaq 0x1c6c0(%rip), %rsi     # 0xe9721
xorl %eax, %eax
callq 0xcfe73
callq 0xcf284
leaq 0x797fc(%rip), %r15     # 0x146870
movq 0x30(%r15), %rax
testq %rax, %rax
je 0xcd0ae
cmpq %r14, 0xd8(%rax)
je 0xcd08d
movq %r14, 0xd8(%rax)
movslq %ebx, %rcx
movq %rcx, 0x50(%rax)
callq 0xcfe2a
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_O3/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 0x74bd3(%rip), %rbx     # 0x1421c0
cmpb $0x0, 0x1c(%rbx)
jne 0xcd608
leaq 0x1bfbc(%rip), %rdi     # 0xe95b6
leaq 0x1c34b(%rip), %rsi     # 0xe994c
xorl %eax, %eax
callq 0xcfe73
leaq 0x79261(%rip), %r14     # 0x146870
cmpq $0x0, 0x30(%r14)
jne 0xcd62b
leaq 0x1c2f1(%rip), %rdi     # 0xe990e
leaq 0x1c328(%rip), %rsi     # 0xe994c
xorl %eax, %eax
callq 0xcfe73
callq 0x21da0
movq 0x30(%r14), %rax
cmpl $0x0, 0x30(%rax)
je 0xcd681
leaq 0x7918f(%rip), %rcx     # 0x1467d0
movq (%rcx), %rdi
movq 0x18(%rax), %rsi
callq 0x22170
cmpl $0x0, 0x30(%rbx)
je 0xcd681
movl $0x2bc, %edi            # imm = 0x2BC
callq 0xd1dc4
movl 0x34(%rbx), %esi
movl 0x38(%rbx), %ecx
incl %esi
movl %esi, 0x34(%rbx)
testl %ecx, %ecx
je 0xcd67e
movl %eax, %edi
subl %ecx, %edi
cmpl 0x30(%rbx), %edi
jbe 0xcd681
movl %eax, %edx
callq 0x229f0
jmp 0xcd681
movl %eax, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_display.c
// Function: glutPostWindowRedisplay
void FGAPIENTRY glutPostWindowRedisplay( int windowID )
{
    SFG_Window* window;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutPostWindowRedisplay" );
    window = fgWindowByID( windowID );
    freeglut_return_if_fail( window );
    window->State.Redisplay = GL_TRUE;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x74b2d(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xcd6ae
leaq 0x1bf16(%rip), %rdi     # 0xe95b6
leaq 0x1c2e5(%rip), %rsi     # 0xe998c
xorl %eax, %eax
callq 0xcfe73
movl %ebx, %edi
callq 0xd2dfd
testq %rax, %rax
je 0xcd6be
movb $0x1, 0x48(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutBitmapCharacter
void FGAPIENTRY glutBitmapCharacter( void* fontID, int character )
{
    const GLubyte* face;
    SFG_Font* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapCharacter" );
    font = fghFontByID( fontID );
    freeglut_return_if_fail( ( character >= 1 )&&( character < 256 ) );
    freeglut_return_if_fail( font );

    /*
     * Find the character we want to draw (???)
     */
    face = font->Characters[ character ];

    glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
    glPixelStorei( GL_UNPACK_SWAP_BYTES,  GL_FALSE );
    glPixelStorei( GL_UNPACK_LSB_FIRST,   GL_FALSE );
    glPixelStorei( GL_UNPACK_ROW_LENGTH,  0        );
    glPixelStorei( GL_UNPACK_SKIP_ROWS,   0        );
    glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0        );
    glPixelStorei( GL_UNPACK_ALIGNMENT,   1        );
    glBitmap(
        face[ 0 ], font->Height,      /* The bitmap's width and height  */
        font->xorig, font->yorig,     /* The origin in the font glyph   */
        ( float )( face[ 0 ] ), 0.0,  /* The raster advance -- inc. x,y */
        ( face + 1 )                  /* The packed bitmap data...      */
    );
    glPopClientAttrib( );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x74af0(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xcd6eb
leaq 0x1bed9(%rip), %rdi     # 0xe95b6
leaq 0x1c2c0(%rip), %rsi     # 0xe99a4
xorl %eax, %eax
callq 0xcfe73
movq %r14, %rdi
callq 0xcd7a6
movq %rax, %r14
leal -0x100(%rbx), %eax
cmpl $0xffffff01, %eax       # imm = 0xFFFFFF01
setb %al
testq %r14, %r14
sete %cl
orb %al, %cl
je 0xcd716
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x10(%r14), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rbx
movl $0x1, %edi
callq 0x21620
movl $0xcf0, %edi            # imm = 0xCF0
xorl %esi, %esi
callq 0x21410
movl $0xcf1, %edi            # imm = 0xCF1
xorl %esi, %esi
callq 0x21410
movl $0xcf2, %edi            # imm = 0xCF2
xorl %esi, %esi
callq 0x21410
movl $0xcf3, %edi            # imm = 0xCF3
xorl %esi, %esi
callq 0x21410
movl $0xcf4, %edi            # imm = 0xCF4
xorl %esi, %esi
callq 0x21410
movl $0xcf5, %edi            # imm = 0xCF5
movl $0x1, %esi
callq 0x21410
movzbl (%rbx), %edi
movl 0xc(%r14), %esi
movss 0x18(%r14), %xmm0
movss 0x1c(%r14), %xmm1
cvtsi2ss %edi, %xmm2
incq %rbx
xorps %xmm3, %xmm3
movq %rbx, %rdx
callq 0x21860
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21ac0