LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reader_init
void reader_init(reader *p)
{
	memset(p,0,sizeof(reader));
    p->filename = (char*)malloc(MAX_PATH);
    p->line = (char*)malloc(MAX_LINE);
    p->token = (char*)malloc(MAX_LINE);
    memset(p->filename,0,MAX_PATH);
    memset(p->line,0,MAX_LINE);
    memset(p->token,0,MAX_LINE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
andq $0x0, 0x20(%rdi)
pushq $0x1
popq %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
callq 0x21e0
movq %rax, 0x38(%rbx)
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
callq 0x21e0
movq %rax, 0x28(%rbx)
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
callq 0x21e0
movq %rax, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reader_save
void reader_save(reader *p,reader* save)
{
	p->r.filepos = ftell(p->r.f);
	memcpy(save,p,sizeof(reader_static));
    save->filename = strdup(p->filename);
    save->line = strdup(p->line);
    save->token = strdup(p->token);
    save->pos = save->line + (p->pos - p->line);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x2210
movl %eax, 0x18(%r14)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movups 0x10(%r14), %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x38(%r14), %rdi
callq 0x2340
movq %rax, 0x38(%rbx)
movq 0x28(%r14), %rdi
callq 0x2340
movq %rax, %r15
movq %rax, 0x28(%rbx)
movq 0x30(%r14), %rdi
callq 0x2340
movq %rax, 0x30(%rbx)
movq 0x20(%r14), %rax
subq 0x28(%r14), %rax
addq %r15, %rax
movq %rax, 0x20(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reader_line
int reader_line(reader* p)
{
	size_t i;
    p->line[0] = 0;
	fgets(p->line,MAX_LINE,p->r.f);
	if (feof(p->r.f) && p->line[0]==0)
		return 0;
	i=strlen(p->line);
	while (i && isspace(p->line[--i]))
		p->line[i]=0;
	p->pos = p->line;
	++p->r.no;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movb $0x0, (%rax)
movq (%rdi), %rdx
movq 0x28(%rdi), %rdi
movl $0x2000, %esi           # imm = 0x2000
callq 0x21d0
movq (%rbx), %rdi
callq 0x2220
movq 0x28(%rbx), %r14
testl %eax, %eax
je 0x32f9
cmpb $0x0, (%r14)
je 0x333d
movq %r14, %rdi
callq 0x2120
movq %rax, %r15
movq %rax, %r12
subq $0x1, %r12
jb 0x3331
callq 0x2360
movq (%rax), %rax
movsbq -0x1(%r14,%r15), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x3331
movb $0x0, -0x1(%r14,%r15)
movq 0x28(%rbx), %r14
movq %r12, %r15
jmp 0x3307
movq %r14, 0x20(%rbx)
incl 0xc(%rbx)
pushq $0x1
popq %rax
jmp 0x333f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: strins
char* strins(char* s,const char* begin,const char* end)
{
	size_t n = end?end-begin:strlen(begin);
	memmove(s+n,s,strlen(s)+1);
	memcpy(s,begin,n);
	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x3366
movq %rdx, %r15
subq %rbx, %r15
jmp 0x3371
movq %rbx, %rdi
callq 0x2120
movq %rax, %r15
leaq (%r14,%r15), %r12
movq %r14, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x22c0
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reader_comment
void reader_comment(reader* p)
{
	char* s = p->line;
	while (*s)
	{
		if (p->r.comment)
		{
			char* s0 = s;
			for (;*s;++s)
				if (s[0]=='*' && s[1]=='/')
				{
					s = strdel(s0,s);
					p->r.comment = 0;
					break;
				}

			if (p->r.comment)
			{
				s = s0;
				*s = 0;
			}
		}
		else
		{
			for (;*s;++s)
			{
				if (s[0]=='/' && s[1]=='*')
				{
					s = strdel(s,s+2);
					p->r.comment = 1;
					break;
				}
				if (s[0]=='/' && s[1]=='/')
				{
					*s = 0;
					break;
				}
			}
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movb (%r14), %al
testb %al, %al
je 0x3450
cmpl $0x0, 0x8(%rbx)
je 0x3407
movq %r14, %rsi
cmpb $0x2a, %al
je 0x33f8
movzbl %al, %eax
testl %eax, %eax
je 0x343c
movb 0x1(%rsi), %al
jmp 0x33ff
movb 0x1(%rsi), %al
cmpb $0x2f, %al
je 0x3442
incq %rsi
jmp 0x33e8
incq %r14
cmpb $0x2f, %al
je 0x3418
movzbl %al, %eax
testl %eax, %eax
je 0x33d8
movb 0x1(%r14), %al
jmp 0x3404
movzbl 0x1(%r14), %eax
cmpl $0x2f, %eax
je 0x343c
cmpl $0x2a, %eax
jne 0x3404
leaq 0x2(%r14), %rsi
movq %r14, %rdi
callq 0x33a5
movl $0x1, 0x8(%rbx)
jmp 0x33d8
movb $0x0, (%r14)
jmp 0x33d8
movq %r14, %rdi
callq 0x33a5
andl $0x0, 0x8(%rbx)
jmp 0x33d8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reader_istoken
int reader_istoken(reader* p,const char* token)
{
	if (!(p->r.flags & FLAG_READY) && !reader_read(p))
		return 0;

	if (stricmp(p->token,token)!=0)
		return 0;

	p->r.flags &= ~FLAG_READY;
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testb $0x2, 0x11(%rdi)
jne 0x36ce
movq %rbx, %rdi
callq 0x34b6
testl %eax, %eax
je 0x36de
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x2070
testl %eax, %eax
je 0x36e2
xorl %eax, %eax
jmp 0x36e9
andb $-0x3, 0x11(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reader_tokenline
int reader_tokenline(reader* p,int onespace)
{
	char* s = p->pos;

	assert(!(p->r.flags & FLAG_READY));

    if (onespace >= 0)
    {
	    while (*s && isspace(*s))
	    {
		    ++s;
		    if (onespace) break;
	    }
    }

	strcpy(p->token,s);
	p->pos = s + strlen(s);

	return p->token[0]!=0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testb $0x2, 0x11(%rdi)
jne 0x37be
movl %esi, %ebp
movq %rdi, %rbx
movq 0x20(%rdi), %r14
testl %esi, %esi
js 0x378c
movsbq (%r14), %r15
testq %r15, %r15
je 0x378c
callq 0x2360
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0x378c
incq %r14
testl %ebp, %ebp
je 0x376c
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x20b0
movq %r14, %rdi
callq 0x2120
addq %r14, %rax
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc98d(%rip), %rdi      # 0x10152
leaq 0xc8da(%rip), %rsi      # 0x100a6
leaq 0xc99a(%rip), %rcx      # 0x1016d
movl $0x3d8, %edx            # imm = 0x3D8
callq 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: truncfilefourcc
void truncfilefourcc(char* path)
{
	char* i = getfilename(path);
	memmove(path,i,strlen(i)+1);
    path[4] = 0;
    while (strlen(path)<4)
        strcat(path,"_");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3853
movq %rax, %r14
movq %rax, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22c0
movb $0x0, 0x4(%rbx)
movq %rbx, %rdi
callq 0x2120
cmpq $0x3, %rax
ja 0x3938
movq %rbx, %rdi
callq 0x2120
movw $0x5f, (%rbx,%rax)
jmp 0x391a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: truncfileext
void truncfileext(char* path)
{
	char* i = getfilename(path);
	char* ext = strrchr(i,'.');
	if (ext)
		memmove(path,ext+1,strlen(ext+1)+1);
	else
		path[0]=0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3853
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x2150
testq %rax, %rax
je 0x3980
movq %rax, %r14
incq %r14
movq %r14, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22c0
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: truncfourcc
void truncfourcc(char* s)
{
	size_t len = strlen(s);
	if (len>2 && s[0]=='\'' && s[len-1]=='\'')
	{
		strdel(s+len-1,s+len);
		strdel(s,s+1);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2120
cmpq $0x3, %rax
jb 0x39c3
cmpb $0x27, (%rbx)
jne 0x39c3
cmpb $0x27, -0x1(%rbx,%rax)
jne 0x39c3
leaq (%rbx,%rax), %rsi
leaq (%rbx,%rax), %rdi
decq %rdi
callq 0x33a5
leaq 0x1(%rbx), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x33a5
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: truncfilepath
void truncfilepath(char* path,int delend)
{
	char* i = getfilename(path);
	if (i) *i=0;
	if (delend)
	{
		delendpath(path);
		if (!path[0])
			strcpy(path,".");
	}
	else
		addendpath(path);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3853
testq %rax, %rax
je 0x3a46
movb $0x0, (%rax)
testl %ebp, %ebp
je 0x3a63
movq %rbx, %rdi
callq 0x3a15
cmpb $0x0, (%rbx)
jne 0x3a5c
movw $0x2e, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x39f0
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: truncfileupper
void truncfileupper(char* path)
{
    delendpath(path);
    truncfilepath(path,0);
    if (!path[0])
        strcpy(path,"./");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x3a15
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3a31
cmpb $0x0, (%rbx)
jne 0x3a92
movb $0x0, 0x2(%rbx)
movw $0x2f2e, (%rbx)         # imm = 0x2F2E
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: reversestr
void reversestr(char *value)
{
    char tmpstr[MAX_LINE];
    size_t i,len=strlen(value);
    for (i=0;i<len;++i)
        tmpstr[i]=value[len-i-1];
    memcpy(value,tmpstr,len);
    value[len]=0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rdi, %rbx
callq 0x2120
movq %rax, %r14
movq %rsp, %rax
movq %r14, %rdx
movq %r14, %rcx
subq $0x1, %rcx
jb 0x3af4
movb -0x1(%rbx,%rdx), %dl
movb %dl, (%rax)
incq %rax
movq %rcx, %rdx
jmp 0x3ae0
movq %rsp, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2240
movb $0x0, (%rbx,%r14)
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: escapestr
void escapestr(char *value)
{
    char *s;
    s = strchr(value,'\\');
    while (s)
    {
        memmove(s+1,s,strlen(s)+1);
        value[s-value] = '\\';
        s = strchr(s+2,'\\');
    }
    s = strchr(value,'"');
    while (s)
    {
        memmove(s+1,s,strlen(s)+1);
        value[s-value] = '\\';
        s = strchr(s+2,'"');
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x5c
popq %rbp
movl %ebp, %esi
callq 0x2130
movq %rax, %r14
testq %rax, %rax
je 0x3b56
leaq 0x1(%r14), %r15
movq %r14, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22c0
movb $0x5c, (%r14)
addq $0x2, %r14
movq %r14, %rdi
jmp 0x3b1f
pushq $0x22
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2130
testq %rax, %rax
je 0x3b8f
movq %rax, %rbx
leaq 0x1(%rax), %r14
movq %rax, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22c0
movb $0x5c, (%rbx)
addq $0x2, %rbx
jmp 0x3b59
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: escapepath
void escapepath(char *value, int mode)
{
    char *s;
    s = strchr(value,'/');
    while (s)
    {
        if (mode==2)
            *s = '_';
        else if (mode==3)
            *s = '.';
        s = strchr(s+1,'/');
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %rax
pushq $0x2f
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x2130
testq %rax, %rax
je 0x3bcb
cmpl $0x2, %ebx
je 0x3bc2
cmpl $0x3, %ebx
jne 0x3bc6
movb $0x2e, %cl
jmp 0x3bc4
movb $0x5f, %cl
movb %cl, (%rax)
incq %rax
jmp 0x3ba5
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: simplifypath
void simplifypath(char* path, int head)
{
    char* s;
    for (s=path;*s;++s)
    {
        if (strncmp(s,"/../",4)==0 && s!=path)
        {
            char* end = s+4;
            do
            {
				if (s[-1] == '/' || s[-1] == '\\')
					break;
			} while (--s!=path);
            s = strdel(s,end);
            if (s != path)
                --s;
            --s;
        }
        if (strncmp(s,"/./",3)==0 && s!=path)
            memmove(s+1,s+3,strlen(s+3)+1);
        if (strncmp(s,"/.",3)==0 && s!=path)
            s[1]=0;
    }
    if (head)
    {
        while (path[0] == '.' && path[1] == '/')
            memmove(path,path+2,strlen(path+2));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, 0x4(%rsp)
movq %rdi, %rbx
leaq 0xd351(%rip), %r13      # 0x111a3
pushq $0x4
popq %r15
movq %rdi, %r12
movb (%r12), %bpl
testb %bpl, %bpl
je 0x3f2e
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x20a0
cmpq %rbx, %r12
je 0x3eb7
testl %eax, %eax
jne 0x3eb7
leaq 0x4(%r12), %rsi
movzbl -0x1(%r12), %eax
cmpl $0x2f, %eax
je 0x3e9d
cmpl $0x5c, %eax
je 0x3e9d
decq %r12
cmpq %rbx, %r12
jne 0x3e82
movq %rbx, %r12
movq %r12, %rdi
callq 0x33a5
xorl %eax, %eax
cmpq %rbx, %r12
setne %al
notq %rax
movb (%rax,%r12), %bpl
addq %rax, %r12
cmpb $0x2f, %bpl
jne 0x3f26
cmpb $0x2e, 0x1(%r12)
jne 0x3f03
cmpq %rbx, %r12
sete %r14b
je 0x3f0a
cmpb $0x2f, 0x2(%r12)
jne 0x3f0a
movq %r13, %r15
leaq 0x1(%r12), %r13
leaq 0x3(%r12), %rbp
movq %rbp, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %r13
pushq $0x4
popq %r15
movq %rbp, %rsi
callq 0x22c0
jmp 0x3f0a
cmpq %rbx, %r12
sete %r14b
cmpb $0x2e, 0x1(%r12)
jne 0x3f26
cmpb $0x0, 0x2(%r12)
setne %al
orb %al, %r14b
jne 0x3f26
movb $0x0, 0x1(%r12)
incq %r12
jmp 0x3e59
cmpl $0x0, 0x4(%rsp)
je 0x3f5c
leaq 0x2(%rbx), %r14
cmpb $0x2e, (%rbx)
jne 0x3f5c
cmpb $0x2f, 0x1(%rbx)
jne 0x3f5c
movq %r14, %rdi
callq 0x2120
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22c0
jmp 0x3f39
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: strip_path_abs
void strip_path_abs(char *path, int flags)
{
    assert((flags & FLAG_PATH_MASK) != FLAG_PATH_NOT_PATH);
    switch (flags & FLAG_PATH_MASK)
    {
    case FLAG_PATH_GENERATED:
        if (proj_root_len && strstr(path,proj_root)==path)
            memmove(path,path+proj_root_len,strlen(path+proj_root_len)+1);
        break;
    case FLAG_PATH_COREMAKE:
        if (coremake_root_len && strstr(path,coremake_root)==path)
           memmove(path,path+coremake_root_len,strlen(path+coremake_root_len)+1);
        break;
    case FLAG_PATH_SOURCE:
        if (src_root_len && strstr(path,src_root)==path)
            memmove(path,path+src_root_len,strlen(path+src_root_len)+1);
        break;
    case FLAG_PATH_SYSTEM: // do nothing
        break;
    default: assert(0);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
andl $0xf, %esi
cmpl $0x4, %esi
ja 0x402a
movq %rdi, %rbx
leaq 0xc096(%rip), %rax      # 0x1001c
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x1326a(%rip), %r14     # 0x17200
testq %r14, %r14
je 0x3fe6
leaq 0x1265e(%rip), %r15     # 0x16600
jmp 0x3fcc
movq 0x13265(%rip), %r14     # 0x17210
testq %r14, %r14
je 0x3fe6
leaq 0x12e49(%rip), %r15     # 0x16e00
jmp 0x3fcc
movq 0x13248(%rip), %r14     # 0x17208
testq %r14, %r14
je 0x3fe6
leaq 0x12a34(%rip), %r15     # 0x16a00
movq %r15, %rdi
callq 0x2120
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x20a0
testl %eax, %eax
je 0x3fec
popq %rbx
popq %r14
popq %r15
retq
addq %rbx, %r14
movq %r14, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x22c0
leaq 0xc1cb(%rip), %rdi      # 0x101dd
leaq 0xc08d(%rip), %rsi      # 0x100a6
leaq 0xc1ec(%rip), %rcx      # 0x1020c
movl $0x4e0, %edx            # imm = 0x4E0
callq 0x2160
leaq 0xd048(%rip), %rdi      # 0x11079
leaq 0xc06e(%rip), %rsi      # 0x100a6
leaq 0xc1cd(%rip), %rcx      # 0x1020c
movl $0x4f1, %edx            # imm = 0x4F1
callq 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: load_cond2
itemcond* load_cond2(reader* file,item* config)
{
	itemcond* p;
	if (reader_istoken(file,"("))
	{
		p = load_cond0(file,config);
		if (!reader_istoken(file,")"))
			syntax(file);
	}
	else
	{
		if (reader_istoken(file,")"))
			syntax(file);
		reader_name(file);
		p = itemcond_new(COND_GET,item_get(config,file->token,0));
	}
	return p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc377(%rip), %rsi      # 0x1054b
callq 0x36b2
testl %eax, %eax
je 0x4209
movq %rbx, %rdi
movq %r14, %rsi
callq 0x424b
movq %rax, %r14
leaq 0xd051(%rip), %rsi      # 0x11243
movq %rbx, %rdi
callq 0x36b2
testl %eax, %eax
je 0x4243
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xd033(%rip), %rsi      # 0x11243
movq %rbx, %rdi
callq 0x36b2
testl %eax, %eax
jne 0x4243
movq %rbx, %rdi
callq 0x380b
movq 0x30(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x26a2
xorl %edi, %edi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2c45
movq %rbx, %rdi
callq 0x24c2
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: load_cond1
itemcond* load_cond1(reader* file,item* config)
{
	if (reader_istoken(file,"!"))
	{
		itemcond* p = itemcond_new(COND_NOT,NULL);
		p->a = load_cond1(file,config);
		return p;
	}
	else
		return load_cond2(file,config);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd1a6(%rip), %rsi      # 0x11476
callq 0x36b2
testl %eax, %eax
je 0x42fe
pushq $0x3
popq %rdi
xorl %esi, %esi
callq 0x2c45
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42be
movq %rax, 0x10(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x41c3
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: load_cond
itemcond* load_cond(item* item, reader* file, int force)
{
	itemcond* p = NULL;
	if (reader_istoken(file,"("))
	{
		p = load_cond0(file,getconfig(item));
		if (!reader_istoken(file,")"))
			syntax(file);
	}
	else
	if (force)
		p = load_cond0(file,getconfig(item));

	return p;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc22a(%rip), %rsi      # 0x1054b
movq %rbx, %rdi
callq 0x36b2
testl %eax, %eax
je 0x435e
movq %r14, %rdi
callq 0x2702
movq %rbx, %rdi
movq %rax, %rsi
callq 0x424b
movq %rax, %r14
leaq 0xcef9(%rip), %rsi      # 0x11243
movq %rbx, %rdi
callq 0x36b2
testl %eax, %eax
je 0x437e
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
testl %ebp, %ebp
je 0x4379
movq %r14, %rdi
callq 0x2702
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x424b
xorl %r14d, %r14d
jmp 0x4356
movq %rbx, %rdi
callq 0x24c2
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: load_file
int load_file(item* p,const char* filename, int file_kind, itemcond* cond)
{
	reader r;
    reader_init(&r);
	strcpy(r.filename,filename);
	pathunix(r.filename);
	r.r.f = fopen(filename,"r");
	r.pos = r.line;
	if (r.r.f)
	{
        r.r.filename_kind = file_kind;
		load_item(p,&r,0,cond);
		fclose(r.r.f);
        reader_free(&r);
		return 1;
	}
    reader_free(&r);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3181
movq 0x38(%r12), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x20b0
movq %r13, %rdi
callq 0x3a94
leaq 0xb0bb(%rip), %rsi      # 0x10371
movq %r15, %rdi
callq 0x22d0
movq %rax, (%r12)
movq 0x28(%r12), %rcx
movq %rcx, 0x20(%r12)
testq %rax, %rax
je 0x52f7
leaq 0x8(%rsp), %r15
movl %ebp, 0x14(%r15)
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4386
movq (%r15), %rdi
callq 0x20f0
pushq $0x1
popq %rbx
jmp 0x52f9
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x31d6
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: dumpitem
void dumpitem(item* p,int deep)
{
	item** child;
	printf("%*c%s",deep*2,' ',p->value);
	if (p->cond)
	{
		printf(" (");
		dumpcond(stdout,p->cond,1,COND_GET,NULL,0);
		printf(")");
	}
	printf("\r\n");
	for (child=p->child;child!=p->childend;++child)
		dumpitem(*child,deep+1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leal (%rbx,%rbx), %esi
movq (%rdi), %rcx
leaq 0xb060(%rip), %rdi      # 0x10544
pushq $0x20
popq %rdx
xorl %eax, %eax
callq 0x2140
cmpq $0x0, 0x8(%r14)
je 0x5529
leaq 0xb04e(%rip), %rdi      # 0x1054a
xorl %eax, %eax
callq 0x2140
movq 0x10ad6(%rip), %rax     # 0x15fe0
movq (%rax), %rdi
movq 0x8(%r14), %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x5314
pushq $0x29
popq %rdi
callq 0x2060
leaq 0xbfe4(%rip), %rdi      # 0x11514
callq 0x20d0
movq 0x18(%r14), %r15
incl %ebx
cmpq 0x20(%r14), %r15
je 0x5551
movq (%r15), %rdi
movl %ebx, %esi
callq 0x54cd
addq $0x8, %r15
jmp 0x553b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: usage
void usage()
{
	printf("usage: coremake [<options>] <platform>\r\n\r\n");
	printf(" -h : help\r\n");
	printf(" -v : verbose\r\n");
	printf(" -r : root folder (default is current dir)\r\n");
	printf(" -f <file> : specify project file (default is root.proj)\r\n");
	printf(" -d : dump project\r\n");
	printf(" -p : dump project at the end\r\n");
    // TODO: add support for using another config file than config.h
}

// Assembly:
pushq %rax
leaq 0xbf8d(%rip), %rdi      # 0x114ec
callq 0x20d0
leaq 0xbfab(%rip), %rdi      # 0x11516
callq 0x20d0
leaq 0xbfab(%rip), %rdi      # 0x11522
callq 0x20d0
leaq 0xbfae(%rip), %rdi      # 0x11531
callq 0x20d0
leaq 0xbfce(%rip), %rdi      # 0x1155d
callq 0x20d0
leaq 0xbffc(%rip), %rdi      # 0x11597
callq 0x20d0
leaq 0xc004(%rip), %rdi      # 0x115ab
popq %rax
jmp 0x20d0
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_setremoved
void preprocess_setremoved(item* p)
{
	item** child;
	p->flags |= FLAG_REMOVED;
	p->flags &= ~FLAG_DEFINED;
	for (child=p->child;child!=p->childend;++child)
		preprocess_setremoved(*child);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x30(%rdi), %eax
andl $-0x61, %eax
orl $0x40, %eax
movl %eax, 0x30(%rdi)
movq 0x18(%rdi), %r14
cmpq 0x20(%rbx), %r14
je 0x55d8
movq (%r14), %rdi
callq 0x55ad
addq $0x8, %r14
jmp 0x55c4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_condstart
void preprocess_condstart(item* p)
{
	item** child;
	p->flags &= ~FLAG_PROCESSED;
	p->flags &= ~FLAG_REMOVED;
	for (child=p->child;child!=p->childend;++child)
		preprocess_condstart(*child);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andb $0x3f, 0x30(%rdi)
movq 0x18(%rdi), %r14
cmpq 0x20(%rbx), %r14
je 0x5603
movq (%r14), %rdi
callq 0x55e0
addq $0x8, %r14
jmp 0x55ef
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_config
void preprocess_config(item* p)
{
	item** child;
	for (child=p->child;child!=p->childend;++child)
		if (!((*child)->flags & FLAG_DEFINED))
			(*child)->flags |= FLAG_REMOVED;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
cmpq %rcx, %rax
je 0x5630
movq (%rax), %rdx
movl 0x30(%rdx), %esi
testb $0x20, %sil
jne 0x562a
orl $0x40, %esi
movl %esi, 0x30(%rdx)
addq $0x8, %rax
jmp 0x5613
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_condend
void preprocess_condend(item* p)
{
	item** child;

	if (p->cond)
	{
		itemcond_delete(p->cond);
		p->cond = NULL;
	}

	for (child=p->child;child!=p->childend;++child)
	{
		if ((*child)->flags & FLAG_REMOVED)
		{
			item_delete(*child);
			--child;
		}
		else
			preprocess_condend(*child);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x564b
callq 0x2bbf
andq $0x0, 0x8(%rbx)
movq 0x18(%rbx), %r14
cmpq 0x20(%rbx), %r14
je 0x5674
movq (%r14), %rdi
testb $0x40, 0x30(%rdi)
jne 0x5665
callq 0x5631
jmp 0x566e
callq 0x2be9
addq $-0x8, %r14
addq $0x8, %r14
jmp 0x564f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_dependency
void preprocess_dependency(item* p)
{
	item** child;
	if (!p) return;
	for (child=p->child;child!=p->childend;++child)
		preprocess_dependency_project(*child);
}

// Assembly:
testq %rdi, %rdi
je 0x58c6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
cmpq 0x20(%rbx), %r14
je 0x58bf
movq (%r14), %rdi
callq 0x56c8
addq $0x8, %r14
jmp 0x58ab
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: file_finalize
void file_finalize(char* name)
{
	char tmp[MAX_PATH];
	char* i = strrchr(name,'.');
	if (i && stricmp(i,".tmp")==0)
	{
		FILE* a;
		FILE* b;
		int same=0;

		strcpy(tmp,name);
		*i = 0;

		a = fopen(tmp,"rb");
		b = fopen(name,"rb");
		if (a && b)
		{
			char bufa[1024];
			char bufb[1024];
			for (;;)
			{
				size_t na = fread(bufa,1,sizeof(bufa),a);
				size_t nb = fread(bufb,1,sizeof(bufb),b);
				if (na != nb || memcmp(bufa,bufb,na)!=0)
					break;
				if (feof(a) || feof(b))
				{
					same=1;
					break;
				}
			}
		}
		if (a) fclose(a);
		if (b) fclose(b);
		if (!same)
		{
			if (verbose)
				printf("updating %s\r\n",name);
			remove(name);
			rename(tmp,name);
		}
		else
			remove(tmp);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc18, %rsp            # imm = 0xC18
movq %rdi, %rbx
pushq $0x2e
popq %rsi
callq 0x2150
testq %rax, %rax
je 0x5a35
movq %rax, %r14
leaq 0xac8f(%rip), %rsi      # 0x10585
movq %rax, %rdi
callq 0x2070
testl %eax, %eax
jne 0x5a35
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20b0
movb $0x0, (%r14)
leaq 0xac69(%rip), %r14      # 0x1058a
movq %r15, %rdi
movq %r14, %rsi
callq 0x22d0
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22d0
movq %rax, %r14
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
movb $0x1, %r13b
orb %al, %cl
jne 0x59db
movq %rbx, 0x8(%rsp)
leaq 0x810(%rsp), %rbx
leaq 0x410(%rsp), %r13
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rbp
movq %rbx, %rdi
pushq $0x1
popq %rbx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x20e0
movq %rax, %r12
movl $0x400, %edx            # imm = 0x400
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x20e0
movq %r13, %rsi
movb $0x1, %r13b
cmpq %rax, %r12
jne 0x59d6
movq %rbp, %rbx
movq %rbp, %rdi
movq %rsi, %rbp
movq %r12, %rdx
callq 0x2280
testl %eax, %eax
jne 0x59d6
movq %r15, %rdi
callq 0x2220
testl %eax, %eax
jne 0x59d3
movq %r14, %rdi
callq 0x2220
testl %eax, %eax
movq %rbp, %r13
je 0x5969
xorl %r13d, %r13d
movq 0x8(%rsp), %rbx
testq %r15, %r15
je 0x59e8
movq %r15, %rdi
callq 0x20f0
testq %r14, %r14
je 0x59f5
movq %r14, %rdi
callq 0x20f0
testb %r13b, %r13b
je 0x5a2b
cmpl $0x0, 0x10bef(%rip)     # 0x165f0
je 0x5a14
leaq 0xab83(%rip), %rdi      # 0x1058d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2140
movq %rbx, %rdi
callq 0x2090
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x22e0
jmp 0x5a35
leaq 0x10(%rsp), %rdi
callq 0x2090
addq $0xc18, %rsp            # imm = 0xC18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: itemcond_print
itemcond* itemcond_print(FILE* f,itemcond* p,itemcond* cond)
{
	if (!itemcond_same(p,cond))
	{
		if (p)
		{
			itemcond_delete(p);
			fprintf(f,"#endif\n");
		}

		p = itemcond_dup(cond);
		if (p)
		{
            int pos = ftell(f);
			fprintf(f,"#if ");
			dumpcond(f,p,1,COND_GET,&pos,0);
			fprintf(f,"\n");
		}
	}
	return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x2c69
testl %eax, %eax
je 0x5a6d
movq %r15, %rbx
jmp 0x5ae0
testq %r15, %r15
je 0x5a8f
movq %r15, %rdi
callq 0x2bbf
leaq 0xab1a(%rip), %rdi      # 0x1059b
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2330
testq %rbx, %rbx
je 0x5ade
incl (%rbx)
movq %r14, %rdi
callq 0x2210
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
leaq 0xaaf6(%rip), %rdi      # 0x105a3
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2330
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r15, %r8
xorl %r9d, %r9d
callq 0x5314
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x21a0
jmp 0x5ae0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: getpri
int getpri(item* p)
{
    int i;
    item* v = item_find(p,"priority");
    if (v && item_childcount(v) && sscanf(v->child[0]->value,"%d",&i)==1)
        return i;
    return MAX_PRI;
}

// Assembly:
pushq %rax
leaq 0xa9b3(%rip), %rsi      # 0x1051e
callq 0x262e
movq %rax, %rcx
movl $0x100000, %eax         # imm = 0x100000
testq %rcx, %rcx
je 0x5bb0
movq 0x18(%rcx), %rdx
cmpq %rdx, 0x20(%rcx)
je 0x5bb0
movq (%rdx), %rax
movq (%rax), %rdi
leaq 0xabd1(%rip), %rsi      # 0x10765
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x2270
movl %eax, %ecx
movl $0x100000, %eax         # imm = 0x100000
cmpl $0x1, %ecx
jne 0x5bb0
movl 0x4(%rsp), %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: getabspath
void getabspath(char* path, int path_flags, const char *rel_path, int rel_flags)
{
    //assert((path_flags & FLAG_PATH_MASK) != FLAG_PATH_NOT_PATH);
    if (!(path_flags & FLAG_PATH_SET_ABSOLUTE))
    {
        char base[3*MAX_PATH];
        if (rel_path[0])
        {
            base[0] = '\0';
            strins(base,rel_path,getfilename(rel_path));
        }
        else
            switch (rel_flags & FLAG_PATH_MASK)
            {
            case FLAG_PATH_SOURCE:    strcpy(base,src_root); break;
            case FLAG_PATH_GENERATED: strcpy(base,proj_root); break;
            case FLAG_PATH_COREMAKE:  strcpy(base,coremake_root); break;
            default: base[0] = '\0'; // safety
            }
        addendpath(base);
        strcat(base,path);
        simplifypath(base,0);
        strcpy(path,base);
    }
}

// Assembly:
testb $0x10, %sil
jne 0x60c5
pushq %r15
pushq %r14
pushq %rbx
subq $0xc00, %rsp            # imm = 0xC00
movq %rdx, %r14
movq %rdi, %rbx
cmpb $0x0, (%rdx)
je 0x6055
movq %rsp, %r15
movb $0x0, (%r15)
movq %r14, %rdi
callq 0x3853
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x334b
jmp 0x608e
andl $0xf, %ecx
cmpl $0x3, %ecx
je 0x6079
cmpl $0x2, %ecx
je 0x6070
cmpl $0x1, %ecx
jne 0x608a
leaq 0x10592(%rip), %rsi     # 0x16600
jmp 0x6080
leaq 0x10989(%rip), %rsi     # 0x16a00
jmp 0x6080
leaq 0x10d80(%rip), %rsi     # 0x16e00
movq %rsp, %rdi
callq 0x20b0
jmp 0x608e
movb $0x0, (%rsp)
movq %rsp, %r14
movq %r14, %rdi
callq 0x39f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2300
movq %r14, %rdi
xorl %esi, %esi
callq 0x3e39
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20b0
addq $0xc00, %rsp            # imm = 0xC00
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: create_missing_dirs
void create_missing_dirs(const char *path)
{
	size_t strpos = 0, strpos_i;
	char new_dir[MAX_PATH];
	char new_path[MAX_PATH];
	int ret;
	struct stat dir_stats;

    assert(ispathabs(path)); // internally all pathes should be absolute

    strcpy(new_path,path);
    pathunix(new_path);
    simplifypath(new_path,1);

	for (;;)
	{
		strpos_i = strcspn(&new_path[strpos], "/");
		if (strpos_i == strlen(&new_path[strpos]))
			break;
		strpos += strpos_i+1;

		strncpy(new_dir, new_path, strpos-1);
        new_dir[strpos-1] = '\0';

		if (stat(new_dir, &dir_stats) == 0)
		{
			if ((dir_stats.st_mode & S_IFDIR) != S_IFDIR)
			{
				printf("%s is not a directory\r\n",new_dir);
				exit(1);
			}
		}
        else if (strpos>1 && new_dir[strpos-2] != ':')
		{
			ret = make_dir(new_dir);

			if (ret != 0 && ret != EEXIST)
			{
				printf("can't create directory %s\r\n",new_dir);
				exit(1);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x898, %rsp            # imm = 0x898
movq %rdi, %r14
callq 0x3bd2
testl %eax, %eax
je 0x7e76
leaq 0x490(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20b0
movq %rbx, %rdi
callq 0x3a94
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3e39
xorl %ebx, %ebx
leaq 0x9408(%rip), %r14      # 0x111a6
leaq 0x90(%rsp), %r15
movq %rsp, %r12
leaq (%rsp,%rbx), %r13
addq $0x490, %r13            # imm = 0x490
movq %r13, %rdi
movq %r14, %rsi
callq 0x21b0
movq %rax, %rbp
movq %r13, %rdi
callq 0x2120
cmpq %rax, %rbp
je 0x7e5b
leaq (%rbx,%rbp), %r13
addq %rbp, %rbx
incq %rbx
movq %r15, %rdi
leaq 0x490(%rsp), %rsi
movq %r13, %rdx
callq 0x2080
movb $0x0, 0x90(%rsp,%r13)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2230
testl %eax, %eax
je 0x7e32
cmpq $0x2, %rbx
jb 0x7da9
cmpb $0x3a, -0x1(%r13,%r15)
je 0x7da9
movq %r15, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x20c0
testl %eax, %eax
je 0x7da9
cmpl $0x11, %eax
je 0x7da9
jmp 0x7e6d
testb $0x40, 0x19(%rsp)
jne 0x7da9
leaq 0x9401(%rip), %rdi      # 0x11245
leaq 0x90(%rsp), %rsi
xorl %eax, %eax
callq 0x2140
pushq $0x1
popq %rdi
callq 0x2320
addq $0x898, %rsp            # imm = 0x898
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x93e9(%rip), %rdi      # 0x1125d
jmp 0x7e44
leaq 0x9391(%rip), %rdi      # 0x1120e
leaq 0x8222(%rip), %rsi      # 0x100a6
leaq 0x9393(%rip), %rcx      # 0x1121e
movl $0x1210, %edx           # imm = 0x1210
callq 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_workspace_adddep
void preprocess_workspace_adddep(item* workspace_use,item* p)
{
	item* ref = findref(p);
	p->flags |= FLAG_PROCESSED;
	if (ref && !(ref->flags & FLAG_REMOVED))
	{
		size_t i;
		item* use = item_get(ref,"use",0);
		for (i=0;i<item_childcount(use);++i)
			if (!(use->child[i]->flags & FLAG_REMOVED))
			{
				item* dep = item_get(workspace_use,use->child[i]->value,1);
				if (!(dep->flags & FLAG_PROCESSED))
					preprocess_workspace_adddep(workspace_use,dep);
			}

		use = item_get(ref,"dep",0);
		for (i=0;i<item_childcount(use);++i)
			if (!(use->child[i]->flags & FLAG_REMOVED))
			{
				item* dep = item_get(workspace_use,use->child[i]->value,1);
				if (!(dep->flags & FLAG_PROCESSED))
					preprocess_workspace_adddep(workspace_use,dep);
			}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2776
orb $-0x80, 0x30(%r15)
testq %rax, %rax
je 0x9543
movq %rax, %r14
testb $0x40, 0x30(%rax)
jne 0x9543
leaq 0x6c5c(%rip), %rsi      # 0x100dc
xorl %r12d, %r12d
movq %r14, %rdi
xorl %edx, %edx
callq 0x26a2
movq %rax, %r15
pushq $0x1
popq %rbp
testq %r15, %r15
je 0x94a6
movq 0x20(%r15), %rax
subq 0x18(%r15), %rax
sarq $0x3, %rax
jmp 0x94a8
xorl %eax, %eax
cmpq %rax, %r12
jae 0x94de
movq 0x18(%r15), %rax
movq (%rax,%r12,8), %rax
testb $0x40, 0x30(%rax)
jne 0x94d9
movq (%rax), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x26a2
testb $-0x80, 0x30(%rax)
jne 0x94d9
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9448
incq %r12
jmp 0x9493
leaq 0x6bf3(%rip), %rsi      # 0x100d8
xorl %r15d, %r15d
movq %r14, %rdi
xorl %edx, %edx
callq 0x26a2
movq %rax, %r14
pushq $0x1
popq %rbp
testq %r14, %r14
je 0x950b
movq 0x20(%r14), %rax
subq 0x18(%r14), %rax
sarq $0x3, %rax
jmp 0x950d
xorl %eax, %eax
cmpq %rax, %r15
jae 0x9543
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
testb $0x40, 0x30(%rax)
jne 0x953e
movq (%rax), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x26a2
testb $-0x80, 0x30(%rax)
jne 0x953e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9448
incq %r15
jmp 0x94f8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_workspace_init
void preprocess_workspace_init(item* p)
{
	item** child;
	if (!p) return;
	for (child=p->child;child!=p->childend;++child)
		(*child)->flags &= ~FLAG_PROCESSED;
}

// Assembly:
testq %rdi, %rdi
je 0x956e
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
cmpq %rcx, %rax
je 0x956e
movq (%rax), %rdx
andl $0xffffff7f, 0x30(%rdx) # imm = 0xFFFFFF7F
addq $0x8, %rax
jmp 0x9559
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_workspace
void preprocess_workspace(item* p)
{
	item** child;
	for (child=p->child;child!=p->childend;++child)
	{
		item* use = item_get(*child,"use",0);
		size_t i;
		for (i=0;i<item_childcount(use);++i)
			use->child[i]->flags &= ~FLAG_PROCESSED;

		for (i=0;i<item_childcount(use);++i)
			if (!(use->child[i]->flags & FLAG_PROCESSED))
				preprocess_workspace_adddep(use,use->child[i]);

		for (i=0;i<item_childcount(use);++i)
		{
			item* ref = findref(use->child[i]);
			if (!ref || (ref->flags & FLAG_REMOVED))
			{
				item_delete(use->child[i]);
				--i;
			}
		}

		if (!item_childcount(use))
		{
			item_delete(*child);
			--child;
		}
#if 0
		else
		{
			// copy all the FRAMEWORK of each (use) into the WORKSPACE (*child)
			item *frameworks = item_get(*child,"framework",0);
			for (i=0;i<item_childcount(use);++i)
			{
				item* ref = findref(use->child[i]);
				if (ref)
				{
					item_merge(frameworks,item_find(ref,"framework"),NULL);
				}
			}
		}
#endif
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r12
leaq 0x6b56(%rip), %r14      # 0x100dc
cmpq 0x20(%rbx), %r12
je 0x9663
movq (%r12), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x26a2
movq %rax, %r15
xorl %eax, %eax
testq %r15, %r15
je 0x95b6
movq 0x20(%r15), %rcx
subq 0x18(%r15), %rcx
sarq $0x3, %rcx
jmp 0x95b8
xorl %ecx, %ecx
cmpq %rcx, %rax
jae 0x95d1
movq 0x18(%r15), %rcx
movq (%rcx,%rax,8), %rcx
andl $0xffffff7f, 0x30(%rcx) # imm = 0xFFFFFF7F
incq %rax
jmp 0x95a3
xorl %r13d, %r13d
testq %r15, %r15
je 0x964d
movq 0x20(%r15), %rax
subq 0x18(%r15), %rax
sarq $0x3, %rax
cmpq %rax, %r13
jae 0x9605
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %rsi
testb $-0x80, 0x30(%rsi)
jne 0x9600
movq %r15, %rdi
callq 0x9448
incq %r13
jmp 0x95d4
xorl %r13d, %r13d
movq 0x18(%r15), %rax
movq 0x20(%r15), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r13
jae 0x9648
movq (%rax,%r13,8), %rdi
callq 0x2776
testq %rax, %rax
je 0x9633
testb $0x40, 0x30(%rax)
je 0x9643
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %rdi
callq 0x2be9
decq %r13
incq %r13
jmp 0x9608
cmpq %rax, %rcx
jne 0x965a
movq (%r12), %rdi
callq 0x2be9
addq $-0x8, %r12
addq $0x8, %r12
jmp 0x9586
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: merge_project
void merge_project(item* target,item* source,item* filter)
{
	size_t j;

    item* tmp = item_get(NULL,"tmp",0);

	item_add(tmp,item_find(source,"path"));

	item_merge(target,source,filter);

	for (j=0;j<item_childcount(tmp);++j)
		item_add(source,tmp->child[j]);

	item_delete(tmp);

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x6f00(%rip), %rsi      # 0x10586
xorl %r13d, %r13d
xorl %edi, %edi
xorl %edx, %edx
callq 0x26a2
movq %rax, %r14
leaq 0x79d4(%rip), %rsi      # 0x11070
movq %rbx, %rdi
callq 0x262e
movq %r14, %rdi
movq %rax, %rsi
callq 0x259a
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x30f9
testq %r14, %r14
je 0x96d0
movq 0x20(%r14), %rax
subq 0x18(%r14), %rax
sarq $0x3, %rax
jmp 0x96d2
xorl %eax, %eax
cmpq %rax, %r13
jae 0x96ec
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x259a
incq %r13
jmp 0x96bd
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2be9
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: replace_use
void replace_use(item* p,const char* remove,item* set)
{
	item** child;
	if (!p) return;
	for (child=p->child;child!=p->childend;++child)
	{
		item* use = item_get(*child,"use",0);
		item* a = item_find(use,remove);
		if (a && !(a->flags & FLAG_REMOVED))
		{
            // remove old use
			item_delete(a);

			if (stricmp((*child)->value,set->value)!=0)
			{
				item* setuse = item_find(item_find(set,"use"),(*child)->value);
				if (setuse)
				{
                    if ((*child)->parent && stricmp((*child)->parent->value,"lib")==0)
                        continue;

					item_get(item_get(set,"dep",0),(*child)->value,1);
					item_delete(setuse);
				}

                // replace use
				item_get(use,set->value,1);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
testq %rdi, %rdi
je 0x9815
movq %rdi, %r15
movq 0x18(%rdi), %rbx
cmpq 0x20(%r15), %rbx
je 0x9815
movq (%rbx), %rdi
leaq 0x69a3(%rip), %rsi      # 0x100dc
xorl %edx, %edx
callq 0x26a2
movq %rax, %r13
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x262e
testq %rax, %rax
je 0x980c
testb $0x40, 0x30(%rax)
jne 0x980c
movq %rax, %rdi
callq 0x2be9
movq (%rbx), %r14
movq (%r14), %rbp
movq 0x8(%rsp), %rax
movq (%rax), %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2070
testl %eax, %eax
je 0x980c
movq 0x8(%rsp), %rdi
leaq 0x6944(%rip), %rsi      # 0x100dc
callq 0x262e
movq %rax, %rdi
movq %rbp, %rsi
callq 0x262e
testq %rax, %rax
je 0x97fe
movq %rax, %rbp
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x97cc
movq (%rax), %rdi
leaq 0x79dc(%rip), %rsi      # 0x1119f
callq 0x2070
testl %eax, %eax
je 0x980c
movq 0x8(%rsp), %r14
movq %r14, %rdi
leaq 0x68fd(%rip), %rsi      # 0x100d8
xorl %edx, %edx
callq 0x26a2
movq (%rbx), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
pushq $0x1
popq %rdx
callq 0x26a2
movq %rbp, %rdi
callq 0x2be9
movq (%r14), %r12
movq %r13, %rdi
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x26a2
addq $0x8, %rbx
jmp 0x9725
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_outputname
void preprocess_outputname(item* p,const char* outputname)
{
	item* output;
	item** child;
	if (!p) return;
	output = getvalue(item_find(getconfig(p),outputname));
	for (child=p->child;child!=p->childend;++child)
	{
		if (!output)
			preprocess_setremoved(*child);
		else
		if (!getvalue(item_find(*child,"output")))
			item_get(item_get(*child,"output",0),output->value,1);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x9c63
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2702
movq %rax, %rdi
movq %r14, %rsi
callq 0x262e
movq %rax, %rdi
callq 0x270e
movq %rax, %r14
movq 0x18(%rbx), %r13
leaq 0x6a87(%rip), %r15      # 0x10688
pushq $0x1
popq %rbp
cmpq 0x20(%rbx), %r13
je 0x9c55
movq (%r13), %r12
testq %r14, %r14
je 0x9c47
movq %r12, %rdi
movq %r15, %rsi
callq 0x262e
movq %rax, %rdi
callq 0x270e
testq %rax, %rax
jne 0x9c4f
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x26a2
movq (%r14), %rsi
movq %rax, %rdi
movl %ebp, %edx
callq 0x26a2
jmp 0x9c4f
movq %r12, %rdi
callq 0x55ad
addq $0x8, %r13
jmp 0x9c04
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_project
void preprocess_project(item* p)
{
	size_t i;
	if (!p) return;
    for (i=0;i<item_childcount(p);++i)
	{
        item* ref = findref(p->child[i]);
        if (ref)
        {
			merge_project(ref,p->child[i],p->child[i]);
			item_delete(p->child[i]);
			--i;
        }
	}
}

// Assembly:
testq %rdi, %rdi
je 0x9cc4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jae 0x9cbd
movq (%rax,%r14,8), %rdi
callq 0x2776
testq %rax, %rax
je 0x9cb8
movq 0x18(%rbx), %rcx
movq (%rcx,%r14,8), %rdx
movq %rax, %rdi
movq %rdx, %rsi
callq 0x966d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2be9
decq %r14
incq %r14
jmp 0x9c73
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: preprocess_group
void preprocess_group(item* p)
{
	item** child;
	if (!p) return;
	for (child=p->child;child!=p->childend;++child)
	{
		size_t i;
		item* use = item_get(*child,"use",0);
		for (i=0;i<item_childcount(use);++i)
		{
			item* group = item_find(getroot(p,"group"),use->child[i]->value);
			if (group)
			{
				merge_project(*child,group,use->child[i]);
				item_delete(use->child[i]);
				--i; // process the same item again until there is no more 'group'
			}
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0x9d86
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rbp
leaq 0x6416(%rip), %r15      # 0x100fd
cmpq 0x20(%rbx), %rbp
je 0x9d78
movq (%rbp), %rdi
leaq 0x63e0(%rip), %rsi      # 0x100dc
xorl %edx, %edx
callq 0x26a2
movq %rax, %r12
xorl %r14d, %r14d
testq %r12, %r12
je 0x9d1e
movq 0x20(%r12), %rax
subq 0x18(%r12), %rax
sarq $0x3, %rax
jmp 0x9d20
xorl %eax, %eax
cmpq %rax, %r14
jae 0x9d6f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x268c
movq 0x18(%r12), %rcx
movq (%rcx,%r14,8), %r13
movq (%r13), %rsi
movq %rax, %rdi
callq 0x262e
testq %rax, %rax
je 0x9d6a
movq (%rbp), %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x966d
movq 0x18(%r12), %rax
movq (%rax,%r14,8), %rdi
callq 0x2be9
decq %r14
incq %r14
jmp 0x9d09
addq $0x8, %rbp
jmp 0x9ce7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: generate_xcodeuid
void generate_xcodeuid(char *xcodeuid,const char *srcstr)
{
	int i;
	union
	{
		unsigned int d[3];
		unsigned char b[12];
	} code;

    for (i=0;i<3;++i)
        code.d[i] = 1;

	for (i=0;srcstr[i];++i)
	{
		unsigned char ch = (unsigned char)srcstr[i];
		code.d[0] = (code.d[0] + 0x33299112 + code.d[0] * ch) ^ code.d[2];
		code.d[1] = (code.d[1] + 0x1345AF22 + code.d[2] * ch) ^ code.d[1];
		code.d[2] = (code.d[2] + 0x73A92332 + code.d[1] * ch) ^ code.d[0];
	}

	sprintf(xcodeuid,"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
		code.b[0],code.b[1],code.b[2],code.b[3],
		code.b[4],code.b[5],code.b[6],code.b[7],
		code.b[8],code.b[9],code.b[10],code.b[11]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
cmpq $0x3, %rax
je 0xa4e9
movl $0x1, 0xc(%rsp,%rax,4)
incq %rax
jmp 0xa4d6
movl 0xc(%rsp), %r9d
movl 0x10(%rsp), %r10d
movl 0x14(%rsp), %r11d
movzbl (%rsi), %eax
testl %eax, %eax
je 0xa53c
movl %r9d, %ecx
imull %eax, %ecx
addl %ecx, %r9d
addl $0x33299112, %r9d       # imm = 0x33299112
xorl %r11d, %r9d
movl %r11d, %ecx
imull %eax, %ecx
addl %r10d, %ecx
addl $0x1345af22, %ecx       # imm = 0x1345AF22
xorl %r10d, %ecx
imull %ecx, %eax
addl %eax, %r11d
addl $0x73a92332, %r11d      # imm = 0x73A92332
xorl %r9d, %r11d
incq %rsi
movl %ecx, %r10d
jmp 0xa4f8
movl $0xff, %eax
movl %r9d, %edx
andl %eax, %edx
movl %r9d, %ecx
shrl $0x8, %ecx
andl %eax, %ecx
movl %r9d, %r8d
shrl $0x10, %r8d
andl %eax, %r8d
shrl $0x18, %r9d
movl %r10d, %ebx
andl %eax, %ebx
movl %r10d, %r14d
shrl $0x8, %r14d
andl %eax, %r14d
movl %r10d, %r15d
shrl $0x10, %r15d
andl %eax, %r15d
shrl $0x18, %r10d
movl %r11d, %r12d
andl %eax, %r12d
movl %r11d, %r13d
shrl $0x8, %r13d
andl %eax, %r13d
movl %r11d, %ebp
shrl $0x10, %ebp
andl %eax, %ebp
shrl $0x18, %r11d
leaq 0x6943(%rip), %rsi      # 0x10edf
xorl %eax, %eax
pushq %r11
pushq %rbp
pushq %r13
pushq %r12
pushq %r10
pushq %r15
pushq %r14
pushq %rbx
callq 0x2310
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq