LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/phase[P]o/libregexp/rregexec.c
// Function: rregexec9
extern int
rregexec(Reprog *progp,	/* program to run */
	Rune *bol,	/* string to run machine on */
	Resub *mp,	/* subexpression elements */
	int ms)		/* number of elements at mp */
{
	Reljunk j;
	Relist relist0[LISTSIZE], relist1[LISTSIZE];
	int rv;

	/*
 	 *  use user-specified starting/ending location if specified
	 */
	j.rstarts = bol;
	j.reol = 0;
	if(mp && ms>0){
		if(mp->s.sp)
			j.rstarts = mp->s.rsp;
		if(mp->e.ep)
			j.reol = mp->e.rep;
	}
	j.starttype = 0;
	j.startchar = 0;
	if(progp->startinst->type == RUNE && progp->startinst->r.r < Runeself) {
		j.starttype = RUNE;
		j.startchar = progp->startinst->r.r;
	}
	if(progp->startinst->type == BOL)
		j.starttype = BOL;

	/* mark space */
	j.relist[0] = relist0;
	j.relist[1] = relist1;
	j.reliste[0] = relist0 + nelem(relist0) - 2;
	j.reliste[1] = relist1 + nelem(relist1) - 2;

	rv = rregexec1(progp, bol, mp, ms, &j);
	if(rv >= 0)
		return rv;
	rv = rregexec2(progp, bol, mp, ms, &j);
	if(rv >= 0)
		return rv;
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf410, %rsp           # imm = 0xF410
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rsi, -0x30(%rbp)
andq $0x0, -0x28(%rbp)
testq %rdx, %rdx
sete %al
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x6f7a
movq (%r14), %rax
testq %rax, %rax
je 0x6f6d
movq %rax, -0x30(%rbp)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x6f7a
movq %rax, -0x28(%rbp)
andq $0x0, -0x48(%rbp)
movq (%r12), %rax
movl (%rax), %ecx
cmpl $0xc3, %ecx
je 0x6fa6
cmpl $0x7f, %ecx
jne 0x6fad
movl 0x8(%rax), %eax
cmpl $0x7f, %eax
ja 0x6fad
movl $0x7f, -0x48(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6fad
movl $0xc3, -0x48(%rbp)
leaq -0x2910(%rbp), %rax
leaq -0x68(%rbp), %r8
movq %rax, (%r8)
leaq -0x14c0(%rbp), %rcx
movq %rcx, 0x8(%r8)
movl $0x1040, %edx           # imm = 0x1040
addq %rdx, %rax
movq %rax, 0x10(%r8)
addq %rdx, %rcx
movq %rcx, 0x18(%r8)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x7039
testl %eax, %eax
jns 0x7029
leaq -0xf430(%rbp), %rax
leaq -0x68(%rbp), %r8
movq %rax, (%r8)
leaq -0x8ea0(%rbp), %rcx
movq %rcx, 0x8(%r8)
movl $0x6180, %edx           # imm = 0x6180
addq %rdx, %rax
movq %rax, 0x10(%r8)
addq %rdx, %rcx
movq %rcx, 0x18(%r8)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x7039
addq $0xf410, %rsp           # imm = 0xF410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/phase[P]o/libregexp/rregsub.c
// Function: rregsub9
extern	void
rregsub(Rune *sp,	/* source string */
	Rune *dp,	/* destination string */
	int dlen,
	Resub *mp,	/* subexpression elements */
	int ms)		/* number of elements pointed to by mp */
{
	Rune *ssp, *ep;
	int i;

	ep = dp+(dlen/sizeof(Rune))-1;
	while(*sp != '\0'){
		if(*sp == '\\'){
			switch(*++sp){
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':
				i = *sp-'0';
				if(mp!=0 && mp[i].s.rsp != 0 && ms>i)
					for(ssp = mp[i].s.rsp;
					     ssp < mp[i].e.rep;
					     ssp++)
						if(dp < ep)
							*dp++ = *ssp;
				break;
			case '\\':
				if(dp < ep)
					*dp++ = '\\';
				break;
			case '\0':
				sp--;
				break;
			default:
				if(dp < ep)
					*dp++ = *sp;
				break;
			}
		}else if(*sp == '&'){
			if(mp!=0 && mp[0].s.rsp != 0 && ms>0)
				for(ssp = mp[0].s.rsp;
				     ssp < mp[0].e.rep; ssp++)
					if(dp < ep)
						*dp++ = *ssp;
		}else{
			if(dp < ep)
				*dp++ = *sp;
		}
		sp++;
	}
	*dp = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movslq %edx, %rax
andq $-0x4, %rax
addq %rsi, %rax
addq $-0x4, %rax
movl $0x5c, %edx
movl (%rdi), %r10d
cmpl $0x26, %r10d
je 0x73c6
cmpl $0x5c, %r10d
je 0x7370
testl %r10d, %r10d
je 0x741f
movq %rdi, %r9
cmpq %rax, %rsi
jae 0x7416
movl %r10d, (%rsi)
addq $0x4, %rsi
jmp 0x7413
leaq 0x4(%rdi), %r9
movl 0x4(%rdi), %r10d
leal -0x30(%r10), %r11d
cmpl $0xa, %r11d
jae 0x73fc
testq %rcx, %rcx
je 0x7413
movq %r11, %rdi
shlq $0x4, %rdi
movq (%rcx,%rdi), %r10
testq %r10, %r10
sete %bl
cmpl %r8d, %r11d
setge %r11b
orb %bl, %r11b
jne 0x7413
addq %rcx, %rdi
cmpq 0x8(%rdi), %r10
jae 0x7413
cmpq %rax, %rsi
jae 0x73c0
movl (%r10), %r11d
movl %r11d, (%rsi)
addq $0x4, %rsi
addq $0x4, %r10
jmp 0x73ab
testq %rcx, %rcx
je 0x7416
testl %r8d, %r8d
setle %r10b
movq (%rcx), %r9
testq %r9, %r9
sete %r11b
orb %r10b, %r11b
jne 0x7416
cmpq 0x8(%rcx), %r9
jae 0x7416
cmpq %rax, %rsi
jae 0x73f6
movl (%r9), %r10d
movl %r10d, (%rsi)
addq $0x4, %rsi
addq $0x4, %r9
jmp 0x73e1
testl %r10d, %r10d
je 0x7416
cmpl $0x5c, %r10d
jne 0x740a
movl %edx, %r10d
cmpq %rax, %rsi
jb 0x7364
movq %r9, %rdi
addq $0x4, %rdi
jmp 0x7340
andl $0x0, (%rsi)
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/phase[P]o/libregexp/utf.c
// Function: runestrchr
Rune*
runestrchr(Rune *s, Rune c)
{
	Rune c0 = c;
	Rune c1;

	if(c == 0) {
		while(*s++)
			;
		return s-1;
	}

	while((c1 = *s++))
		if(c1 == c0)
			return s-1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
addq $-0x4, %rax
testl %esi, %esi
je 0x7511
movl 0x4(%rax), %ecx
testl %ecx, %ecx
je 0x7523
addq $0x4, %rax
cmpl %esi, %ecx
jne 0x7500
jmp 0x7525
movq %rax, %rcx
leaq 0x4(%rcx), %rax
cmpl $0x0, 0x4(%rcx)
movq %rax, %rcx
jne 0x7514
jmp 0x7525
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/phase[P]o/libregexp/utf.c
// Function: utfrune
char*
utfrune(char *s, Rune c)
{
	Rune c1;
	Rune r;
	int n;

	if(c < Runesync)		/* not part of utf sequence */
		return strchr(s, c);

	for(;;) {
		c1 = *(unsigned char*)s;
		if(c1 < Runeself) {	/* one byte rune */
			if(c1 == 0)
				return 0;
			if(c1 == c)
				return s;
			s++;
			continue;
		}
		n = chartorune(&r, s);
		if(r == c)
			return s;
		s += n;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x80, %esi
jae 0x755b
movq %rbx, %rdi
movl %r14d, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
pushq $0x1
popq %r12
leaq -0x24(%rbp), %r15
movzbl (%rbx), %eax
testb %al, %al
js 0x7578
testl %eax, %eax
je 0x7590
movq %r12, %rcx
cmpl %r14d, %eax
jne 0x758b
jmp 0x7592
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7428
cmpl %r14d, -0x24(%rbp)
je 0x7592
movl %eax, %ecx
addq %rcx, %rbx
jmp 0x7563
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/tests/kvlds-blocking/main.c
// Function: main
int
main(int argc, char * argv[])
{
	struct wire_requestqueue * Q;
	struct kivaloo_cookie * K;

	WARNP_INIT;

	/* Check number of arguments. */
	if (argc != 2) {
		fprintf(stderr, "usage: test_kvlds %s\n", "<socketname>");
		exit(1);
	}

	/* Open a connection to KVLDS. */
	if ((K = kivaloo_open(argv[1], &Q)) == NULL) {
		warnp("Could not connect o KVLDS daemon.");
		exit(1);
	}

	/* Test the blocking API. */
	if (set_get_blocking(Q))
		exit(1);

	/* Free the request queue and network connection. */
	kivaloo_close(K);

	/* Success! */
	exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x241a
callq 0x2530
cmpl $0x2, %ebp
jne 0x244e
movq 0x8(%rbx), %rdi
movq %rsp, %rsi
callq 0x29c4
testq %rax, %rax
jne 0x2475
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2514
leaq 0x6be2(%rip), %rdi      # 0x9027
xorl %eax, %eax
callq 0x273c
jmp 0x246d
movq 0xcba3(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x6ba5(%rip), %rsi      # 0x9004
leaq 0x6bb4(%rip), %rdx      # 0x901a
xorl %eax, %eax
callq 0x21a0
pushq $0x1
popq %rdi
callq 0x2280
movq %rax, %rbx
movq (%rsp), %r12
leaq 0x77f7(%rip), %rdi      # 0x9c7a
pushq $0x3
popq %r15
movq %r15, %rsi
callq 0x28c0
movq %rax, %r14
leaq 0x6bb0(%rip), %rdi      # 0x9049
movq %r15, %rsi
callq 0x28c0
movq %rax, %r15
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2d7b
testl %eax, %eax
jne 0x246d
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x2e14
testl %eax, %eax
jne 0x246d
movzbl (%r15), %edx
movq 0x8(%rsp), %r12
cmpb (%r12), %dl
jne 0x246d
leaq 0x1(%r12), %rdi
movq %r15, %rsi
incq %rsi
callq 0x2210
testl %eax, %eax
jne 0x246d
movq %r14, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2aff
xorl %edi, %edi
callq 0x2280
movq %rax, %rbx
leaq 0x6b09(%rip), %rdi      # 0x9027
xorl %eax, %eax
callq 0x25ad
andl $0x0, (%rbx)
jmp 0x246d
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_08/argv0.c
// Function: main
int main(int argc, char *argv[])
{
	char *name;

	/* Get the file name removing the prepending path name */
	name = basename(argv[0]);

	/* Do different actions according to the invoking name */
	if (strcmp(name, "hello") == 0) {
		printf("hello ");
		if (argc >= 2)
			printf("%s!", argv[1]);
		else
			printf("world");
		printf("\n");
	} else if (strcmp(name, "sum") == 0) {
		if (argc >= 3)
			printf("%d\n", atoi(argv[1]) + atoi(argv[2]));
		else
			printf("too few arguments!\n");
	} else {
		printf("change my name!\n");
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rdi
callq 0x1070
movq %rax, %r14
leaq 0xe5d(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1060
testl %eax, %eax
je 0x11cf
leaq 0xe61(%rip), %rsi       # 0x201b
movq %r14, %rdi
callq 0x1060
testl %eax, %eax
je 0x11f6
leaq 0xe56(%rip), %rdi       # 0x2023
jmp 0x1242
leaq 0xe34(%rip), %rdi       # 0x200a
xorl %eax, %eax
callq 0x1050
cmpl $0x2, %ebp
jl 0x1223
movq 0x8(%rbx), %rsi
leaq 0xe24(%rip), %rdi       # 0x2011
xorl %eax, %eax
callq 0x1050
jmp 0x1231
cmpl $0x3, %ebp
jl 0x123b
movq 0x8(%rbx), %rdi
callq 0x1080
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x1080
addl %eax, %ebp
leaq 0xe07(%rip), %rdi       # 0x201f
movl %ebp, %esi
xorl %eax, %eax
callq 0x1050
jmp 0x1247
leaq 0xdeb(%rip), %rdi       # 0x2015
xorl %eax, %eax
callq 0x1050
pushq $0xa
popq %rdi
callq 0x1030
jmp 0x1247
leaq 0xdf1(%rip), %rdi       # 0x2033
callq 0x1040
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/testrender.c
// Function: main
int main(int argc, char* argv[])
{
	struct aatrace_text txt;
	struct aatrace_font font;
	struct aatrace_pic out;

	if (argc < 4)
		return 1;

	if (util_load_text(&txt, argv[1]) < 0)
		return 2;

	if (util_load_font(&font, argv[2]) < 0)
		return 3;

	aatrace_render_pic(&out, &txt, &font);

	if (util_store_pic(argv[3], &out) < 0)
		return 4;

	return 0;
}

// Assembly:
cmpl $0x4, %edi
jge 0x1225
pushq $0x1
popq %rax
retq
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
movq %rsp, %rdi
callq 0x165a
testl %eax, %eax
js 0x127a
movq 0x10(%rbx), %rsi
leaq 0x18(%rsp), %rdi
callq 0x19a3
testl %eax, %eax
js 0x127e
leaq 0x40(%rsp), %r14
movq %rsp, %rsi
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x1a10
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x18e6
shrl $0x1d, %eax
andl $-0x4, %eax
jmp 0x1281
pushq $0x2
jmp 0x1280
pushq $0x3
popq %rax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/pnm.c
// Function: pnm_filename_open
pnm_file pnm_filename_open(const char* fname, pnm_type_t* ptype, int* pwidth, int* pheight)
{
	FILE* f;
	pnm_file pnm;

	f = fopen(fname, "rb");
	if (!f)
		return 0;

	pnm = pnm_file_open(f, ptype, pwidth, pheight);
	if (!pnm) {
		fclose(f);
		return 0;
	}

	return pnm;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
leaq 0xd60(%rip), %rsi       # 0x2004
callq 0x10f0
testq %rax, %rax
je 0x12cf
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x12dd
testq %rax, %rax
jne 0x12d1
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/pnm.c
// Function: pnm_file_open
pnm_file pnm_file_open(FILE* f, pnm_type_t* ptype, int* pwidth, int* pheight)
{
	char magic, typec;
	int depth;
	int i;
	pnm_file s;

	if (fscanf(f, "%c%c\n", &magic, &typec) != 2)
		return 0;

	if (magic != 'P' || (typec != '5' && typec != '6'))
		return 0;

	*ptype = (pnm_type_t)(typec - '0');

	/* comments */
	for (i = 0; i < 16; i++)
		if (!fscanf(f, "#%*[^\n]\n"))
			break;

	if (fscanf(f, "%d %d\n", pwidth, pheight) != 2)
		return 0;

	/* scanf("%d\n") matches ANY AMOUNT of whitespace after the number. */
	if (fscanf(f, "%d", &depth) != 1)
		return 0;
	if (fgetc(f) != '\n')
		return 0;

	if (depth != 255)
		return 0;

	s = (pnm_file)malloc(sizeof(*s));
	s->file = f;
	s->type = *ptype;
	s->width = *pwidth;
	s->height = *pheight;
	s->stride = ((s->type == 6) ? 3 : 1) * s->width;

	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0xd0c(%rip), %rsi       # 0x2007
xorl %r13d, %r13d
leaq 0x3(%rsp), %rdx
leaq 0x2(%rsp), %rcx
xorl %eax, %eax
callq 0x1050
cmpl $0x2, %eax
jne 0x13ec
cmpb $0x50, 0x3(%rsp)
jne 0x13ec
movzbl 0x2(%rsp), %eax
leal -0x37(%rax), %ecx
cmpb $-0x2, %cl
jae 0x1338
xorl %r13d, %r13d
jmp 0x13ec
addl $-0x30, %eax
movl %eax, (%r15)
pushq $0x11
popq %rbp
leaq 0xcc5(%rip), %r13       # 0x200d
decl %ebp
je 0x135d
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1050
testl %eax, %eax
jne 0x1348
leaq 0xcb2(%rip), %rsi       # 0x2016
xorl %r13d, %r13d
movq %r12, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1050
cmpl $0x2, %eax
jne 0x13ec
leaq 0xc9a(%rip), %rsi       # 0x201d
xorl %r13d, %r13d
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1050
cmpl $0x1, %eax
jne 0x13ec
movq %r12, %rdi
callq 0x1090
xorl %r13d, %r13d
cmpl $0xa, %eax
jne 0x13ec
cmpl $0xff, 0x4(%rsp)
jne 0x13ec
pushq $0x18
popq %rdi
callq 0x10d0
movq %rax, %r13
movq %r12, (%rax)
movl (%r15), %eax
movl %eax, 0x8(%r13)
movl (%r14), %ecx
movl %ecx, 0xc(%r13)
movl (%rbx), %edx
movl %edx, 0x10(%r13)
xorl %edx, %edx
cmpl $0x6, %eax
sete %dl
leal 0x1(,%rdx,2), %eax
imull %ecx, %eax
movl %eax, 0x14(%r13)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/pnm.c
// Function: pnm_file_read_pic
int pnm_file_read_pic(pnm_file s, pnm_pix_t* picbuf)
{
	int l;

	for (l = 0; l < s->height; l++)
		if (pnm_file_read_line(s, picbuf + l*s->stride) < 0)
			return -1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
cmpl 0x10(%r15), %r12d
jge 0x1462
movslq 0x14(%r15), %rax
movslq %r12d, %rsi
imulq %rax, %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0x13fe
incl %r12d
testl %eax, %eax
jns 0x143d
movl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/pnm.c
// Function: pnm_filename_create
pnm_file pnm_filename_create(const char* fname, pnm_type_t type, int width, int height)
{
	FILE* f;
	pnm_file pnm;

	f = fopen(fname, "wb");
	if (!f)
		return 0;

	pnm = pnm_file_create(f, type, width, height);
	if (!pnm) {
		fclose(f);
		return 0;
	}

	return pnm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
leaq 0xb9d(%rip), %rsi       # 0x2020
callq 0x10f0
testq %rax, %rax
je 0x14ad
movq %rax, %rbx
movq %rax, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x14ba
testq %rax, %rax
jne 0x14af
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/pnm.c
// Function: pnm_file_create
pnm_file pnm_file_create(FILE* f, pnm_type_t type, int width, int height)
{
	pnm_file s;

	s = (pnm_file)malloc(sizeof(*s));

	s->file = f;
	s->type = type;
	s->width = width;
	s->height = height;
	s->stride = ((s->type == 6) ? 3 : 1) * s->width;

	fprintf(f, "P%d\n%d %d\n255\n", type, width, height);

	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0x10d0
movq %rax, %r12
movq %r15, (%rax)
movl %r14d, 0x8(%rax)
movl %ebp, 0xc(%rax)
movl %ebx, 0x10(%rax)
xorl %eax, %eax
cmpl $0x6, %r14d
sete %al
leal 0x1(,%rax,2), %eax
imull %ebp, %eax
movl %eax, 0x14(%r12)
leaq 0xb20(%rip), %rsi       # 0x2023
movq %r15, %rdi
movl %r14d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x10c0
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/pnm.c
// Function: pnm_file_write_pic
int pnm_file_write_pic(pnm_file s, const pnm_pix_t* picbuf)
{
	int l;

	for (l = 0; l < s->height; l++)
		if (pnm_file_write_line(s, picbuf + l*s->stride) < 0)
			return -1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
cmpl 0x10(%r15), %r12d
jge 0x1585
movslq 0x14(%r15), %rax
movslq %r12d, %rsi
imulq %rax, %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0x1521
incl %r12d
testl %eax, %eax
jns 0x1560
movl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_read_text
int util_read_text(struct aatrace_text* txt, FILE* f)
{
	size_t sz = 0x1000;
	txt->buf = (char*)malloc(sz);
	unsigned int l;

	if (!fgets(txt->buf, sz, f))
		return -1;

	txt->ll = txt->w = strlen(txt->buf) - 1;

	for (l = 1; ; l++) {
		if ((l + 1)*txt->ll + 1 > sz) {
			sz *= 2;
			txt->buf = (char*)realloc(txt->buf, sz);
		}

		if (!fgets(&txt->buf[l*txt->ll], sz - l*txt->ll, f))
			break;
	}

	txt->h = l;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1000, %r15d          # imm = 0x1000
movl $0x1000, %edi           # imm = 0x1000
callq 0x10d0
movq %rax, (%rbx)
movq %rax, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdx
callq 0x10a0
testq %rax, %rax
je 0x164b
movq (%rbx), %rdi
callq 0x1080
decl %eax
movl %eax, 0xc(%rbx)
movl %eax, 0x8(%rbx)
xorl %r12d, %r12d
leal 0x2(%r12), %edx
movl 0x8(%rbx), %ecx
imull %ecx, %edx
incl %edx
movq (%rbx), %rax
cmpq %rdx, %r15
jae 0x1626
addq %r15, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
incl %r12d
imull %r12d, %ecx
leaq (%rcx,%rax), %rdi
movl %r15d, %esi
subl %ecx, %esi
movq %r14, %rdx
callq 0x10a0
testq %rax, %rax
jne 0x15fd
movl %r12d, 0x10(%rbx)
xorl %eax, %eax
jmp 0x164e
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_load_text
int util_load_text(struct aatrace_text* txt, const char* fname)
{
	FILE* f = stdin;

	if (strcmp(fname, "-")) {
		f = fopen(fname, "rb");
		if (!f) {
			fprintf(stderr, "Error opening TXT file '%s': %s\n",
				fname, strerror(errno));

			return -1;
		}
	}

	if (util_read_text(txt, f) < 0) {
		fprintf(stderr, "Error reading TXT file '%s': %s\n",
			fname, strerror(errno));

		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x2d, (%rsi)
jne 0x1670
cmpb $0x0, 0x1(%rbx)
je 0x169d
leaq 0x98d(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x10f0
movq %rax, %rsi
testq %rax, %rax
je 0x16b2
movq %r14, %rdi
callq 0x15b4
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
js 0x16a9
popq %rbx
popq %r14
popq %r15
retq
movq 0x2934(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
jmp 0x1687
leaq 0x9a3(%rip), %r14       # 0x2053
jmp 0x16b9
leaq 0x979(%rip), %r14       # 0x2032
movq 0x2938(%rip), %rax      # 0x3ff8
movq (%rax), %r15
callq 0x1040
movl (%rax), %edi
callq 0x1110
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10c0
pushq $-0x1
popq %rax
jmp 0x1697
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_write_text
int util_write_text(FILE* f, const struct aatrace_text* txt)
{
	int l;

	for (l = 0; l < txt->h; l++) {
		if (fwrite(&txt->buf[l*txt->ll], txt->w, 1, f) != 1)
			return -1;

		putc('\n', f);
	}

	return (txt->w + 1)*txt->h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
pushq $0x1
popq %r12
pushq $-0x1
popq %rbx
pushq $0xa
popq %rbp
movl 0x10(%r14), %eax
cmpl %eax, %r13d
jge 0x173d
movl 0x8(%r14), %edi
imull %r13d, %edi
addq (%r14), %rdi
movslq 0xc(%r14), %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1100
cmpq $0x1, %rax
jne 0x1746
movl %ebp, %edi
movq %r15, %rsi
callq 0x10b0
incl %r13d
jmp 0x1705
movl 0xc(%r14), %ebx
incl %ebx
imull %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_store_text
int util_store_text(const char* fname, const struct aatrace_text* txt)
{
	FILE* f = stdout;

	if (strcmp(fname, "-")) {
		f = fopen(fname, "wb");
		if (!f) {
			fprintf(stderr, "Error creating TXT file '%s': %s\n",
				fname, strerror(errno));

			return -1;
		}
	}

	if (util_write_text(f, txt) < 0) {
		fprintf(stderr, "Error writing TXT file '%s': %s\n",
			fname, strerror(errno));
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x2d, (%rdi)
jne 0x176d
cmpb $0x0, 0x1(%rbx)
je 0x179a
leaq 0x8ac(%rip), %rsi       # 0x2020
movq %rbx, %rdi
callq 0x10f0
movq %rax, %rdi
testq %rax, %rax
je 0x17af
movq %r14, %rsi
callq 0x16e7
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
js 0x17a6
popq %rbx
popq %r14
popq %r15
retq
movq 0x282f(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
jmp 0x1784
leaq 0x8e9(%rip), %r14       # 0x2096
jmp 0x17b6
leaq 0x8be(%rip), %r14       # 0x2074
movq 0x283b(%rip), %rax      # 0x3ff8
movq (%rax), %r15
callq 0x1040
movl (%rax), %edi
callq 0x1110
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10c0
pushq $-0x1
popq %rax
jmp 0x1794
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_load_pic
int util_load_pic(struct aatrace_pic* pic, const char* fname)
{
	pnm_file pnm;
	pnm_type_t type;

	if (strcmp(fname, "-")) {
		pnm = pnm_filename_open(fname, &type, &pic->w, &pic->h);
	} else {
		pnm = pnm_file_open(stdin, &type, &pic->w, &pic->h);
	}

	if (!pnm || type != PNM_TYPE_PGM) {
		if (errno) {
			fprintf(stderr, "Error opening PGM file '%s': %s\n",
				fname, strerror(errno));
		} else {
			fprintf(stderr, "Bad PGM file '%s'\n", fname);
		}
		return -1;
	}

	pic->ll = pic->w;
	pic->buf = (unsigned char*)malloc(pic->ll*pic->h);

	if (pnm_file_read_pic(pnm, pic->buf) < 0) {
		fprintf(stderr, "Error reading PGM file '%s': %s\n",
			fname, strerror(errno));
		return -1;
	}

	pnm_file_close(pnm);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x2d, (%rsi)
jne 0x17fe
cmpb $0x0, 0x1(%rbx)
je 0x185a
leaq 0xc(%r14), %rdx
leaq 0x10(%r14), %rcx
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x128c
movq %rax, %r15
testq %rax, %rax
je 0x1878
cmpl $0x5, 0xc(%rsp)
jne 0x1878
movl 0xc(%r14), %edi
movl %edi, 0x8(%r14)
imull 0x10(%r14), %edi
callq 0x10d0
movq %rax, (%r14)
movq %r15, %rdi
movq %rax, %rsi
callq 0x1427
testl %eax, %eax
js 0x18a3
movq %r15, %rdi
callq 0x159a
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x2777(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
leaq 0xc(%r14), %rdx
leaq 0x10(%r14), %rcx
leaq 0xc(%rsp), %rsi
callq 0x12dd
jmp 0x1813
callq 0x1040
movl (%rax), %edi
movq 0x2772(%rip), %rax      # 0x3ff8
movq (%rax), %r14
testl %edi, %edi
jne 0x18c2
leaq 0x844(%rip), %rsi       # 0x20d8
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x18de
movq 0x274e(%rip), %rax      # 0x3ff8
movq (%rax), %r14
callq 0x1040
movl (%rax), %edi
callq 0x1110
leaq 0x82b(%rip), %rsi       # 0x20eb
jmp 0x18ce
callq 0x1110
leaq 0x7e9(%rip), %rsi       # 0x20b7
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10c0
pushq $-0x1
popq %rax
jmp 0x1850
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_store_pic
int util_store_pic(const char* fname, const struct aatrace_pic* pic)
{
	pnm_file pnm;

	if (strcmp(fname, "-")) {
		pnm = pnm_filename_create(fname, PNM_TYPE_PGM, pic->w, pic->h);
	} else {
		pnm = pnm_file_create(stdout, PNM_TYPE_PGM, pic->w, pic->h);
	}

	if (!pnm) {
		fprintf(stderr, "Error creating PGM file '%s': %s\n",
			fname, strerror(errno));
		return -1;
	}

	if (pnm_file_write_pic(pnm, pic->buf) < 0) {
		fprintf(stderr, "Error writing PGM file '%s': %s\n",
			fname, strerror(errno));

		return -1;
	}

	pnm_file_close(pnm);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x2d, (%rdi)
jne 0x18fc
cmpb $0x0, 0x1(%rbx)
je 0x1936
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x146d
movq %rax, %r15
testq %rax, %rax
je 0x1952
movq (%r14), %rsi
movq %r15, %rdi
callq 0x154a
testl %eax, %eax
js 0x1971
movq %r15, %rdi
callq 0x159a
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2693(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
pushq $0x5
popq %rsi
callq 0x14ba
jmp 0x190f
movq 0x269f(%rip), %rax      # 0x3ff8
movq (%rax), %r14
callq 0x1040
movl (%rax), %edi
callq 0x1110
leaq 0x79d(%rip), %rsi       # 0x210c
jmp 0x198e
movq 0x2680(%rip), %rax      # 0x3ff8
movq (%rax), %r14
callq 0x1040
movl (%rax), %edi
callq 0x1110
leaq 0x7a0(%rip), %rsi       # 0x212e
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10c0
pushq $-0x1
popq %rax
jmp 0x1930
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/util.c
// Function: util_load_font
int util_load_font(struct aatrace_font* font, const char* fname)
{
	if (util_load_pic(&font->pic, fname) < 0)
		return -1;

	if (font->pic.w != AATRACE_FONT_WIDTH) {
		fprintf(stderr, "Font '%s' has unsupported width %d\n",
			fname, font->pic.w);
		return -1;
	}

	font->w = AATRACE_FONT_WIDTH;
	font->h = AATRACE_FONT_HEIGHT;
	font->nchars = font->pic.h/AATRACE_FONT_HEIGHT;
	font->ascii_offset = AATRACE_FONT_ASCII_OFFSET;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x17e4
pushq $-0x1
popq %rbx
testl %eax, %eax
js 0x19e9
movl 0xc(%r14), %ecx
cmpl $0x8, %ecx
jne 0x19f1
movabsq $0x1000000008, %rax     # imm = 0x1000000008
movq %rax, 0x18(%r14)
movl 0x10(%r14), %eax
pushq $0x10
popq %rcx
cltd
idivl %ecx
movl %eax, 0x20(%r14)
movl $0x20, 0x24(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2600(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x74d(%rip), %rsi       # 0x214f
movq %r15, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x19e9
nop
// File: /workspace/github_c_makefile_star2_O2/ravenexp[P]aatrace/render.c
// Function: aatrace_render_pic
void aatrace_render_pic(struct aatrace_pic* out,
			const struct aatrace_text* txt,
			const struct aatrace_font* font)
{
	int tl, tc;

	out->ll = out->w = txt->w*font->w;
	out->h = txt->h*font->h;
	out->buf = (unsigned char*)malloc(out->ll*out->h);

	for (tl = 0; tl < txt->h; tl++)
		for (tc = 0; tc < txt->w; tc++) {
			int tile = txt->buf[tl*txt->ll + tc] - font->ascii_offset;

			aatrace_bitblt(out->buf, font->pic.buf,
				       out->ll, font->pic.ll,
				       tc*font->w, tl*font->h,
				       0, tile*font->h,
				       font->w, font->h);
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rsi), %ebp
movl 0x18(%rdx), %eax
imull %ebp, %eax
movl %eax, 0xc(%rdi)
movl %eax, 0x8(%rdi)
movl 0x10(%rsi), %r12d
movq %rdx, 0x20(%rsp)
movl 0x1c(%rdx), %edi
imull %r12d, %edi
movl %edi, 0x10(%r14)
imull %eax, %edi
callq 0x10d0
movq %r14, 0x10(%rsp)
movq %rax, (%r14)
xorl %r8d, %r8d
movq %rbx, 0x18(%rsp)
cmpl %r12d, %r8d
jge 0x1b2a
xorl %ecx, %ecx
movl %r8d, 0xc(%rsp)
cmpl %ebp, %ecx
jge 0x1b1e
movq (%rbx), %rax
movl 0x8(%rbx), %edx
imull %r8d, %edx
addl %ecx, %edx
movsbl (%rax,%rdx), %edi
movq 0x20(%rsp), %rbx
subl 0x24(%rbx), %edi
movq 0x10(%rsp), %rax
movq (%rax), %rdx
movl 0x8(%rax), %esi
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %r15d
xorl %r9d, %r9d
testl %eax, %eax
movl $0x0, %r10d
cmovgl %eax, %r10d
testl %r15d, %r15d
movl $0x0, %r11d
cmovgl %r15d, %r11d
imull %r15d, %r8d
imull %esi, %r8d
imull %ecx, %eax
addl %r8d, %eax
movl 0x8(%rbx), %ebp
imull %ebp, %r15d
imull %edi, %r15d
movq (%rbx), %r12
cmpl %r11d, %r9d
je 0x1b0a
movq %r10, %r13
movl %r15d, %r8d
movl %eax, %edi
subq $0x1, %r13
jb 0x1b00
movl %r8d, %r14d
movb (%r12,%r14), %r14b
movl %edi, %ebx
movb %r14b, (%rdx,%rbx)
incl %edi
incl %r8d
jmp 0x1ae6
incl %r9d
addl %esi, %eax
addl %ebp, %r15d
jmp 0x1ad9
incl %ecx
movq 0x18(%rsp), %rbx
movl 0xc(%rbx), %ebp
movl 0xc(%rsp), %r8d
jmp 0x1a6f
incl %r8d
movl 0x10(%rbx), %r12d
jmp 0x1a5f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vincenthsu[P]nweb/nweb23.c
// Function: logger
void logger(int type, char *s1, char *s2, int socket_fd)
{
	int fd ;
	char logbuffer[BUFSIZE*2];

	switch (type) {
	case ERROR: (void)sprintf(logbuffer,"ERROR: %s:%s Errno=%d exiting pid=%d",s1, s2, errno,getpid()); 
		break;
	case FORBIDDEN: 
		(void)write(socket_fd, "HTTP/1.1 403 Forbidden\nContent-Length: 185\nConnection: close\nContent-Type: text/html\n\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\nThe requested URL, file type or operation is not allowed on this simple static file webserver.\n</body></html>\n",271);
		(void)sprintf(logbuffer,"FORBIDDEN: %s:%s",s1, s2); 
		break;
	case NOTFOUND: 
		(void)write(socket_fd, "HTTP/1.1 404 Not Found\nContent-Length: 136\nConnection: close\nContent-Type: text/html\n\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\nThe requested URL was not found on this server.\n</body></html>\n",224);
		(void)sprintf(logbuffer,"NOT FOUND: %s:%s",s1, s2); 
		break;
	case LOG: (void)sprintf(logbuffer," INFO: %s:%s:%d",s1, s2,socket_fd); break;
	}	
	/* No checks here, nothing can be done with a failure anyway */
	if((fd = open("nweb.log", O_CREAT| O_WRONLY | O_APPEND,0644)) >= 0) {
		(void)write(fd,logbuffer,strlen(logbuffer)); 
		(void)write(fd,"\n",1);      
		(void)close(fd);
	}
	if(type == ERROR || type == NOTFOUND || type == FORBIDDEN) exit(3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x3f48, %rsp           # imm = 0x3F48
movl %ecx, %r8d
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebx
cmpl $0x194, %edi            # imm = 0x194
je 0x1343
cmpl $0x2c, %ebx
je 0x130d
cmpl $0x193, %ebx            # imm = 0x193
je 0x1326
cmpl $0x2a, %ebx
jne 0x136e
callq 0x1030
movl (%rax), %ebp
callq 0x1070
leaq 0xd6d(%rip), %rsi       # 0x2062
movq %rsp, %rdi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x1150
jmp 0x136e
leaq 0xf86(%rip), %rsi       # 0x229a
movq %rsp, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1150
jmp 0x136e
leaq 0xd5a(%rip), %rsi       # 0x2087
movl $0x10f, %edx            # imm = 0x10F
movl %r8d, %edi
callq 0x1060
leaq 0xe56(%rip), %rsi       # 0x2197
jmp 0x135e
leaq 0xe5e(%rip), %rsi       # 0x21a8
movl $0xe0, %edx
movl %r8d, %edi
callq 0x1060
leaq 0xf2b(%rip), %rsi       # 0x2289
movq %rsp, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1150
leaq 0xf35(%rip), %rdi       # 0x22aa
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x1120
testl %eax, %eax
js 0x13bc
movl %eax, %ebp
movq %rsp, %r14
movq %r14, %rdi
callq 0x1080
movl %ebp, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1060
leaq 0x101e(%rip), %rsi      # 0x23c9
pushq $0x1
popq %rdx
movl %ebp, %edi
callq 0x1060
movl %ebp, %edi
callq 0x10c0
leal -0x193(%rbx), %eax
cmpl $0x2, %eax
jb 0x13da
cmpl $0x2a, %ebx
je 0x13da
addq $0x3f48, %rsp           # imm = 0x3F48
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x3
popq %rdi
callq 0x1160
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/3-ProcessUser/exec_example.c
// Function: main
int main(void) {
	int i = 10;
	printf("before execl...\n");

//	execl("/bin/xxx", "/bin/ls", "-l", "-a", NULL);
  execl("/bin/ls", "-l", "-a", NULL);
//    execl("/bin/ls", "/bin/ls", "*.c", NULL);

	printf("after execl...(%d)\n", i);

	return 0;
}

// Assembly:
pushq %rax
leaq 0xec2(%rip), %rdi       # 0x2026
callq 0x1030
leaq 0xe94(%rip), %rdi       # 0x2004
leaq 0xe95(%rip), %rsi       # 0x200c
leaq 0xe91(%rip), %rdx       # 0x200f
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x1050
leaq 0xe84(%rip), %rdi       # 0x2012
pushq $0xa
popq %rsi
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/saulvargas[P]re-C-sys/test_ub.c
// Function: main
int main(int argc, char** argv) {
    FILE* user_data;
    FILE* item_data;
    int N_users;
    int N_items;
    int N_prefs;
    int binary;
    recdata_t* recdata;
    int uid;
    int i;
    similarity_t* similarity;
    recommender_t* recommender;
    idpairs_t* pairs;

    if (!read_args(argc, argv, &user_data, &item_data, &N_users, &N_items, &N_prefs, &binary)) {
        return EXIT_FAILURE;
    }

    recdata = recdata_simple_create(user_data, item_data, N_users, N_items, N_prefs, binary);
    
    fclose(user_data);
    fclose(item_data);

    if (!binary) {
        similarity = similarity_veccosine_create(recdata);
    } else {
        similarity = similarity_setcosine_create(recdata);
    }

    recommender = recommender_ub_create(recdata, similarity, 100, binary);

    for (uid = 0; uid < recdata->N_users; uid++) {
        pairs = recommender_recommend(recommender, uid, 100);

        for (i = 0; i < idpairs_size(pairs); i++) {
            printf("%d\t%d\t%.4f\n", uid, idpairs_keys(pairs)[i], idpairs_values(pairs)[i]);
        }
        
        idpairs_close_deep(pairs);
    }
 
    recommender_close(recommender);
 
    similarity_close(similarity);
    
    recdata_close(recdata);
    
    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x8(%rsp), %rax
leaq 0xc(%rsp), %r10
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rax
pushq %r10
callq 0x2498
popq %rcx
popq %rdx
testl %eax, %eax
je 0x128f
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x8(%rsp), %r9d
callq 0x1696
movq %rax, %r15
movq 0x28(%rsp), %rdi
callq 0x1060
movq 0x20(%rsp), %rdi
callq 0x1060
cmpl $0x0, 0x8(%rsp)
je 0x1297
movq %r15, %rdi
callq 0x192a
jmp 0x129f
pushq $0x1
popq %rax
jmp 0x1345
movq %r15, %rdi
callq 0x1bbd
movl 0x8(%rsp), %ecx
pushq $0x64
popq %rdx
movq %r15, %rdi
movq %rax, 0x30(%rsp)
movq %rax, %rsi
callq 0x2170
movq %rax, 0x18(%rsp)
xorl %r12d, %r12d
leaq 0x1d3f(%rip), %r13      # 0x3004
cmpl (%r15), %r12d
jge 0x1327
movq 0x18(%rsp), %rdi
movl %r12d, %esi
pushq $0x64
popq %rdx
callq 0x1f80
movq %rax, %r14
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x240f
cltq
cmpq %rax, %rbx
jge 0x131a
movq %r14, %rdi
callq 0x2412
movl (%rax,%rbx,4), %ebp
movq %r14, %rdi
callq 0x2417
movsd (%rax,%rbx,8), %xmm0
movq %r13, %rdi
movl %r12d, %esi
movl %ebp, %edx
movb $0x1, %al
callq 0x1080
incq %rbx
jmp 0x12df
movq %r14, %rdi
callq 0x23eb
incl %r12d
jmp 0x12c5
movq 0x18(%rsp), %rdi
callq 0x2051
movq 0x30(%rsp), %rdi
callq 0x17d8
movq %r15, %rdi
callq 0x138c
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yy_create_buffer
YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file , yyscanner);

	return b;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x40
popq %rdi
callq 0x34f0
testq %rax, %rax
je 0x5123
movq %rax, %r15
movl %ebp, 0x18(%rax)
addl $0x2, %ebp
movslq %ebp, %rdi
callq 0x34f0
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x5123
movl $0x1, 0x20(%r15)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x543f
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4488(%rip), %rdi      # 0x95b2
callq 0x5301
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yy_load_buffer_state
static void yy_load_buffer_state  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
	yyg->yy_hold_char = *yyg->yy_c_buf_p;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x28(%rdi), %rcx
movq (%rcx,%rax,8), %rdx
movl 0x1c(%rdx), %esi
movl %esi, 0x34(%rdi)
movq 0x10(%rdx), %rdx
movq %rdx, 0x40(%rdi)
movq %rdx, 0x80(%rdi)
movq (%rcx,%rax,8), %rax
movq (%rax), %rax
movq %rax, 0x8(%rdi)
movb (%rdx), %al
movb %al, 0x30(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: yy_get_previous_state
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
{
	yy_state_type yy_current_state;
	char *yy_cp;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	yy_current_state = yyg->yy_start;

	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
		{
		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			yyg->yy_last_accepting_state = yy_current_state;
			yyg->yy_last_accepting_cpos = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 158 )
				yy_c = yy_meta[yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
		}

	return yy_current_state;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x4c(%rdi), %eax
movq 0x80(%rdi), %rcx
movq 0x40(%rdi), %rdx
leaq 0x30ae(%rip), %rsi      # 0x83f0
leaq 0x37f7(%rip), %r8       # 0x8b40
leaq 0x31e0(%rip), %r9       # 0x8530
leaq 0x3b09(%rip), %r10      # 0x8e60
leaq 0x3952(%rip), %r11      # 0x8cb0
leaq 0x3abb(%rip), %rbx      # 0x8e20
leaq 0x2f84(%rip), %r14      # 0x82f0
cmpq %rdx, %rcx
jae 0x53c8
movzbl (%rcx), %r15d
testq %r15, %r15
je 0x5380
movb (%r15,%r14), %bpl
jmp 0x5383
movb $0x1, %bpl
movslq %eax, %r15
cmpw $0x0, (%rsi,%r15,2)
je 0x5395
movl %eax, 0x68(%rdi)
movq %rcx, 0x70(%rdi)
movzbl %bpl, %r15d
cltq
movswq (%r8,%rax,2), %r12
addq %r15, %r12
movswl (%r9,%r12,2), %ebp
cmpl %ebp, %eax
je 0x53be
movswl (%r11,%rax,2), %eax
cmpl $0x9e, %eax
jl 0x5399
movb (%r15,%rbx), %bpl
jmp 0x5395
movswl (%r10,%r12,2), %eax
incq %rcx
jmp 0x536c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yyrestart
void yyrestart  (FILE * input_file , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack (yyscanner);
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
	}

	yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
	yy_load_buffer_state( yyscanner );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0x53ef
movq 0x18(%rbx), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x541d
movq %rbx, %rdi
callq 0x503b
movq 0x8(%rbx), %rdi
movl $0x4000, %esi           # imm = 0x4000
movq %rbx, %rdx
callq 0x34d0
movq 0x18(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq %rax, (%rdx,%rcx,8)
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x5423
movq (%rax,%rcx,8), %rdi
jmp 0x5425
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x543f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x512f
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yy_switch_to_buffer
void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	/* TODO. We should be able to replace this entire function body
	 * with
	 *		yypop_buffer_state();
	 *		yypush_buffer_state(new_buffer);
     */
	yyensure_buffer_stack (yyscanner);
	if ( YY_CURRENT_BUFFER == new_buffer )
		return;

	if ( YY_CURRENT_BUFFER )
		{
		/* Flush out information for old buffer. */
		*yyg->yy_c_buf_p = yyg->yy_hold_char;
		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
		}

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	yy_load_buffer_state( yyscanner );

	/* We don't actually know whether we did this switch during
	 * EOF (yywrap()) processing, but the only time this flag
	 * is looked at is after yywrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	yyg->yy_did_buffer_switch_on_eof = 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x503b
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x5528
movq 0x18(%rbx), %rcx
movq (%rax,%rcx,8), %rdx
cmpq %r14, %rdx
je 0x5528
testq %rdx, %rdx
je 0x5515
movb 0x30(%rbx), %al
movq 0x40(%rbx), %rcx
movb %al, (%rcx)
movq 0x40(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq 0x28(%rbx), %rax
movq (%rax,%rcx,8), %rsi
movq %rdx, 0x10(%rsi)
movl 0x34(%rbx), %edx
movq (%rax,%rcx,8), %rsi
movl %edx, 0x1c(%rsi)
movq %r14, (%rax,%rcx,8)
movq %rbx, %rdi
callq 0x512f
movl $0x1, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yy_delete_buffer
void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	if ( ! b )
		return;

	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;

	if ( b->yy_is_our_buffer )
		yyfree( (void *) b->yy_ch_buf , yyscanner );

	yyfree( (void *) b , yyscanner );
}

// Assembly:
testq %rdi, %rdi
je 0x5551
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0x5552
movq 0x18(%rsi), %rcx
movq (%rax,%rcx,8), %rcx
jmp 0x5554
retq
xorl %ecx, %ecx
cmpq %rbx, %rcx
jne 0x5562
movq 0x18(%rsi), %rcx
andq $0x0, (%rax,%rcx,8)
cmpl $0x0, 0x20(%rbx)
je 0x5571
movq 0x8(%rbx), %rdi
callq 0x3050
movq %rbx, %rdi
popq %rbx
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yy_flush_buffer
void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if ( ! b )
		return;

	b->yy_n_chars = 0;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

	b->yy_buf_pos = &b->yy_ch_buf[0];

	b->yy_at_bol = 1;
	b->yy_buffer_status = YY_BUFFER_NEW;

	if ( b == YY_CURRENT_BUFFER )
		yy_load_buffer_state( yyscanner );
}

// Assembly:
testq %rdi, %rdi
je 0x55c0
andl $0x0, 0x1c(%rdi)
movq 0x8(%rdi), %rcx
xorl %eax, %eax
movb %al, (%rcx)
movq 0x8(%rdi), %rcx
movb %al, 0x1(%rcx)
movq 0x8(%rdi), %rcx
movq %rcx, 0x10(%rdi)
movl $0x1, 0x28(%rdi)
andl $0x0, 0x38(%rdi)
movq 0x28(%rsi), %rcx
testq %rcx, %rcx
je 0x55bb
movq 0x18(%rsi), %rax
movq (%rcx,%rax,8), %rax
cmpq %rdi, %rax
je 0x55c1
retq
movq %rsi, %rdi
jmp 0x512f
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yypush_buffer_state
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if (new_buffer == NULL)
		return;

	yyensure_buffer_stack(yyscanner);

	/* This block is copied from yy_switch_to_buffer. */
	if ( YY_CURRENT_BUFFER )
		{
		/* Flush out information for old buffer. */
		*yyg->yy_c_buf_p = yyg->yy_hold_char;
		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
		}

	/* Only push if top exists. Otherwise, replace top. */
	if (YY_CURRENT_BUFFER)
		yyg->yy_buffer_stack_top++;
	YY_CURRENT_BUFFER_LVALUE = new_buffer;

	/* copied from yy_switch_to_buffer. */
	yy_load_buffer_state( yyscanner );
	yyg->yy_did_buffer_switch_on_eof = 1;
}

// Assembly:
testq %rdi, %rdi
je 0x5637
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x503b
movq 0x18(%rbx), %rax
movq 0x28(%rbx), %rcx
cmpq $0x0, (%rcx,%rax,8)
je 0x561d
movb 0x30(%rbx), %al
movq 0x40(%rbx), %rcx
movb %al, (%rcx)
movq 0x40(%rbx), %rdx
movq 0x18(%rbx), %rax
movq 0x28(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %rdx, 0x10(%rsi)
movl 0x34(%rbx), %edx
movq (%rcx,%rax,8), %rsi
movl %edx, 0x1c(%rsi)
incq %rax
movq %rax, 0x18(%rbx)
movq %r14, (%rcx,%rax,8)
movq %rbx, %rdi
callq 0x512f
movl $0x1, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yypop_buffer_state
void yypop_buffer_state (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if (!YY_CURRENT_BUFFER)
		return;

	yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
	YY_CURRENT_BUFFER_LVALUE = NULL;
	if (yyg->yy_buffer_stack_top > 0)
		--yyg->yy_buffer_stack_top;

	if (YY_CURRENT_BUFFER) {
		yy_load_buffer_state( yyscanner );
		yyg->yy_did_buffer_switch_on_eof = 1;
	}
}

// Assembly:
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x5697
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rcx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x5696
movq %rbx, %rsi
callq 0x3280
movq 0x18(%rbx), %rax
movq 0x28(%rbx), %rcx
andq $0x0, (%rcx,%rax,8)
testq %rax, %rax
je 0x5675
decq %rax
movq %rax, 0x18(%rbx)
jmp 0x5677
xorl %eax, %eax
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x5696
cmpq $0x0, (%rcx,%rax,8)
je 0x5696
movq %rbx, %rdi
callq 0x512f
movl $0x1, 0x50(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/doy[P]libvt100/src/parser.c
// Function: vt100_parser_yylex_init_extra
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
    struct yyguts_t dummy_yyguts;

    yyset_extra (yy_user_defined, &dummy_yyguts);

    if (ptr_yy_globals == NULL){
        errno = EINVAL;
        return 1;
    }

    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );

    if (*ptr_yy_globals == NULL){
        errno = ENOMEM;
        return 1;
    }

    /* By setting to 0xAA, we expose bugs in
    yy_init_globals. Leave at 0x00 for releases. */
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));

    yyset_extra (yy_user_defined, *ptr_yy_globals);

    return yy_init_globals ( *ptr_yy_globals );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x58ec
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x1
popq %rdi
movl $0x90, %esi
callq 0x33b0
movq %rax, (%r14)
testq %rax, %rax
je 0x58f9
movq %rbx, (%rax)
xorl %eax, %eax
jmp 0x5907
callq 0x3080
movl $0x16, (%rax)
jmp 0x5904
callq 0x3080
movl $0xc, (%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq