LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/aarect.cpp
// Function: yz_rect::hit(ray const&, float, float, hit_record&) const
bool yz_rect::hit(const ray& _ray, float t_min, float t_max, hit_record& rec) const
{
    float t = (k - _ray.origin().x()) / _ray.direction().x();
    if(t < t_min || t > t_max)
    {
        return false;
    }
    float y = _ray.origin().y() + t * _ray.direction().y();
    float z = _ray.origin().z() + t * _ray.direction().z();
    if(y < y0 || y > y1 || z < z0 || z > z1)
    {
        return false;
    }
    rec.u = (y - y0) / (y1 - y0);
    rec.v = (z - z0) / (z1 - z0);
    rec.t = t;
    rec.material_ref = rect_material;
    rec.hit_point = _ray.point_at_parameter(t);
    rec.normal = vec3(1.0f, 0.0f, 0.0f);
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movss 0x18(%rdi), %xmm6
movsd (%rsi), %xmm2
movsd 0xc(%rsi), %xmm3
subss %xmm2, %xmm6
divss %xmm3, %xmm6
xorl %eax, %eax
ucomiss %xmm6, %xmm0
ja 0x86ff
ucomiss %xmm1, %xmm6
ja 0x86ff
movq %rdi, %rsi
movaps %xmm6, %xmm7
shufps $0x0, %xmm6, %xmm7      # xmm7 = xmm7[0,0],xmm6[0,0]
movss 0x8(%r14), %xmm1
movss 0x14(%r14), %xmm0
shufps $0xd4, %xmm3, %xmm0     # xmm0 = xmm0[0,1],xmm3[1,3]
shufps $0x52, %xmm3, %xmm0     # xmm0 = xmm0[2,0],xmm3[1,1]
shufps $0xd4, %xmm2, %xmm1     # xmm1 = xmm1[0,1],xmm2[1,3]
shufps $0x52, %xmm2, %xmm1     # xmm1 = xmm1[2,0],xmm2[1,1]
mulps %xmm7, %xmm0
addps %xmm1, %xmm0
movss 0x8(%rdi), %xmm1
ucomiss %xmm0, %xmm1
ja 0x86fd
movss 0xc(%rsi), %xmm2
ucomiss %xmm2, %xmm0
ja 0x86fd
movss 0x10(%rsi), %xmm3
movaps %xmm0, %xmm5
shufps $0x55, %xmm0, %xmm5     # xmm5 = xmm5[1,1],xmm0[1,1]
ucomiss %xmm5, %xmm3
ja 0x86fd
movss 0x14(%rsi), %xmm4
ucomiss %xmm4, %xmm5
jbe 0x8707
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rdx, %rbx
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subps %xmm1, %xmm0
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subps %xmm1, %xmm2
divps %xmm2, %xmm0
movlps %xmm0, 0x4(%rdx)
movss %xmm6, (%rdx)
movq 0x20(%rsi), %rax
movq %rax, 0x28(%rdx)
leaq 0x30(%rdx), %rdi
addq $0x28, %rsi
movaps %xmm6, (%rsp)
movaps %xmm7, 0x10(%rsp)
callq 0x7a28
movaps (%rsp), %xmm2
mulss 0x14(%r14), %xmm2
movsd (%r14), %xmm0
movsd 0xc(%r14), %xmm1
movaps 0x10(%rsp), %xmm3
mulps %xmm1, %xmm3
addps %xmm0, %xmm3
addss 0x8(%r14), %xmm2
movlps %xmm3, 0xc(%rbx)
movss %xmm2, 0x14(%rbx)
movss 0x33a8e(%rip), %xmm0    # 0x3c204
movlps %xmm0, 0x18(%rbx)
movl $0x0, 0x20(%rbx)
movb $0x1, %al
jmp 0x86ff
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/texture.cpp
// Function: checker_texture::value_at_uv(float, float, vec3 const&) const
vec3 checker_texture::value_at_uv(float _u, float _v, const vec3& _hit_point) const
{
    // TODO : 
    // need a way to distinguish sampling from odd and even texture.
    // currently using world space position to do the determination.
    // which will cause artifacts on bending surfaces like a sphere.

    float sines = std::sin(10 * _hit_point.x()) * std::sin(10 * _hit_point.y()) * std::sin(10 * _hit_point.z());
    if(sines < 0.0f)
    {
        return odd_texture->value_at_uv(_u, _v, _hit_point);
    }
    return even_texture->value_at_uv(_u, _v, _hit_point);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movss %xmm1, 0x14(%rsp)
movss %xmm0, 0x10(%rsp)
movq %rdi, %r14
movss (%rsi), %xmm0
mulss 0x33a33(%rip), %xmm0    # 0x3c23c
callq 0x6340
movss %xmm0, 0xc(%rsp)
movss 0x4(%rbx), %xmm0
mulss 0x33a1b(%rip), %xmm0    # 0x3c23c
callq 0x6340
mulss 0xc(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x33a02(%rip), %xmm0    # 0x3c23c
mulss 0x8(%rbx), %xmm0
callq 0x6340
mulss 0xc(%rsp), %xmm0
xorps %xmm1, %xmm1
xorl %eax, %eax
ucomiss %xmm0, %xmm1
seta %al
shll $0x4, %eax
movq 0x8(%r14,%rax), %rdi
movq (%rdi), %rax
movq (%rax), %rax
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/texture.cpp
// Function: perlin_noise_texture::value_at_uv(float, float, vec3 const&) const
vec3 perlin_noise_texture::value_at_uv(float _u, float _v, const vec3& _hit_point) const
{
    //return vec3(1, 1, 1) * perlin::get_noise(scale * _hit_point);
    //std::cout << perlin::turb(scale * _hit_point) << "\n";
    //return vec3(1, 1, 1) * perlin::turb(scale * _hit_point);
    return vec3(1, 1, 1) * 0.5f * (1 + std::sin(scale * _hit_point.x() + 5.0f * perlin::turb(_hit_point * scale)));
}

// Assembly:
subq $0x38, %rsp
movss 0x8(%rdi), %xmm2
movaps %xmm2, (%rsp)
movsd (%rsi), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm2, %xmm0
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
mulps %xmm1, %xmm0
movss 0x8(%rsi), %xmm1
mulss %xmm2, %xmm1
leaq 0x28(%rsp), %rdi
movlps %xmm0, (%rdi)
movss %xmm1, 0x8(%rdi)
movl $0x7, %esi
callq 0xbb08
mulss 0x3397d(%rip), %xmm0    # 0x3c240
movaps (%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
addss %xmm1, %xmm0
callq 0x6340
addss 0x33926(%rip), %xmm0    # 0x3c204
mulss 0x3395e(%rip), %xmm0    # 0x3c244
movaps %xmm0, %xmm2
shufps $0x0, %xmm0, %xmm2      # xmm2 = xmm2[0,0],xmm0[0,0]
movaps %xmm0, %xmm1
movaps %xmm2, %xmm0
addq $0x38, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/texture.cpp
// Function: image_texture::image_texture(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
image_texture::image_texture(std::string _file_name)
{
    data = stbi_load(_file_name.c_str(), &width, &height, &channel, 0);
    std::cout << "SYS : Loading texture : " << _file_name << ", width = " << width << ", height = " << height << ", channel = " << channel << "\n";
    if(data == nullptr)
    {
        std::cerr << "Error when loading texture : " << _file_name << "\n";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x457d6(%rip), %rax     # 0x4e0e0
movq %rax, (%rdi)
movq (%rsi), %rdi
leaq 0x10(%r14), %rsi
leaq 0x14(%r14), %rdx
leaq 0x18(%r14), %rcx
xorl %r8d, %r8d
callq 0x23bc4
movq %rax, 0x8(%r14)
movq 0x46679(%rip), %r15     # 0x4efa8
leaq 0x3392a(%rip), %rsi     # 0x3c260
movl $0x18, %edx
movq %r15, %rdi
callq 0x6470
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r15, %rdi
callq 0x6470
movq %rax, %r15
leaq 0x3391d(%rip), %rsi     # 0x3c279
movl $0xa, %edx
movq %rax, %rdi
callq 0x6470
movl 0x10(%r14), %esi
movq %r15, %rdi
callq 0x66c0
movq %rax, %r15
leaq 0x33905(%rip), %rsi     # 0x3c284
movl $0xb, %edx
movq %rax, %rdi
callq 0x6470
movl 0x14(%r14), %esi
movq %r15, %rdi
callq 0x66c0
movq %rax, %r15
leaq 0x338ee(%rip), %rsi     # 0x3c290
movl $0xc, %edx
movq %rax, %rdi
callq 0x6470
movl 0x18(%r14), %esi
movq %r15, %rdi
callq 0x66c0
leaq 0x34361(%rip), %rsi     # 0x3cd23
movl $0x1, %edx
movq %rax, %rdi
callq 0x6470
cmpq $0x0, 0x8(%r14)
je 0x89dc
popq %rbx
popq %r14
popq %r15
retq
movq 0x465fd(%rip), %r14     # 0x4efe0
leaq 0x338b3(%rip), %rsi     # 0x3c29d
movl $0x1d, %edx
movq %r14, %rdi
callq 0x6470
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x6470
leaq 0x34316(%rip), %rsi     # 0x3cd23
movl $0x1, %edx
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6470
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/texture.cpp
// Function: image_texture::value_at_uv(float, float, vec3 const&) const
vec3 image_texture::value_at_uv(float _u, float _v, const vec3& _hit_point) const
{
    // do some repeating and fraction
    // _u *= 5.0f;
    // _v *= 5.0f;

    // _u = _u -(long)_u;
    // _v = _v -(long)_v;

    int width_index = _u * width;
    //int height_index = _v * height;
    int height_index = ( 1 - _v ) * height - 0.001f;

    width_index = std::clamp(width_index, 0, width - 1);
    height_index = std::clamp(height_index, 0, height - 1);

    float normalized_r = int(data[ height_index * width * 3 + width_index * 3 + 0 ]) / 255.0f;
    float normalized_g = int(data[ height_index * width * 3 + width_index * 3 + 1 ]) / 255.0f;
    float normalized_b = int(data[ height_index * width * 3 + width_index * 3 + 2 ]) / 255.0f;

    //std::cout << "input uv = " << _u << " , " << _v << std::endl;
    //std::cout << "width_index = " << width_index << " , height_index = " << height_index << std::endl;

    return vec3(normalized_r, normalized_g, normalized_b);
}

// Assembly:
movl 0x10(%rdi), %eax
cvtsi2ss %eax, %xmm2
mulss %xmm0, %xmm2
cvttss2si %xmm2, %ecx
movss 0x337cd(%rip), %xmm0    # 0x3c204
subss %xmm1, %xmm0
movl 0x14(%rdi), %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
mulss %xmm0, %xmm1
addss 0x337f7(%rip), %xmm1    # 0x3c248
cvttss2si %xmm1, %esi
leal -0x1(%rax), %r8d
cmpl %ecx, %r8d
cmovgel %ecx, %r8d
xorl %r9d, %r9d
testl %ecx, %ecx
cmovsl %r9d, %r8d
decl %edx
cmpl %esi, %edx
cmovgel %esi, %edx
testl %esi, %esi
cmovsl %r9d, %edx
movq 0x8(%rdi), %rcx
imull %eax, %edx
addl %r8d, %edx
leal (%rdx,%rdx,2), %eax
cltq
movzwl (%rcx,%rax), %edx
movd %edx, %xmm0
xorps %xmm1, %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
cvtdq2ps %xmm0, %xmm0
divps 0x337ae(%rip), %xmm0    # 0x3c250
movzbl 0x2(%rcx,%rax), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
divss 0x33796(%rip), %xmm1    # 0x3c24c
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/hitable_list.cpp
// Function: hitable_list::hit(ray const&, float, float, hit_record&) const
bool hitable_list::hit(const ray& _ray, float t_min, float t_max, hit_record& rec) const
{
    hit_record temp_rec;
    bool is_anything_hit = false;
    double closest_so_far = t_max;

    for(int i = 0; i < list_size; i++)
    {
        if(list[i]->hit(_ray, t_min, closest_so_far, temp_rec))
        {
            is_anything_hit = true;
            closest_so_far = temp_rec.t;
            rec = temp_rec;
        }
    }

    return is_anything_hit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movss %xmm0, 0xc(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
cmpl $0x0, 0x20(%rdi)
jle 0x8b90
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x30(%rdx), %rax
movq %rax, 0x18(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%r15), %rax
movq (%rax,%r12), %rdi
xorps %xmm1, %xmm1
cvtsd2ss 0x10(%rsp), %xmm1
movq (%rdi), %rax
movq %r14, %rsi
movss 0xc(%rsp), %xmm0
leaq 0x20(%rsp), %rdx
callq *(%rax)
testb %al, %al
je 0x8b6f
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x20(%rbx)
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rbx)
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x7a28
movb $0x1, %bpl
incq %r13
movslq 0x20(%r15), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x8b05
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x8b92
callq 0x7774
jmp 0x8b92
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x8bb9
callq 0x7774
movq %rbx, %rdi
callq 0x66e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/hitable_list.cpp
// Function: hitable_list::bounding_box(float, float, aabb&) const
bool hitable_list::bounding_box(float t0, float t1, aabb& _box) const
{
    if(list_size < 1) return false;
    aabb result;
    bool first_true = list[0]->bounding_box(t0, t1, result);
    if(!first_true)
    {
        return false;
    }
    else
    {
        _box = result;
    }
    
    for(int i = 1; i < list_size; i++)
    {
        // TODO : Is this correct?
        // Reference to github issue page : https://github.com/RayTracing/raytracingthenextweek/issues/2
        // it should be list[i] rather than list[0]
        if(list[i]->bounding_box(t0, t1, result))
        {
            _box = surrounding_box(_box, result);
        }
        else
        {
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
cmpl $0x0, 0x20(%rdi)
jle 0x8cc8
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq (%rax), %rdi
movq (%rdi), %rax
leaq 0x38(%rsp), %rsi
movss %xmm0, 0x30(%rsp)
movss %xmm1, 0x34(%rsp)
callq *0x8(%rax)
testb %al, %al
je 0x8cc8
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rbx)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %bpl
cmpl $0x2, 0x20(%r14)
jl 0x8cca
movl $0x1, %r13d
movl $0x10, %r12d
leaq 0x38(%rsp), %r15
movq 0x8(%r14), %rax
movq (%rax,%r12), %rdi
movq (%rdi), %rax
movss 0x30(%rsp), %xmm0
movss 0x34(%rsp), %xmm1
movq %r15, %rsi
callq *0x8(%rax)
movl %eax, %ebp
testb %al, %al
je 0x8cca
movups (%rbx), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x60(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
callq 0xc370
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rbx)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rbx)
incq %r13
movslq 0x20(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x8c39
jmp 0x8cca
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/sphere.cpp
// Function: moving_sphere::bounding_box(float, float, aabb&) const
bool moving_sphere::bounding_box(float t0, float t1, aabb& _box) const
{
    vec3 radius_vector(radius, radius, radius);
    aabb box_at_t0( center(t0) - radius_vector, center(t0) + radius_vector );
    aabb box_at_t1( center(t1) - radius_vector, center(t1) + radius_vector );

    _box = surrounding_box(box_at_t0, box_at_t1);
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movss 0x28(%rdi), %xmm3
movss 0x20(%rdi), %xmm6
subss %xmm6, %xmm0
movss 0x24(%rdi), %xmm7
subss %xmm6, %xmm7
divss %xmm7, %xmm0
movss 0x1c(%rdi), %xmm2
movss 0x10(%rdi), %xmm8
subss %xmm8, %xmm2
movaps %xmm0, %xmm4
mulss %xmm2, %xmm4
addss %xmm8, %xmm4
movaps %xmm3, %xmm5
addss %xmm4, %xmm5
subss %xmm3, %xmm4
subss %xmm6, %xmm1
divss %xmm7, %xmm1
mulss %xmm1, %xmm2
addss %xmm8, %xmm2
movaps %xmm2, %xmm6
subss %xmm3, %xmm6
movsd 0x14(%rdi), %xmm8
movsd 0x8(%rdi), %xmm7
subps %xmm7, %xmm8
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
mulps %xmm8, %xmm0
addps %xmm7, %xmm0
addss %xmm3, %xmm2
shufps $0x0, %xmm3, %xmm3      # xmm3 = xmm3[0,0,0,0]
movaps %xmm3, %xmm9
addps %xmm0, %xmm9
subps %xmm3, %xmm0
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
mulps %xmm8, %xmm1
addps %xmm7, %xmm1
movaps %xmm1, %xmm7
subps %xmm3, %xmm7
addps %xmm3, %xmm1
movlps %xmm0, 0x48(%rsp)
movss %xmm4, 0x50(%rsp)
movlps %xmm9, 0x54(%rsp)
movss %xmm5, 0x5c(%rsp)
movlps %xmm7, 0x30(%rsp)
movss %xmm6, 0x38(%rsp)
movlps %xmm1, 0x3c(%rsp)
movss %xmm2, 0x44(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0xc370
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
addq $0x78, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/bvh.cpp
// Function: bvh_node::box_x_compare::operator()(std::shared_ptr<hitable> const&, std::shared_ptr<hitable> const&) const
bool bvh_node::box_x_compare::operator() (const hitable_reference& a, const hitable_reference& b) const
{
    aabb box_left, box_right;
    if(a->bounding_box(0, 0, box_left) == false || b->bounding_box(0, 0, box_right) == false)
    {
        std::cerr << "No bounding box in bvh_node constructor!\n";
    }

    // IMPORTANT !!!
    // Reference : https://stackoverflow.com/questions/1541817/sort-function-c-segmentation-fault
    // In C++, your "compare" predicate must be a strict weak ordering.
    // In particular, "compare(X,X)" must return "false" for any X.
    // ... (Otherwise) Therefore, this "compare" predicate does not impose a strict weak ordering,
    // and the result of passing it to "sort" is undefined.

    if(box_left.get_min().x() - box_right.get_min().x() <= 0.0f)
    {
        return false;
    }
    else
    {
        return true;
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq (%rsi), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
je 0x98be
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
jne 0x98d6
movq 0x4571b(%rip), %rdi     # 0x4efe0
leaq 0x32b0c(%rip), %rsi     # 0x3c3d8
movl $0x29, %edx
callq 0x6470
movss 0x18(%rsp), %xmm0
subss (%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
setb %al
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/bvh.cpp
// Function: bvh_node::box_y_compare::operator()(std::shared_ptr<hitable> const&, std::shared_ptr<hitable> const&) const
bool bvh_node::box_y_compare::operator() (const hitable_reference& a, const hitable_reference& b) const
{
    aabb box_left, box_right;
    if(a->bounding_box(0, 0, box_left) == false || b->bounding_box(0, 0, box_right) == false)
    {
        std::cerr << "No bounding box in bvh_node constructor!\n";
    }

    if(box_left.get_min().y() - box_right.get_min().y() <= 0.0f)
    {
        return false;
    }
    else
    {
        return true;
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq (%rsi), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
je 0x9926
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
jne 0x993e
movq 0x456b3(%rip), %rdi     # 0x4efe0
leaq 0x32aa4(%rip), %rsi     # 0x3c3d8
movl $0x29, %edx
callq 0x6470
movss 0x1c(%rsp), %xmm0
subss 0x4(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
setb %al
addq $0x30, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/bvh.cpp
// Function: bvh_node::box_z_compare::operator()(std::shared_ptr<hitable> const&, std::shared_ptr<hitable> const&) const
bool bvh_node::box_z_compare::operator() (const hitable_reference& a, const hitable_reference& b) const
{
    aabb box_left, box_right;
    if(a->bounding_box(0, 0, box_left) == false || b->bounding_box(0, 0, box_right) == false)
    {
        std::cerr << "No bounding box in bvh_node constructor!\n";
    }

    if(box_left.get_min().z() - box_right.get_min().z() <= 0.0f)
    {
        return false;
    }
    else
    {
        return true;
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq (%rsi), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
je 0x9990
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
jne 0x99a8
movq 0x45649(%rip), %rdi     # 0x4efe0
leaq 0x32a3a(%rip), %rsi     # 0x3c3d8
movl $0x29, %edx
callq 0x6470
movss 0x20(%rsp), %xmm0
subss 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
setb %al
addq $0x30, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/bvh.cpp
// Function: bvh_node::hit(ray const&, float, float, hit_record&) const
bool bvh_node::hit(const ray& _ray, float t_min, float t_max, hit_record& rec) const
{
    if(box.hit(_ray, t_min, t_max))
    {
        hit_record left_record, right_record;
        bool hit_left = left->hit(_ray, t_min, t_max, left_record);
        bool hit_right = right->hit(_ray, t_min, t_max, right_record);

        if(hit_left && hit_right)
        {
            if(left_record.t < right_record.t)
            {
                rec = left_record;
                return true;
            }
            else
            {
                rec = right_record;
                return true;
            }
        }
        else if(hit_left)
        {
            rec = left_record;
            return true;
        }
        else if(hit_right)
        {
            rec = right_record;
            return true;
        }
        else
        {
            return false;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x28, %rdi
movss %xmm0, (%rsp)
movss %xmm1, 0x4(%rsp)
callq 0xc218
testb %al, %al
je 0x9e2a
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movups %xmm0, 0x28(%rdx)
movups %xmm0, 0x30(%rsp)
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
callq *(%rax)
movl %eax, %ebp
movq 0x18(%r15), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rdx
movq %r14, %rsi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
callq *(%rax)
leaq 0x70(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x68(%rsp), %rcx
leaq 0x30(%rsp), %rdi
movl %ebp, %r8d
andb %al, %r8b
cmpb $0x1, %r8b
jne 0x9e2e
movss 0x8(%rsp), %xmm0
ucomiss 0x40(%rsp), %xmm0
ja 0x9e33
jmp 0x9e51
xorl %ebx, %ebx
jmp 0x9ea2
testb %bpl, %bpl
je 0x9e4d
movl 0x60(%rsp), %eax
movl %eax, 0x20(%rbx)
movups 0x40(%rsp), %xmm0
movups 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x9e6f
testb %al, %al
je 0x9eaf
movl 0x28(%rsp), %eax
movl %eax, 0x20(%rbx)
movups 0x8(%rsp), %xmm0
movups 0x18(%rsp), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rdi, %rcx
movq %rdx, %rsi
movq (%rcx), %rax
movq %rax, 0x28(%rbx)
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x7a28
movb $0x1, %bl
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x9e93
callq 0x7774
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x9ea2
callq 0x7774
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x9e84
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x9eca
callq 0x7774
jmp 0x9eca
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x9ed9
callq 0x7774
movq %rbx, %rdi
callq 0x66e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/perlin.cpp
// Function: perlin::get_noise(vec3 const&)
float perlin::get_noise(const vec3& _p)
{
    float u = _p.x() - std::floor(_p.x());
    float v = _p.y() - std::floor(_p.y());
    float w = _p.z() - std::floor(_p.z());
    int i = std::floor(_p.x());
    int j = std::floor(_p.y());
    int k = std::floor(_p.z());

    vec3 data[2][2][2];
    for(int di = 0; di < 2; di++)
    {
        for(int dj = 0; dj < 2; dj++)
        {
            for(int dk = 0; dk < 2; dk++)
            {
                data[di][dj][dk] = 
                    random_vecs[perm_x[(i + di) & 255] ^ perm_y[(j + dj) & 255] ^ perm_z[(k + dk) & 255]];
            }
        }
    }

    return perlin_interpolate(data, u, v, w);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movss (%rdi), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x4(%rdi), %xmm0
movss %xmm0, 0x1c(%rsp)
callq 0x6150
movss %xmm0, 0xc(%rsp)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0x18(%rsp)
callq 0x6150
movss %xmm0, 0x14(%rsp)
cvttss2si 0xc(%rsp), %ebx
movss 0x10(%rsp), %xmm0
callq 0x6150
movss 0x14(%rsp), %xmm1
cvttss2si %xmm0, %eax
movq %rax, 0x28(%rsp)
cvttss2si %xmm1, %ecx
movq 0x43a73(%rip), %rax     # 0x4f470
movq %rax, 0x20(%rsp)
movq 0x43a7f(%rip), %rsi     # 0x4f488
movq 0x43a90(%rip), %rdi     # 0x4f4a0
movb $0x1, %r9b
movq 0x43a3e(%rip), %r8      # 0x4f458
xorl %r11d, %r11d
movq 0x28(%rsp), %rax
leal (%r11,%rax), %r10d
movzbl %r10b, %r10d
movq 0x20(%rsp), %rax
movl (%rax,%r10,4), %r10d
leaq (%r11,%r11,2), %r11
shlq $0x4, %r11
addq %rsp, %r11
addq $0x30, %r11
movb $0x1, %bpl
xorl %r12d, %r12d
leal (%r12,%rbx), %r14d
movzbl %r14b, %r14d
movl (%rsi,%r14,4), %r14d
xorl %r10d, %r14d
movb $0x1, %r15b
leaq (%r12,%r12,2), %r12
leaq (%r11,%r12,8), %r12
xorl %r13d, %r13d
leal (%rcx,%r13), %eax
movzbl %al, %eax
movl (%rdi,%rax,4), %eax
xorl %r14d, %eax
cltq
leaq (%rax,%rax,2), %rax
leaq (%r13,%r13,2), %r13
movl 0x8(%r8,%rax,4), %edx
movl %edx, 0x8(%r12,%r13,4)
movq (%r8,%rax,4), %rax
movq %rax, (%r12,%r13,4)
movl $0x1, %r13d
testb $0x1, %r15b
movl $0x0, %r15d
jne 0xba65
movl $0x1, %r12d
testb $0x1, %bpl
movl $0x0, %ebp
jne 0xba48
movl $0x1, %r11d
testb $0x1, %r9b
movl $0x0, %r9d
jne 0xba1d
movss 0x18(%rsp), %xmm2
subss %xmm1, %xmm2
movss 0x1c(%rsp), %xmm1
subss 0xc(%rsp), %xmm1
movss 0x10(%rsp), %xmm3
subss %xmm0, %xmm3
leaq 0x30(%rsp), %rdi
movaps %xmm3, %xmm0
callq 0x14dd0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/perlin.cpp
// Function: perlin::turb(vec3 const&, int)
float perlin::turb(const vec3& _p, int depth)
{
    float accum = 0.0f;
    vec3 temp_p = _p;
    float weight = 1.0f;
    for(int i = 0; i < depth; i++)
    {
        accum += weight * get_noise(temp_p);
        weight *= 0.5;
        temp_p *= 2;
    }

    //if(accum > 1.0f)
    // adding this line will produce what the book demonstrated
    accum -= 1.0f;

    return std::abs(accum);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl 0x8(%rdi), %eax
movl %eax, 0x18(%rsp)
movq (%rdi), %rax
movq %rax, 0x10(%rsp)
testl %esi, %esi
jle 0xbbb1
movl %esi, %ebx
leaq 0x10(%rsp), %r14
movsd (%r14), %xmm1
xorps %xmm0, %xmm0
movss 0x306c7(%rip), %xmm2    # 0x3c204
movss 0x8(%r14), %xmm3
movss %xmm3, 0x8(%rsp)
movss %xmm2, 0xc(%rsp)
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq %r14, %rdi
callq 0xb988
movss 0x8(%rsp), %xmm3
movss 0xc(%rsp), %xmm2
mulss %xmm2, %xmm0
movaps 0x20(%rsp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, 0x20(%rsp)
movaps 0x30(%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
mulss 0x306b3(%rip), %xmm2    # 0x3c244
addps %xmm1, %xmm1
movlps %xmm1, 0x10(%rsp)
addss %xmm3, %xmm3
movss %xmm3, 0x18(%rsp)
decl %ebx
jne 0xbb43
addss 0x307b9(%rip), %xmm0    # 0x3c368
jmp 0xbbb9
movss 0x307af(%rip), %xmm0    # 0x3c368
andps 0x308d0(%rip), %xmm0    # 0x3c490
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/perlin.cpp
// Function: perlin::perlin_generate()
std::vector<vec3> perlin::perlin_generate()
{
    std::vector<vec3> result;
    result.reserve(256);
    for(int i = 0; i < 256; i++)
    {
        // IMPORTANT : it has to be unit_vector here.
        result.push_back(unit_vector(vec3(-1 + 2 * drand48(), -1 + 2 * drand48(), -1 + 2 * drand48())));
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x100, %esi            # imm = 0x100
callq 0xbdbc
movl $0x100, %ebp            # imm = 0x100
movq %rsp, %r14
callq 0x63a0
movapd %xmm0, 0x20(%rsp)
callq 0x63a0
movapd %xmm0, 0x10(%rsp)
callq 0x63a0
addsd %xmm0, %xmm0
addsd 0x308a4(%rip), %xmm0    # 0x3c4c0
cvtsd2ss %xmm0, %xmm0
movapd 0x20(%rsp), %xmm1
unpcklpd 0x10(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
addpd %xmm1, %xmm1
addpd 0x30878(%rip), %xmm1    # 0x3c4b0
cvtpd2ps %xmm1, %xmm1
movapd %xmm1, %xmm2
mulps %xmm1, %xmm2
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
sqrtss %xmm2, %xmm2
divss %xmm2, %xmm0
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
divps %xmm2, %xmm1
movlps %xmm1, (%rsp)
movss %xmm0, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xbc94
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rsi)
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x8(%rbx)
jmp 0xbc9f
movq %rbx, %rdi
movq %r14, %rdx
callq 0xbf70
decl %ebp
jne 0xbbf5
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xbcb5
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xbccc
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x6400
movq %r14, %rdi
callq 0x66e0
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/perlin.cpp
// Function: perlin::permute(std::vector<int, std::allocator<int>>&, int)
void perlin::permute(std::vector<int>& _p, int _n)
{
    for(int i = _n - 1; i > 0; i--)
    {
        int target = int(drand48() * (i+1));
        int tmp = _p[i];
        _p[i] = _p[target];
        _p[target] = tmp;
    }
    return;
}

// Assembly:
cmpl $0x2, %esi
jl 0xbd20
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r14d
leaq -0x1(%r14), %r15
callq 0x63a0
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movq (%rbx), %rcx
movl -0x4(%rcx,%r14,4), %edx
cltq
movl (%rcx,%rax,4), %esi
movl %esi, -0x4(%rcx,%r14,4)
movl %edx, (%rcx,%rax,4)
cmpq $0x2, %r14
movq %r15, %r14
ja 0xbce4
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/perlin.cpp
// Function: perlin::perlin_generate_perm()
std::vector<int> perlin::perlin_generate_perm()
{
    std::vector<int> result;
    result.reserve(256);

    for(int i = 0; i < 256; i++)
    {
        result.push_back(i);
    }
    permute(result, 256);
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x100, %esi            # imm = 0x100
callq 0xbe96
leaq 0x4(%rsp), %r14
movl $0x0, (%r14)
xorl %eax, %eax
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xbd65
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xbd70
movq %rbx, %rdi
movq %r14, %rdx
callq 0xc0f6
movl 0x4(%rsp), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $0xff, %ecx
jl 0xbd4f
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xbcd4
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0xbd9d
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xbdb4
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x6400
movq %r14, %rdi
callq 0x66e0
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/aabb.cpp
// Function: surrounding_box(aabb, aabb)
aabb surrounding_box(aabb box0, aabb box1)
{
    vec3 minimum( fmin(box0.get_min().x(), box1.get_min().x() ),
                  fmin(box0.get_min().y(), box1.get_min().y() ),
                  fmin(box0.get_min().z(), box1.get_min().z() ));
    vec3 maximum( fmax(box0.get_max().x(), box1.get_max().x() ),
                  fmax(box0.get_max().y(), box1.get_max().y() ),
                  fmax(box0.get_max().z(), box1.get_max().z() ));
    
    return aabb(minimum, maximum);
}

// Assembly:
movq %rdi, %rax
movsd 0x8(%rsp), %xmm0
movss 0x10(%rsp), %xmm3
movsd 0x20(%rsp), %xmm2
movss 0x28(%rsp), %xmm4
movaps %xmm3, %xmm1
cmpunordss %xmm3, %xmm1
movaps %xmm1, %xmm5
andps %xmm4, %xmm5
minss %xmm3, %xmm4
andnps %xmm4, %xmm1
orps %xmm5, %xmm1
movsd 0x14(%rsp), %xmm3
movss 0x1c(%rsp), %xmm6
movsd 0x2c(%rsp), %xmm5
movss 0x34(%rsp), %xmm7
movaps %xmm6, %xmm4
cmpunordss %xmm6, %xmm4
movaps %xmm4, %xmm8
andps %xmm7, %xmm8
maxss %xmm6, %xmm7
andnps %xmm7, %xmm4
orps %xmm8, %xmm4
movaps %xmm2, %xmm6
minps %xmm0, %xmm6
cmpunordps %xmm0, %xmm0
andps %xmm0, %xmm2
andnps %xmm6, %xmm0
orps %xmm2, %xmm0
movlps %xmm0, (%rdi)
movss %xmm1, 0x8(%rdi)
movaps %xmm5, %xmm0
maxps %xmm3, %xmm0
cmpunordps %xmm3, %xmm3
andps %xmm3, %xmm5
andnps %xmm0, %xmm3
orps %xmm5, %xmm3
movlps %xmm3, 0xc(%rdi)
movss %xmm4, 0x14(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::safeGetline(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
static std::istream &safeGetline(std::istream &is, std::string &t) {
  t.clear();

  // The characters in the stream are read one-by-one using a std::streambuf.
  // That is faster than reading them one-by-one using the std::istream.
  // Code that uses streambuf this way must be guarded by a sentry object.
  // The sentry object performs various tasks,
  // such as thread synchronization and updating the stream state.

  std::istream::sentry se(is, true);
  std::streambuf *sb = is.rdbuf();

  if (se) {
    for (;;) {
      int c = sb->sbumpc();
      switch (c) {
        case '\n':
          return is;
        case '\r':
          if (sb->sgetc() == '\n') sb->sbumpc();
          return is;
        case EOF:
          // Also handle the case when the last line has no line ending
          if (t.empty()) is.setstate(std::ios::eofbit);
          return is;
        default:
          t += static_cast<char>(c);
      }
    }
  }

  return is;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq $0x0, 0x8(%rsi)
movq (%rsi), %rax
movb $0x0, (%rax)
leaq 0xf(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x6600
cmpb $0x1, (%r14)
jne 0xeca5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0xe8(%rbx,%rax), %r14
movq 0x10(%r14), %rcx
cmpq 0x18(%r14), %rcx
jae 0xec57
movzbl (%rcx), %eax
incq %rcx
movq %rcx, 0x10(%r14)
cmpl $-0x1, %eax
je 0xec62
cmpl $0xa, %eax
je 0xeca5
cmpl $0xd, %eax
je 0xec82
movsbl %al, %esi
movq %r15, %rdi
callq 0x6360
jmp 0xec27
movq (%r14), %rax
movq %r14, %rdi
callq *0x50(%rax)
jmp 0xec3b
cmpq $0x0, 0x8(%r15)
jne 0xeca5
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x2, %esi
callq 0x6680
jmp 0xeca5
movq 0x10(%r14), %rax
cmpq 0x18(%r14), %rax
jae 0xecb2
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0xeca5
movq 0x10(%r14), %rax
cmpq 0x18(%r14), %rax
jae 0xecbd
incq %rax
movq %rax, 0x10(%r14)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
jmp 0xec8f
movq (%r14), %rax
movq %r14, %rdi
callq *0x50(%rax)
jmp 0xeca5
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::parseInt(char const**)
static inline int parseInt(const char **token) {
  (*token) += strspn((*token), " \t");
  int i = atoi((*token));
  (*token) += strcspn((*token), " \t\r");
  return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
leaq 0x2db0c(%rip), %rsi     # 0x3c7e8
movq %r14, %rdi
callq 0x6190
movq %rax, %r15
addq %r14, %r15
movq %r15, (%rbx)
movq %r15, %rdi
callq 0x65e0
movl %eax, %ebp
leaq 0x2e0df(%rip), %rsi     # 0x3cddd
movq %r15, %rdi
callq 0x6060
addq %r15, %rax
movq %rax, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::MaterialStreamReader::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<tinyobj::material_t, std::allocator<tinyobj::material_t>>*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool MaterialStreamReader::operator()(const std::string &matId,
                                      std::vector<material_t> *materials,
                                      std::map<std::string, int> *matMap,
                                      std::string *warn, std::string *err) {
  (void)err;
  (void)matId;
  if (!m_inStream) {
    std::stringstream ss;
    ss << "Material stream in error state. " << std::endl;
    if (warn) {
      (*warn) += ss.str();
    }
    return false;
  }

  LoadMtl(matMap, materials, &m_inStream, warn, err);

  return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %r8, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq -0x18(%rsi), %rsi
movl 0x20(%rax,%rsi), %ebp
testb $0x5, %bpl
je 0xf0fc
leaq 0x28(%rsp), %rdi
callq 0x62a0
leaq 0x38(%rsp), %r14
leaq 0x2d956(%rip), %rsi     # 0x3c9bb
movl $0x20, %edx
movq %r14, %rdi
callq 0x6470
movq 0x38(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x63d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6280
testq %rbx, %rbx
je 0xf0dc
leaq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x6620
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x60f0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf0dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x3fe7d(%rip), %rsi     # 0x4ef60
leaq 0x28(%rsp), %rdi
callq 0x62e0
leaq 0xa8(%rsp), %rdi
callq 0x6100
jmp 0xf10d
movq %rcx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0xcea2
testb $0x5, %bpl
sete %al
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf145
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6400
jmp 0xf145
jmp 0xf142
movq %rax, %rbx
movq 0x3fe14(%rip), %rsi     # 0x4ef60
leaq 0x28(%rsp), %rdi
callq 0x62e0
leaq 0xa8(%rsp), %rdi
callq 0x6100
movq %rbx, %rdi
callq 0x66e0
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::parseTriple(char const**, int, int, int, tinyobj::vertex_index_t*)
static bool parseTriple(const char **token, int vsize, int vnsize, int vtsize,
                        vertex_index_t *ret) {
  if (!ret) {
    return false;
  }

  vertex_index_t vi(-1);

  if (!fixIndex(atoi((*token)), vsize, &(vi.v_idx))) {
    return false;
  }

  (*token) += strcspn((*token), "/ \t\r");
  if ((*token)[0] != '/') {
    (*ret) = vi;
    return true;
  }
  (*token)++;

  // i//k
  if ((*token)[0] == '/') {
    (*token)++;
    if (!fixIndex(atoi((*token)), vnsize, &(vi.vn_idx))) {
      return false;
    }
    (*token) += strcspn((*token), "/ \t\r");
    (*ret) = vi;
    return true;
  }

  // i/j/k or i/j
  if (!fixIndex(atoi((*token)), vtsize, &(vi.vt_idx))) {
    return false;
  }

  (*token) += strcspn((*token), "/ \t\r");
  if ((*token)[0] != '/') {
    (*ret) = vi;
    return true;
  }

  // i/j/k
  (*token)++;  // skip '/'
  if (!fixIndex(atoi((*token)), vnsize, &(vi.vn_idx))) {
    return false;
  }
  (*token) += strcspn((*token), "/ \t\r");

  (*ret) = vi;

  return true;
}

// Assembly:
testq %r8, %r8
je 0x12698
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r14
movl %ecx, 0x10(%rsp)
movq (%rdi), %r15
movq %r15, %rdi
callq 0x65e0
movl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ebp, %ebp
jg 0x12620
movl %r12d, %eax
je 0x12729
movl %r13d, 0xc(%rsp)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movl %eax, 0x14(%rsp)
leaq 0x2a7a4(%rip), %rsi     # 0x3cddc
movq %r15, %rdi
callq 0x6060
leaq (%r15,%rax), %r12
movq %r12, (%r14)
cmpb $0x2f, (%r15,%rax)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jne 0x12714
leaq 0x1(%r12), %r15
movq %r15, (%r14)
cmpb $0x2f, 0x1(%r12)
jne 0x1269b
addq $0x2, %r12
movq %r12, (%r14)
movq %r12, %rdi
callq 0x65e0
movl %eax, %r13d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r13d, %r13d
jg 0x1268e
movl 0xc(%rsp), %eax
je 0x12729
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
jmp 0x126fc
xorl %eax, %eax
retq
movq %r15, %rdi
callq 0x65e0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jg 0x126b8
movl 0x10(%rsp), %ecx
je 0x12729
addl %ecx, %eax
movl %eax, 0x8(%rsp)
leaq 0x2a717(%rip), %rsi     # 0x3cddc
movq %r15, %rdi
callq 0x6060
leaq (%r15,%rax), %r12
movq %r12, (%r14)
cmpb $0x2f, (%r15,%rax)
jne 0x12714
incq %r12
movq %r12, (%r14)
movq %r12, %rdi
callq 0x65e0
movl %eax, %r13d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r13d, %r13d
jg 0x126fc
movl 0xc(%rsp), %eax
je 0x12729
addl %eax, %r13d
leaq 0x2a6d6(%rip), %rsi     # 0x3cddc
movq %r12, %rdi
callq 0x6060
addq %r12, %rax
movq %rax, (%r14)
addl 0x14(%rsp), %ebp
movl %ebp, (%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rbx)
movl %r13d, 0x8(%rbx)
movb $0x1, %al
jmp 0x1272b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::SplitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
static void SplitString(const std::string &s, char delim,
                        std::vector<std::string> &elems) {
  std::stringstream ss;
  ss.str(s);
  std::string item;
  while (std::getline(ss, item, delim)) {
    elems.push_back(item);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rdi
callq 0x62a0
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x6580
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x20(%rsp), %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x20, %edx
callq 0x6730
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1346b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1af16
jmp 0x13440
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x13481
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x3bad8(%rip), %rsi     # 0x4ef60
leaq 0x20(%rsp), %rdi
callq 0x62e0
leaq 0xa0(%rsp), %rdi
callq 0x6100
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x134cc
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x134cc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x3ba8d(%rip), %rsi     # 0x4ef60
leaq 0x20(%rsp), %rdi
callq 0x62e0
leaq 0xa0(%rsp), %rdi
callq 0x6100
movq %rbx, %rdi
callq 0x66e0
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::ObjReader::ParseFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, tinyobj::ObjReaderConfig const&)
bool ObjReader::ParseFromFile(const std::string &filename,
                              const ObjReaderConfig &config) {
  std::string mtl_search_path;

  if (config.mtl_search_path.empty()) {
    //
    // split at last '/'(for unixish system) or '\\'(for windows) to get
    // the base directory of .obj file
    //
    if (filename.find_last_of("/\\") != std::string::npos) {
      mtl_search_path = filename.substr(0, filename.find_last_of("/\\"));
    }
  }

  valid_ = LoadObj(&attrib_, &shapes_, &materials_, &warning_, &error_,
                   filename.c_str(), mtl_search_path.c_str(),
                   config.triangulate, config.vertex_color);

  return valid_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
cmpq $0x0, 0x10(%rdx)
je 0x146d4
leaq 0x8(%rbx), %rdi
leaq 0x98(%rbx), %rsi
leaq 0xb0(%rbx), %rdx
leaq 0xc8(%rbx), %rcx
leaq 0xe8(%rbx), %r8
movq (%r15), %r9
movzbl (%r14), %eax
movzbl 0x1(%r14), %r10d
subq $0x8, %rsp
pushq %r10
pushq %rax
pushq 0x20(%rsp)
callq 0xf16b
addq $0x20, %rsp
movl %eax, %ebp
movb %al, (%rbx)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x146c3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6400
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2865b(%rip), %rsi     # 0x3cd36
movl $0x2, %ecx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x6780
cmpq $-0x1, %rax
je 0x14668
leaq 0x28636(%rip), %rsi     # 0x3cd36
movl $0x2, %ecx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x6780
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x6420
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x64a0
movq (%r12), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x14668
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6400
jmp 0x14668
jmp 0x1475e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x14778
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6400
movq %rbx, %rdi
callq 0x66e0
// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/util.cpp
// Function: random_in_unit_sphere()
vec3 random_in_unit_sphere()
{
    // This is a rejection method, which i s not that good for performance

    // vec3 p;
    // do
    // {
    //     p = 2 * vec3(drand48(), drand48(), drand48()) - vec3(1.0f, 1.0f, 1.0f);
    // } while (p.squared_length() >= 1.0f);
    // return p;

    // Reference : 
    // https://karthikkaranth.me/blog/generating-random-points-in-a-sphere/#using-normally-distributed-random-numbers
    //
    // Update :
    // This will cause visual bug in lighting, reason to be found.
    // Update :
    // This is actually caused by the difference of drand48() and 2 * drand48() - 1.
    // Which maps to the range of [0, 1) and [-1, 1) , respectively.
    
    vec3 direction = 2 * vec3(drand48(), drand48(), drand48()) - vec3(1.0f, 1.0f, 1.0f);
    float mag = std::cbrtf(drand48());

    return mag * unit_vector(direction);
}

// Assembly:
subq $0x38, %rsp
callq 0x63a0
movaps %xmm0, 0x20(%rsp)
callq 0x63a0
movaps %xmm0, 0x10(%rsp)
callq 0x63a0
cvtsd2ss %xmm0, %xmm0
addss %xmm0, %xmm0
addss 0x27904(%rip), %xmm0    # 0x3c368
movss %xmm0, 0xc(%rsp)
callq 0x63a0
cvtsd2ss %xmm0, %xmm0
callq 0x6170
movapd 0x20(%rsp), %xmm1
unpcklpd 0x10(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
cvtpd2ps %xmm1, %xmm1
addps %xmm1, %xmm1
addps 0x27a9e(%rip), %xmm1    # 0x3c530
movaps %xmm1, %xmm2
mulps %xmm1, %xmm2
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movss 0xc(%rsp), %xmm4
movaps %xmm4, %xmm2
mulss %xmm4, %xmm2
addss %xmm3, %xmm2
sqrtss %xmm2, %xmm2
divss %xmm2, %xmm4
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
divps %xmm2, %xmm1
mulss %xmm0, %xmm4
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
mulps %xmm1, %xmm0
movaps %xmm4, %xmm1
addq $0x38, %rsp
retq