LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: cloneWave
WAVE *
cloneWave(WAVE *v)
    {
    int i;
    WAVE *w = newWave();

    w->ID = v->ID;
    w->Format = v->Format;
    w->Subchunk1ID = v->Subchunk1ID;
    w->Subchunk2ID = v->Subchunk2ID;
    w->ChunkSize = v->ChunkSize;
    w->Subchunk1Size = v->Subchunk1Size;
    w->AudioFormat = v->AudioFormat;
    w->NumChannels = v->NumChannels;
    w->SampleRate = v->SampleRate;
    w->ByteRate = v->ByteRate;
    w->BlockAlign = v->BlockAlign;
    w->BitsPerSample = v->BitsPerSample;
    w->Subchunk2Size = v->Subchunk2Size;
    for (i = 0; i < MAX_CHANNELS; ++i)
        w->channels[i] = v->channels[i];
    w->sampleCount = v->sampleCount;
    w->sampleWidth = v->sampleWidth;
    w->maxAmp = v->maxAmp;

    return w;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1c10
movups (%rbx), %xmm0
movups %xmm0, (%rax)
movups 0x10(%rbx), %xmm0
movups %xmm0, 0x10(%rax)
movups 0x20(%rbx), %xmm0
movups %xmm0, 0x20(%rax)
movups 0x30(%rbx), %xmm0
movups %xmm0, 0x30(%rax)
movq 0x40(%rbx), %rcx
movq %rcx, 0x40(%rax)
movq 0x48(%rbx), %rcx
movq %rcx, 0x48(%rax)
pushq $0xa
popq %rcx
cmpq $0xf, %rcx
je 0x1d7b
movq (%rbx,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
jmp 0x1d68
movq 0x78(%rbx), %rcx
movq %rcx, 0x78(%rax)
movl 0x80(%rbx), %ecx
movl %ecx, 0x80(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: displayWave
void
displayWave(WAVE *w)
    {
    printf("ID: %s\n",w->ID);
    printf("ChunkSize: %ld\n",w->ChunkSize);
    printf("Format: %s\n",w->Format);
    printf("Subchunk1ID: %s\n",w->Subchunk1ID);
    printf("Subchunk1Size: %ld\n",w->Subchunk1Size);
    printf("AudioFormat: %d\n",w->AudioFormat);
    printf("NumChannels: %d\n",w->NumChannels);
    printf("SampleRate: %d\n",w->SampleRate);
    printf("ByteRate: %d\n",w->ByteRate);
    printf("BlockAlign: %d\n",w->BlockAlign);
    printf("BitsPerSample: %d\n",w->BitsPerSample);
    printf("Subchunk2ID: %s\n",w->Subchunk2ID);
    printf("Subchunk2Size: %ld\n",w->Subchunk2Size);
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x17de(%rip), %rdi      # 0x357d
xorl %eax, %eax
callq 0x10c0
movq 0x20(%rbx), %rsi
leaq 0x17a7(%rip), %rdi      # 0x3558
xorl %eax, %eax
callq 0x10c0
movq 0x8(%rbx), %rsi
leaq 0x17a5(%rip), %rdi      # 0x3568
xorl %eax, %eax
callq 0x10c0
movq 0x10(%rbx), %rsi
leaq 0x179f(%rip), %rdi      # 0x3574
xorl %eax, %eax
callq 0x10c0
movq 0x28(%rbx), %rsi
leaq 0x179e(%rip), %rdi      # 0x3585
xorl %eax, %eax
callq 0x10c0
movl 0x30(%rbx), %esi
leaq 0x17a1(%rip), %rdi      # 0x3599
xorl %eax, %eax
callq 0x10c0
movl 0x34(%rbx), %esi
leaq 0x17a1(%rip), %rdi      # 0x35aa
xorl %eax, %eax
callq 0x10c0
movl 0x38(%rbx), %esi
leaq 0x17a1(%rip), %rdi      # 0x35bb
xorl %eax, %eax
callq 0x10c0
movl 0x3c(%rbx), %esi
leaq 0x17a0(%rip), %rdi      # 0x35cb
xorl %eax, %eax
callq 0x10c0
movl 0x40(%rbx), %esi
leaq 0x179d(%rip), %rdi      # 0x35d9
xorl %eax, %eax
callq 0x10c0
movl 0x44(%rbx), %esi
leaq 0x179c(%rip), %rdi      # 0x35e9
xorl %eax, %eax
callq 0x10c0
movq 0x18(%rbx), %rsi
leaq 0x179d(%rip), %rdi      # 0x35fc
xorl %eax, %eax
callq 0x10c0
movq 0x48(%rbx), %rsi
leaq 0x179c(%rip), %rdi      # 0x360d
xorl %eax, %eax
popq %rbx
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: isID
static int
isID(FILE *in,char *id)
    {
    char ch;
    int matching = 1;
    int count = 0;
    while (matching && *id)
        {
        fread(&ch,sizeof(char),1,in);
        if (ch != *id) matching = 0;
        //fprintf(stderr,"comparing %c (%d) with %c\n",ch,ch,*id);
        ++count;
        ++id;
        }
    skip(in,-count);
    //if (matching) 
    //    fprintf(stderr,"match!\n");
    //else
    //    fprintf(stderr,"no match.\n");
    return matching;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r14
pushq $0x1
popq %rax
xorl %ebx, %ebx
leaq 0x7(%rsp), %r13
pushq $0x1
popq %rbp
xorl %r15d, %r15d
testl %eax, %eax
je 0x20dc
cmpb $0x0, (%r12,%r15)
je 0x20d7
movq %r13, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x1070
movb 0x7(%rsp), %cl
xorl %eax, %eax
cmpb (%r12,%r15), %cl
sete %al
incq %r15
jmp 0x20a9
pushq $0x1
popq %rax
movl %eax, %ebx
negq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x20fb
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: readWave
WAVE *
readWave(const char *fileName)
    {
    WAVE *w;

    w = readWaveFP(OpenFile(fileName,"r"));
    w->inName = StringDup(fileName);

    fprintf(stderr,"file name is %s\n",w->inName);

    return w;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x135f(%rip), %rsi      # 0x3470
callq 0x1a48
movq %rax, %rdi
callq 0x2156
movq %rax, %r14
movq %rbx, %rdi
callq 0x1ab0
movq %rax, 0x90(%r14)
movq 0x3ec1(%rip), %rcx      # 0x5ff8
movq (%rcx), %rdi
leaq 0x14ef(%rip), %rsi      # 0x3630
movq %rax, %rdx
xorl %eax, %eax
callq 0x10f0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: readWaveFP
WAVE *
readWaveFP(FILE *in)
    {
    int i,j;
    WAVE *w;

    w = newWave();

    readWaveHeader(w,in);

    if (w->AudioFormat != 1)
        fprintf(stderr,"WARNING: Audio format is not PCM");

    //fprintf(stderr,"allocating %d samples for each of %d channels\n",
            //w->sampleCount,w->NumChannels);

    for (j = 0; j < w->NumChannels; ++j)
        w->channels[j] = (int *) newIntArray(w->sampleCount);

    for (i = 0; !feof(in) && i < w->sampleCount; ++i)
        for (j = 0; j < w->NumChannels; ++j)
            {
            int amp;
            amp = readByteInt(in,w->sampleWidth);
            if (amp >= w->maxAmp)
                amp = -2 * w->maxAmp + amp;
            //if (i < 1000) printf("read sample %d: %d\n", i, amp);
            w->channels[j][i] = amp;
            }

    //fprintf(stderr,"i is %d\n",i);
    if (i != w->sampleCount)
        {
        fprintf(stderr,"sample count mismatch, setting sample count to %d\n",
            i);
        setWaveSize(w,i);
        }

    fclose(in);

    //fprintf(stderr,"samples allocated\n");

    return w;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x1c10
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e79
cmpl $0x1, 0x30(%r14)
jne 0x2214
xorl %r15d, %r15d
movslq 0x34(%r14), %rax
cmpq %rax, %r15
jge 0x219f
movl 0x78(%r14), %edi
callq 0x225d
movq %rax, 0x50(%r14,%r15,8)
incq %r15
jmp 0x2183
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x1100
movl 0x78(%r14), %ecx
testl %eax, %eax
jne 0x21fa
movslq %ecx, %rax
cmpq %rax, %r15
jge 0x21fa
xorl %r13d, %r13d
movslq 0x34(%r14), %rax
cmpq %rax, %r13
jge 0x21f5
movl 0x7c(%r14), %esi
movq %rbx, %rdi
callq 0x2062
movl 0x80(%r14), %ecx
leal (%rcx,%rcx), %edx
cmpl %ecx, %eax
cmovll %r12d, %edx
subl %edx, %eax
movq 0x50(%r14,%r13,8), %rcx
movl %eax, (%rcx,%r15,4)
incq %r13
jmp 0x21c0
incq %r15
jmp 0x21a5
cmpl %r15d, %ecx
jne 0x2235
movq %rbx, %rdi
callq 0x10a0
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x3ddd(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x141c(%rip), %rdi      # 0x3641
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
jmp 0x2180
movq 0x3dbc(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x141c(%rip), %rsi      # 0x3662
movl %r15d, %edx
xorl %eax, %eax
callq 0x10f0
movq %r14, %rdi
movl %r15d, %esi
callq 0x2274
jmp 0x21ff
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: setWaveSize
void
setWaveSize(WAVE *w,int samples)
    {
    int bytes = samples * w->NumChannels * w->BitsPerSample / 8;

    w->ChunkSize = 36+bytes;
    w->Subchunk2Size = bytes;
    w->sampleCount = samples;
    }

// Assembly:
movl 0x34(%rdi), %eax
imull %esi, %eax
imull 0x44(%rdi), %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
leal 0x24(%rax), %ecx
movslq %ecx, %rcx
movq %rcx, 0x20(%rdi)
cltq
movq %rax, 0x48(%rdi)
movl %esi, 0x78(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: readWaveMono
WAVE *
readWaveMono(const char *fileName)
    {
    WAVE *w;
    w = readWaveMonoFP(OpenFile(fileName,"r"));
    w->inName = StringDup(fileName);

    fprintf(stderr,"file name is %s\n",w->inName);

    return w;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x11ca(%rip), %rsi      # 0x3470
callq 0x1a48
movq %rax, %rdi
callq 0x22eb
movq %rax, %r14
movq %rbx, %rdi
callq 0x1ab0
movq %rax, 0x90(%r14)
movq 0x3d2c(%rip), %rcx      # 0x5ff8
movq (%rcx), %rdi
leaq 0x135a(%rip), %rsi      # 0x3630
movq %rax, %rdx
xorl %eax, %eax
callq 0x10f0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: readWaveMonoFP
WAVE *
readWaveMonoFP(FILE *in)
    {
    int i,j;
    WAVE *w;

    if (in == 0) return 0;

    w = newWave();

    readWaveHeader(w,in);

    if (w->AudioFormat != 1)
        Fatal("PCM only (no compression)");

    fprintf(stderr,"allocating %d samples\n",w->sampleCount);

    w->channels[0] = (int *) newIntArray(w->sampleCount);

    for (i = 0; !feof(in) && i < w->sampleCount; ++i)
        {
        int total = 0;
        for (j = 0; j < w->NumChannels; ++j)
            {
            int amp;
            amp = readByteInt(in,w->sampleWidth);
            if (amp >= w->maxAmp)
                amp = -2 * w->maxAmp + amp;
            total += amp;
            }
        w->channels[0][i] = total;
        }

    if (i != w->sampleCount)
        setWaveSize(w,i);

    if (w->NumChannels != 1)
        {
        fprintf(stderr,"WAVE WARNING: converting to mono\n");
        w->NumChannels = 1;
        setWaveSize(w,w->sampleCount);
        }

    fclose(in);

    fprintf(stderr,"samples allocated\n");

    return w;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
jne 0x230f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r14
callq 0x1c10
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e79
cmpl $0x1, 0x30(%rbx)
je 0x2339
leaq 0x1363(%rip), %rdi      # 0x3695
xorl %eax, %eax
callq 0x1918
movq 0x3cb8(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movl 0x78(%rbx), %edx
leaq 0x1362(%rip), %rsi      # 0x36af
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x10f0
movl 0x78(%rbx), %edi
callq 0x225d
movq %rax, 0x50(%rbx)
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x1100
movl 0x78(%rbx), %ecx
testl %eax, %eax
jne 0x23ba
movslq %ecx, %rax
cmpq %rax, %r15
jge 0x23ba
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpl 0x34(%rbx), %r12d
jge 0x23ad
movl 0x7c(%rbx), %esi
movq %r14, %rdi
callq 0x2062
movl 0x80(%rbx), %ecx
leal (%rcx,%rcx), %edx
negl %edx
cmpl %ecx, %eax
cmovll %r13d, %edx
addl %eax, %ebp
addl %edx, %ebp
incl %r12d
jmp 0x2382
movq 0x50(%rbx), %rax
movl %ebp, (%rax,%r15,4)
incq %r15
jmp 0x2366
cmpl %r15d, %ecx
je 0x23ca
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2274
cmpl $0x1, 0x34(%rbx)
movq 0x3c23(%rip), %r15      # 0x5ff8
je 0x23fe
movq (%r15), %rcx
leaq 0x12e5(%rip), %rdi      # 0x36c6
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
movl $0x1, 0x34(%rbx)
movl 0x78(%rbx), %esi
movq %rbx, %rdi
callq 0x2274
movq %r14, %rdi
callq 0x10a0
movq (%r15), %rcx
leaq 0x12d8(%rip), %rdi      # 0x36e8
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
jmp 0x22fd
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: writeWaveHeader
void
writeWaveHeader(FILE *out,int rate,int channels,int bps,int samples)
    {
    writeByteString(out,"RIFF",4);

    writeByteInt(out,36 + samples * channels * (bps / 8),4);

    writeByteString(out,"WAVE",4);

    writeByteString(out,"fmt ",4);

    writeByteInt(out,16,4); //PCM subchunk

    writeByteInt(out,1,2); //PCM (no compression)

    writeByteInt(out,channels,2);  //1 for mono, 2 for stereo

    writeByteInt(out,rate,4); //sample rate

    writeByteInt(out,rate * channels * (bps / 8),4); //byte rate

    writeByteInt(out,channels * (bps / 8),2); //block align

    writeByteInt(out,bps,2); //bits per sample

    writeByteString(out,"data",4);

    writeByteInt(out,samples * channels * (bps / 8),4); //subchunk 2 size

    fprintf(stderr,"header written\n");
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %r15d
movl %ecx, 0x4(%rsp)
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
leaq 0x1276(%rip), %rsi      # 0x36fb
callq 0x257e
pushq $0x8
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
movl %eax, %r13d
imull %ebp, %r13d
imull %r13d, %ebx
leal 0x24(%rbx), %esi
pushq $0x4
popq %r15
movq %r14, %rdi
movl %r15d, %edx
callq 0x2592
leaq 0x1249(%rip), %rsi      # 0x3700
movq %r14, %rdi
callq 0x257e
leaq 0x1160(%rip), %rsi      # 0x3626
movq %r14, %rdi
callq 0x257e
pushq $0x10
popq %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x2592
pushq $0x1
popq %rsi
pushq $0x2
popq %r15
movq %r14, %rdi
movl %r15d, %edx
callq 0x2592
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x2592
movq %r14, %rdi
movl %r12d, %esi
pushq $0x4
popq %rbp
movl %ebp, %edx
callq 0x2592
imull %r13d, %r12d
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x2592
movq %r14, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x2592
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl %r15d, %edx
callq 0x2592
leaq 0xd65(%rip), %rsi       # 0x32a5
movq %r14, %rdi
callq 0x257e
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x2592
movq 0x3a9d(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x11a0(%rip), %rdi      # 0x3705
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1190
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: newDoubleArray
double *
newDoubleArray(int size)
    {
    double *a = (double *) New(sizeof(double) * (size+1));

    fprintf(stderr,"newDoubleArray: allocating %d reals at location %p\n",size,a);

    a[0] = size + 0.01;
    return a + 1;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leal 0x8(,%rbx,8), %edi
callq 0x1acd
movq %rax, %r14
movq 0x3897(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0xfaa(%rip), %rsi       # 0x3715
movl %ebx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x10f0
cvtsi2sd %ebx, %xmm0
addsd 0xdcd(%rip), %xmm0      # 0x3550
movsd %xmm0, (%r14)
addq $0x8, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: growIntArray
int *
growIntArray(int *a)
    {
    int i;
    int *b = newIntArray(LENGTH(a) * 2);

    for (i = 0; i < LENGTH(a); ++i)
        b[i] = a[i];

    return b;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rdi), %edi
addl %edi, %edi
callq 0x225d
xorl %ecx, %ecx
movslq -0x4(%rbx), %rdx
cmpq %rdx, %rcx
jge 0x27bb
movl (%rbx,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0x27a7
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: growDoubleArray
double *
growDoubleArray(double *a)
    {
    int i;
    double *b = newDoubleArray(LENGTH(a) * 2);

    for (i = 0; i < LENGTH(a); ++i)
        b[i] = a[i];

    return b;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cvttsd2si -0x8(%rdi), %edi
addl %edi, %edi
callq 0x2745
xorl %ecx, %ecx
cvttsd2si -0x8(%rbx), %edx
movslq %edx, %rdx
cmpq %rdx, %rcx
jge 0x27eb
movsd (%rbx,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0x27cf
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: copyIntArray
int *
copyIntArray(int *a)
    {
    int i;
    int *b = newIntArray(LENGTH(a));

    for (i = 0; i < LENGTH(a); ++i)
        b[i] = a[i];

    return b;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl -0x4(%rdi), %edi
callq 0x225d
xorl %ecx, %ecx
movslq -0x4(%rbx), %rdx
cmpq %rdx, %rcx
jge 0x280f
movl (%rbx,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0x27fb
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/wave.c
// Function: copyDoubleArray
double *
copyDoubleArray(double *a)
    {
    int i;
    double *b = newDoubleArray((int) LENGTH(a));

    for (i = 0; i < (int) LENGTH(a); ++i)
        b[i] = a[i];

    return b;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cvttsd2si -0x8(%rdi), %edi
callq 0x2745
xorl %ecx, %ecx
cvttsd2si -0x8(%rbx), %edx
movslq %edx, %rdx
cmpq %rdx, %rcx
jge 0x283d
movsd (%rbx,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0x2821
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/marcespie[P]unix-samples/chapter1/fork1.c
// Function: main
int
main()
{
	int i = 15; // XXX implicit communication
	// since fork() gives you a CC of the parent,
	// -> you get implicit parameter passing to the child
	int pid = fork();
	switch(pid) {
	case -1: 
		err(1, "fork");
	case 0:
		perform_computation(i);
		exit(0);
	default:
		break;
	}
	// this is purely the parent's code
	int status;
	// always check *all* syscalls for errors
	// always use waitpid *even if you have one single child*
	// (you never know when you're going to reuse your code,
	// in a context with more children)
	int r = waitpid(pid, &status, 0);
	if (r == -1)
		err(1, "waitpid");
	// decode status
	// some similar code is *required* each time you interact with
	// children
	// -> we have some simple communication back from child to parent
	// which is whether we succeeded or not
	if (WIFEXITED(status)) {
		int rc = WEXITSTATUS(status);
		if (rc == 0) {
			// that case is 100% silent because 
			exit(0);	// everything is okay
		} else {
			fprintf(stderr, "Child exited with exit(%d)\n", rc);
			exit(1);
		}
	} else if (WIFSIGNALED(status)) {
		int sig = WTERMSIG(status);
		fprintf(stderr, "Child exited with signal %d (%s)\n", 
		    sig, strsignal(sig));
		exit(1);
	} else {
		// under normal circumstances, you either get a signal
		// or an exit status
		fprintf(stderr, "This should never happen: %d\n", status);
		exit(1);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x1090
testl %eax, %eax
je 0x11cf
cmpl $-0x1, %eax
jne 0x11de
leaq 0xe4b(%rip), %rsi       # 0x2018
jmp 0x11f8
pushq $0xf
popq %rdi
callq 0x119c
xorl %edi, %edi
callq 0x1080
leaq 0x4(%rsp), %rsi
movl %eax, %edi
xorl %edx, %edx
callq 0x1070
cmpl $-0x1, %eax
jne 0x1202
leaq 0xe25(%rip), %rsi       # 0x201d
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1050
movl 0x4(%rsp), %edx
movl %edx, %ebx
andl $0x7f, %ebx
jne 0x122b
shrl $0x8, %edx
andl $0xff, %edx
je 0x11d7
movq 0x2dd9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xdfc(%rip), %rsi       # 0x2025
jmp 0x126f
movl %ebx, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
movq 0x2dbc(%rip), %rcx      # 0x3ff8
movq (%rcx), %r14
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x1265
movl %ebx, %edi
callq 0x1060
leaq 0xded(%rip), %rsi       # 0x2041
movq %r14, %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1040
jmp 0x1276
leaq 0xdf7(%rip), %rsi       # 0x2063
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
pushq $0x1
popq %rdi
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/optional_mutex/normal/../main.c
// Function: main
int
main(int argc, char * argv[])
{
	int counter_expected;

	WARNP_INIT;
	(void)argc; /* UNUSED */

#ifdef NUM_THREADS
	counter_expected = NUM_TIMES * NUM_THREADS;
	if (test_pthread())
		goto err0;
#else
	counter_expected = NUM_TIMES;
	inc_dec_counter(NULL);
#endif

	/* Check the counter. */
	if (check_counter(counter_expected))
		goto err0;

	/* Success! */
	exit(0);

err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x1265
callq 0x1354
pushq $0x65
popq %rbp
leaq 0x2e59(%rip), %r14      # 0x40c8
leaq 0xd8e(%rip), %r12       # 0x2004
movq %rsp, %r15
leaq 0xd9c(%rip), %rbx       # 0x201c
movq %r14, %rdi
callq 0x16e4
decl %ebp
je 0x12c8
testl %eax, %eax
jne 0x12f8
incl 0x2e5a(%rip)            # 0x40f0
andq $0x0, (%rsp)
movq $0x989680, 0x8(%rsp)    # imm = 0x989680
movq %r15, %rdi
xorl %esi, %esi
callq 0x1080
decl 0x2e3c(%rip)            # 0x40f0
incl 0x2e3a(%rip)            # 0x40f4
movq %r14, %rdi
callq 0x16e7
testl %eax, %eax
je 0x1280
jmp 0x12fb
testl %eax, %eax
jne 0x131e
movl 0x2e1e(%rip), %ebp      # 0x40f0
movl 0x2e1c(%rip), %ebx      # 0x40f4
leaq 0x2de9(%rip), %rdi      # 0x40c8
callq 0x16e7
testl %eax, %eax
jne 0x1327
testl %ebp, %ebp
jne 0x134a
cmpl $0x64, %ebx
jne 0x134a
xorl %edi, %edi
callq 0x1110
movq %r12, %rbx
movl %eax, %edi
callq 0x1140
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1560
callq 0x1060
andl $0x0, (%rax)
xorl %edi, %edi
callq 0x10d0
leaq 0xcdf(%rip), %rbx       # 0x2004
jmp 0x132e
leaq 0xcee(%rip), %rbx       # 0x201c
movl %eax, %edi
callq 0x1140
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1560
callq 0x1060
andl $0x0, (%rax)
pushq $0x1
popq %rdi
callq 0x1110
nop
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_type_of
es_type_t es_type_of(es_val_t val)
{
  switch(es_tag(val)) {
  case ES_OBJ_TAG:    return obj_type_of(val);
  case ES_VALUE_TAG:  return es_payload(es_type_t, val);
  case ES_BOOL_TAG:   return ES_BOOL_TYPE;
  case ES_FIXNUM_TAG: return ES_FIXNUM_TYPE;
  case ES_SYMBOL_TAG: return ES_SYMBOL_TYPE;
  case ES_CHAR_TAG:   return ES_CHAR_TYPE;
  default:            return ES_INVALID_TYPE;
  }
}

// Assembly:
movq %rdi, %rax
movl %eax, %ecx
andl $0x7, %ecx
cmpq $0x5, %rcx
ja 0x1862
leaq 0x47c6(%rip), %rdx      # 0x6008
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl (%rax), %eax
retq
pushq $0x1
jmp 0x1864
pushq $0x3
jmp 0x1864
sarl $0x3, %eax
retq
pushq $0x2
jmp 0x1864
pushq $0x4
jmp 0x1864
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_port_vprintf
es_val_t es_port_vprintf(es_ctx_t* ctx, es_val_t port, const char* fmt, va_list args)
{
  if (!fmt || *fmt == '\0') {
    return es_void;
  }

  es_port_t* p = es_port_val(port);
  char buf[1024];
  char* loc = strstr(fmt, "%@");

  if (loc) {
    strncpy(buf, fmt, loc - fmt);
    buf[loc - fmt] = '\0';
    if (*buf != '\0') {
      vfprintf(p->stream, buf, args);
    }
    es_val_t val = va_arg(args, es_val_t);
    es_port_write(ctx, port, val);
    es_port_vprintf(ctx, port, loc + 2, args);
    return es_void;
  } else {
    vfprintf(p->stream, fmt, args);
    return es_void;
  }
}

// Assembly:
testq %rdx, %rdx
je 0x19d3
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %r13
cmpb $0x0, (%rdx)
je 0x19c2
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4c7b(%rip), %rsi      # 0x65a8
movq %r13, %rdi
callq 0x1170
testq %rax, %rax
je 0x1982
movq %rax, %r12
movq %rax, %rbp
subq %r13, %rbp
movq %rsp, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x1040
movb $0x0, (%rsp,%rbp)
movq %rsp, %rax
cmpb $0x0, (%rax)
je 0x196c
movq 0x10(%r14), %rdi
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x1120
movl (%rbx), %ecx
cmpq $0x28, %rcx
ja 0x1993
movq %rcx, %rax
addq 0x10(%rbx), %rax
addl $0x8, %ecx
movl %ecx, (%rbx)
jmp 0x199f
movq 0x10(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x1120
jmp 0x19c2
movq 0x8(%rbx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq (%rax), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x19e3
addq $0x2, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x18f7
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_char_cstr
es_val_t es_make_char_cstr(char* buf)
{
  if (strcmp("space", buf) == 0) {
    return es_make_char(' ');
  } else if (strcmp("newline", buf) == 0) {
    return es_make_char('\n');
  } else if (strcmp("tab", buf) == 0) {
    return es_make_char('\t');
  } else {
    return es_make_char(*buf);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x4697(%rip), %rdi      # 0x657f
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x1f28
leaq 0x468c(%rip), %rdi      # 0x6587
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x1f2f
leaq 0x4683(%rip), %rdi      # 0x6591
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x1f33
movsbq (%rbx), %rax
leaq 0x5(,%rax,8), %rax
jmp 0x1f36
movl $0x105, %eax            # imm = 0x105
jmp 0x1f36
pushq $0x55
jmp 0x1f35
pushq $0x4d
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_alloc
static void* es_alloc(es_ctx_t* ctx, es_type_t type, size_t size)
{
  void* mem = heap_alloc(&ctx->heap, size);

  if (!mem) {
    es_gc(ctx);
    mem = heap_alloc(&ctx->heap, size);
    if (!mem) {
      exit(1);
    }
  }

  obj_init(es_obj_to_val(mem), type);
  return mem;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movq 0x10(%rdi), %rax
movq 0x28(%rdi), %rcx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rcx
cmpq %rdx, %rcx
jb 0x1f95
leaq (%rax,%r14), %rcx
movq %rcx, 0x10(%r15)
testq %rax, %rax
jne 0x1fc1
movq %r15, %rdi
callq 0x2da4
movq 0x10(%r15), %rax
movq 0x28(%r15), %rcx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rcx
cmpq %r14, %rcx
jb 0x1fce
addq %rax, %r14
movq %r14, 0x10(%r15)
testq %rax, %rax
je 0x1fce
movl %ebx, (%rax)
andq $0x0, 0x8(%rax)
popq %rbx
popq %r14
popq %r15
retq
pushq $0x1
popq %rdi
callq 0x1150
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_pair
es_val_t es_make_pair(es_ctx_t* ctx, es_val_t head, es_val_t tail)
{
  es_pair_t* pair;
  gc_root2(ctx, head, tail);
  pair = es_alloc(ctx, ES_PAIR_TYPE, sizeof(es_pair_t));
  pair->head = head;
  pair->tail = tail;
  gc_unroot(ctx, 2);
  return es_obj_to_val(pair);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %rsi, (%r14)
movq %rsp, %r15
movq %rdx, (%r15)
movslq 0x2040(%rdi), %rax
movq %r14, 0x40(%rdi,%rax,8)
leal 0x2(%rax), %ecx
movl %ecx, 0x2040(%rdi)
movq %r15, 0x48(%rdi,%rax,8)
pushq $0x6
popq %rsi
pushq $0x20
popq %rdx
callq 0x1f63
movq (%r14), %rcx
movq %rcx, 0x10(%rax)
movq (%r15), %rcx
movq %rcx, 0x18(%rax)
addl $-0x2, 0x2040(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_port
es_val_t es_make_port(es_ctx_t* ctx, FILE* stream)
{
  es_port_t* port = es_alloc(ctx, ES_PORT_TYPE, sizeof(es_port_t));
  port->stream = stream;
  port->eof    = 0;
  port->top    = 0;
  port->tail   = 0;
  port->cur    = 0;
  port->nbytes = 0;
  port->linum  = 0;
  port->colnum = 0;
  port->size   = 65536;
  port->buf    = malloc(port->size);
  return es_obj_to_val(port);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
pushq $0xc
popq %rsi
movl $0x1848, %edx           # imm = 0x1848
callq 0x1f63
movq %rax, %r14
movq %rbx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x24(%rax)
movups %xmm0, 0x34(%rax)
movl $0x10000, 0x20(%rax)    # imm = 0x10000
movl $0x10000, %edi          # imm = 0x10000
callq 0x10f0
movq %rax, 0x18(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_port_getc
int es_port_getc(es_val_t port)
{
  es_port_t* p = es_port_val(port);
  if (p->cur < p->tail) {
    int c = p->buf[p->cur++];
    if (p->top == 0 && p->cur == p->tail)
      p->cur = p->tail = 0;
    return port_update_pos(port, c);
  } else if (p->eof) {
    return EOF;
  } else {
    int c = getc(p->stream);
    if (EOF == c) {
      p->eof = 1;
    } else if (p->top > 0) {
      assert(p->tail < p->size);
      p->buf[p->tail] = c;
      p->cur = ++p->tail;
    } else if (p->cur == p->tail) {
      p->cur = p->tail = 0;
    }
    return port_update_pos(port, c);
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x24(%rdi), %rcx
movl 0x28(%rdi), %eax
cmpl %eax, %ecx
jge 0x2434
movq 0x18(%rbx), %rsi
leal 0x1(%rcx), %edx
movl %edx, 0x24(%rbx)
movsbl (%rsi,%rcx), %ebp
cmpl $0x0, 0x40(%rbx)
jne 0x2484
cmpl %eax, %edx
jne 0x2484
andq $0x0, 0x24(%rbx)
jmp 0x2484
cmpl $0x0, 0x2c(%rbx)
je 0x243f
pushq $-0x1
popq %rbp
jmp 0x248e
movq 0x10(%rbx), %rdi
callq 0x1160
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x2473
cmpl $0x0, 0x40(%rbx)
jle 0x247c
movslq 0x28(%rbx), %rax
cmpl 0x20(%rbx), %eax
jge 0x2497
movq 0x18(%rbx), %rcx
movb %bpl, (%rcx,%rax)
movl 0x28(%rbx), %eax
incl %eax
movl %eax, 0x28(%rbx)
movl %eax, 0x24(%rbx)
jmp 0x2484
movl $0x1, 0x2c(%rbx)
jmp 0x2484
movl 0x24(%rbx), %eax
cmpl 0x28(%rbx), %eax
je 0x242d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x24b6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x3d6e(%rip), %rdi      # 0x620c
leaq 0x3d79(%rip), %rsi      # 0x621e
leaq 0x3d78(%rip), %rcx      # 0x6224
movl $0x336, %edx            # imm = 0x336
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_port_peekc
int es_port_peekc(es_val_t port)
{
  es_port_t* p = es_port_val(port);
  if (p->cur < p->tail) {
    return p->buf[p->cur];
  } else {
    es_port_mark(port);
    int c = es_port_getc(port);
    es_port_reset(port);
    return c;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x24(%rdi), %rax
cmpl 0x28(%rdi), %eax
jge 0x24e5
movq 0x18(%rbx), %rcx
movsbl (%rcx,%rax), %eax
jmp 0x2501
movq %rbx, %rdi
callq 0x2508
movq %rbx, %rdi
callq 0x2404
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2530
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_port_mark
void es_port_mark(es_val_t port)
{
  es_port_t* p = es_port_val(port);
  //assert(!p->mark);
  p->state[p->top].cur    = p->cur;
  p->state[p->top].nbytes = p->nbytes;
  p->state[p->top].linum  = p->linum;
  p->state[p->top].colnum = p->colnum;
  p->top++;
}

// Assembly:
movl 0x24(%rdi), %eax
movslq 0x40(%rdi), %rcx
imulq $0x18, %rcx, %rdx
movl %eax, 0x48(%rdi,%rdx)
movq 0x30(%rdi), %rax
movq %rax, 0x50(%rdi,%rdx)
movq 0x38(%rdi), %rax
movq %rax, 0x58(%rdi,%rdx)
leal 0x1(%rcx), %eax
movl %eax, 0x40(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_port_reset
void es_port_reset(es_val_t port)
{
  es_port_t* p = es_port_val(port);
  assert(p->top > 0);
  --p->top;
  p->cur    = p->state[p->top].cur;
  p->nbytes = p->state[p->top].nbytes;
  p->linum  = p->state[p->top].linum;
  p->colnum = p->state[p->top].colnum;
}

// Assembly:
movl 0x40(%rdi), %eax
testl %eax, %eax
jle 0x255a
decl %eax
movl %eax, 0x40(%rdi)
imulq $0x18, %rax, %rax
movl 0x48(%rdi,%rax), %ecx
movl %ecx, 0x24(%rdi)
movq 0x50(%rdi,%rax), %rcx
movq %rcx, 0x30(%rdi)
movq 0x58(%rdi,%rax), %rax
movq %rax, 0x38(%rdi)
retq
pushq %rax
leaq 0x3cdd(%rip), %rdi      # 0x623f
leaq 0x3cb5(%rip), %rsi      # 0x621e
leaq 0x3cda(%rip), %rcx      # 0x624a
movl $0x35b, %edx            # imm = 0x35B
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_fn
es_val_t es_make_fn(es_ctx_t* ctx, int arity, es_pfn_t pfn)
{
  es_fn_t* fn = es_alloc(ctx, ES_FN_TYPE, sizeof(es_fn_t));
  fn->arity   = arity;
  fn->pfn     = pfn;
  return es_obj_to_val(fn);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
pushq $0xe
popq %rsi
pushq $0x20
popq %rdx
callq 0x1f63
movl %ebp, 0x10(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_proc
es_val_t es_make_proc(es_ctx_t* ctx, int arity, int rest, int addr, int end)
{
  es_proc_t* proc = es_alloc(ctx, ES_PROC_TYPE, sizeof(es_proc_t));
  proc->arity = arity;
  proc->rest  = rest;
  proc->addr  = addr;
  proc->end   = end;
  return es_obj_to_val(proc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
pushq $0x11
popq %rsi
pushq $0x20
popq %rdx
callq 0x1f63
movl %r15d, 0x10(%rax)
movl %r14d, 0x14(%rax)
movl %ebp, 0x18(%rax)
movl %ebx, 0x1c(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_string
es_val_t es_make_string(es_ctx_t* ctx, char* cstr)
{
  es_string_t* string;
  long length = strlen(cstr);
  string = es_alloc(ctx, ES_STRING_TYPE, sizeof(es_string_t) + length + 1);
  string->length = length;
  strcpy(string->value, cstr);
  return es_obj_to_val(string);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1070
movq %rax, %r15
leaq 0x19(%rax), %rdx
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x1f63
movq %rax, %r14
movq %r15, 0x10(%rax)
leaq 0x18(%rax), %rdi
movq %rbx, %rsi
callq 0x1050
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_string_make
es_val_t es_string_make(es_ctx_t* ctx, int length, char c)
{
  es_string_t* string;
  string = es_alloc(ctx, ES_STRING_TYPE, sizeof(es_string_t) + length + 1);
  string->length = length;
  for(int i = 0; i < string->length; i++) {
    string->value[i] = c;
  }
  string->value[string->length] = '\0';
  return es_obj_to_val(string);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movslq %esi, %r14
leaq 0x19(%r14), %rdx
pushq $0x5
popq %rsi
callq 0x1f63
movq %r14, 0x10(%rax)
movl %r14d, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x26e5
movb %bl, 0x18(%rax,%rdx)
incq %rdx
jmp 0x26d7
movb $0x0, 0x18(%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_symbol_intern
es_val_t es_symbol_intern(es_ctx_t* ctx, const char* cstr)
{
  es_symtab_t* symtab = &ctx->symtab;
  int id = symtab_find_or_create(symtab, cstr);
  if (id < 0) {
    return es_make_error(ctx, "symtab count exceeded");
  }
  return es_make_symbol(id);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x42048(%rdi), %r12d
movslq %r12d, %r13
xorl %r15d, %r15d
testq %r13, %r13
movl $0x0, %ebp
cmovgq %r13, %rbp
cmpq %r15, %rbp
je 0x277e
movq 0x2048(%rbx,%r15,8), %rdi
movq %r14, %rsi
callq 0x10d0
testl %eax, %eax
je 0x27bb
incq %r15
jmp 0x2760
cmpl $0x7fff, %r12d          # imm = 0x7FFF
jg 0x27dc
movq %r14, %rdi
callq 0x1070
leaq 0x1(%rax), %rdi
callq 0x10f0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
movq %r15, 0x2048(%rbx,%r13,8)
leal 0x1(%r12), %eax
movl %eax, 0x42048(%rbx)
jmp 0x27be
movl %r15d, %r12d
testl %r12d, %r12d
js 0x27dc
leal 0x2(,%r12,8), %eax
cltq
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3a84(%rip), %rsi      # 0x6267
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f4e
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_vector
es_val_t es_make_vector(es_ctx_t* ctx, int size)
{
  assert(size >= 0);
  es_vec_t* vector = es_alloc(ctx, ES_VECTOR_TYPE, sizeof(es_vec_t) + size * sizeof(es_val_t));
  vector->length = size;
  for(int i = 0; i < size; i++)
    vector->array[i] = es_undefined;
  return es_obj_to_val(vector);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x28c4
movl %esi, %ebx
movl %esi, %r14d
leaq 0x18(,%r14,8), %rdx
pushq $0xd
popq %rsi
callq 0x1f63
movl %ebx, 0x10(%rax)
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0x28bc
movq $0x53, 0x18(%rax,%rcx,8)
incq %rcx
jmp 0x28a9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x39b2(%rip), %rdi      # 0x627d
leaq 0x394c(%rip), %rsi      # 0x621e
leaq 0x39ae(%rip), %rcx      # 0x6287
movl $0x471, %edx            # imm = 0x471
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_vector_from_list
es_val_t es_vector_from_list(es_ctx_t* ctx, es_val_t list)
{
  es_val_t vector;
  int i, length;
  gc_root(ctx, list);
  length = es_list_length(list);
  vector = es_make_vector(ctx, length);
  for(i = 0; i < length; i++, list = es_cdr(list)) {
    es_vector_set(vector, i, es_car(list));
  }
  gc_unroot(ctx, 1);
  return vector;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, (%rax)
movslq 0x2040(%rdi), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x2040(%rdi)
movq %rax, 0x40(%rdi,%rcx,8)
movq %rsi, %rdi
callq 0x297c
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
callq 0x2887
xorl %ecx, %ecx
testl %r14d, %r14d
cmovlel %ecx, %r14d
cmpq %rcx, %r14
je 0x296e
movq (%rsp), %rdx
movq 0x10(%rdx), %rdx
movq %rdx, 0x18(%rax,%rcx,8)
incq %rcx
movq (%rsp), %rdx
movq 0x18(%rdx), %rdx
movq %rdx, (%rsp)
jmp 0x294b
decl 0x2040(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_list_length
int es_list_length(es_val_t list)
{
  int i = 0;
  while(!es_is_nil(list)) {
    list = es_cdr(list);
    i++;
  }
  return i;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2864
testl %eax, %eax
jne 0x2999
movq 0x18(%r14), %r14
incl %ebx
jmp 0x2985
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_env
es_val_t es_make_env(es_ctx_t* ctx, int size)
{
  size_t sz = sizeof(es_env_t) + sizeof(es_slot_t) * size;
  es_env_t* env = es_alloc(ctx, ES_ENV_TYPE, sz);
  env->count = 0;
  env->size  = size;
  return es_obj_to_val(env);
}

// Assembly:
pushq %rbx
movslq %esi, %rbx
movq %rbx, %rdx
shlq $0x4, %rdx
addq $0x18, %rdx
pushq $0xf
popq %rsi
callq 0x1f63
andl $0x0, 0x10(%rax)
movl %ebx, 0x14(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: env_reserve_loc
static int env_reserve_loc(es_ctx_t* ctx, es_val_t env, es_val_t sym, es_val_t init)
{
  int loc = es_env_loc(env, sym);
  if (loc > -1) {
    if (es_is_unbound(es_env_val_of(env, loc))) {
      env_set_val(env, loc, init);
    }
    return loc;
  }

  int size  = es_env_size(env);
  size_t count = es_env_count(env);

  if (count >= size) {
    int new_size = (size << 1) + size;
    gc_root3(ctx, env, sym, init);

    es_val_t new_env = es_make_env(ctx, new_size);

    for(int i = 0; i < count; i++) {
      es_env_val(new_env)->slots[i].sym = es_env_val(env)->slots[i].sym;
      es_env_val(new_env)->slots[i].val = es_env_val(env)->slots[i].val;
      es_env_val(new_env)->count++;
    }

    gc_unroot(ctx, 3);

    ctx->env = new_env;
    env = new_env;
  }

  es_env_val(env)->slots[es_env_val(env)->count].sym = sym;
  es_env_val(env)->slots[es_env_val(env)->count].val = init;
  return es_env_val(env)->count++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x8(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x2ba2
testl %eax, %eax
js 0x2a31
movl %eax, %r12d
movl %eax, %r14d
shlq $0x4, %r14
movq 0x18(%rbx,%r14), %rdi
callq 0x281c
testl %eax, %eax
je 0x2b01
leaq (%rbx,%r14), %rax
addq $0x18, %rax
movq %r13, (%rax)
jmp 0x2b01
movl 0x10(%rbx), %r12d
movl 0x14(%rbx), %eax
cmpl %eax, %r12d
jb 0x2acd
leal (%rax,%rax,2), %esi
movslq 0x2040(%r14), %rax
leaq 0x8(%rsp), %rcx
movq %rcx, 0x40(%r14,%rax,8)
leaq 0x18(%rsp), %rcx
movq %rcx, 0x48(%r14,%rax,8)
leal 0x3(%rax), %ecx
movl %ecx, 0x2040(%r14)
leaq 0x10(%rsp), %rcx
movq %rcx, 0x50(%r14,%rax,8)
movq %r14, %rdi
callq 0x29a3
movq %rax, %rbx
shlq $0x4, %r12
xorl %eax, %eax
cmpq %rax, %r12
je 0x2ab0
movq 0x8(%rsp), %rcx
movq 0x20(%rcx,%rax), %rcx
movq %rcx, 0x20(%rbx,%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rcx,%rax), %rcx
movq %rcx, 0x18(%rbx,%rax)
incl 0x10(%rbx)
addq $0x10, %rax
jmp 0x2a84
addl $-0x3, 0x2040(%r14)
movq %rbx, 0x42080(%r14)
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %r15
movl 0x10(%rbx), %r12d
movslq %r12d, %rax
shlq $0x4, %rax
movq %r15, 0x20(%rbx,%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movslq 0x10(%rcx), %rdx
shlq $0x4, %rdx
movq %rax, 0x18(%rcx,%rdx)
movq 0x8(%rsp), %rax
movl 0x10(%rax), %r12d
leal 0x1(%r12), %ecx
movl %ecx, 0x10(%rax)
movl %r12d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_env_loc
static int es_env_loc(es_val_t _env, es_val_t sym)
{
  es_env_t* env = es_env_val(_env);
  for(int i = 0; i < env->count; i++) {
    if (es_is_eq(env->slots[i].sym, sym)) {
      return i;
    }
  }
  return -1;
}

// Assembly:
movl 0x10(%rdi), %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovlel %ecx, %edx
addq $0x20, %rdi
pushq $-0x1
popq %rax
cmpq %rcx, %rdx
je 0x2bc8
cmpq %rsi, (%rdi)
je 0x2bc6
incq %rcx
addq $0x10, %rdi
jmp 0x2bb3
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_bytecode
es_val_t es_make_bytecode(es_ctx_t* ctx)
{
  es_bytecode_t* b = es_alloc(ctx, ES_BYTECODE_TYPE, sizeof(es_bytecode_t));
  b->inst       = malloc(1024 * sizeof(es_inst_t));
  b->inst_size  = 1024;
  b->cpool_size = ES_CONST_POOL_SIZE;
  b->next_const = 0;
  b->next_inst  = 0;
  return es_obj_to_val(b);
}

// Assembly:
pushq %rbx
pushq $0x12
popq %rsi
movl $0x8028, %edx           # imm = 0x8028
callq 0x1f63
movq %rax, %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x10f0
movq %rax, 0x8018(%rbx)
movq $0x400, 0x8020(%rbx) # imm = 0x400
movq $0x1000, 0x8010(%rbx) # imm = 0x1000
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_closure
es_val_t es_make_closure(es_ctx_t* ctx, es_val_t env, es_val_t proc)
{
  es_closure_t* closure;
  gc_root2(ctx, env, proc);
  closure = es_alloc(ctx, ES_CLOSURE_TYPE, sizeof(es_closure_t));
  closure->proc = proc;
  closure->env  = (es_args_t*)env;
  gc_unroot(ctx, 2);
  return es_obj_to_val(closure);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %rsi, (%r14)
movq %rsp, %r15
movq %rdx, (%r15)
movslq 0x2040(%rdi), %rax
movq %r14, 0x40(%rdi,%rax,8)
leal 0x2(%rax), %ecx
movl %ecx, 0x2040(%rdi)
movq %r15, 0x48(%rdi,%rax,8)
pushq $0x8
popq %rsi
pushq $0x20
popq %rdx
callq 0x1f63
movq (%r15), %rcx
movq %rcx, 0x18(%rax)
movq (%r14), %rcx
movq %rcx, 0x10(%rax)
addl $-0x2, 0x2040(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_make_macro
es_val_t es_make_macro(es_ctx_t* ctx, es_val_t trans)
{
  es_macro_t* macro;
  gc_root(ctx, trans);
  macro = es_alloc(ctx, ES_MACRO_TYPE, sizeof(es_macro_t));
  macro->trans = trans;
  gc_unroot(ctx, 1);
  return es_obj_to_val(macro);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq %rsi, (%r14)
movslq 0x2040(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x2040(%rdi)
movq %r14, 0x40(%rdi,%rax,8)
pushq $0x14
popq %rsi
pushq $0x18
popq %rdx
callq 0x1f63
movq (%r14), %rcx
movq %rcx, 0x10(%rax)
decl 0x2040(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_size_of
size_t es_size_of(es_val_t val)
{
  switch(es_type_of(val)) {
  case ES_STRING_TYPE:       return es_string_size_of(val);
  case ES_PAIR_TYPE:         return sizeof(es_pair_t);
  case ES_CLOSURE_TYPE:      return sizeof(es_closure_t);
  case ES_PORT_TYPE:         return sizeof(es_port_t);
  case ES_VECTOR_TYPE:       return es_vector_size_of(val);
  case ES_FN_TYPE:           return sizeof(es_fn_t);
  case ES_BYTECODE_TYPE:     return sizeof(es_bytecode_t);
  case ES_ERROR_TYPE:        return sizeof(es_error_t);
  case ES_ENV_TYPE:          return es_env_size_of(val);
  case ES_PROC_TYPE:         return sizeof(es_proc_t);
  case ES_ARGS_TYPE:         return es_args_size_of(val);
  case ES_MACRO_TYPE:        return sizeof(es_macro_t);
  case ES_BUFFER_TYPE:       return es_buffer_size_of(val);
  case ES_INVALID_TYPE:      return -1;
  case ES_NIL_TYPE:
  case ES_BOOL_TYPE:
  case ES_FIXNUM_TYPE:
  case ES_SYMBOL_TYPE:
  case ES_CHAR_TYPE:
  case ES_EOF_OBJ_TYPE:
  case ES_UNBOUND_TYPE:
  case ES_UNDEFINED_TYPE:
  case ES_VOID_TYPE:
  case ES_CONT_TYPE:
    return sizeof(es_val_t);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x182d
movl %eax, %ecx
pushq $0x20
popq %rax
incl %ecx
cmpl $0x17, %ecx
ja 0x2d52
leaq 0x3372(%rip), %rdx      # 0x60b8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
pushq $0x8
popq %rax
popq %rbx
retq
pushq $0x18
jmp 0x2d51
movslq 0x10(%rbx), %rax
leaq 0x18(,%rax,8), %rax
jmp 0x2d52
movl $0x1848, %eax           # imm = 0x1848
jmp 0x2d52
movq 0x10(%rbx), %rax
addq $0x19, %rax
jmp 0x2d52
pushq $-0x1
jmp 0x2d51
movslq 0x14(%rbx), %rax
shlq $0x4, %rax
addq $0x18, %rax
jmp 0x2d52
movslq 0x18(%rbx), %rax
leaq 0x20(,%rax,8), %rax
jmp 0x2d52
movq 0x10(%rbx), %rax
jmp 0x2d52
movl $0x8028, %eax           # imm = 0x8028
jmp 0x2d52
// File: /workspace/github_c_makefile_star2_O2/pedro-onate[P]eva/eva.c
// Function: es_mark_copy
void es_mark_copy(es_heap_t* heap, es_val_t* ref, char** next)
{
  assert(*next < heap->to_end);
  if (!is_obj(*ref))
    return;

  if (es_obj_is_reloc(*ref)) {
    *ref = es_obj_to_val(es_val_to_obj(*ref)->reloc); // Update stale reference to relocated object
  } else {
    size_t size = es_size_of(*ref);                // Get size of object
    *next = alignp(*next, ES_DEFAULT_ALIGNMENT); // Ensure next pointer is aligned
    memcpy(*next, (void*)*ref, size);                 // Copy object from_space from_space-space into to_space-space
    es_val_to_obj(*ref)->reloc = (es_obj_t*)*next;            // Leave forwarding pointer in old from_space-space object
    *ref = es_obj_to_val(es_val_to_obj(*ref)->reloc);                    // Update current reference to_space point to_space new object in to_space-space
    es_val_to_obj(*ref)->reloc = NULL;                        // Reset tombstone
    *next += size;                                 // Update next pointer
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdx), %r15
cmpq 0x30(%rdi), %r15
jae 0x3084
movq %rsi, %r14
movq (%rsi), %r12
testb $0x7, %r12b
setne %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x307a
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x303e
movq %rax, (%r14)
jmp 0x307a
movq %rdx, %rbx
movq %r12, %rdi
callq 0x2d2a
movq %rax, %r13
addq $0xf, %r15
andq $-0x10, %r15
movq %r15, (%rbx)
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x10e0
movq (%rbx), %rax
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
movq %rax, (%r14)
andq $0x0, 0x8(%rax)
addq %r13, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x3591(%rip), %rdi      # 0x661c
leaq 0x318c(%rip), %rsi      # 0x621e
leaq 0x3598(%rip), %rcx      # 0x6631
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x10a0