LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/alpha.cpp
// Function: squish::WriteAlphaBlock(int, int, unsigned char const*, void*)
static void WriteAlphaBlock( int alpha0, int alpha1, u8 const* indices, void* block )
{
    u8* bytes = reinterpret_cast< u8* >( block );

    // write the first two bytes
    bytes[0] = ( u8 )alpha0;
    bytes[1] = ( u8 )alpha1;

    // pack the indices with 3 bits each
    u8* dest = bytes + 2;
    u8 const* src = indices;
    for( int i = 0; i < 2; ++i )
    {
        // pack 8 3-bit values
        int value = 0;
        for( int j = 0; j < 8; ++j )
        {
            int index = *src++;
            value |= ( index << 3*j );
        }

        // store in 3 bytes
        for( int j = 0; j < 3; ++j )
        {
            int byte = ( value >> 8*j ) & 0xff;
            *dest++ = ( u8 )byte;
        }
    }
}

// Assembly:
movq %rcx, %rax
movb %dil, (%rcx)
movb %sil, 0x1(%rcx)
addq $0x2, %rax
xorl %esi, %esi
cmpl $0x2, %esi
je 0x64e47
xorl %ecx, %ecx
xorl %edi, %edi
movq %rdx, %r8
cmpl $0x18, %ecx
je 0x64e27
movzbl (%r8), %r9d
shll %cl, %r9d
incq %r8
orl %r9d, %edi
addl $0x3, %ecx
jmp 0x64e10
xorl %ecx, %ecx
cmpl $0x18, %ecx
je 0x64e3f
movl %edi, %r8d
sarl %cl, %r8d
movb %r8b, (%rax)
incq %rax
addl $0x8, %ecx
jmp 0x64e29
addq $0x8, %rdx
incl %esi
jmp 0x64e04
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/clusterfit.cpp
// Function: squish::ClusterFit::ClusterFit(squish::ColourSet const*, int, float*)
ClusterFit::ClusterFit( ColourSet const* colours, int flags, float* metric )
  : ColourFit( colours, flags )
{
    // set the iteration count
    m_iterationCount = ( m_flags & kColourIterativeClusterFit ) ? kMaxIterations : 1;

    // initialise the metric (old perceptual = 0.2126f, 0.7152f, 0.0722f)
    if( metric )
        m_metric = Vec4( metric[0], metric[1], metric[2], 1.0f );
    else
        m_metric = VEC4_CONST( 1.0f );

    // initialise the best error
    m_besterror = VEC4_CONST( FLT_MAX );

    // cache some values
    int const count = m_colours->GetCount();
    Vec3 const* values = m_colours->GetPoints();

    // get the covariance matrix
    Sym3x3 covariance = ComputeWeightedCovariance( count, values, m_colours->GetWeights() );

    // compute the principle component
    m_principle = ComputePrincipleComponent( covariance );
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdi, %rbx
callq 0x66678
leaq 0x26d2f(%rip), %rax     # 0x8bb90
movq %rax, (%rbx)
btl $0x8, 0x10(%rbx)
pushq $0x1
popq %rax
pushq $0x8
popq %rcx
cmovael %eax, %ecx
movl %ecx, 0x14(%rbx)
testq %r14, %r14
je 0x64e87
movsd (%r14), %xmm0
movss 0x8(%r14), %xmm1
jmp 0x64e96
movaps 0xa612(%rip), %xmm0     # 0x6f4a0
movss 0x713e(%rip), %xmm1     # 0x6bfd4
movlps %xmm0, 0x1b4(%rbx)
movss %xmm1, 0x1bc(%rbx)
movaps 0xec84(%rip), %xmm0     # 0x73b30
movups %xmm0, 0x1c0(%rbx)
movl $0x7f7fffff, 0x1d0(%rbx) # imm = 0x7F7FFFFF
movq 0x8(%rbx), %rcx
movl (%rcx), %esi
leaq 0x4(%rcx), %rdx
addq $0xc4, %rcx
movq %rsp, %r14
movq %r14, %rdi
callq 0x668d0
movq %r14, %rdi
callq 0x66a17
movlps %xmm0, 0x18(%rbx)
movss %xmm1, 0x20(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/simd_float.h
// Function: squish::Truncate(squish::Vec4 const&)
Vec4 Truncate( Vec4::Arg v )
    {
        return Vec4(
            v.m_x > 0.0f ? std::floor( v.m_x ) : std::ceil( v.m_x ),
            v.m_y > 0.0f ? std::floor( v.m_y ) : std::ceil( v.m_y ),
            v.m_z > 0.0f ? std::floor( v.m_z ) : std::ceil( v.m_z ),
            v.m_w > 0.0f ? std::floor( v.m_w ) : std::ceil( v.m_w )
        );
    }

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movss (%rdi), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x66287
callq 0x6850
jmp 0x6628c
callq 0x63d0
movaps %xmm0, 0x20(%rsp)
movss 0x4(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x662a5
callq 0x6850
jmp 0x662aa
callq 0x63d0
movaps %xmm0, 0x10(%rsp)
movss 0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x662c3
callq 0x6850
jmp 0x662c8
callq 0x63d0
movaps %xmm0, (%rsp)
movss 0xc(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x662e0
callq 0x6850
jmp 0x662e5
callq 0x63d0
movaps (%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps 0x20(%rsp), %xmm0
unpcklps 0x10(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/simd_float.h
// Function: squish::CompareAnyLessThan(squish::Vec4 const&, squish::Vec4 const&)
bool CompareAnyLessThan( Vec4::Arg left, Vec4::Arg right )
    {
        return left.m_x < right.m_x
            || left.m_y < right.m_y
            || left.m_z < right.m_z
            || left.m_w < right.m_w;
    }

// Assembly:
movss (%rsi), %xmm0
movb $0x1, %al
ucomiss (%rdi), %xmm0
ja 0x6633a
movss 0x4(%rsi), %xmm0
ucomiss 0x4(%rdi), %xmm0
ja 0x6633a
movss 0x8(%rsi), %xmm0
ucomiss 0x8(%rdi), %xmm0
ja 0x6633a
movss 0xc(%rsi), %xmm0
ucomiss 0xc(%rdi), %xmm0
seta %al
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourblock.cpp
// Function: squish::WriteColourBlock3(squish::Vec3 const&, squish::Vec3 const&, unsigned char const*, void*)
void WriteColourBlock3( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block )
{
    // get the packed values
    int a = FloatTo565( start );
    int b = FloatTo565( end );

    // remap the indices
    u8 remapped[16];
    if( a <= b )
    {
        // use the indices directly
        for( int i = 0; i < 16; ++i )
            remapped[i] = indices[i];
    }
    else
    {
        // swap a and b
        std::swap( a, b );
        for( int i = 0; i < 16; ++i )
        {
            if( indices[i] == 0 )
                remapped[i] = 1;
            else if( indices[i] == 1 )
                remapped[i] = 0;
            else
                remapped[i] = indices[i];
        }
    }

    // write the block
    WriteColourBlock( a, b, remapped, block );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
callq 0x663cc
movl %eax, %ebp
movq %r15, %rdi
callq 0x663cc
xorl %ecx, %ecx
cmpl %eax, %ebp
jbe 0x6639a
cmpq $0x10, %rcx
je 0x663ac
movzbl (%r14,%rcx), %edx
testl %edx, %edx
je 0x66390
cmpl $0x1, %edx
jne 0x66392
xorl %edx, %edx
jmp 0x66392
movb $0x1, %dl
movb %dl, (%rsp,%rcx)
incq %rcx
jmp 0x66378
cmpq $0x10, %rcx
je 0x663b2
movb (%r14,%rcx), %dl
movb %dl, (%rsp,%rcx)
incq %rcx
jmp 0x6639a
movl %eax, %edi
movl %ebp, %eax
jmp 0x663b4
movl %ebp, %edi
movq %rsp, %rdx
movl %eax, %esi
movq %rbx, %rcx
callq 0x66451
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourblock.cpp
// Function: squish::WriteColourBlock(int, int, unsigned char*, void*)
static void WriteColourBlock( int a, int b, u8* indices, void* block )
{
    // get the block as bytes
    u8* bytes = ( u8* )block;

    // write the endpoints
    bytes[0] = ( u8 )( a & 0xff );
    bytes[1] = ( u8 )( a >> 8 );
    bytes[2] = ( u8 )( b & 0xff );
    bytes[3] = ( u8 )( b >> 8 );

    // write the indices
    for( int i = 0; i < 4; ++i )
    {
        u8 const* ind = indices + 4*i;
        bytes[4 + i] = ind[0] | ( ind[1] << 2 ) | ( ind[2] << 4 ) | ( ind[3] << 6 );
    }
}

// Assembly:
pushq %rbx
movl %esi, %eax
movl %edi, %ebx
movb %bl, (%rcx)
movb %bh, 0x1(%rcx)
movb %al, 0x2(%rcx)
movb %ah, 0x3(%rcx)
xorl %eax, %eax
cmpq $0x4, %rax
je 0x66498
movb 0x1(%rdx,%rax,4), %sil
shlb $0x2, %sil
orb (%rdx,%rax,4), %sil
movb 0x2(%rdx,%rax,4), %dil
shlb $0x4, %dil
movb 0x3(%rdx,%rax,4), %r8b
shlb $0x6, %r8b
orb %dil, %r8b
orb %sil, %r8b
movb %r8b, 0x4(%rcx,%rax)
incq %rax
jmp 0x66463
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourblock.cpp
// Function: squish::WriteColourBlock4(squish::Vec3 const&, squish::Vec3 const&, unsigned char const*, void*)
void WriteColourBlock4( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block )
{
    // get the packed values
    int a = FloatTo565( start );
    int b = FloatTo565( end );

    // remap the indices
    u8 remapped[16];
    if( a < b )
    {
        // swap a and b
        std::swap( a, b );
        for( int i = 0; i < 16; ++i )
            remapped[i] = ( indices[i] ^ 0x1 ) & 0x3;
    }
    else if( a == b )
    {
        // use index 0
        for( int i = 0; i < 16; ++i )
            remapped[i] = 0;
    }
    else
    {
        // use the indices directly
        for( int i = 0; i < 16; ++i )
            remapped[i] = indices[i];
    }

    // write the block
    WriteColourBlock( a, b, remapped, block );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
callq 0x663cc
movl %eax, %ebp
movq %r15, %rdi
callq 0x663cc
cmpl %eax, %ebp
jae 0x664da
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x664ed
movb (%r14,%rcx), %dl
andb $0x3, %dl
xorb $0x1, %dl
movb %dl, (%rsp,%rcx)
incq %rcx
jmp 0x664c2
jne 0x664f1
xorl %eax, %eax
cmpq $0x10, %rax
je 0x66505
movb $0x0, (%rsp,%rax)
incq %rax
jmp 0x664de
movl %eax, %edi
jmp 0x66507
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x6650b
movb (%r14,%rcx), %dl
movb %dl, (%rsp,%rcx)
incq %rcx
jmp 0x664f3
movl %ebp, %edi
movl %ebp, %eax
jmp 0x6650d
movl %ebp, %edi
movq %rsp, %rdx
movl %eax, %esi
movq %rbx, %rcx
callq 0x66451
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourblock.cpp
// Function: squish::DecompressColour(unsigned char*, void const*, bool)
void DecompressColour( u8* rgba, void const* block, bool isDxt1 )
{
    // get the block bytes
    u8 const* bytes = reinterpret_cast< u8 const* >( block );

    // unpack the endpoints
    u8 codes[16];
    int a = Unpack565( bytes, codes );
    int b = Unpack565( bytes + 2, codes + 4 );

    // generate the midpoints
    for( int i = 0; i < 3; ++i )
    {
        int c = codes[i];
        int d = codes[4 + i];

        if( isDxt1 && a <= b )
        {
            codes[8 + i] = ( u8 )( ( c + d )/2 );
            codes[12 + i] = 0;
        }
        else
        {
            codes[8 + i] = ( u8 )( ( 2*c + d )/3 );
            codes[12 + i] = ( u8 )( ( c + 2*d )/3 );
        }
    }

    // fill in alpha for the intermediate values
    codes[8 + 3] = 255;
    codes[12 + 3] = ( isDxt1 && a <= b ) ? 0 : 255;

    // unpack the indices
    u8 indices[16];
    for( int i = 0; i < 4; ++i )
    {
        u8* ind = indices + 4*i;
        u8 packed = bytes[4 + i];

        ind[0] = packed & 0x3;
        ind[1] = ( packed >> 2 ) & 0x3;
        ind[2] = ( packed >> 4 ) & 0x3;
        ind[3] = ( packed >> 6 ) & 0x3;
    }

    // store out the colours
    for( int i = 0; i < 16; ++i )
    {
        u8 offset = 4*indices[i];
        for( int j = 0; j < 4; ++j )
            rgba[4*i + j] = codes[offset + j];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x66629
movl %eax, %r15d
leaq 0x2(%r14), %rdi
leaq 0x4(%rsp), %rsi
callq 0x66629
cmpl %eax, %r15d
setbe %cl
andb %bpl, %cl
pushq $0xc
popq %rsi
movw $0x3, %di
cmpq $0xf, %rsi
je 0x665a6
movzbl -0xc(%rsp,%rsi), %r9d
movzbl -0x8(%rsp,%rsi), %r8d
testb %cl, %cl
je 0x66588
addl %r9d, %r8d
shrl %r8d
movb %r8b, -0x4(%rsp,%rsi)
xorl %eax, %eax
jmp 0x6659e
leal (%r8,%r9,2), %eax
xorl %edx, %edx
divw %di
movb %al, -0x4(%rsp,%rsi)
leal (%r9,%r8,2), %eax
xorl %edx, %edx
divw %di
movb %al, (%rsp,%rsi)
incq %rsi
jmp 0x66563
movb $-0x1, 0xb(%rsp)
decb %cl
movb %cl, 0xf(%rsp)
xorl %eax, %eax
cmpq $0x4, %rax
je 0x665eb
movb 0x4(%r14,%rax), %cl
movl %ecx, %edx
andb $0x3, %dl
movb %dl, 0x10(%rsp,%rax,4)
movl %ecx, %edx
shrb $0x2, %dl
andb $0x3, %dl
movb %dl, 0x11(%rsp,%rax,4)
movl %ecx, %edx
shrb $0x4, %dl
andb $0x3, %dl
movb %dl, 0x12(%rsp,%rax,4)
shrb $0x6, %cl
movb %cl, 0x13(%rsp,%rax,4)
incq %rax
jmp 0x665b3
xorl %eax, %eax
cmpq $0x10, %rax
je 0x6661e
movb 0x10(%rsp,%rax), %cl
shlb $0x2, %cl
movzbl %cl, %ecx
addq %rsp, %rcx
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x66615
movb (%rcx,%rdx), %sil
movb %sil, (%rbx,%rdx)
incq %rdx
jmp 0x66602
incq %rax
addq $0x4, %rbx
jmp 0x665ed
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourblock.cpp
// Function: squish::Unpack565(unsigned char const*, unsigned char*)
static int Unpack565( u8 const* packed, u8* colour )
{
    // build the packed value
    int value = ( int )packed[0] | ( ( int )packed[1] << 8 );

    // get the components in the stored range
    u8 red = ( u8 )( ( value >> 11 ) & 0x1f );
    u8 green = ( u8 )( ( value >> 5 ) & 0x3f );
    u8 blue = ( u8 )( value & 0x1f );

    // scale up to 8 bits
    colour[0] = ( red << 3 ) | ( red >> 2 );
    colour[1] = ( green << 2 ) | ( green >> 4 );
    colour[2] = ( blue << 3 ) | ( blue >> 2 );
    colour[3] = 255;

    // return the value
    return value;
}

// Assembly:
movzbl (%rdi), %ecx
movzbl 0x1(%rdi), %edx
movl %edx, %eax
shll $0x8, %eax
orl %ecx, %eax
movl %edx, %edi
shrb $0x5, %dil
movl %edx, %r8d
andb $-0x8, %r8b
orb %dil, %r8b
movb %r8b, (%rsi)
movl %eax, %edi
shrl $0x3, %edi
andl $0xfc, %edi
shrl %edx
andl $0x3, %edx
orl %edi, %edx
movb %dl, 0x1(%rsi)
leal (,%rcx,8), %edx
shrb $0x2, %cl
andb $0x7, %cl
orb %dl, %cl
movb %cl, 0x2(%rsi)
movb $-0x1, 0x3(%rsi)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourfit.cpp
// Function: squish::ColourFit::Compress(void*)
void ColourFit::Compress( void* block )
{
    bool isDxt1 = ( ( m_flags & kDxt1 ) != 0 );
    if( isDxt1 )
    {
        Compress3( block );
        if( !m_colours->IsTransparent() )
            Compress4( block );
    }
    else
        Compress4( block );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testb $0x1, 0x10(%rdi)
movq (%rdi), %rax
je 0x666c2
movq %r14, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movq 0x8(%r14), %rax
cmpb $0x0, 0x144(%rax)
je 0x666bf
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rax
movq 0x18(%rax), %rax
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/colourset.cpp
// Function: squish::ColourSet::RemapIndices(unsigned char const*, unsigned char*) const
void ColourSet::RemapIndices( u8 const* source, u8* target ) const
{
    for( int i = 0; i < 16; ++i )
    {
        int j = m_remap[i];
        if( j == -1 )
            target[i] = 3;
        else
            target[i] = source[j];
    }
}

// Assembly:
xorl %eax, %eax
cmpq $0x10, %rax
je 0x668cd
movslq 0x104(%rdi,%rax,4), %rcx
cmpq $-0x1, %rcx
je 0x668c3
movb (%rsi,%rcx), %cl
jmp 0x668c5
movb $0x3, %cl
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x668aa
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/maths.cpp
// Function: squish::ComputeWeightedCovariance(int, squish::Vec3 const*, float const*)
Sym3x3 ComputeWeightedCovariance( int n, Vec3 const* points, float const* weights )
{
    // compute the centroid
    float total = 0.0f;
    Vec3 centroid( 0.0f );
    for( int i = 0; i < n; ++i )
    {
        total += weights[i];
        centroid += weights[i]*points[i];
    }
    if( total > FLT_EPSILON )
        centroid /= total;

    // accumulate the covariance matrix
    Sym3x3 covariance( 0.0f );
    for( int i = 0; i < n; ++i )
    {
        Vec3 a = points[i] - centroid;
        Vec3 b = weights[i]*a;

        covariance[0] += a.X()*b.X();
        covariance[1] += a.X()*b.Y();
        covariance[2] += a.X()*b.Z();
        covariance[3] += a.Y()*b.Y();
        covariance[4] += a.Y()*b.Z();
        covariance[5] += a.Z()*b.Z();
    }

    // return it
    return covariance;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
xorl %ebp, %ebp
testl %esi, %esi
cmovlel %ebp, %r12d
xorps %xmm3, %xmm3
xorps %xmm2, %xmm2
movq %rdx, %r13
xorps %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
cmpq %rbp, %r12
je 0x6694c
movss (%rbx,%rbp,4), %xmm0
movss 0x8(%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
movq %r13, %rdi
movss %xmm2, 0xc(%rsp)
movaps %xmm3, 0x20(%rsp)
callq 0x66ba0
movaps 0x20(%rsp), %xmm3
movss 0xc(%rsp), %xmm2
addps %xmm0, %xmm3
addss %xmm1, %xmm2
incq %rbp
addq $0xc, %r13
jmp 0x66904
movlps %xmm3, 0x10(%rsp)
movss %xmm2, 0x18(%rsp)
movss 0x8(%rsp), %xmm1
ucomiss 0xd29c(%rip), %xmm1     # 0x73c00
jbe 0x6698a
movss 0x5666(%rip), %xmm0     # 0x6bfd4
divss %xmm1, %xmm0
movaps %xmm0, %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
mulps %xmm3, %xmm1
movlps %xmm1, 0x10(%rsp)
mulss %xmm2, %xmm0
movss %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movq %r15, %rdi
callq 0x66bb4
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
cmpq %rbp, %r12
je 0x66a05
movq %r14, %rdi
movq %r13, %rsi
callq 0x66bc7
movss (%rbx,%rbp,4), %xmm3
movaps %xmm1, %xmm2
mulss %xmm3, %xmm2
shufps $0x0, %xmm3, %xmm3      # xmm3 = xmm3[0,0,0,0]
mulps %xmm0, %xmm3
shufps $0xd4, %xmm0, %xmm1     # xmm1 = xmm1[0,1],xmm0[1,3]
shufps $0x52, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[1,1]
shufps $0x40, %xmm0, %xmm0     # xmm0 = xmm0[0,0,0,1]
movups (%r15), %xmm4
movaps %xmm2, %xmm5
shufps $0x30, %xmm3, %xmm5     # xmm5 = xmm5[0,0],xmm3[3,0]
shufps $0x84, %xmm5, %xmm3     # xmm3 = xmm3[0,1],xmm5[0,2]
shufps $0x64, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,1]
mulps %xmm0, %xmm3
addps %xmm4, %xmm3
movups %xmm3, (%r15)
movsd 0x10(%r15), %xmm0
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
mulps %xmm1, %xmm2
addps %xmm0, %xmm2
movlps %xmm2, 0x10(%r15)
incq %rbp
addq $0xc, %r14
jmp 0x6699c
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/maths.h
// Function: squish::Truncate(squish::Vec3 const&)
Vec3 Truncate( Arg v )
    {
        return Vec3(
            v.m_x > 0.0f ? std::floor( v.m_x ) : std::ceil( v.m_x ),
            v.m_y > 0.0f ? std::floor( v.m_y ) : std::ceil( v.m_y ),
            v.m_z > 0.0f ? std::floor( v.m_z ) : std::ceil( v.m_z )
        );
    }

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movss (%rdi), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x672c0
callq 0x6850
jmp 0x672c5
callq 0x63d0
movaps %xmm0, 0x10(%rsp)
movss 0x4(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x672de
callq 0x6850
jmp 0x672e3
callq 0x63d0
movaps %xmm0, (%rsp)
movss 0x8(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x672fb
callq 0x6850
jmp 0x67300
callq 0x63d0
movaps %xmm0, %xmm1
movaps 0x10(%rsp), %xmm0
unpcklps (%rsp), %xmm0           # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/singlecolourfit.cpp
// Function: squish::SingleColourFit::SingleColourFit(squish::ColourSet const*, int)
SingleColourFit::SingleColourFit( ColourSet const* colours, int flags )
  : ColourFit( colours, flags )
{
    // grab the single colour
    Vec3 const* values = m_colours->GetPoints();
    m_colour[0] = ( u8 )FloatToInt( 255.0f*values->X(), 255 );
    m_colour[1] = ( u8 )FloatToInt( 255.0f*values->Y(), 255 );
    m_colour[2] = ( u8 )FloatToInt( 255.0f*values->Z(), 255 );

    // initialise the best error
    m_besterror = INT_MAX;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x66678
leaq 0x248e4(%rip), %rax     # 0x8bc20
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
movss 0x7fd5(%rip), %xmm0     # 0x6f320
movss 0x4(%rcx), %xmm1
mulss %xmm0, %xmm1
movss 0x7fac(%rip), %xmm2     # 0x6f308
addss %xmm2, %xmm1
cvttss2si %xmm1, %edx
movl $0xff, %eax
cmpl %eax, %edx
cmovgel %eax, %edx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
movb %dl, 0x14(%rbx)
movss 0x8(%rcx), %xmm1
mulss %xmm0, %xmm1
addss %xmm2, %xmm1
cvttss2si %xmm1, %edx
cmpl %eax, %edx
cmovgel %eax, %edx
testl %edx, %edx
cmovlel %esi, %edx
movb %dl, 0x15(%rbx)
mulss 0xc(%rcx), %xmm0
addss %xmm2, %xmm0
cvttss2si %xmm0, %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
testl %eax, %eax
cmovlel %esi, %eax
movb %al, 0x16(%rbx)
movl $0x7fffffff, 0x38(%rbx) # imm = 0x7FFFFFFF
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/singlecolourfit.cpp
// Function: squish::SingleColourFit::Compress3(void*)
void SingleColourFit::Compress3( void* block )
{
    // build the table of lookups
    SingleColourLookup const* const lookups[] =
    {
        lookup_5_3,
        lookup_6_3,
        lookup_5_3
    };

    // find the best end-points and index
    ComputeEndPoints( lookups );

    // build the block if we win
    if( m_error < m_besterror )
    {
        // remap the indices
        u8 indices[16];
        m_colours->RemapIndices( &m_index, indices );

        // save the block
        WriteColourBlock3( m_start, m_end, indices, block );

        // save the error
        m_besterror = m_error;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x24870(%rip), %rsi     # 0x8bc40
callq 0x67414
movl 0x34(%rbx), %eax
cmpl 0x38(%rbx), %eax
jge 0x67409
movq 0x8(%rbx), %rdi
leaq 0x30(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdx
callq 0x668a8
leaq 0x18(%rbx), %rdi
leaq 0x24(%rbx), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x66350
movl 0x34(%rbx), %eax
movl %eax, 0x38(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/libsquish/singlecolourfit.cpp
// Function: squish::SingleColourFit::Compress4(void*)
void SingleColourFit::Compress4( void* block )
{
    // build the table of lookups
    SingleColourLookup const* const lookups[] =
    {
        lookup_5_4,
        lookup_6_4,
        lookup_5_4
    };

    // find the best end-points and index
    ComputeEndPoints( lookups );

    // build the block if we win
    if( m_error < m_besterror )
    {
        // remap the indices
        u8 indices[16];
        m_colours->RemapIndices( &m_index, indices );

        // save the block
        WriteColourBlock4( m_start, m_end, indices, block );

        // save the error
        m_besterror = m_error;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2474c(%rip), %rsi     # 0x8bc60
callq 0x67414
movl 0x34(%rbx), %eax
cmpl 0x38(%rbx), %eax
jge 0x6754d
movq 0x8(%rbx), %rdi
leaq 0x30(%rbx), %rsi
movq %rsp, %r15
movq %r15, %rdx
callq 0x668a8
leaq 0x18(%rbx), %rdi
leaq 0x24(%rbx), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x6649a
movl 0x34(%rbx), %eax
movl %eax, 0x38(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/decimal.c
// Function: SH_Decimal__init
SH_Decimal*
SH_Decimal__init(sh_float_t value, int* err) {
	SH_Decimal* obj;
	sh_bool_t n; /*negative?*/
	sh_int_t i;  /*(abs) int val*/
	uint16_t f;  /*fraction part*/

	__cascade(err, (SH_Decimal*)0);

	i = (sh_int_t)value;
	if (i < 0) {
		i = -i;
		n = SH_TRUE;
	} else {
		n = SH_FALSE;
	}

	if (i > SH_INT_C(999999999999)) {
		__raise(err, SH_E_DECIMAL_OUT_OF_BOUNDS);
		return (SH_Decimal*)0;
	}

	/* FIXME: wrong round (to infinity, should be to even) */
	f = (uint16_t)(
			(uint64_t)(
				(sh_float_t)fabs((double)(value * FFACTOR)) + SH_FLOAT_C(0.5)
			) % IFACTOR
		);

	obj = (SH_Decimal*)malloc(sizeof(SH_Decimal));
	if ((SH_Decimal*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_Decimal*)0;
	}

	obj->value = (n ? SH_FLOAT_C(-1.0) : SH_FLOAT_C(1.0)) * ((sh_float_t)i + ((sh_float_t)f / FFACTOR));
	obj->_neg = n;
	obj->_int = i;
	obj->_frac = f;

	__clear(err);
	return obj;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1139
cmpl $0x0, (%rbx)
je 0x1139
xorl %ecx, %ecx
jmp 0x120e
cvttsd2si %xmm0, %r15
movq %r15, %r14
negq %r14
cmovsq %r15, %r14
movq %r14, %rax
shrq $0xc, %rax
cmpq $0xe8d4a51, %rax        # imm = 0xE8D4A51
jb 0x1161
movl $0x120001, %eax         # imm = 0x120001
jmp 0x1205
movapd %xmm0, (%rsp)
pushq $0x20
popq %rdi
callq 0x1040
testq %rax, %rax
je 0x1200
movq %rax, %rcx
movq %r15, %rsi
sarq $0x3f, %rsi
movsd 0xe77(%rip), %xmm0      # 0x2000
movapd (%rsp), %xmm1
mulsd %xmm0, %xmm1
andpd 0xe86(%rip), %xmm1      # 0x2020
addsd 0xe66(%rip), %xmm1      # 0x2008
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0xe5a(%rip), %xmm1      # 0x2010
cvttsd2si %xmm1, %rax
andq %rdi, %rax
orq %rdx, %rax
movl $0x3e8, %edi            # imm = 0x3E8
xorl %edx, %edx
divq %rdi
cvtsi2sd %r14, %xmm2
movswl %dx, %eax
cvtsi2sd %eax, %xmm1
xorl %eax, %eax
divsd %xmm0, %xmm1
addsd %xmm2, %xmm1
testq %r15, %r15
jns 0x11ee
xorpd 0xe42(%rip), %xmm1      # 0x2030
movsd %xmm1, (%rcx)
movb %sil, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movw %dx, 0x18(%rcx)
jmp 0x1207
movl $0x80000001, %eax       # imm = 0x80000001
xorl %ecx, %ecx
testq %rbx, %rbx
je 0x120e
movl %eax, (%rbx)
movq %rcx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/decimal.c
// Function: SH_Decimal__to_s
sh_char_t*
SH_Decimal__to_s(SH_Decimal* obj, int* err) {
	sh_char_t* str;
	sh_char_t* ptr;
	sh_char_t  buffer[18]; /* sign + 12 digits + dot + 3 digits + null */
	size_t n;
	sh_int_t v;

	__cascade(err, (sh_char_t*)0);

	if (obj->value == SH_FLOAT_C(0)) {
		str = (sh_char_t*)malloc(sizeof(sh_char_t) * 4);
		if ((sh_char_t*)0 == str) {
			__raise(err, SH_E_MALLOC_ERROR);
			return (sh_char_t*)0;
		}

		str[0] = (sh_char_t)'0';
		str[1] = (sh_char_t)'.';
		str[2] = (sh_char_t)'0';
		str[3] = SH_CHAR_C(0);

		__clear(err);
		return str;
	}

	n = 0;
	buffer[n++] = SH_CHAR_C(0);

	/* fractional part */
	v = (sh_int_t)SH_Decimal__fractional_part(obj, err);

	if (SH_INT_C(0) == v) {
		buffer[n++] = SH_CHAR_C('0');
	} else {
		while (v > SH_INT_C(0)) {
			buffer[n++] = (sh_char_t)(v % 10) + SH_CHAR_C('0');
			v /= SH_INT_C(10);
		}
	}

	buffer[n++] = SH_CHAR_C('.');

	/* integer part and sign (same as SH_Integer) */
	v = SH_Decimal__integer_part(obj, err);

	while (v > SH_INT_C(0) && n <= 14) {
		buffer[n++] = (sh_char_t)(v % 10) + SH_CHAR_C('0');
		v /= SH_INT_C(10);
	}

	/* FIXME: if v > 0: invalid state? */

	if (SH_Decimal__negative(obj, err)) {
		buffer[n++] = (sh_char_t)'-';
	}

	str = (sh_char_t*)malloc(sizeof(sh_char_t) * n);
	if ((sh_char_t*)0 == str) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (sh_char_t*)0;
	}

	ptr = str;
	while (n > 0) {
		n--;
		*ptr = buffer[n];
		ptr++;
	}

	__clear(err);
	return str;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
testq %rsi, %rsi
je 0x12b4
cmpl $0x0, (%rbx)
je 0x12b4
xorl %eax, %eax
jmp 0x13a4
movsd (%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x12eb
jp 0x12eb
pushq $0x4
popq %rdi
callq 0x1040
testq %rax, %rax
je 0x1396
movl $0x302e30, (%rax)       # imm = 0x302E30
testq %rbx, %rbx
je 0x13a4
xorl %ecx, %ecx
jmp 0x13a2
movb $0x0, (%rsp)
movzwl 0x18(%rdi), %eax
pushq $0xa
popq %rcx
testq %rax, %rax
je 0x1315
pushq $0x1
popq %r14
testq %rax, %rax
je 0x131e
xorl %edx, %edx
divq %rcx
orb $0x30, %dl
movb %dl, (%rsp,%r14)
incq %r14
jmp 0x12ff
movb $0x30, 0x1(%rsp)
pushq $0x2
popq %r14
movb $0x2e, (%rsp,%r14)
testq %rbx, %rbx
je 0x1331
cmpl $0x0, (%rbx)
je 0x1331
xorl %eax, %eax
jmp 0x1335
movq 0x10(%rdi), %rax
incq %r14
testq %rax, %rax
jle 0x1351
cmpq $0xe, %r14
ja 0x1351
xorl %edx, %edx
divq %rcx
orb $0x30, %dl
movb %dl, (%rsp,%r14)
jmp 0x1335
testq %rbx, %rbx
je 0x135b
cmpl $0x0, (%rbx)
jne 0x1369
cmpb $0x0, 0x8(%rdi)
je 0x1369
movb $0x2d, (%rsp,%r14)
incq %r14
movq %r14, %rdi
callq 0x1040
testq %rax, %rax
je 0x1396
movq %rax, %rcx
movq %r14, %rdx
subq $0x1, %rdx
jb 0x12db
movb -0x1(%rsp,%r14), %sil
movb %sil, (%rcx)
incq %rcx
movq %rdx, %r14
jmp 0x137c
movl $0x80000001, %ecx       # imm = 0x80000001
xorl %eax, %eax
testq %rbx, %rbx
je 0x13a4
movl %ecx, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/carlitosmarin[P]Sistema-Ficheros-SOII/mi_mkdir.c
// Function: main
int main (int argc, char **argv) {
	if (argc != 4) {
		printf("Número de parametros incorrectos\n");
		return -1;
	}
	//Montamos el disco
	bmount(argv[1]);

	unsigned int permisos = atoi(argv[2]);
	if(permisos < 0 || permisos > 7) {
		puts("Permisos no válidos\n");
		bumount();
		return -1;
	}
	int charF = strlen(argv[3])-1;

	if(argv[3][charF] == '/') { // DIRECTORIO
		if(mi_creat(argv[3], permisos) == 0){
			printf("El directorio %s se ha creado correctamente\n", argv[3]);
		} else printf("Error: No se ha podido llevar a cabo mi_mkdir");
	} else { // FICHERO
		if(mi_creat(argv[3], permisos) == 0){
			printf("El archivo %s se ha creado correctamente\n", argv[3]);
		} else printf("Error: No se ha podido llevar a cabo mi_mkdir");
	}

	bumount();
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x4, %edi
jne 0x3c07
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x128c
movq 0x10(%rbx), %rdi
callq 0x1150
cmpl $0x8, %eax
jb 0x3c18
leaq 0x92f(%rip), %rdi       # 0x4528
callq 0x1060
xorl %eax, %eax
callq 0x12c8
jmp 0x3c13
leaq 0x9b5(%rip), %rdi       # 0x45c3
callq 0x1060
pushq $-0x1
popq %rbx
jmp 0x3c80
movl %eax, %ebp
movq 0x18(%rbx), %r14
movq %r14, %rdi
callq 0x1080
decl %eax
cltq
movb (%r14,%rax), %r15b
movzbl %bpl, %esi
movq %r14, %rdi
callq 0x301d
cmpb $0x2f, %r15b
jne 0x3c51
testl %eax, %eax
jne 0x3c55
movq 0x18(%rbx), %rsi
leaq 0x8ef(%rip), %rdi       # 0x453e
jmp 0x3c70
testl %eax, %eax
je 0x3c65
leaq 0x90f(%rip), %rdi       # 0x456b
xorl %eax, %eax
callq 0x1090
jmp 0x3c77
movq 0x18(%rbx), %rsi
leaq 0x929(%rip), %rdi       # 0x4599
xorl %eax, %eax
callq 0x1090
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x12c8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/creationix[P]color-control/src/libs/reader.c
// Function: reader_push
reader_result_t reader_push(reader_t* reader, uint8_t* data, uint16_t len) {

  // Read the header in an interruptible way if we don't have it all yet.
  while (!reader->body) {
    if (!len--) return READER_NEED_MORE;
    uint8_t byte = *data++;
    uint8_t offset = reader->offset++;
    if (offset == 0) {
      if (byte == '(') continue;
    }
    if (offset == 1) {
      if (byte == ']') continue;
    }
    if (offset == 2) {
      reader->size = byte << 8;
      continue;
    }
    if (offset == 3) {
      reader->size = (reader->size | byte) - 6;
      reader->offset = 0;
      reader->body = malloc(reader->size);
      if (reader->size) break;
    }
    return READER_INVALID_START_BYTES;
  }

  uint16_t bytes_left = reader->size - reader->offset;

  if (len >= bytes_left) {
    memcpy(reader->body + reader->offset, data, bytes_left);
    if (len > bytes_left + 1) {
      if (data[bytes_left] != '[' || data[bytes_left + 1] != ')') {
        return READER_INVALID_END_BYTES;
      }
    }
    // TODO: verify trailing bytes when they are broken to a new packet?
    return READER_DONE;
  }

  memcpy(reader->body + reader->offset, data, len);
  reader->offset += len;
  return READER_NEED_MORE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %rdi
pushq $0x1
popq %r10
movl %r10d, %r13d
subl %edx, %r13d
leaq 0x1(%rsi), %rbx
pushq $0x2
popq %r15
testq %rdi, %rdi
jne 0x18d5
cmpw $0x1, %r13w
je 0x1905
movb -0x1(%rbx), %cl
movzwl 0x2(%r14), %eax
movl %eax, %edx
incl %edx
movw %dx, 0x2(%r14)
movl %eax, %edx
andw $0xff, %dx
sete %r8b
cmpb $0x28, %cl
sete %r9b
testb %r9b, %r8b
jne 0x18cd
movzbl %cl, %r12d
cmpw $0x1, %dx
jne 0x18be
cmpb $0x5d, %r12b
je 0x18cd
cmpb $0x2, %al
jne 0x1940
movzwl %r12w, %eax
shll $0x8, %eax
movw %ax, (%r14)
incl %r13d
incq %rbx
jmp 0x187a
movzwl (%r14), %r12d
movzwl 0x2(%r14), %eax
movq %rsi, %rbx
subl %eax, %r12d
cmpw %r12w, %bp
jae 0x190a
movzwl %ax, %eax
addq %rax, %rdi
movzwl %bp, %edx
movq %rbx, %rsi
movl %r10d, %r15d
callq 0x1090
addw %bp, 0x2(%r14)
jmp 0x1983
movl %r10d, %r15d
jmp 0x1983
movzwl %bp, %ebp
movzwl %ax, %eax
addq %rax, %rdi
movzwl %r12w, %r14d
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1090
leaq 0x1(%r14), %rax
cmpl %ebp, %eax
jae 0x193b
pushq $0x3
popq %r15
cmpb $0x5b, (%rbx,%r14)
jne 0x1983
cmpb $0x29, (%rbx,%rax)
jne 0x1983
xorl %r15d, %r15d
jmp 0x1983
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1983
orw (%r14), %r12w
addl $-0x6, %r12d
movw %r12w, (%r14)
andw $0x0, 0x2(%r14)
movzwl %r12w, %ebp
movq %rbp, %rdi
callq 0x10b0
movq %rax, 0x8(%r14)
testw %bp, %bp
je 0x1983
movq %rax, %rdi
negl %r13d
xorl %eax, %eax
movl %r13d, %ebp
pushq $0x1
popq %r10
jmp 0x18e1
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/creationix[P]color-control/src/libs/reader.c
// Function: reader_reset
void reader_reset(reader_t* reader) {
  free(reader->body);
  reader->body = NULL;
  reader->size = 0;
  reader->offset = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1030
andq $0x0, 0x8(%rbx)
andl $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/creationix[P]color-control/src/simulate.c
// Function: main
int main()
{

  while (true)
  {
    uint8_t buf[CHUNK_SIZE];
    ssize_t bytes_read = read(0, buf, CHUNK_SIZE);
    if (bytes_read < 0)
    {
      fprintf(stderr, "Problem reading data from stdin: %s\n", strerror(errno));
      return -1;
    }
    if (!bytes_read)
      return -1;
    reader_result_t res = reader_push(&reader, buf, bytes_read);
    if (res == READER_NEED_MORE)
      continue;
    if (res == READER_DONE)
    {
      run_program(reader.body);
      reader_reset(&reader);
      return 0;
    }
    fprintf(stderr, "Ignoring invalid data: code %d\n", res);
    reader_reset(&reader);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsp, %r14
pushq $0x10
popq %r15
pushq $-0x1
popq %rbx
leaq 0x2725(%rip), %r12      # 0x40f0
movq 0x2626(%rip), %rbp      # 0x3ff8
leaq 0x83e(%rip), %r13       # 0x2217
xorl %edi, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1070
testq %rax, %rax
js 0x1a7a
je 0x1a69
movzwl %ax, %edx
movq %r12, %rdi
movq %r14, %rsi
callq 0x1854
cmpl $0x1, %eax
je 0x19d9
testl %eax, %eax
je 0x1a22
movq (%rbp), %rdi
movq %r13, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x1080
movq %r12, %rdi
callq 0x1995
jmp 0x19d9
leaq 0x26c7(%rip), %r14      # 0x40f0
movq 0x26c8(%rip), %rbx      # 0x40f8
leaq 0x93b(%rip), %rdi       # 0x2372
callq 0x1050
movq %rbx, 0x269d(%rip)      # 0x40e0
leaq 0x263e(%rip), %rdi      # 0x4088
callq 0x11dc
leaq 0x7e1(%rip), %rdi       # 0x2237
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %r14, %rdi
callq 0x1995
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbp), %r14
callq 0x1040
movl (%rax), %edi
callq 0x10d0
leaq 0x761(%rip), %rsi       # 0x21f2
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1080
jmp 0x1a69
// File: /workspace/github_c_makefile_star2_O2/creationix[P]color-control/src/libs/color-control.c
// Function: skip
static void skip(vm_t* vm) {
  opcode_t op = *(vm->pc)++;
  // If the opcode is less than 128, it's a literal unsigned integer
  if (op < 128) return;
  // Everything else needs to be switched based on it's code.
  switch (op) {
    // Handle the larger number literals (these consume 2-5 bytes)
    case UINT8:   vm->pc += 1; return;
    case UINT16:  vm->pc += 2; return;
    case UINT24:  vm->pc += 3; return;
    case UINT32:  vm->pc += 4; return;

    // Operations that don't consume any expressions
    case UPDATE:
    case GET0: case GET1: case GET2: case GET3:
    case GET4: case GET5: case GET6: case GET7:
      return;

    // Operators that consume one expression
    case SET0: case SET1: case SET2: case SET3:
    case SET4: case SET5: case SET6: case SET7:
    case NOT:
    case DELAY:
    case HUE: case RAND: case SRAND:
    case FILL:
      return skip(vm);

    // Operators that consume two expressions
    case ADD: case SUB: case MUL: case DIV: case MOD:
    case LT: case GT: case LTE: case GTE: case EQ: case NEQ:
    case AND: case OR: case WHILE: case IF:
    case PINA: case PINB: case WRITE: case FADE:
      return skip(vm), skip(vm);

    // Consume 3
    case RGB: case MIX:
      return skip(vm), skip(vm), skip(vm);

    // Operators that consume 4 expressions
    case FOR0: case FOR1: case FOR2: case FOR3:
    case FOR4: case FOR5: case FOR6: case FOR7:
      return skip(vm), skip(vm), skip(vm), skip(vm);

    case DO: return skip_do(vm);

    case END:
      vm->on_error(op, "Illegal opcode");
  }
  vm->on_error(op, "Unknown opcode");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x63d(%rip), %r15       # 0x20ec
movq 0x58(%rbx), %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x58(%rbx)
movzbl (%rcx), %r14d
testb %r14b, %r14b
jns 0x1b52
leal -0x80(%r14), %edx
cmpl $0x39, %edx
ja 0x1b23
movslq (%r15,%rdx,4), %rdx
addq %r15, %rdx
jmpq *%rdx
movq %rbx, %rdi
callq 0x1aa0
movq %rbx, %rdi
callq 0x1aa0
movq %rbx, %rdi
callq 0x1aa0
jmp 0x1aaf
movq %rbx, %rdi
callq 0x1aa0
movq 0x58(%rbx), %rax
cmpb $-0x53, (%rax)
jne 0x1af4
incq %rax
movq %rax, 0x58(%rbx)
jmp 0x1b52
leaq 0x6bf(%rip), %rsi       # 0x21d4
movl $0xad, %r14d
movl $0xad, %edi
callq *0x10(%rbx)
movq 0x10(%rbx), %rax
leaq 0x6b5(%rip), %rsi       # 0x21e3
movl %r14d, %edi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
addq $0x2, %rcx
jmp 0x1b4e
addq $0x5, %rcx
jmp 0x1b4e
addq $0x3, %rcx
jmp 0x1b4e
addq $0x4, %rcx
movq %rcx, 0x58(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/creationix[P]color-control/src/simulate.c
// Function: on_update
static void on_update(uint8_t *pixels)
{
  static bool first = true;
  if (first)
  {
    first = false;
  }
  else
  {
    printf("\x1b[5A");
  }
  printf(
      "   \x1b[38;2;%d;%d;%dm◢■■◣\x1b[0m\n"
      " \x1b[38;2;%d;%d;%dm◢■◤\x1b[0m  \x1b[38;2;%d;%d;%dm◥■◣\x1b[0m\n"
      "\x1b[38;2;%d;%d;%dm■■\x1b[0m      \x1b[38;2;%d;%d;%dm■■\x1b[0m\n"
      " \x1b[38;2;%d;%d;%dm◥■◣\x1b[0m  \x1b[38;2;%d;%d;%dm◢■◤\x1b[0m\n"
      "   \x1b[38;2;%d;%d;%dm◥■■◤\x1b[0m\n",
      pixels[0], pixels[1], pixels[2],
      pixels[21], pixels[22], pixels[23],
      pixels[3], pixels[4], pixels[5],
      pixels[18], pixels[19], pixels[20],
      pixels[6], pixels[7], pixels[8],
      pixels[15], pixels[16], pixels[17],
      pixels[9], pixels[10], pixels[11],
      pixels[12], pixels[13], pixels[14]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x2594(%rip)      # 0x4104
je 0x1b82
leaq 0x6c9(%rip), %rdi       # 0x2242
xorl %eax, %eax
callq 0x1060
jmp 0x1b89
movb $0x1, 0x257b(%rip)      # 0x4104
movzbl (%rbx), %esi
movzbl 0x1(%rbx), %edx
movzbl 0x2(%rbx), %ecx
movzbl 0x15(%rbx), %r8d
movzbl 0x16(%rbx), %r9d
movzbl 0x17(%rbx), %eax
movq %rax, 0x50(%rsp)
movzbl 0x3(%rbx), %eax
movq %rax, 0x48(%rsp)
movzbl 0x4(%rbx), %eax
movq %rax, 0x40(%rsp)
movzbl 0x5(%rbx), %eax
movq %rax, 0x38(%rsp)
movzbl 0x12(%rbx), %eax
movq %rax, 0x30(%rsp)
movzbl 0x13(%rbx), %eax
movq %rax, 0x28(%rsp)
movzbl 0x14(%rbx), %eax
movq %rax, 0x20(%rsp)
movzbl 0x6(%rbx), %eax
movq %rax, 0x18(%rsp)
movzbl 0x7(%rbx), %eax
movq %rax, 0x10(%rsp)
movzbl 0x8(%rbx), %eax
movq %rax, 0x8(%rsp)
movzbl 0xf(%rbx), %eax
movq %rax, (%rsp)
movzbl 0x10(%rbx), %r12d
movzbl 0x11(%rbx), %r13d
movzbl 0x9(%rbx), %ebp
movzbl 0xa(%rbx), %r10d
movzbl 0xb(%rbx), %r11d
movzbl 0xc(%rbx), %r14d
movzbl 0xd(%rbx), %r15d
movzbl 0xe(%rbx), %ebx
subq $0x8, %rsp
leaq 0x616(%rip), %rdi       # 0x2247
xorl %eax, %eax
pushq %rbx
pushq %r15
pushq %r14
pushq %r11
pushq %r10
pushq %rbp
pushq %r13
pushq %r12
pushq 0x48(%rsp)
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
pushq 0xd8(%rsp)
pushq 0xe8(%rsp)
callq 0x1060
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/creationix[P]color-control/src/simulate.c
// Function: delay
static void delay(uint32_t ms)
{
  // printf("Delay %u\n", ms);
  struct timeval t = {
      .tv_sec = ms / 1000,
      .tv_usec = (ms % 1000) * 1000};
  select(0, NULL, NULL, NULL, &t);
}

// Assembly:
subq $0x18, %rsp
movl %edi, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
imull $0x3e8, %edx, %eax      # imm = 0x3E8
movq %rax, 0x8(%r8)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10a0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTMap_test.c
// Function: test_create
void test_create(void) {

	// Δημιουργούμε μια κενή λίστα (χωρίς αυτόματο free)
	Map map = map_create(compare_ints, NULL, NULL);
	map_set_hash_function(map, hash_int);
	map_set_destroy_key(map, NULL);
	map_set_destroy_value(map, NULL);

	// Ελέγχουμε ότι δεν απέτυχε η malloc στην λίστα, και ότι
	// αρχικοποιείται με μέγεθος 0 (δηλαδή χωρίς κόμβους)
	TEST_ASSERT(map != NULL);
	TEST_ASSERT(map_size(map) == 0);

	map_destroy(map);
}

// Assembly:
pushq %rbx
leaq -0xd(%rip), %rdi        # 0x3a71
xorl %esi, %esi
xorl %edx, %edx
callq 0x4b4c
movq %rax, %rbx
leaq 0x1323(%rip), %rsi      # 0x4db4
movq %rax, %rdi
callq 0x4dba
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4d11
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4d1a
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x285b(%rip), %rsi      # 0x6318
leaq 0x2b45(%rip), %rcx      # 0x6609
leaq 0x285b(%rip), %r8       # 0x6326
pushq $0x1d
popq %rdx
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3b15
movq %rbx, %rdi
callq 0x4c04
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x2828(%rip), %rsi      # 0x6318
leaq 0x2b12(%rip), %rcx      # 0x6609
leaq 0x2834(%rip), %r8       # 0x6332
pushq $0x1e
popq %rdx
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3b15
movq %rbx, %rdi
popq %rbx
jmp 0x4d23
callq 0x2bc0
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTMap_test.c
// Function: shuffle
void shuffle(int* array[], int n) {
	for (int i = 0; i < n; i++) {
		int j = i + rand() / (RAND_MAX / (n - i) + 1);
		int* t = array[j];
		array[j] = array[i];
		array[i] = t;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
testl %esi, %esi
movl $0x0, %r12d
cmovgl %esi, %r12d
cmpq %r15, %r12
je 0x3bd4
callq 0x2280
movl %eax, %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
idivl %ebx
movl %eax, %esi
incl %esi
movl %ecx, %eax
cltd
idivl %esi
cltq
addq %r15, %rax
movq (%r14,%rax,8), %rcx
movq (%r14,%r15,8), %rdx
movq %rdx, (%r14,%rax,8)
movq %rcx, (%r14,%r15,8)
incq %r15
decl %ebx
jmp 0x3b9a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Uno/Src/uno.c
// Function: pass_loc
static void
pass_loc(char *pref, char *par)
{
	strcat(loc_args, pref);
	if (par)
	{	strcat(loc_args, par);
		strcat(loc_args, " ");
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x26c9(%rip), %rbx      # 0x40d0
movq %rbx, %rdi
callq 0x10f0
testq %r14, %r14
je 0x1a2d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1060
movw $0x20, (%rax,%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Uno/Src/uno.c
// Function: cleanup
static void
cleanup(int unused)
{
	if (verbose)
	{	return;
	}

	if ((int) strlen(glob_cmd) > glob_base && glob_base > 5)
	{	memset(glob_cmd, ' ', glob_base);
		strncpy(glob_cmd, "rm -f", 5); /* replace first 5 chars */
		if (w_dir)
		{	char *p = malloc(strlen(glob_cmd) + strlen("cd ;") + strlen(w_dir) + 1);
			sprintf(p, "cd %s; %s\n", w_dir, glob_cmd);
			if (verbose) { printf("%s\n", p); }
			System(p);
		} else
		{
			if (verbose) { printf("%s\n", glob_cmd); }
			System(glob_cmd);
	}	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x4410(%rip)      # 0x60d0
jne 0x1d8c
leaq 0x3403(%rip), %rdi      # 0x50d0
callq 0x1060
movl 0x4420(%rip), %edx      # 0x60f8
cmpl %eax, %edx
setge %al
cmpl $0x6, %edx
setl %cl
orb %al, %cl
jne 0x1d8c
addq $-0x5, %rdx
leaq 0x33df(%rip), %rdi      # 0x50d5
pushq $0x20
popq %rsi
callq 0x10a0
movl $0x2d206d72, 0x33c8(%rip) # imm = 0x2D206D72
movb $0x66, 0x33c5(%rip)     # 0x50d4
movq 0x43c2(%rip), %r14      # 0x60d8
testq %r14, %r14
je 0x1d92
leaq 0x33ae(%rip), %r15      # 0x50d0
movq %r15, %rdi
callq 0x1060
movq %rax, %rbx
movq %r14, %rdi
callq 0x1060
leaq (%rbx,%rax), %rdi
addq $0x5, %rdi
callq 0x10e0
movq %rax, %rbx
leaq 0x950(%rip), %rsi       # 0x269c
movq %rax, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1110
cmpb $0x1, 0x436d(%rip)      # 0x60d0
jne 0x1d87
movq %rbx, %rdi
callq 0x1050
cmpb $0x1, 0x435c(%rip)      # 0x60d0
jne 0x1d87
leaq 0x447(%rip), %rdi       # 0x21c4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
jmp 0x1d99
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3337(%rip), %rdi      # 0x50d0
popq %rbx
popq %r14
popq %r15
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/yhg926[P]public_kssd/./global_basic.h
// Function: mmp_uint_arr
static inline mmp_uint_t mmp_uint_arr (char *cofname)
{
 mmp_uint_t cofilemmp;
 int fd;
 struct stat s;
 fd = open (cofname, O_RDONLY);
 check (fd < 0, "open %s failed: %s", cofname, strerror (errno));
 fstat (fd, & s);
 cofilemmp.fsize = s.st_size;
 cofilemmp.mmpco = mmap(NULL, s.st_size , PROT_READ, MAP_PRIVATE, fd, 0);
 check ( cofilemmp.mmpco == MAP_FAILED, "mmap %s failed: %s", cofname, strerror (errno));
 close(fd);
 return cofilemmp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
xorl %esi, %esi
xorl %eax, %eax
callq 0x3380
movl %eax, %ebp
movl %eax, %r15d
shrl $0x1f, %r15d
callq 0x3060
movq %rax, %r14
movl (%rax), %edi
callq 0x3470
leaq 0x107a7(%rip), %rsi     # 0x141af
movl %r15d, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x451c
leaq 0x8(%rsp), %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x34a0
movq 0x30(%r15), %r15
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
xorl %edi, %edi
movq %r15, %rsi
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, %r12
xorl %r13d, %r13d
cmpq $-0x1, %rax
sete %r13b
movl (%r14), %edi
callq 0x3470
leaq 0x10764(%rip), %rsi     # 0x141c2
movl %r13d, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x451c
movl %ebp, %edi
callq 0x3220
movq %r15, %rax
movq %r12, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq