LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2765b(%rip), %xmm0    # 0x30204
subss %xmm1, %xmm0
movl 0x14(%rdi), %edx
cvtsi2ss %edx, %xmm1
mulss %xmm0, %xmm1
addss 0x27688(%rip), %xmm1    # 0x30248
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 0x2763f(%rip), %xmm0    # 0x30250
movzbl 0x2(%rcx,%rax), %eax
cvtsi2ss %eax, %xmm1
divss 0x2762a(%rip), %xmm1    # 0x3024c
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdx, 0x18(%rsp)
movss %xmm0, 0xc(%rsp)
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r12
movups %xmm0, 0x28(%r12)
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r13d, %r13d
movslq 0x20(%r15), %rax
cmpq %rax, %rbx
jge 0x8cc7
movq 0x8(%r15), %rax
movq (%rax,%rbp), %rdi
cvtsd2ss 0x10(%rsp), %xmm1
movq (%rdi), %rax
movq %r14, %rsi
movss 0xc(%rsp), %xmm0
movq %r12, %rdx
callq *(%rax)
testb %al, %al
je 0x8cbe
cvtss2sd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x8e06
movb $0x1, %r13b
incq %rbx
addq $0x10, %rbp
jmp 0x8c76
leaq 0x50(%rsp), %rdi
callq 0x7426
andb $0x1, %r13b
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x7426
movq %rbx, %rdi
callq 0x6710
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8def
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq (%rax), %rdi
movq (%rdi), %rax
leaq 0x58(%rsp), %rsi
movss %xmm0, 0x38(%rsp)
movss %xmm1, 0x3c(%rsp)
callq *0x8(%rax)
testb %al, %al
je 0x8def
leaq 0x58(%rsp), %r15
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
pushq $0x1
popq %r13
pushq $0x10
popq %r12
movslq 0x20(%r14), %rax
cmpq %rax, %r13
setge %bpl
movss 0x3c(%rsp), %xmm1
movss 0x38(%rsp), %xmm0
jge 0x8df1
movq 0x8(%r14), %rax
movq (%rax,%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x8(%rax)
testb %al, %al
je 0x8df1
movups (%rbx), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
callq 0xc5d9
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rbx)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rbx)
incq %r13
addq $0x10, %r12
jmp 0x8d5f
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_O2/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 $0xd8, %rsp
movq %rsi, %rbx
movss %xmm1, 0x30(%rsp)
movss %xmm0, 0x50(%rsp)
movq %rdi, %r14
movss 0x28(%rdi), %xmm1
movaps %xmm1, 0x40(%rsp)
callq 0x9460
movaps 0x40(%rsp), %xmm2
movaps %xmm2, %xmm3
shufps $0x0, %xmm2, %xmm3      # xmm3 = xmm3[0,0],xmm2[0,0]
movaps %xmm3, 0x60(%rsp)
subps %xmm3, %xmm0
movaps %xmm0, 0xb0(%rsp)
subss %xmm2, %xmm1
movss %xmm1, 0x3c(%rsp)
movq %r14, %rdi
movss 0x50(%rsp), %xmm0
callq 0x9460
addps 0x60(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
addss 0x40(%rsp), %xmm1
movss %xmm1, 0x38(%rsp)
movq %r14, %rdi
movss 0x30(%rsp), %xmm0
callq 0x9460
subps 0x60(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
subss 0x40(%rsp), %xmm1
movss %xmm1, 0x34(%rsp)
movq %r14, %rdi
movss 0x30(%rsp), %xmm0
callq 0x9460
addps 0x60(%rsp), %xmm0
addss 0x40(%rsp), %xmm1
movaps 0xb0(%rsp), %xmm2
movlps %xmm2, 0x88(%rsp)
movss 0x3c(%rsp), %xmm2
movss %xmm2, 0x90(%rsp)
movaps 0x50(%rsp), %xmm2
movlps %xmm2, 0x94(%rsp)
movss 0x38(%rsp), %xmm2
movss %xmm2, 0x9c(%rsp)
movaps 0xa0(%rsp), %xmm2
movlps %xmm2, 0x70(%rsp)
movss 0x34(%rsp), %xmm2
movss %xmm2, 0x78(%rsp)
movlps %xmm0, 0x7c(%rsp)
movss %xmm1, 0x84(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x88(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0xc5d9
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x99b6
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
jne 0x99c9
movq 0x3e623(%rip), %rdi     # 0x47fe0
leaq 0x26a0c(%rip), %rsi     # 0x303d0
callq 0x6420
movss 0x18(%rsp), %xmm0
subss (%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
setb %al
addq $0x30, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9a1a
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
jne 0x9a2d
movq 0x3e5bf(%rip), %rdi     # 0x47fe0
leaq 0x269a8(%rip), %rsi     # 0x303d0
callq 0x6420
movss 0x1c(%rsp), %xmm0
subss 0x4(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
setb %al
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9a7e
movq (%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq *0x8(%rax)
testb %al, %al
jne 0x9a91
movq 0x3e55b(%rip), %rdi     # 0x47fe0
leaq 0x26944(%rip), %rsi     # 0x303d0
callq 0x6420
movss 0x20(%rsp), %xmm0
subss 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
setb %al
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x80, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
addq $0x28, %rdi
movss %xmm0, 0x8(%rsp)
movss %xmm1, 0xc(%rsp)
callq 0xc480
testb %al, %al
je 0x9de6
xorps %xmm0, %xmm0
leaq 0x48(%rsp), %r14
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x38(%rsp)
movq 0x8(%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
movq %r14, %rdx
callq *(%rax)
movl %eax, %ebp
movq 0x18(%r12), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %r12
movq %r15, %rsi
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
movq %r12, %rdx
callq *(%rax)
movl %ebp, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x9dea
movss 0x10(%rsp), %xmm0
ucomiss 0x48(%rsp), %xmm0
cmovaq %r14, %r12
jmp 0x9df8
xorl %ebx, %ebx
jmp 0x9e1d
orb %bpl, %al
testb %bpl, %bpl
cmovneq %r14, %r12
cmpb $0x1, %al
jne 0x9e07
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8e06
movb $0x1, %bl
jmp 0x9e09
xorl %ebx, %ebx
leaq 0x40(%rsp), %rdi
callq 0x7426
leaq 0x78(%rsp), %rdi
callq 0x7426
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9e31
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x7426
leaq 0x78(%rsp), %rdi
callq 0x7426
movq %rbx, %rdi
callq 0x6710
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6140
movss %xmm0, 0xc(%rsp)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0x18(%rsp)
callq 0x6140
movss %xmm0, 0x14(%rsp)
cvttss2si 0xc(%rsp), %ebx
movss 0x10(%rsp), %xmm0
callq 0x6140
movss 0x14(%rsp), %xmm1
cvttss2si %xmm0, %eax
movq %rax, 0x20(%rsp)
cvttss2si %xmm1, %ecx
movq 0x3c81f(%rip), %rdx     # 0x484c0
movq 0x3c830(%rip), %rsi     # 0x484d8
movq 0x3c841(%rip), %rdi     # 0x484f0
leaq 0x30(%rsp), %r14
movq 0x3c7ed(%rip), %r9      # 0x484a8
xorl %r10d, %r10d
cmpq $0x2, %r10
je 0xbd39
movq 0x20(%rsp), %rax
leal (%r10,%rax), %r11d
movzbl %r11b, %r11d
movq %r14, 0x28(%rsp)
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0xbd2b
leal (%r15,%rbx), %ebp
movzbl %bpl, %r12d
xorl %r13d, %r13d
movl %ecx, %ebp
cmpq $0x18, %r13
je 0xbd22
movl (%rsi,%r12,4), %eax
xorl (%rdx,%r11,4), %eax
movzbl %bpl, %r8d
xorl (%rdi,%r8,4), %eax
cltq
imulq $0xc, %rax, %rax
movl 0x8(%r9,%rax), %r8d
movl %r8d, 0x8(%r14,%r13)
movq (%r9,%rax), %rax
movq %rax, (%r14,%r13)
incl %ebp
addq $0xc, %r13
jmp 0xbcec
incq %r15
addq $0x18, %r14
jmp 0xbcd9
incq %r10
movq 0x28(%rsp), %r14
addq $0x30, %r14
jmp 0xbcbe
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 0x1201d
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %rbx
subq $0x48, %rsp
movq (%rdi), %rax
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movl 0x8(%rdi), %eax
movl %eax, 0x8(%rbx)
movsd (%rbx), %xmm0
xorl %ebp, %ebp
testl %esi, %esi
cmovgl %esi, %ebp
movss 0x8(%rbx), %xmm2
movss 0x2445d(%rip), %xmm3    # 0x30204
xorps %xmm1, %xmm1
subl $0x1, %ebp
jb 0xbe07
movq %rbx, %rdi
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
movss %xmm2, 0xc(%rsp)
movss %xmm3, 0x8(%rsp)
callq 0xbc2c
movss 0x8(%rsp), %xmm3
movss 0xc(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
mulss %xmm3, %xmm0
addss %xmm0, %xmm1
movaps 0x30(%rsp), %xmm0
mulss 0x24451(%rip), %xmm3    # 0x30244
addps %xmm0, %xmm0
movlps %xmm0, 0x10(%rsp)
addss %xmm2, %xmm2
movss %xmm2, 0x18(%rsp)
jmp 0xbdaa
addss 0x24541(%rip), %xmm1    # 0x30350
andps 0x2466a(%rip), %xmm1    # 0x30480
movaps %xmm1, %xmm0
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x20, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movl $0x100, %esi            # imm = 0x100
callq 0xbf9e
movl $0x100, %ebp            # imm = 0x100
leaq 0x10(%rsp), %r14
subl $0x1, %ebp
jb 0xbec6
callq 0x63e0
addsd %xmm0, %xmm0
movsd 0x24646(%rip), %xmm1    # 0x304a8
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movaps %xmm0, (%rsp)
callq 0x63e0
addsd %xmm0, %xmm0
addsd 0x24629(%rip), %xmm0    # 0x304a8
cvtsd2ss %xmm0, %xmm0
movaps (%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps %xmm1, (%rsp)
callq 0x63e0
addsd %xmm0, %xmm0
addsd 0x24609(%rip), %xmm0    # 0x304a8
cvtsd2ss %xmm0, %xmm1
movapd (%rsp), %xmm0
callq 0xbbab
movlpd %xmm0, 0x10(%rsp)
movss %xmm1, 0x18(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc1a8
jmp 0xbe4c
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xbed4
movq %rax, %r14
movq %rbx, %rdi
callq 0xc124
movq %r14, %rdi
callq 0x6710
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r14d
cmpl $0x1, %r14d
jle 0xbf29
leaq -0x1(%r14), %r15
callq 0x63e0
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)
movq %r15, %r14
jmp 0xbef3
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x10(%rdi)
movl $0x100, %esi            # imm = 0x100
callq 0xc06a
xorl %eax, %eax
leaq 0x4(%rsp), %r14
movl %eax, 0x4(%rsp)
cmpl $0x100, %eax            # imm = 0x100
jge 0xbf71
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc100
movl 0x4(%rsp), %eax
incl %eax
jmp 0xbf53
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xbee8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0xbf8b
movq %rax, %r14
movq %rbx, %rdi
callq 0xc308
movq %r14, %rdi
callq 0x6710
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movsd 0x60(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movss 0x68(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movaps %xmm1, 0x10(%rsp)
movss 0x80(%rsp), %xmm1
callq 0x62b0
movss %xmm0, 0xc(%rsp)
movsd 0x6c(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movss 0x74(%rsp), %xmm0
movsd 0x84(%rsp), %xmm1
movaps %xmm1, 0x20(%rsp)
movss 0x8c(%rsp), %xmm1
callq 0x64b0
movaps 0x10(%rsp), %xmm3
movaps %xmm3, %xmm1
movaps 0x30(%rsp), %xmm2
minps %xmm2, %xmm1
cmpunordps %xmm2, %xmm2
andps %xmm2, %xmm3
andnps %xmm1, %xmm2
orps %xmm3, %xmm2
movlps %xmm2, (%rbx)
movss 0xc(%rsp), %xmm1
movss %xmm1, 0x8(%rbx)
movaps 0x20(%rsp), %xmm3
movaps %xmm3, %xmm1
movaps 0x40(%rsp), %xmm2
maxps %xmm2, %xmm1
cmpunordps %xmm2, %xmm2
andps %xmm2, %xmm3
andnps %xmm1, %xmm2
orps %xmm3, %xmm2
movlps %xmm2, 0xc(%rbx)
movss %xmm0, 0x14(%rbx)
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::parseOnOff(char const**, bool)
static inline bool parseOnOff(const char **token, bool default_value = true) {
  (*token) += strspn((*token), " \t");
  const char *end = (*token) + strcspn((*token), " \t\r");

  bool ret = default_value;
  if ((0 == strncmp((*token), "on", 2))) {
    ret = true;
  } else if ((0 == strncmp((*token), "off", 3))) {
    ret = false;
  }

  (*token) = end;
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r15
leaq 0x23b3d(%rip), %rsi     # 0x307b0
movq %r15, %rdi
callq 0x6180
movq %rax, %r12
leaq (%r15,%rax), %r14
movq %r14, (%rbx)
leaq 0x24119(%rip), %rsi     # 0x30da5
movq %r14, %rdi
callq 0x6050
movb $0x1, %cl
cmpb $0x6f, (%r15,%r12)
jne 0xccb3
cmpb $0x6e, 0x1(%r14)
je 0xccb3
cmpb $0x66, 0x1(%r14)
jne 0xccb3
cmpb $0x66, 0x2(%r14)
setne %cl
addq %rax, %r14
movq %r14, (%rbx)
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::parseReal(char const**, double)
static inline real_t parseReal(const char **token, double default_value = 0.0) {
  (*token) += strspn((*token), " \t");
  const char *end = (*token) + strcspn((*token), " \t\r");
  double val = default_value;
  tryParseDouble((*token), end, &val);
  real_t f = static_cast<real_t>(val);
  (*token) = end;
  return f;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
movq (%rdi), %r14
leaq 0x23acb(%rip), %rsi     # 0x307b0
movq %r14, %rdi
callq 0x6180
addq %rax, %r14
movq %r14, (%rbx)
leaq 0x240ab(%rip), %rsi     # 0x30da5
movq %r14, %rdi
callq 0x6050
movq %rax, %r15
addq %r14, %r15
leaq 0x10(%rsp), %r12
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r12)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x16041
cvtsd2ss (%r12), %xmm0
movq %r15, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::parseString[abi:cxx11](char const**)
static inline std::string parseString(const char **token) {
  std::string s;
  (*token) += strspn((*token), " \t");
  size_t e = strcspn((*token), " \t\r");
  s = std::string((*token), &(*token)[e]);
  (*token) += e;
  return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
movq (%rsi), %r12
leaq 0x239a1(%rip), %rsi     # 0x307b0
movq %r12, %rdi
callq 0x6180
addq %rax, %r12
movq %r12, (%r14)
leaq 0x23f81(%rip), %rsi     # 0x30da5
movq %r12, %rdi
callq 0x6050
movq %rax, %r15
leaq (%r12,%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x171c6
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x64e0
movq %r12, %rdi
callq 0x61a0
addq %r15, (%r14)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x61a0
movq %r14, %rdi
callq 0x6710
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
andq $0x0, 0x8(%rsi)
movq %rdi, %rbx
movq (%rsi), %rax
movb $0x0, (%rax)
leaq 0xf(%rsp), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6640
cmpb $0x1, (%r15)
jne 0xe2d5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0xe8(%rbx,%rax), %r15
movq %r15, %rdi
callq 0x6210
cmpl $-0x1, %eax
je 0xe2a5
cmpl $0xa, %eax
je 0xe2d5
cmpl $0xd, %eax
je 0xe2c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x6390
jmp 0xe281
cmpq $0x0, 0x8(%r14)
jne 0xe2d5
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0x2
popq %rsi
callq 0x6270
jmp 0xe2d5
movq %r15, %rdi
callq 0x65b0
cmpl $0xa, %eax
jne 0xe2d5
movq %r15, %rdi
callq 0x6210
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x224ba(%rip), %rsi     # 0x307b0
movq %r14, %rdi
callq 0x6180
movq %rax, %r15
addq %r14, %r15
movq %r15, (%rbx)
movq %r15, %rdi
callq 0x6620
movl %eax, %ebp
leaq 0x22a8d(%rip), %rsi     # 0x30da5
movq %r15, %rdi
callq 0x6050
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_O2/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 %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %r8, %rbx
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq -0x18(%rsi), %rsi
movl 0x20(%rax,%rsi), %ebp
testb $0x5, %bpl
je 0xe573
leaq 0x20(%rsp), %rdi
callq 0x62d0
leaq 0x30(%rsp), %rdi
leaq 0x2244e(%rip), %rsi     # 0x30983
callq 0x6420
movq %rax, %rdi
callq 0x61d0
testq %rbx, %rbx
je 0xe567
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x6660
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x67d0
movq %rsp, %rdi
callq 0x61a0
leaq 0x20(%rsp), %rdi
callq 0x6320
jmp 0xe584
movq %rcx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0xce86
testb $0x5, %bpl
sete %al
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x61a0
jmp 0xe5a7
jmp 0xe5a4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6320
movq %rbx, %rdi
callq 0x6710
// File: /workspace/github_cpp_makefile_star2_O2/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 0x103bb
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r14
movl %ecx, 0xc(%rsp)
movq (%rdi), %r13
movq %r13, %rdi
callq 0x6620
pushq $-0x1
popq %r15
movl %r15d, %ecx
testl %eax, %eax
jg 0x10359
movl %ebp, %ecx
je 0x10449
movl %r12d, 0x8(%rsp)
movl %ecx, 0x10(%rsp)
movl %eax, 0x14(%rsp)
leaq 0x20a37(%rip), %rsi     # 0x30da4
movq %r13, %rdi
callq 0x6050
leaq (%rax,%r13), %r12
movq %r12, (%r14)
cmpb $0x2f, (%r13,%rax)
movl %r15d, %r13d
jne 0x10433
leaq 0x1(%r12), %rbp
movq %rbp, (%r14)
cmpb $0x2f, 0x1(%r12)
jne 0x103be
addq $0x2, %r12
movq %r12, (%r14)
movq %r12, %rdi
callq 0x6620
movl %eax, %r13d
pushq $-0x1
popq %r15
movl %r15d, %eax
testl %r13d, %r13d
jg 0x1041b
jmp 0x10415
xorl %eax, %eax
retq
movq %rbp, %rdi
callq 0x6620
movl %eax, %r15d
pushq $-0x1
popq %r13
movl %r13d, %eax
testl %r15d, %r15d
jg 0x103db
movl 0xc(%rsp), %eax
je 0x10449
addl %eax, %r15d
leaq 0x209bf(%rip), %rsi     # 0x30da4
movq %rbp, %rdi
callq 0x6050
leaq (%rax,%rbp), %r12
movq %r12, (%r14)
cmpb $0x2f, (%rbp,%rax)
jne 0x10433
incq %r12
movq %r12, (%r14)
movq %r12, %rdi
callq 0x6620
movl %eax, %r13d
testl %eax, %eax
jle 0x10415
pushq $-0x1
popq %rax
jmp 0x1041b
movl 0x8(%rsp), %eax
je 0x10449
addl %eax, %r13d
leaq 0x2097f(%rip), %rsi     # 0x30da4
movq %r12, %rdi
callq 0x6050
addq %r12, %rax
movq %rax, (%r14)
movl 0x14(%rsp), %eax
addl 0x10(%rsp), %eax
movl %eax, (%rbx)
movl %r15d, 0x4(%rbx)
movl %r13d, 0x8(%rbx)
movb $0x1, %al
jmp 0x1044b
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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rdi
callq 0x62d0
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x65d0
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rsp), %r14
movq %rsp, %r15
pushq $0x20
popq %rbp
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x6770
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x10e63
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1685a
jmp 0x10e3b
movq %rsp, %rdi
callq 0x61a0
leaq 0x20(%rsp), %rdi
callq 0x6320
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x10e93
movq %rax, %rbx
movq %rsp, %rdi
callq 0x61a0
leaq 0x20(%rsp), %rdi
callq 0x6320
movq %rbx, %rdi
callq 0x6710
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
cmpq $0x0, 0x10(%rdx)
jne 0x11aed
leaq 0x1f25e(%rip), %rsi     # 0x30cfe
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x6410
cmpq $-0x1, %rax
je 0x11aed
leaq 0x1f246(%rip), %rsi     # 0x30cfe
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x6410
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x6470
movq %rsp, %rdi
leaq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0x64e0
movq %r12, %rdi
callq 0x61a0
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 0x18(%rsp)
callq 0xe5b9
addq $0x20, %rsp
movl %eax, %ebp
movb %al, (%rbx)
movq %rsp, %rdi
callq 0x61a0
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11b4a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x61a0
movq %rbx, %rdi
callq 0x6710
nop
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::ObjReader::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, tinyobj::ObjReaderConfig const&)
bool ObjReader::ParseFromString(const std::string &obj_text,
                                const std::string &mtl_text,
                                const ObjReaderConfig &config) {
  std::stringbuf obj_buf(obj_text);
  std::stringbuf mtl_buf(mtl_text);

  std::istream obj_ifs(&obj_buf);
  std::istream mtl_ifs(&mtl_buf);

  MaterialStreamReader mtl_ss(mtl_ifs);

  valid_ = LoadObj(&attrib_, &shapes_, &materials_, &warning_, &error_,
                   &obj_ifs, &mtl_ss, config.triangulate, config.vertex_color);

  return valid_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x80(%rsp), %rdi
pushq $0x18
popq %rbp
movl %ebp, %edx
callq 0x6260
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x6260
leaq 0xe8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x6780
leaq 0x200(%rsp), %r15
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x6780
leaq 0x35882(%rip), %rax     # 0x47448
leaq 0x8(%rsp), %r10
movq %rax, (%r10)
movq %r15, 0x8(%r10)
leaq 0x8(%rbx), %rdi
leaq 0x98(%rbx), %rsi
leaq 0xb0(%rbx), %rdx
leaq 0xc8(%rbx), %rcx
leaq 0xe8(%rbx), %r8
movzbl (%r14), %eax
movzbl 0x1(%r14), %r11d
subq $0x8, %rsp
leaq 0xf0(%rsp), %r9
pushq %r11
pushq %rax
pushq %r10
callq 0xe7d0
addq $0x20, %rsp
movl %eax, %ebp
movb %al, (%rbx)
leaq 0x200(%rsp), %rdi
callq 0x66b0
leaq 0xe8(%rsp), %rdi
callq 0x66b0
leaq 0x18(%rsp), %rdi
callq 0x16b26
leaq 0x80(%rsp), %rdi
callq 0x16b26
movl %ebp, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x66b0
jmp 0x11c6f
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x66b0
jmp 0x11c81
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x16b26
jmp 0x11c90
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x16b26
movq %rbx, %rdi
callq 0x6710
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x63e0
movaps %xmm0, 0x10(%rsp)
callq 0x63e0
movaps %xmm0, (%rsp)
callq 0x63e0
cvtsd2ss %xmm0, %xmm0
addss %xmm0, %xmm0
movapd 0x10(%rsp), %xmm1
unpcklpd (%rsp), %xmm1           # xmm1 = xmm1[0],mem[0]
cvtpd2ps %xmm1, %xmm1
addps %xmm1, %xmm1
addps 0x1e7f2(%rip), %xmm1    # 0x30540
movaps %xmm1, 0x10(%rsp)
addss 0x1e5f5(%rip), %xmm0    # 0x30350
movss %xmm0, (%rsp)
callq 0x63e0
cvtsd2ss %xmm0, %xmm0
callq 0x6160
movaps %xmm0, 0x20(%rsp)
movaps 0x10(%rsp), %xmm0
movss (%rsp), %xmm1
callq 0xbbab
movaps 0x20(%rsp), %xmm3
movaps %xmm3, %xmm2
shufps $0x0, %xmm3, %xmm2      # xmm2 = xmm2[0,0],xmm3[0,0]
mulps %xmm2, %xmm0
mulss %xmm3, %xmm1
addq $0x38, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/src/util.cpp
// Function: refract(vec3 const&, vec3 const&, float, vec3&)
bool refract(const vec3& _ray_direction, const vec3& _normal, float ni_over_nt, vec3& refracted)
{
    vec3 unit_direction = unit_vector(_ray_direction);
    float dt = dot(unit_direction, _normal);
    float discriminant = 1.0f - ni_over_nt * ni_over_nt * (1 - dt * dt);
    if(discriminant > 0.0f)
    {
        refracted = ni_over_nt * (unit_direction - _normal * dt) - _normal * sqrt(discriminant);
        return true;
    }
    return false;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movaps %xmm0, 0x10(%rsp)
movq %rsi, %r14
movsd (%rdi), %xmm0
movss 0x8(%rdi), %xmm1
callq 0xbbab
movaps 0x10(%rsp), %xmm3
movaps %xmm0, %xmm5
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulss 0x4(%r14), %xmm0
movss (%r14), %xmm2
mulss %xmm5, %xmm2
addss %xmm0, %xmm2
movss 0x8(%r14), %xmm0
mulss %xmm1, %xmm0
addss %xmm2, %xmm0
movaps %xmm0, %xmm4
mulss %xmm0, %xmm4
movss 0x1e385(%rip), %xmm6    # 0x30204
movaps %xmm6, %xmm2
subss %xmm4, %xmm2
movaps %xmm3, %xmm4
mulss %xmm3, %xmm4
mulss %xmm2, %xmm4
subss %xmm4, %xmm6
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm6
jbe 0x11f2d
movaps %xmm5, 0x30(%rsp)
movq %r14, %rdi
movss %xmm1, 0x8(%rsp)
movss %xmm6, 0xc(%rsp)
callq 0x8c23
movss 0xc(%rsp), %xmm2
movaps %xmm0, 0x20(%rsp)
movss 0x8(%rsp), %xmm0
subss %xmm1, %xmm0
mulss 0x10(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
ucomiss 0x1e5b2(%rip), %xmm2    # 0x30494
jb 0x11eea
sqrtss %xmm2, %xmm0
jmp 0x11ef2
movaps %xmm2, %xmm0
callq 0x6750
movq %r14, %rdi
callq 0x8c23
movaps 0x30(%rsp), %xmm3
subps 0x20(%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
mulps %xmm3, %xmm2
subps %xmm0, %xmm2
movss 0x8(%rsp), %xmm0
subss %xmm1, %xmm0
movlps %xmm2, (%rbx)
movss %xmm0, 0x8(%rbx)
movss 0xc(%rsp), %xmm6
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm6
seta %al
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/src/util.cpp
// Function: get_sphere_uv(vec3 const&, float&, float&)
void get_sphere_uv(const vec3& point_on_surface, float& _u, float& _v)
{
    float phi = std::atan2(point_on_surface.z(), point_on_surface.x());
    float theta = std::asin(point_on_surface.y());
    _u = 1 - (phi + M_PI) / (2.0f * M_PI);
    _v = (theta + M_PI / 2.0f) / M_PI;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movss (%rdi), %xmm1
movss 0x8(%rdi), %xmm0
callq 0x6530
movss %xmm0, 0xc(%rsp)
movss 0x4(%r15), %xmm0
callq 0x6650
cvtss2sd 0xc(%rsp), %xmm1
movsd 0x1e4e2(%rip), %xmm2    # 0x304c0
addsd %xmm2, %xmm1
divsd 0x1e4de(%rip), %xmm1    # 0x304c8
addsd 0x1e4be(%rip), %xmm1    # 0x304b0
cvtsd2ss %xmm1, %xmm1
movss %xmm1, (%r14)
cvtss2sd %xmm0, %xmm0
addsd 0x1e4c9(%rip), %xmm0    # 0x304d0
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/src/util.cpp
// Function: perlin_interpolate(vec3 (*) [2][2], float, float, float)
float perlin_interpolate(vec3 _data[2][2][2], float _u, float _v, float _w)
{
    // Reference :
    // https://github.com/RayTracing/TheNextWeek/issues/6
    //
    // in the original implementation in the book, the dot product
    // will return negative results, causing the produced image haing
    // several dark bands. 
    // Accoring to the github issue, this can be resolved by rescaling
    // the interpolation result from [-1, 1] to [0, 1].

    float uu = _u * _u * (3 - 2 * _u);
    float vv = _v * _v * (3 - 2 * _v);
    float ww = _w * _w * (3 - 2 * _w);

    float accum = 0.0f;
    for(int i = 0; i < 2; i++)
    {
        for(int j = 0; j < 2; j++)
        {
            for(int k = 0; k < 2; k++)
            {
                vec3 weight(_u - i, _v - j, _w - k);
                accum += (i * uu + (1 - i) * (1 - uu)) *
                         (j * vv + (1 - j) * (1 - vv)) *
                         (k * ww + (1 - k) * (1 - ww)) * dot(_data[i][j][k], weight);
            }
        }
    }
    return 0.5f * (accum + 1.0f);
}

// Assembly:
movaps %xmm0, %xmm3
mulss %xmm0, %xmm3
movss %xmm0, -0x4(%rsp)
movaps %xmm0, %xmm6
addss %xmm0, %xmm6
movss 0x1e4cf(%rip), %xmm4    # 0x30508
movaps %xmm4, %xmm0
subss %xmm6, %xmm0
mulss %xmm3, %xmm0
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
movaps %xmm1, %xmm7
addss %xmm1, %xmm7
movaps %xmm4, %xmm6
subss %xmm7, %xmm6
mulss %xmm3, %xmm6
movaps %xmm2, %xmm3
mulss %xmm2, %xmm3
movaps %xmm2, %xmm7
addss %xmm2, %xmm7
subss %xmm7, %xmm4
mulss %xmm3, %xmm4
movss 0x1e189(%rip), %xmm7    # 0x30204
movaps %xmm7, %xmm8
movss %xmm0, -0x8(%rsp)
subss %xmm0, %xmm8
movaps %xmm7, %xmm9
subss %xmm6, %xmm9
subss %xmm4, %xmm7
addq $0x8, %rdi
xorps %xmm3, %xmm3
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x2, %rax
je 0x1219d
cvtsi2ss %eax, %xmm10
movss -0x4(%rsp), %xmm11
subss %xmm10, %xmm11
movl %ecx, %edx
subl %eax, %edx
cvtsi2ss %edx, %xmm12
mulss %xmm8, %xmm12
mulss -0x8(%rsp), %xmm10
addss %xmm12, %xmm10
movq %rdi, %rdx
xorl %esi, %esi
cmpq $0x2, %rsi
je 0x12191
cvtsi2ss %esi, %xmm12
movaps %xmm1, %xmm13
movl %ecx, %r8d
subl %esi, %r8d
cvtsi2ss %r8d, %xmm14
subss %xmm12, %xmm13
mulss %xmm9, %xmm14
mulss %xmm6, %xmm12
addss %xmm14, %xmm12
mulss %xmm10, %xmm12
movq %rdx, %r8
movl %ecx, %r9d
xorl %r10d, %r10d
cmpq $0x2, %r10
je 0x12185
cvtsi2ss %r10d, %xmm14
movaps %xmm2, %xmm15
subss %xmm14, %xmm15
cvtsi2ss %r9d, %xmm5
mulss %xmm7, %xmm5
mulss %xmm4, %xmm14
addss %xmm5, %xmm14
mulss %xmm12, %xmm14
movss -0x4(%r8), %xmm5
mulss %xmm13, %xmm5
movss -0x8(%r8), %xmm0
mulss %xmm11, %xmm0
addss %xmm5, %xmm0
mulss (%r8), %xmm15
addss %xmm0, %xmm15
mulss %xmm14, %xmm15
addss %xmm15, %xmm3
incq %r10
decl %r9d
addq $0xc, %r8
jmp 0x1211f
incq %rsi
addq $0x18, %rdx
jmp 0x120df
incq %rax
addq $0x30, %rdi
jmp 0x120a5
addss 0x1e05f(%rip), %xmm3    # 0x30204
mulss 0x1e097(%rip), %xmm3    # 0x30244
movaps %xmm3, %xmm0
retq