LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/./tools.h
// Function: hashset<ident>::insert(unsigned int)
chain *insert(uint h)
    {
        if(!unused)
        {
            chainchunk *chunk = new chainchunk;
            chunk->next = chunks;
            chunks = chunk;
            loopi(CHUNKSIZE-1) chunk->chains[i].next = &chunk->chains[i+1];
            chunk->chains[CHUNKSIZE-1].next = unused;
            unused = chunk->chains;
        }
        chain *c = unused;
        unused = unused->next;
        c->next = chains[h];
        chains[h] = c;
        numelems++;
        return c;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
jne 0x130d9
movl $0x1208, %edi           # imm = 0x1208
callq 0x156f0
movq 0x10(%rbx), %rcx
movq %rcx, 0x1200(%rax)
movq %rax, 0x10(%rbx)
movq %rax, %rcx
addq $0x48, %rcx
movl $0x3f, %edx
movq %rcx, -0x8(%rcx)
addq $0x48, %rcx
decq %rdx
jne 0x130c1
movq $0x0, 0x11f8(%rax)
movq 0x40(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq 0x8(%rbx), %rcx
movl %r14d, %edx
movq (%rcx,%rdx,8), %rsi
movq %rsi, 0x40(%rax)
movq %rax, (%rcx,%rdx,8)
incl 0x4(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/./command.h
// Function: ident::getval(tagval&) const
inline void ident::getval(tagval &v) const
{
    switch(valtype)
    {
        case VAL_STR: case VAL_MACRO: v.setstr(newstring(val.s)); break;
        case VAL_INT: v.setint(val.i); break;
        case VAL_FLOAT: v.setfloat(val.f); break;
        default: v.setnull(); break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl 0x10(%rdi), %eax
decl %eax
cmpl $0x5, %eax
ja 0x133c5
leaq 0x4987(%rip), %rcx      # 0x17cf0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x2080
leaq 0x1(%rax), %r15
movq %r15, %rdi
callq 0x15705
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2130
movl $0x3, 0x8(%rbx)
movq %r12, (%rbx)
jmp 0x133cc
movss 0x20(%rdi), %xmm0
movl $0x2, 0x8(%rbx)
movss %xmm0, (%rbx)
jmp 0x133cc
movl 0x20(%rdi), %eax
movl $0x1, 0x8(%rbx)
jmp 0x133ca
xorl %eax, %eax
movl %eax, 0x8(%rbx)
movl %eax, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/command.cpp
// Function: sortfun::operator()(sortitem const&, sortitem const&)
bool operator()(const sortitem &xval, const sortitem &yval)
    {
        if(x->valtype != VAL_MACRO) x->valtype = VAL_MACRO;
        cleancode(*x);
        x->val.code = (const uint *)xval.str;
        if(y->valtype != VAL_MACRO) y->valtype = VAL_MACRO;
        cleancode(*y);
        y->val.code = (const uint *)yval.str;
        return executebool(body);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r12
cmpl $0x6, 0x10(%r12)
je 0x13571
movl $0x6, 0x10(%r12)
movq (%rbx), %r12
movq 0x18(%r12), %rax
testq %rax, %rax
je 0x1359f
addl $0xffffff00, (%rax)     # imm = 0xFFFFFF00
movq 0x18(%r12), %rdi
cmpl $0xff, (%rdi)
jg 0x13593
callq 0x1572b
movq $0x0, 0x18(%r12)
movq (%rbx), %r12
movq (%r15), %rax
movq %rax, 0x20(%r12)
movq 0x8(%rbx), %r15
cmpl $0x6, 0x10(%r15)
je 0x135be
movl $0x6, 0x10(%r15)
movq 0x8(%rbx), %r15
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x135ea
addl $0xffffff00, (%rax)     # imm = 0xFFFFFF00
movq 0x18(%r15), %rdi
cmpl $0xff, (%rdi)
jg 0x135de
callq 0x1572b
movq $0x0, 0x18(%r15)
movq 0x8(%rbx), %r15
movq (%r14), %rax
movq %rax, 0x20(%r15)
movq 0x10(%rbx), %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x966f
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: path(char*)
char *path(char *s)
{
    for(char *curpart = s;;)
    {
        char *endpart = strchr(curpart, '&');
        if(endpart) *endpart = '\0';
        if(curpart[0]=='<')
        {
            char *file = strrchr(curpart, '>');
            if(!file) return s;
            curpart = file+1;
        }
        for(char *t = curpart; (t = strpbrk(t, "/\\")); *t++ = PATHDIV);
        for(char *prevdir = NULL, *curdir = curpart;;)
        {
            prevdir = curdir[0]==PATHDIV ? curdir+1 : curdir;
            curdir = strchr(prevdir, PATHDIV);
            if(!curdir) break;
            if(prevdir+1==curdir && prevdir[0]=='.')
            {
                memmove(prevdir, curdir+1, strlen(curdir+1)+1);
                curdir = prevdir;
            }
            else if(curdir[1]=='.' && curdir[2]=='.' && curdir[3]==PATHDIV)
            {
                if(prevdir+2==curdir && prevdir[0]=='.' && prevdir[1]=='.') continue;
                memmove(prevdir, curdir+4, strlen(curdir+4)+1);
                curdir = prevdir;
            }
        }
        if(endpart)
        {
            *endpart = '&';
            curpart = endpart+1;
        }
        else break;
    }
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x50bc(%rip), %r14      # 0x18d0e
movq %rdi, %r13
movq %r13, %rdi
movl $0x26, %esi
callq 0x2060
movq %rax, %r15
testq %rax, %rax
je 0x13c6e
movb $0x0, (%r15)
cmpb $0x3c, (%r13)
jne 0x13c91
movq %r13, %rdi
movl $0x3e, %esi
callq 0x21c0
testq %rax, %rax
je 0x13d5b
movq %rax, %r13
incq %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2380
testq %rax, %rax
je 0x13cac
movb $0x2f, (%rax)
incq %rax
movq %rax, %rdi
jmp 0x13c94
xorl %r12d, %r12d
cmpb $0x2f, (%r13)
sete %r12b
addq %r13, %r12
movq %r12, %rdi
movl $0x2f, %esi
callq 0x2060
movq %rax, %r13
testq %rax, %rax
je 0x13d47
leaq 0x1(%r12), %rax
cmpq %r13, %rax
jne 0x13ce6
movl $0x1, %ecx
cmpb $0x2e, (%r12)
je 0x13d1b
cmpb $0x2e, 0x1(%r13)
jne 0x13d16
cmpb $0x2e, 0x2(%r13)
jne 0x13d16
cmpb $0x2f, 0x3(%r13)
jne 0x13d16
leaq 0x2(%r12), %rdx
movl $0x4, %ecx
cmpq %r13, %rdx
jne 0x13d1b
cmpb $0x2e, (%r12)
jne 0x13d1b
cmpb $0x2e, (%rax)
jne 0x13d1b
movq %r13, %r12
jmp 0x13d35
addq %rcx, %r13
movq %r13, %rdi
callq 0x2080
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2340
xorl %eax, %eax
cmpb $0x2f, (%r12)
sete %al
addq %rax, %r12
jmp 0x13cbb
testq %r15, %r15
je 0x13d5b
movb $0x26, (%r15)
incq %r15
movq %r15, %r13
jmp 0x13c55
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: path(char const*, bool)
char *path(const char *s, bool copy)
{
    static string tmp;
    copystring(tmp, s);
    path(tmp);
    return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2080
movq %rax, %r14
incq %r14
movl $0x104, %eax            # imm = 0x104
cmpq %rax, %r14
cmovaeq %rax, %r14
leaq 0xc5d8(%rip), %r15      # 0x20370
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2130
movb $0x0, -0x1(%r14,%r15)
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13c3a
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: parentdir(char const*)
const char *parentdir(const char *directory)
{
    const char *p = directory + strlen(directory);
    while(p > directory && *p != '/' && *p != '\\') p--;
    static string parent;
    size_t len = p-directory+1;
    copystring(parent, directory, len);
    return parent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2080
movq %rax, %r14
addq %rbx, %rax
testq %r14, %r14
jle 0x13df0
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x13df0
cmpl $0x5c, %ecx
je 0x13df0
decq %rax
cmpq %rbx, %rax
ja 0x13ddb
subq %rbx, %rax
incq %rax
incq %r14
cmpq %rax, %r14
cmovaeq %rax, %r14
leaq 0xc679(%rip), %r15      # 0x20480
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2130
movb $0x0, -0x1(%r14,%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: createdir(char const*)
bool createdir(const char *path)
{
    size_t len = strlen(path);
    if(path[len-1]==PATHDIV)
    {
        static string strip;
        path = copystring(strip, path, len);
    }
#ifdef WIN32
    return CreateDirectory(path, NULL)!=0;
#else
    return mkdir(path, 0777)==0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2080
cmpb $0x2f, -0x1(%rbx,%rax)
jne 0x13ecf
movq %rax, %r14
incq %rax
cmpq %r14, %rax
cmovbq %rax, %r14
leaq 0xc6d8(%rip), %r15      # 0x20590
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2130
movb $0x0, -0x1(%r14,%r15)
movq %r15, %rbx
movq %rbx, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x2090
testl %eax, %eax
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: fixpackagedir(char*)
size_t fixpackagedir(char *dir)
{
    path(dir);
    size_t len = strlen(dir);
    if(len > 0 && dir[len-1] != PATHDIV)
    {
        dir[len] = PATHDIV;
        dir[len+1] = '\0';
    }
    return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x13c3a
movq %rbx, %rdi
callq 0x2080
testq %rax, %rax
je 0x13f14
cmpb $0x2f, -0x1(%rbx,%rax)
je 0x13f14
movw $0x2f, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: subhomedir(char*, int, char const*)
bool subhomedir(char *dst, int len, const char *src)
{
    const char *sub = strstr(src, "$HOME");
    if(!sub) sub = strchr(src, '~');
    if(sub && sub-src < len)
    {
#ifdef WIN32
        char home[MAX_PATH+1];
        home[0] = '\0';
        if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, home) != S_OK || !home[0]) return false;
#else
        const char *home = getenv("HOME");
        if(!home || !home[0]) return false;
#endif
        dst[sub-src] = '\0';
        concatstring(dst, home);
        concatstring(dst, sub+(*sub == '~' ? 1 : strlen("$HOME")));
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x4dd7(%rip), %rsi      # 0x18d13
movq %rdx, %rdi
callq 0x2040
testq %rax, %rax
jne 0x13f5f
movq %r12, %rdi
movl $0x7e, %esi
callq 0x2060
testq %rax, %rax
je 0x1404f
movq %rax, %r15
movq %rax, %r13
subq %r12, %r13
movslq %r14d, %rax
movb $0x1, %r14b
cmpq %rax, %r13
jge 0x14052
leaq 0x4d96(%rip), %rdi      # 0x18d14
callq 0x2230
testq %rax, %rax
je 0x1404a
movq %rax, %r12
cmpb $0x0, (%rax)
je 0x1404a
movb $0x0, (%rbx,%r13)
movq %rbx, %rdi
callq 0x2080
cmpq $0x103, %rax            # imm = 0x103
ja 0x13ff3
leaq (%rbx,%rax), %rcx
movq %rcx, -0x30(%rbp)
movl $0x104, %ecx            # imm = 0x104
subq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %r12, %rdi
callq 0x2080
movq %rax, %r13
incq %r13
movq -0x38(%rbp), %rax
cmpq %rax, %r13
cmovaeq %rax, %r13
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2130
movq -0x30(%rbp), %rax
movb $0x0, -0x1(%r13,%rax)
movq %rbx, %rdi
callq 0x2080
cmpq $0x103, %rax            # imm = 0x103
ja 0x14052
xorl %ecx, %ecx
cmpb $0x7e, (%r15)
setne %cl
leaq (%r15,%rcx,4), %r15
incq %r15
addq %rax, %rbx
movl $0x104, %r13d           # imm = 0x104
subq %rax, %r13
movq %r15, %rdi
callq 0x2080
movq %rax, %r12
incq %r12
cmpq %r13, %r12
cmovaeq %r13, %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2130
movb $0x0, -0x1(%r12,%rbx)
jmp 0x14052
xorl %r14d, %r14d
jmp 0x14052
movb $0x1, %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: sethomedir(char const*)
const char *sethomedir(const char *dir)
{
    string pdir;
    copystring(pdir, dir);
    if(!subhomedir(pdir, sizeof(pdir), dir) || !fixpackagedir(pdir)) return NULL;
    copystring(homedir, pdir);
    return homedir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0x2080
movq %rax, %r14
incq %r14
movl $0x104, %eax            # imm = 0x104
cmpq %rax, %r14
cmovaeq %rax, %r14
leaq -0x120(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2130
movb $0x0, -0x121(%rbp,%r14)
movq %r15, %rdi
movl $0x104, %esi            # imm = 0x104
movq %rbx, %rdx
callq 0x13f1b
testb %al, %al
je 0x1410f
leaq -0x120(%rbp), %rdi
callq 0x13eec
testq %rax, %rax
je 0x1410f
leaq -0x120(%rbp), %r14
movq %r14, %rdi
callq 0x2080
movq %rax, %r15
incq %r15
movl $0x104, %eax            # imm = 0x104
cmpq %rax, %r15
cmovaeq %rax, %r15
leaq 0xc047(%rip), %rbx      # 0x20140
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2130
movb $0x0, -0x1(%r15,%rbx)
jmp 0x14111
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: addpackagedir(char const*)
const char *addpackagedir(const char *dir)
{
    string pdir;
    copystring(pdir, dir);
    if(!subhomedir(pdir, sizeof(pdir), dir) || !fixpackagedir(pdir)) return NULL;
    char *filter = pdir;
    for(;;)
    {
        static int len = strlen("packages");
        filter = strstr(filter, "packages");
        if(!filter) break;
        if(filter > pdir && filter[-1] == PATHDIV && filter[len] == PATHDIV) break;
        filter += len;
    }    
    packagedir &pf = packagedirs.add();
    pf.dir = filter ? newstring(pdir, filter-pdir) : newstring(pdir);
    pf.dirlen = filter ? filter-pdir : strlen(pdir);
    pf.filter = filter ? newstring(filter) : NULL;
    pf.filterlen = filter ? strlen(filter) : 0;
    return pf.dir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
callq 0x2080
movq %rax, %r14
incq %r14
movl $0x104, %eax            # imm = 0x104
cmpq %rax, %r14
cmovaeq %rax, %r14
leaq -0x140(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2130
movb $0x0, -0x141(%rbp,%r14)
movq %r15, %rdi
movl $0x104, %esi            # imm = 0x104
movq %rbx, %rdx
callq 0x13f1b
testb %al, %al
je 0x1424b
leaq -0x140(%rbp), %rdi
callq 0x13eec
testq %rax, %rax
je 0x1424b
leaq 0x4b77(%rip), %rsi      # 0x18d19
leaq -0x140(%rbp), %r12
movq %r12, %rdi
callq 0x2040
testq %rax, %rax
je 0x141f1
movq %rax, %r15
leaq 0x4b59(%rip), %rbx      # 0x18d19
movq %r15, %r13
subq %r12, %r13
jbe 0x141da
cmpb $0x2f, -0x1(%r15)
jne 0x141da
cmpb $0x2f, 0x8(%r15)
je 0x14263
addq $0x8, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2040
movq %rax, %r15
testq %rax, %rax
jne 0x141c0
leaq 0xc050(%rip), %rdi      # 0x20248
callq 0x14d16
movq %rax, %rbx
leaq -0x140(%rbp), %r15
movq %r15, %rdi
callq 0x2080
leaq 0x1(%rax), %r12
movq %r12, %rdi
callq 0x15705
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2130
movq %r14, (%rbx)
movq %r15, %rdi
callq 0x2080
movq %rax, 0x10(%rbx)
movq $0x0, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x18(%rbx)
jmp 0x1424e
xorl %r14d, %r14d
movq %r14, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbfde(%rip), %rdi      # 0x20248
callq 0x14d16
movq %rax, %rbx
leaq 0x1(%r13), %rdi
movq %rdi, -0x30(%rbp)
callq 0x15705
movq %rax, %r14
movq %r12, %rdi
callq 0x2080
movq %rax, %rdx
incq %rdx
movq -0x30(%rbp), %rax
cmpq %rax, %rdx
cmovaeq %rax, %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %rdx, %r12
callq 0x2130
movb $0x0, -0x1(%r14,%r12)
movq %r14, (%rbx)
movq %r13, 0x10(%rbx)
movq %r15, %rdi
callq 0x2080
leaq 0x1(%rax), %r12
movq %r12, %rdi
callq 0x15705
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2130
movq %r13, 0x8(%rbx)
movq %r15, %rdi
callq 0x2080
jmp 0x14245
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: listfiles(char const*, char const*, vector<char*>&)
int listfiles(const char *dir, const char *ext, vector<char *> &files)
{
    string dirname;
    copystring(dirname, dir);
    path(dirname);
    size_t dirlen = strlen(dirname);
    while(dirlen > 1 && dirname[dirlen-1] == PATHDIV) dirname[--dirlen] = '\0';
    int dirs = 0;
    if(listdir(dirname, true, ext, files)) dirs++;
    string s;
    if(homedir[0])
    {
        formatstring(s)("%s%s", homedir, dirname);
        if(listdir(s, false, ext, files)) dirs++;
    }
    loopv(packagedirs)
    {
        packagedir &pf = packagedirs[i];
        if(pf.filter && strncmp(dirname, pf.filter, dirlen == pf.filterlen-1 ? dirlen : pf.filterlen))
            continue;
        formatstring(s)("%s%s", pf.dir, dirname);
        if(listdir(s, false, ext, files)) dirs++;
    }

    return dirs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
callq 0x2080
movq %rax, %r15
incq %r15
movl $0x104, %eax            # imm = 0x104
cmpq %rax, %r15
cmovaeq %rax, %r15
leaq -0x150(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2130
movb $0x0, -0x151(%rbp,%r15)
movq %r12, %rdi
callq 0x13c3a
movq %r12, %rdi
callq 0x2080
movq %rax, %r15
cmpq $0x2, %rax
jb 0x1470f
cmpb $0x2f, -0x151(%rbp,%r15)
jne 0x1470f
movb $0x0, -0x151(%rbp,%r15)
decq %r15
cmpq $0x1, %r15
ja 0x146ec
movl $0x1, %r15d
leaq -0x150(%rbp), %rdi
movl $0x1, %esi
movq %r13, %rdx
movq %r14, %rcx
callq 0x144f8
movzbl %al, %r12d
cmpb $0x0, 0xba0f(%rip)      # 0x20140
je 0x1477b
leaq -0x260(%rbp), %rbx
leaq -0x38(%rbp), %rdi
movq %rbx, (%rdi)
leaq 0x45da(%rip), %rsi      # 0x18d22
leaq 0xb9f1(%rip), %rdx      # 0x20140
leaq -0x150(%rbp), %rcx
xorl %eax, %eax
callq 0x12e1e
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
callq 0x144f8
leal 0x1(%r12), %ecx
testb %al, %al
cmovel %r12d, %ecx
movl %ecx, %r12d
movq %r12, -0x30(%rbp)
movl 0xbacf(%rip), %ebx      # 0x20254
testl %ebx, %ebx
jle 0x14833
movq %r13, -0x40(%rbp)
movq %r14, -0x48(%rbp)
movq 0xbaac(%rip), %r12      # 0x20248
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x8(%r12,%r14), %rsi
testq %rsi, %rsi
je 0x147cc
movq 0x18(%r12,%r14), %rdx
leaq -0x1(%rdx), %rax
cmpq %rax, %r15
cmoveq %r15, %rdx
leaq -0x150(%rbp), %rdi
callq 0x20a0
testl %eax, %eax
jne 0x14820
leaq -0x260(%rbp), %rbx
movq %rbx, -0x38(%rbp)
movq (%r12,%r14), %rdx
leaq -0x38(%rbp), %rdi
leaq 0x453c(%rip), %rsi      # 0x18d22
leaq -0x150(%rbp), %rcx
xorl %eax, %eax
callq 0x12e1e
movq %rbx, %rdi
xorl %esi, %esi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x144f8
movzbl %al, %eax
movq -0x30(%rbp), %rcx
addl %eax, %ecx
movq %rcx, -0x30(%rbp)
movq 0xba2e(%rip), %r12      # 0x20248
movl 0xba34(%rip), %ebx      # 0x20254
incq %r13
movslq %ebx, %rax
addq $0x20, %r14
cmpq %rax, %r13
jl 0x147a2
movq -0x30(%rbp), %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: stream::size()
stream::offset stream::size()
{
    offset pos = tell(), endpos;
    if(pos < 0 || !seek(0, SEEK_END)) return -1;
    endpos = tell();
    return pos == endpos || seek(pos, SEEK_SET) ? endpos : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x20(%rax)
movq $-0x1, %rbx
testq %rax, %rax
js 0x148a7
movq %rax, %r15
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq *0x30(%rax)
testb %al, %al
je 0x148a7
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movq %rax, %r12
cmpq %rax, %r15
je 0x148a4
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x30(%rax)
testb %al, %al
je 0x148a7
movq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: stream::getline(char*, unsigned long)
bool stream::getline(char *str, size_t len)
{
    loopi(len-1)
    {
        if(read(&str[i], 1) != 1) { str[i] = '\0'; return i > 0; }
        else if(str[i] == '\n') { str[i+1] = '\0'; return true; }
    }
    if(len > 0) str[len-1] = '\0';
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdx, -0x38(%rbp)
leaq -0x1(%rdx), %rcx
movq %rcx, -0x30(%rbp)
testl %ecx, %ecx
jle 0x14913
movq %rdi, %r15
movq -0x30(%rbp), %r13
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %r14d, %r14d
leaq (%rbx,%r14), %r12
movq (%r15), %rax
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq *0x48(%rax)
cmpq $0x1, %rax
jne 0x14926
cmpb $0xa, (%r12)
je 0x14933
incq %r14
cmpq %r14, %r13
jne 0x148e9
movb $0x1, %al
cmpq $0x0, -0x38(%rbp)
je 0x1493b
movq -0x30(%rbp), %rcx
movb $0x0, (%rbx,%rcx)
jmp 0x1493b
movb $0x0, (%rbx,%r14)
testq %r14, %r14
setne %al
jmp 0x1493b
movb $0x0, 0x1(%rbx,%r14)
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: stream::printf(char const*, ...)
size_t stream::printf(const char *fmt, ...)
{
    char buf[512];
    char *str = buf;
    va_list args;
#if defined(WIN32) && !defined(__GNUC__)
    va_start(args, fmt);
    int len = _vscprintf(fmt, args);
    if(len <= 0) { va_end(args); return 0; }
    if(len >= (int)sizeof(buf)) str = new char[len+1];
    _vsnprintf(str, len+1, fmt, args);
    va_end(args);
#else
    va_start(args, fmt);
    int len = vsnprintf(buf, sizeof(buf), fmt, args);
    va_end(args);
    if(len <= 0) return 0;
    if(len >= (int)sizeof(buf))
    {
        str = new char[len+1];
        va_start(args, fmt);
        vsnprintf(str, len+1, fmt, args);
        va_end(args);
    }
#endif
    size_t n = write(str, len);
    if(str != buf) delete[] str;
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rsi, %r15
movq %rdi, %rbx
leaq -0x100(%rbp), %r14
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x149ae
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
leaq -0x50(%rbp), %rcx
movq %r14, 0x10(%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq -0x300(%rbp), %r12
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
movq %r15, %rdx
callq 0x20e0
testl %eax, %eax
jle 0x14a54
movl %eax, %r13d
cmpl $0x200, %eax            # imm = 0x200
jb 0x14a2c
leal 0x1(%r13), %edi
movq %rdi, -0x30(%rbp)
callq 0x15705
movq %rax, %r12
leaq -0x50(%rbp), %rcx
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movq %r12, %rdi
movq -0x30(%rbp), %rsi
movq %r15, %rdx
callq 0x20e0
movl %r13d, %edx
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *0x50(%rax)
movq %rax, %rbx
leaq -0x300(%rbp), %rax
cmpq %rax, %r12
je 0x14a56
movq %r12, %rdi
callq 0x1572b
jmp 0x14a56
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: openrawfile(char const*, char const*)
stream *openrawfile(const char *filename, const char *mode)
{
    const char *found = findfile(filename, mode);
    if(!found) return NULL;
    filestream *file = new filestream;
    if(!file->open(found, mode)) { delete file; return NULL; }
    return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
callq 0x142ec
testq %rax, %rax
je 0x14ab8
movq %rax, %r15
movl $0x10, %edi
callq 0x156f0
movq %rax, %rbx
leaq 0xa1b7(%rip), %rax      # 0x1ec50
movq %rax, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x21e0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x14aba
movq %rbx, %rdi
callq 0x14ef0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: opentempfile(char const*, char const*)
stream *opentempfile(const char *name, const char *mode)
{
    const char *found = findfile(name, mode);
    filestream *file = new filestream;
    if(!file->opentemp(found ? found : name, mode)) { delete file; return NULL; }
    return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x142ec
movl $0x10, %edi
callq 0x156f0
movq %rax, %rbx
leaq 0xa15f(%rip), %rax      # 0x1ec50
movq %rax, (%rbx)
callq 0x2390
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x14b0c
movq %rbx, %rdi
callq 0x14ef0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: openutf8file(char const*, char const*, stream*)
stream *openutf8file(const char *filename, const char *mode, stream *file)
{
    stream *source = file ? file : openfile(filename, mode);
    if(!source) return NULL;
    utf8stream *utf8 = new utf8stream;
    if(!utf8->open(source, mode, !file)) { if(!file) delete source; return NULL; }
    return utf8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdx, %rbx
testq %rdx, %rdx
jne 0x14b42
movq %r14, %rsi
callq 0x14a6b
movq %rax, %rbx
testq %rax, %rax
je 0x14ba5
xorl %r12d, %r12d
testq %r15, %r15
setne %r13b
sete %r12b
movl $0x1038, %edi           # imm = 0x1038
callq 0x156f0
movq %rax, %r15
leaq 0xa1ac(%rip), %rax      # 0x1ed10
movq %rax, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movups %xmm0, 0x18(%r15)
movups %xmm0, 0x23(%r15)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %r12d, %ecx
callq 0x14d4c
movl %eax, %ecx
orb %al, %r13b
xorl %eax, %eax
testb %cl, %cl
cmovneq %r15, %rax
testb %r13b, %r13b
jne 0x14ba7
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: loadfile(char const*, unsigned long*, bool)
char *loadfile(const char *fn, size_t *size, bool utf8)
{
    stream *f = openfile(fn, "rb");
    if(!f) return NULL;
    size_t len = f->size();
    if(len <= 0) { delete f; return NULL; }
    char *buf = new char[len+1];
    if(!buf) { delete f; return NULL; }
    size_t offset = 0;
    if(utf8 && len >= 3)
    {
        if(f->read(buf, 3) != 3) { delete f; delete[] buf; return NULL; }
        if(((uchar *)buf)[0] == 0xEF && ((uchar *)buf)[1] == 0xBB && ((uchar *)buf)[2] == 0xBF) len -= 3;
        else offset += 3;
    } 
    size_t rlen = f->read(&buf[offset], len-offset);
    delete f;
    if(rlen != len-offset) { delete[] buf; return NULL; }
    if(utf8) len = decodeutf8((uchar *)buf, len, (uchar *)buf, len);
    buf[len] = '\0';
    if(size!=NULL) *size = len;
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r12d
movq %rsi, %r15
leaq 0x4158(%rip), %rsi      # 0x18d2c
callq 0x14a6b
testq %rax, %rax
je 0x14cdf
movq %rax, %r13
movq (%rax), %rax
movq %r13, %rdi
callq *0x38(%rax)
testq %rax, %rax
je 0x14c5f
movq %rax, %r14
leaq 0x1(%rax), %rdi
callq 0x15705
movq %rax, %rbx
cmpq $0x3, %r14
setb %al
movl %r12d, -0x34(%rbp)
movl %r12d, %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x14c6b
movq (%r13), %rax
movl $0x3, %r12d
movl $0x3, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq *0x48(%rax)
cmpq $0x3, %rax
jne 0x14ccd
cmpb $-0x11, (%rbx)
movq %r15, -0x30(%rbp)
jne 0x14c72
cmpb $-0x45, 0x1(%rbx)
jne 0x14c72
leaq -0x3(%r14), %rax
xorl %ecx, %ecx
cmpb $-0x41, 0x2(%rbx)
setne %cl
cmoveq %rax, %r14
leaq (%rcx,%rcx,2), %r12
jmp 0x14c72
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
jmp 0x14cdf
movq %r15, -0x30(%rbp)
xorl %r12d, %r12d
movq %rbx, %rsi
addq %r12, %rsi
movq %r14, %r15
subq %r12, %r15
movq (%r13), %rax
movq %r13, %rdi
movq %r15, %rdx
callq *0x48(%rax)
movq %rax, %r12
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
cmpq %r15, %r12
jne 0x14cd7
cmpb $0x0, -0x34(%rbp)
je 0x14cba
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x13604
movq %rax, %r14
movq -0x30(%rbp), %rax
movb $0x0, (%rbx,%r14)
testq %rax, %rax
je 0x14ce1
movq %r14, (%rax)
jmp 0x14ce1
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x1572b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: utf8stream::open(stream*, char const*, bool)
bool open(stream *f, const char *mode, bool needclose)
    {
        if(file) return false;
        for(; *mode; mode++)
        {
            if(*mode=='r') { reading = true; break; }
            else if(*mode=='w') { writing = true; break; }
        }
        if(!reading && !writing) return false;
       
        autoclose = needclose;
        file = f;
       
        if(reading) checkheader();
 
        return true;
    }

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x14d56
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
movzbl (%rdx), %eax
testl %eax, %eax
je 0x14d7a
cmpl $0x77, %eax
je 0x14d76
cmpl $0x72, %eax
je 0x14d70
incq %rdx
jmp 0x14d5a
movb $0x1, 0x30(%rdi)
jmp 0x14d7a
movb $0x1, 0x31(%rdi)
cmpb $0x0, 0x30(%rdi)
je 0x14d8e
movb %cl, 0x32(%rdi)
movq %rsi, 0x8(%rdi)
callq 0x15512
jmp 0x14d9b
cmpb $0x1, 0x31(%rdi)
jne 0x14d9f
movb %cl, 0x32(%rdi)
movq %rsi, 0x8(%rdi)
movb $0x1, %al
jmp 0x14da1
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: utf8stream::seek(long, int)
bool seek(offset off, int whence)
    {
        if(writing || !reading) return false;

        if(whence == SEEK_END)
        {
            uchar skip[512];
            while(read(skip, sizeof(skip)) == sizeof(skip));
            return !off;
        }
        else if(whence == SEEK_CUR) off += pos;
       
        if(off >= pos) off -= pos;
        else if(off < 0 || !file->seek(0, SEEK_SET)) return false;
        else
        {
            bufread = bufcarry = buflen = 0;
            pos = 0;
            checkheader(); 
        }

        uchar skip[512];
        while(off > 0)
        {
            size_t skipped = (size_t)min(off, (offset)sizeof(skip));
            if(read(skip, skipped) != skipped) { stopreading(); return false; }
            off -= skipped;
        }
        
        return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
cmpb $0x0, 0x31(%rdi)
jne 0x1527c
movq %rdi, %rbx
cmpb $0x1, 0x30(%rdi)
jne 0x1527c
movq %rsi, %r14
cmpl $0x1, %edx
je 0x151ee
cmpl $0x2, %edx
jne 0x151f7
leaq -0x230(%rbp), %r15
movq (%rbx), %rax
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
movq %r15, %rsi
callq *0x48(%rax)
cmpq $0x200, %rax            # imm = 0x200
je 0x151c9
testq %r14, %r14
sete %r15b
jmp 0x1527f
movq 0x10(%rbx), %rax
addq %rax, %r14
jmp 0x151fb
movq 0x10(%rbx), %rax
movq %r14, %r13
subq %rax, %r13
jge 0x15236
testq %r14, %r14
js 0x1527c
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
xorl %r15d, %r15d
xorl %esi, %esi
xorl %edx, %edx
callq *0x30(%rax)
testb %al, %al
je 0x1527f
leaq 0x10(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rbx, %rdi
callq 0x15512
movq %r14, %r13
movb $0x1, %r15b
testq %r13, %r13
jle 0x1527f
leaq -0x230(%rbp), %r14
movl $0x200, %eax            # imm = 0x200
cmpq %rax, %r13
movl $0x200, %r12d           # imm = 0x200
cmovbq %r13, %r12
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0x48(%rax)
cmpq %r12, %rax
jne 0x15272
subq %r12, %r13
jg 0x15245
jmp 0x1527f
cmpb $0x1, 0x30(%rbx)
jne 0x1527c
movb $0x0, 0x30(%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: utf8stream::read(void*, unsigned long)
size_t read(void *dst, size_t len)
    {
        if(!reading || !dst || !len) return 0;
        size_t next = 0;
        while(next < len)
        {
            if(bufread >= bufcarry) { if(readbuf(BUFSIZE)) continue; stopreading(); break; }
            size_t n = min(len - next, bufcarry - bufread);
            memcpy(&((uchar *)dst)[next], &buf[bufread], n);
            next += n;
            bufread += n;
        }
        pos += next;
        return next;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x15322
movq %rsi, %r12
testq %rsi, %rsi
je 0x15322
movq %rdi, %r14
cmpb $0x0, 0x30(%rdi)
je 0x15322
movq %rdx, %r15
leaq 0x33(%r14), %rax
movq %rax, -0x30(%rbp)
xorl %ebx, %ebx
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rax
subq %rsi, %rax
ja 0x152e7
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x15562
testb %al, %al
jne 0x152c7
jmp 0x15312
movq %r15, %r13
subq %rbx, %r13
cmpq %rax, %r13
cmovaeq %rax, %r13
leaq (%r12,%rbx), %rdi
addq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0x2130
addq %r13, %rbx
addq %r13, 0x18(%r14)
cmpq %r15, %rbx
jb 0x152c7
jmp 0x1531e
cmpb $0x1, 0x30(%r14)
jne 0x1531e
movb $0x0, 0x30(%r14)
addq %rbx, 0x10(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: utf8stream::write(void const*, unsigned long)
size_t write(const void *src, size_t len)
    {
        if(!writing || !src || !len) return 0;
        uchar dst[512];
        size_t next = 0;
        while(next < len)
        {
            size_t carry = 0, n = encodeutf8(dst, sizeof(dst), &((uchar *)src)[next], len - next, &carry);
            if(n > 0 && file->write(dst, n) != n) { stopwriting(); break; }
            next += carry;
        }
        pos += next;
        return next;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, -0x30(%rbp)
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x153de
movq %rsi, %r12
testq %rsi, %rsi
je 0x153de
movq -0x30(%rbp), %rax
cmpb $0x0, 0x31(%rax)
je 0x153de
movq %rdx, %r15
xorl %ebx, %ebx
leaq -0x240(%rbp), %r13
movq $0x0, -0x38(%rbp)
leaq (%r12,%rbx), %rdx
movq %r15, %rcx
subq %rbx, %rcx
movl $0x200, %esi            # imm = 0x200
movq %r13, %rdi
leaq -0x38(%rbp), %r8
callq 0x1386a
testq %rax, %rax
je 0x153b9
movq %rax, %r14
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq %r13, %rsi
movq %r14, %rdx
callq *0x50(%rax)
cmpq %r14, %rax
jne 0x153c4
addq -0x38(%rbp), %rbx
cmpq %r15, %rbx
jb 0x15375
jmp 0x153d6
movq -0x30(%rbp), %rax
cmpb $0x1, 0x31(%rax)
jne 0x153d6
movq -0x30(%rbp), %rax
movb $0x0, 0x31(%rax)
movq -0x30(%rbp), %rax
addq %rbx, 0x10(%rax)
movq %rbx, %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: utf8stream::getline(char*, unsigned long)
bool getline(char *dst, size_t len)
    {
        if(!reading || !dst || !len) return false;
        --len;
        size_t next = 0;
        while(next < len)
        {
            if(bufread >= bufcarry) { if(readbuf(BUFSIZE)) continue; stopreading(); if(!next) return false; break; }
            size_t n = min(len - next, bufcarry - bufread);
            uchar *endline = (uchar *)memchr(&buf[bufread], '\n', n);
            if(endline) { n = endline+1 - &buf[bufread]; len = next + n; } 
            memcpy(&((uchar *)dst)[next], &buf[bufread], n);
            next += n;
            bufread += n;
        }
        dst[next] = '\0';
        pos += next;
        return true;
    }

// Assembly:
xorl %eax, %eax
testq %rdx, %rdx
je 0x15511
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r13
testq %rsi, %rsi
je 0x15503
movq %rdi, %rbx
cmpb $0x0, 0x30(%rdi)
je 0x15503
movq %rdx, %r15
decq %r15
je 0x154f4
leaq 0x33(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r14d, %r14d
movq 0x18(%rbx), %r12
movq 0x20(%rbx), %rax
subq %r12, %rax
ja 0x15470
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x15562
testb %al, %al
jne 0x15450
jmp 0x154e1
movq %r13, -0x40(%rbp)
movq %r15, %r13
subq %r14, %r13
cmpq %rax, %r13
cmovaeq %rax, %r13
addq -0x38(%rbp), %r12
movq %r12, %rdi
movl $0xa, %esi
movq %r13, %rdx
callq 0x21d0
movq %rax, %rcx
subq %r12, %rcx
testq %rax, %rax
leaq 0x1(%rcx,%r14), %rax
cmovneq %rax, %r15
movq %r14, -0x30(%rbp)
leaq 0x1(%rcx), %r14
cmoveq %r13, %r14
movq -0x40(%rbp), %r13
movq -0x30(%rbp), %rax
leaq (%rax,%r13), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2130
addq %r14, -0x30(%rbp)
addq %r14, 0x18(%rbx)
movq -0x30(%rbp), %r14
cmpq %r15, %r14
jb 0x15450
jmp 0x154f7
cmpb $0x1, 0x30(%rbx)
jne 0x154eb
movb $0x0, 0x30(%rbx)
testq %r14, %r14
jne 0x154f7
xorl %eax, %eax
jmp 0x15503
xorl %r14d, %r14d
movb $0x0, (%r13,%r14)
addq %r14, 0x10(%rbx)
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/stream.cpp
// Function: utf8stream::readbuf(unsigned long)
bool readbuf(size_t size = BUFSIZE)
    {
        if(bufread >= bufcarry) { if(bufcarry > 0 && bufcarry < buflen) memmove(buf, &buf[bufcarry], buflen - bufcarry); buflen -= bufcarry; bufread = bufcarry = 0; }
        size_t n = file->read(&buf[buflen], min(size, BUFSIZE - buflen));
        if(n <= 0) return false;
        buflen += n;
        size_t carry = bufcarry;
        bufcarry += decodeutf8(&buf[bufcarry], BUFSIZE-bufcarry, &buf[bufcarry], buflen-bufcarry, &carry);
        if(carry > bufcarry && carry < buflen) { memmove(&buf[bufcarry], &buf[carry], buflen - carry); buflen -= carry - bufcarry; }
        return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %rax
cmpq %rax, 0x18(%rdi)
jae 0x15586
movq 0x28(%rbx), %r15
jmp 0x155c7
leaq 0x18(%rbx), %r12
testq %rax, %rax
setne %cl
movq 0x28(%rbx), %rdx
movq %rdx, %r15
subq %rax, %r15
seta %sil
andb %cl, %sil
cmpb $0x1, %sil
jne 0x155bb
leaq 0x33(%rbx), %rdi
leaq (%rbx,%rax), %rsi
addq $0x33, %rsi
subq %rax, %rdx
callq 0x2340
movq %r15, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movq 0x8(%rbx), %rdi
leaq (%rbx,%r15), %rsi
addq $0x33, %rsi
movl $0x1000, %r12d          # imm = 0x1000
movl $0x1000, %edx           # imm = 0x1000
subq %r15, %rdx
cmpq %rdx, %r14
cmovbq %r14, %rdx
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, %r14
testq %rax, %rax
je 0x1565f
leaq 0x33(%rbx), %r15
movq 0x28(%rbx), %rcx
addq %r14, %rcx
movq %rcx, 0x28(%rbx)
movq 0x20(%rbx), %rax
leaq -0x30(%rbp), %r13
movq %rax, (%r13)
leaq (%r15,%rax), %rdi
subq %rax, %r12
subq %rax, %rcx
movq %r12, %rsi
movq %rdi, %rdx
movq %r13, %r8
callq 0x13604
addq 0x20(%rbx), %rax
movq %rax, 0x20(%rbx)
movq (%r13), %r12
cmpq %rax, %r12
jbe 0x1565f
movq 0x28(%rbx), %rdx
subq %r12, %rdx
jbe 0x1565f
addq %r15, %rax
addq %r12, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x2340
movq 0x20(%rbx), %rax
subq %r12, %rax
addq %rax, 0x28(%rbx)
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/tools.cpp
// Function: seedMT(unsigned int)
void seedMT(uint seed)
{
    state[0] = seed;
    for(uint i = 1; i < N; i++)
        state[i] = seed = 1812433253U * (seed ^ (seed >> 30)) + i;
    next = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, 0xb04f(%rip)      # 0x207b0
movl $0x1, %eax
leaq 0xb043(%rip), %rcx      # 0x207b0
movl %edi, %edx
shrl $0x1e, %edx
xorl %edi, %edx
imull $0x6c078965, %edx, %edi # imm = 0x6C078965
addl %eax, %edi
movl %edi, (%rcx,%rax,4)
incq %rax
cmpq $0x270, %rax            # imm = 0x270
jne 0x1576d
movl $0x0, 0x9ab4(%rip)      # 0x1f248
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/tools.cpp
// Function: randomMT()
uint randomMT()
{
    int cur = next;
    if(++next >= N)
    {
        if(next > N) { seedMT(5489U + time(NULL)); cur = next++; }
        else next = 0;
    }
    uint y = (state[cur] & 0x80000000U) | (state[next] & 0x7FFFFFFFU);
    state[cur] = y = state[cur < N-M ? cur + M : cur + M-N] ^ (y >> 1) ^ (-int(y & 1U) & K);
    y ^= (y >> 11);
    y ^= (y <<  7) & 0x9D2C5680U;
    y ^= (y << 15) & 0xEFC60000U;
    y ^= (y >> 18);
    return y;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x9aa6(%rip), %ebx      # 0x1f248
leal 0x1(%rbx), %eax
movl %eax, 0x9a9d(%rip)      # 0x1f248
cmpl $0x26f, %ebx            # imm = 0x26F
jl 0x15807
jne 0x157be
movl $0x26f, %ebx            # imm = 0x26F
xorl %eax, %eax
jmp 0x15801
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2170
addl $0x1571, %eax           # imm = 0x1571
movl %eax, 0xafde(%rip)      # 0x207b0
movl $0x1, %ecx
leaq 0xafd2(%rip), %rdx      # 0x207b0
movl %eax, %esi
shrl $0x1e, %esi
xorl %eax, %esi
imull $0x6c078965, %esi, %eax # imm = 0x6C078965
addl %ecx, %eax
movl %eax, (%rdx,%rcx,4)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x157de
movl $0x1, %eax
movl %eax, 0x9a41(%rip)      # 0x1f248
movslq %ebx, %rcx
leaq 0xaf9f(%rip), %rdx      # 0x207b0
leal -0xe3(%rcx), %esi
leal 0x18d(%rcx), %edi
cmpl $0xe3, %ecx
cmovgel %esi, %edi
cltq
movl $0x80000000, %esi       # imm = 0x80000000
andl (%rdx,%rcx,4), %esi
movl (%rdx,%rax,4), %eax
movl %eax, %r8d
andl $0x7ffffffe, %r8d       # imm = 0x7FFFFFFE
orl %esi, %r8d
movslq %edi, %rsi
shrl %r8d
xorl (%rdx,%rsi,4), %r8d
andl $0x1, %eax
negl %eax
andl $0x9908b0df, %eax       # imm = 0x9908B0DF
xorl %r8d, %eax
movl %eax, (%rdx,%rcx,4)
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0x7, %eax
andl $0x9d2c5680, %eax       # imm = 0x9D2C5680
xorl %ecx, %eax
movl %eax, %ecx
shll $0xf, %ecx
andl $0xefc60000, %ecx       # imm = 0xEFC60000
xorl %eax, %ecx
movl %ecx, %eax
shrl $0x12, %eax
xorl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/tools.cpp
// Function: getint(databuf<unsigned char>&)
int getint(ucharbuf &p)
{
    int c = (char)p.get();
    if(c==-128) { int n = p.get(); n |= char(p.get())<<8; return n; }
    else if(c==-127) { int n = p.get(); n |= p.get()<<8; n |= p.get()<<16; return n|(p.get()<<24); }
    else return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %edx
movl 0xc(%rdi), %ecx
cmpl %ecx, %edx
jge 0x15a8c
movslq %edx, %rax
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rax
jmp 0x15a97
orb $0x1, 0x10(%rdi)
leaq 0xb6d9(%rip), %rax      # 0x21170
movzbl (%rax), %eax
cmpl $0x81, %eax
je 0x15ab9
cmpl $0x80, %eax
jne 0x15aca
cmpl %ecx, %edx
jge 0x15ad2
movslq %edx, %rax
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rax
jmp 0x15add
cmpl %ecx, %edx
jge 0x15b07
movslq %edx, %rax
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rax
jmp 0x15b12
movsbl %al, %eax
jmp 0x15b82
orb $0x1, 0x10(%rdi)
leaq 0xb693(%rip), %rax      # 0x21170
movzbl (%rax), %esi
cmpl %ecx, %edx
jge 0x15af2
leal 0x1(%rdx), %eax
movl %eax, 0x8(%rdi)
movslq %edx, %rax
addq (%rdi), %rax
jmp 0x15afd
orb $0x1, 0x10(%rdi)
leaq 0xb673(%rip), %rax      # 0x21170
movsbl (%rax), %eax
shll $0x8, %eax
orl %esi, %eax
jmp 0x15b82
orb $0x1, 0x10(%rdi)
leaq 0xb65e(%rip), %rax      # 0x21170
movzbl (%rax), %esi
cmpl %ecx, %edx
jge 0x15b26
movslq %edx, %rax
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rax
jmp 0x15b31
orb $0x1, 0x10(%rdi)
leaq 0xb63f(%rip), %rax      # 0x21170
movzbl (%rax), %eax
shll $0x8, %eax
orl %esi, %eax
cmpl %ecx, %edx
jge 0x15b4a
movslq %edx, %rsi
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rsi
jmp 0x15b55
orb $0x1, 0x10(%rdi)
leaq 0xb61b(%rip), %rsi      # 0x21170
movzbl (%rsi), %esi
shll $0x10, %esi
orl %esi, %eax
cmpl %ecx, %edx
jge 0x15b6f
leal 0x1(%rdx), %ecx
movl %ecx, 0x8(%rdi)
movslq %edx, %rcx
addq (%rdi), %rcx
jmp 0x15b7a
orb $0x1, 0x10(%rdi)
leaq 0xb5f6(%rip), %rcx      # 0x21170
movzbl (%rcx), %ecx
shll $0x18, %ecx
orl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/tools.cpp
// Function: getuint(databuf<unsigned char>&)
int getuint(ucharbuf &p)
{
    int n = p.get();
    if(n & 0x80)
    {
        n += (p.get() << 7) - 0x80;
        if(n & (1<<14)) n += (p.get() << 14) - (1<<14);
        if(n & (1<<21)) n += (p.get() << 21) - (1<<21);
        if(n & (1<<28)) n |= -1<<28;
    }
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %edx
movl 0xc(%rdi), %ecx
cmpl %ecx, %edx
jge 0x15dca
movslq %edx, %rax
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rax
jmp 0x15dd5
orb $0x1, 0x10(%rdi)
leaq 0xb39b(%rip), %rax      # 0x21170
movzbl (%rax), %eax
testb %al, %al
jns 0x15e79
cmpl %ecx, %edx
jge 0x15df1
movslq %edx, %rsi
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rsi
jmp 0x15dfc
orb $0x1, 0x10(%rdi)
leaq 0xb374(%rip), %rsi      # 0x21170
movzbl (%rsi), %r8d
movl %r8d, %esi
shll $0x7, %esi
addl %eax, %esi
addl $-0x80, %esi
testb %r8b, %r8b
jns 0x15e3a
cmpl %ecx, %edx
jge 0x15e21
movslq %edx, %rax
incl %edx
movl %edx, 0x8(%rdi)
addq (%rdi), %rax
jmp 0x15e2c
orb $0x1, 0x10(%rdi)
leaq 0xb344(%rip), %rax      # 0x21170
movzbl (%rax), %eax
shll $0xe, %eax
addl %eax, %esi
addl $0xffffc000, %esi       # imm = 0xFFFFC000
btl $0x15, %esi
jae 0x15e6b
cmpl %ecx, %edx
jge 0x15e52
leal 0x1(%rdx), %eax
movl %eax, 0x8(%rdi)
movslq %edx, %rax
addq (%rdi), %rax
jmp 0x15e5d
orb $0x1, 0x10(%rdi)
leaq 0xb313(%rip), %rax      # 0x21170
movzbl (%rax), %eax
shll $0x15, %eax
addl %eax, %esi
addl $0xffe00000, %esi       # imm = 0xFFE00000
movl %esi, %eax
orl $0xf0000000, %eax       # imm = 0xF0000000
btl $0x1c, %esi
cmovael %esi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/tools.cpp
// Function: getstring(char*, databuf<unsigned char>&, unsigned long)
void getstring(char *text, ucharbuf &p, size_t len)
{
    char *t = text;
    do
    {
        if(t>=&text[len]) { text[len-1] = 0; return; }
        if(!p.remaining()) { *t = 0; return; }
        *t = getint(p);
    }
    while(*t++);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq %rdi, %r14
cmpq %r14, %rbx
jae 0x16025
movl 0xc(%r15), %eax
cmpl 0x8(%r15), %eax
je 0x1602b
movq %r15, %rdi
callq 0x15a71
movb %al, (%rbx)
incq %rbx
testb %al, %al
jne 0x16003
jmp 0x1602e
decq %r14
movq %r14, %rbx
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Fohlen[P]cubescript-standalone/tools.cpp
// Function: filtertext(char*, char const*, bool, unsigned long)
void filtertext(char *dst, const char *src, bool whitespace, size_t len)
{
    for(int c = uchar(*src); c; c = uchar(*++src))
    {
        if(c == '\f')
        {
            if(!*++src) break;
            continue;
        }
        if(iscubeprint(c) || (iscubespace(c) && whitespace))
        {
            *dst++ = c;
            if(!--len) break;
        }
    }
    *dst = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x222c(%rip), %rax      # 0x18270
xorb $0x1, %dl
movzbl (%rsi), %r8d
cmpl $0xc, %r8d
je 0x1607a
testl %r8d, %r8d
je 0x16088
movb (%rax,%r8), %r9b
testb $0x1, %r9b
jne 0x1606d
testb $0x2, %r9b
sete %r9b
orb %dl, %r9b
jne 0x16083
movb %r8b, (%rdi)
incq %rdi
decq %rcx
jne 0x16083
jmp 0x16088
cmpb $0x0, 0x1(%rsi)
je 0x16088
incq %rsi
incq %rsi
jmp 0x16047
movb $0x0, (%rdi)
popq %rbp
retq
nop