LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: _fxstat
int
__fxstat(int v, int fd, struct stat *restrict buf)
{
	int r;
	static int (*o__fxstat)(int, int, struct stat *restrict) = 0;
	D;
	R(__fxstat);
	r = o__fxstat(v, fd, buf);
	if (!r)
		fdemit('q', fd);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movl %edi, %ebp
leaq 0x36b1(%rip), %rdi      # 0x61a0
leaq 0x1572(%rip), %rsi      # 0x4068
callq 0x23d6
movl %ebp, %edi
movl %ebx, %esi
movq %r14, %rdx
callq *0x3698(%rip)           # 0x61a0
movl %eax, %ebp
testl %eax, %eax
jne 0x2b18
pushq $0x71
popq %rdi
movl %ebx, %esi
callq 0x2595
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: _xstat
int
__xstat(int v, const char *restrict p, struct stat *restrict buf)
{
	int r;
	static int (*o__xstat)(
	    int, const char *restrict, struct stat *restrict) = 0;
	DP;
	R(__xstat);
	r = o__xstat(v, p, buf);
	if (!r)
		emit('q', p);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x3676(%rip), %rdi      # 0x61a8
leaq 0x1538(%rip), %rsi      # 0x4071
callq 0x23d6
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x365c(%rip)           # 0x61a8
movl %eax, %ebp
testl %eax, %eax
jne 0x2b5d
pushq $0x71
popq %rdi
movq %rbx, %rsi
callq 0x232e
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: _xlstat
int
__xlstat(int v, const char *restrict p, struct stat *restrict buf)
{
	int r;
	static int (*o__xlstat)(
	    int, const char *restrict, struct stat *restrict) = 0;
	DP;
	R(__xlstat);
	r = o__xlstat(v, p, buf);
	if (!r)
		emit('q', p);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x3639(%rip), %rdi      # 0x61b0
leaq 0x14fb(%rip), %rsi      # 0x4079
callq 0x23d6
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x361f(%rip)           # 0x61b0
movl %eax, %ebp
testl %eax, %eax
jne 0x2ba2
pushq $0x71
popq %rdi
movq %rbx, %rsi
callq 0x232e
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: _lxstat
int
__lxstat(int v, const char *restrict p, struct stat *restrict buf)
{
	int r;
	static int (*o__lxstat)(
	    int, const char *restrict, struct stat *restrict) = 0;
	DP;
	R(__lxstat);
	r = o__lxstat(v, p, buf);
	if (!r)
		emit('q', p);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x35fc(%rip), %rdi      # 0x61b8
leaq 0x14bf(%rip), %rsi      # 0x4082
callq 0x23d6
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x35e2(%rip)           # 0x61b8
movl %eax, %ebp
testl %eax, %eax
jne 0x2be7
pushq $0x71
popq %rdi
movq %rbx, %rsi
callq 0x232e
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: _fxstatat
int
__fxstatat(int v, int fd, const char *p, struct stat *buf, int flag)
{
	int r;
	DP;
	static int (*o__fxstatat)(
	    int, int, const char *, struct stat *restrict, int) = 0;
	R(__fxstatat);
	r = o__fxstatat(v, fd, p, buf, flag);
	if (!r)
		atemit('q', fd, p, NULL);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r12d
leaq 0x35b5(%rip), %rdi      # 0x61c0
leaq 0x1479(%rip), %rsi      # 0x408b
callq 0x23d6
movl %r12d, %edi
movl %ebp, %esi
movq %rbx, %rdx
movq %r15, %rcx
movl %r14d, %r8d
callq *0x3595(%rip)           # 0x61c0
movl %eax, %r14d
testl %eax, %eax
jne 0x2c41
pushq $0x71
popq %rdi
movl %ebp, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x284b
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: utimensat
int
utimensat(int fd, const char *p, const struct timespec ts[2], int flags)
{
	int r;
	static int (*outimensat)(
	    int, const char *, const struct timespec[2], int);
	DP;
	R(utimensat);
	r = outimensat(fd, p, ts, flags);
	if (!r)
		atemit('t', fd, p, NULL);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x3562(%rip), %rdi      # 0x61c8
leaq 0x1429(%rip), %rsi      # 0x4096
callq 0x23d6
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
movl %r14d, %ecx
callq *0x3545(%rip)           # 0x61c8
movl %eax, %r14d
testl %eax, %eax
jne 0x2c99
pushq $0x74
popq %rdi
movl %ebp, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x284b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: futimens
int
futimens(int fd, const struct timespec ts[2])
{
	int r;
	static int (*ofutimens)(int, const struct timespec[2]);
	D;
	R(futimens);
	r = ofutimens(fd, ts);
	if (!r)
		fdemit('t', fd);
	DD;
	return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
leaq 0x3519(%rip), %rdi      # 0x61d0
leaq 0x13e2(%rip), %rsi      # 0x40a0
callq 0x23d6
movl %ebx, %edi
movq %r14, %rsi
callq *0x3502(%rip)           # 0x61d0
movl %eax, %ebp
testl %eax, %eax
jne 0x2cde
pushq $0x74
popq %rdi
movl %ebx, %esi
callq 0x2595
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/unix/fsatraceso.c
// Function: fdpath
static int
fdpath(int fd, char *ap, size_t sz)
{
	int ok;
#ifdef F_GETPATH
	ok = -1 != fcntl(fd, F_GETPATH, ap);
#else
	ssize_t written;
	char	fdp[100];
	snprintf(fdp, sizeof(fdp), "/proc/self/fd/%d", fd);
	ap[0] = 0;
	written = readlink(fdp, ap, sz);
	ok = written >= 0 && written < sz;
	if (ok)
		ap[written] = 0;
#endif
	if (!ok)
		ap[0] = 0;
	return ok;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movl %edi, %ecx
leaq 0x13eb(%rip), %rdx      # 0x40e5
xorl %r15d, %r15d
movq %rsp, %r14
pushq $0x64
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2100
movb %r15b, (%rbx)
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20a0
xorl %ecx, %ecx
cmpq $0x1000, %rax           # imm = 0x1000
setb %cl
movl $0x0, %edx
cmovbq %rax, %rdx
movb %r15b, (%rbx,%rdx)
movl %ecx, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/emit.c
// Function: emitInit
static const char *
mygetenv(const char *v)
{
	const char *out = getenv(v);
	if (!out) {
		extern char **environ;
		size_t	      l = strlen(v);
		char **	      p = environ;
		while (*p) {
			char *s = *p;
			if (0 == strncmp(s, v, l)) {
				if (s[l] == '=') {
					out = s + l + 1;
					break;
				}
			}
			p++;
		}
	}
#ifdef _WIN32
	// Workaround, bash distributed with ghc 8.6.5 seems to discard most
	// environment variables, pass environment variables as the first few
	// PATH components.
	if (!out) {
		const char *path = getenv("PATH");
		if (strcmp(v, ENVOUT) == 0) {
			static char buf[PATH_MAX];
			unsigned    i = 0;
			unsigned    j = 0;
			while (path[i] != ';')
				buf[j++] = path[i++];
			buf[j] = 0;
			out = buf;
		}
	}
#endif
	return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x13a5(%rip), %rdi      # 0x40f8
callq 0x2030
movq %rax, %rbx
testq %rax, %rax
jne 0x2da0
movq 0x3279(%rip), %rax      # 0x5fe0
movq (%rax), %r12
leaq 0x1387(%rip), %r14      # 0x40f8
pushq $0x8
popq %r15
movq (%r12), %rbx
testq %rbx, %rbx
je 0x2dcb
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2060
testl %eax, %eax
jne 0x2d96
cmpb $0x3d, 0x8(%rbx)
je 0x2d9c
addq $0x8, %r12
jmp 0x2d75
addq $0x9, %rbx
cmpq $0x0, 0x3438(%rip)      # 0x61e0
jne 0x2de8
leaq 0x342f(%rip), %rdi      # 0x61e0
movl $0x1000000, %edx        # imm = 0x1000000
movq %rbx, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2080
leaq 0x132f(%rip), %rdi      # 0x4101
leaq 0x132c(%rip), %rsi      # 0x4105
leaq 0x1330(%rip), %rcx      # 0x4110
pushq $0x3b
popq %rdx
callq 0x2130
leaq 0x1330(%rip), %rdi      # 0x411f
leaq 0x130f(%rip), %rsi      # 0x4105
leaq 0x1313(%rip), %rcx      # 0x4110
pushq $0x3c
jmp 0x2de2
// File: /workspace/github_c_makefile_star2_O2/jacereda[P]fsatrace/src/emit.c
// Function: emitOp
void
emitOp(int oc, const char *op1, const char *p2)
{
	char *	    dst = shm.buf + 4 + 256;
	char *	    opts = shm.buf + 4;
	uint32_t *  psofar = (uint32_t *)shm.buf;
	uint32_t    sofar;
	uint32_t    sz;
	uint32_t    s1;
	uint32_t    s2;
	char *	    p;
	const char *p1;
	int	    c;
	if (!shm.buf || !opts[tolower(oc)])
		return;
	p1 = op1 ? op1 : "<unknown>";
	c = op1 ? oc : toupper(oc);
	s1 = strlen(p1);
	sz = s1 + 3;
	if (p2) {
		s2 = strlen(p2);
		sz += s2 + 1;
	}
	sofar = __sync_fetch_and_add(psofar, sz);
	p = dst + sofar;
	*p++ = c;
	*p++ = '|';
	memcpy(p, p1, s1);
	p += s1;
	if (p2) {
		*p++ = '|';
		memcpy(p, p2, s2);
		p += s2;
	}
	*p++ = '\n';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x33b1(%rip), %r13      # 0x61e0
testq %r13, %r13
je 0x2f06
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %ebp
callq 0x21a0
cltq
cmpb $0x0, 0x4(%r13,%rax)
je 0x2f06
leaq 0x12ce(%rip), %r14      # 0x4128
testq %r15, %r15
cmovneq %r15, %r14
jne 0x2e6c
movl %ebp, %edi
callq 0x2090
movl %eax, %ebp
leaq 0x104(%r13), %r15
movq %r14, %rdi
callq 0x20d0
movq %rax, %r12
testq %rbx, %rbx
je 0x2e9a
movq %rbx, %rdi
callq 0x20d0
leal (%r12,%rax), %ecx
addl $0x4, %ecx
movl %eax, %eax
movq %rax, (%rsp)
jmp 0x2ea8
movl %r12d, %ecx
addl $0x3, %ecx
movq $0x0, (%rsp)
lock
xaddl %ecx, (%r13)
movb %bpl, 0x104(%r13,%rcx)
leaq (%r15,%rcx), %rdi
addq $0x2, %rdi
addq %rcx, %r15
movb $0x7c, 0x105(%r13,%rcx)
movl %r12d, %r12d
movq %r14, %rsi
movq %r12, %rdx
callq 0x2190
leaq (%r12,%r15), %r14
addq $0x2, %r14
testq %rbx, %rbx
je 0x2f02
leaq 0x1(%r14), %rdi
movb $0x7c, (%r14)
movq %rbx, %rsi
movq (%rsp), %rbx
movq %rbx, %rdx
callq 0x2190
addq %rbx, %r14
incq %r14
movb $0xa, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/write1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char buf[BUFLEN];
	char tmpfile[] = "/tmp/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);
	unsigned long size = 0;

	memset(buf, 0, sizeof(buf));
	assert(fd >= 0);
	unlink(tmpfile);

	while (1) {
		int ret = write(fd, buf, BUFLEN);
		assert(ret >= 0);
		size += ret;
		if (size >= FILESIZE) {
			size = 0;
			lseek(fd, 0, SEEK_SET);
		}

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rdi, %rbx
movaps 0x789(%rip), %xmm0      # 0x32d0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%rdi)
callq 0x21d0
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x2140
testl %ebp, %ebp
js 0x2bd8
movq %rsp, %rdi
callq 0x2080
xorl %r15d, %r15d
leaq 0x20(%rsp), %r14
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x20d0
testl %eax, %eax
js 0x2bbf
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %r15, %rax
cmpq $0x100000, %rax         # imm = 0x100000
jb 0x2bb7
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2120
xorl %eax, %eax
incq (%rbx)
movq %rax, %r15
jmp 0x2b87
leaq 0x700(%rip), %rdi       # 0x32c6
leaq 0x6b7(%rip), %rsi       # 0x3284
leaq 0x6bf(%rip), %rcx       # 0x3293
pushq $0x19
jmp 0x2bef
leaq 0x69d(%rip), %rdi       # 0x327c
leaq 0x69e(%rip), %rsi       # 0x3284
leaq 0x6a6(%rip), %rcx       # 0x3293
pushq $0x14
popq %rdx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/GCcompFinder.c
// Function: main
int main(int argc, char **argv){
  
  if (argc < 4) {
    printf("Usage: %s assemblyFile.fasta runningWindow output\n(C) 2011 Scott Clark\nFinds the running window GC content in a fasta file\nJust sequence! No gene name/info!\n", argv[0]);
    return 0;
  }
  
  // attempt to open the first input file
  FILE *ins = fopen(argv[argc - 3], "r");
  if(ins == NULL){
      printf("Error! Could not open the first input file: %s\n", argv[argc - 3]);
      return 1;
  }
  
  // attempt to open the output file
  FILE *fout = fopen(argv[argc - 1], "w");
  if(fout == NULL){
      printf("Error! Could not open the output file: %s\n", argv[argc - 1]);
      return 1;
  }
  
  int runningWindow = atoi(argv[argc - 2]);
  int i;
  char base;
  char *backTrace = malloc(sizeof(char)*runningWindow);
  int gcTot = 0;
  int keepGoing;
  
  for(i = 0; i < runningWindow; i++){
    keepGoing = fscanf(ins, "%c", &base);
//     if(base == '\0' || base == '\n'){
//       i--;
//     }
    backTrace[i] = base;
    if(base == 'G' || base == 'g' || base == 'C' || base == 'c'){
      gcTot++;
    }
  }
  
  printf("%f\n", (float)gcTot/((float)runningWindow));
  
  while(keepGoing > 0){
    keepGoing = fscanf(ins, "%c", &base);
    if(base == '\0' || base == '\n'){
      i--;
    }
    if(base == 'G' || base == 'g' || base == 'C' || base == 'c'){
      gcTot++;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
cmpl $0x3, %edi
jg 0x1197
movq (%r14), %rsi
leaq 0xe7b(%rip), %rdi       # 0x2004
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
jmp 0x129e
movl %edi, %r15d
movq -0x18(%r14,%r15,8), %rdi
leaq 0xefc(%rip), %rsi       # 0x20a2
callq 0x1050
testq %rax, %rax
je 0x127a
movq %rax, %rbx
movq -0x8(%r14,%r15,8), %rdi
leaq 0xf11(%rip), %rsi       # 0x20d4
callq 0x1050
testq %rax, %rax
je 0x1288
movq -0x10(%r14,%r15,8), %rdi
callq 0x1060
testl %eax, %eax
movl $0x0, %r13d
movl %eax, 0x4(%rsp)
cmovgl %eax, %r13d
leaq 0xf0f(%rip), %r15       # 0x2101
leaq 0x3(%rsp), %r12
xorl %r14d, %r14d
subl $0x1, %r13d
jb 0x1231
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
movl %eax, %ebp
movb 0x3(%rsp), %al
addb $-0x43, %al
rolb $0x6, %al
cmpb $0x9, %al
ja 0x11fa
movzbl %al, %eax
movl $0x303, %ecx            # imm = 0x303
btl %eax, %ecx
jae 0x11fa
incl %r14d
jmp 0x11fa
cvtsi2ss %r14d, %xmm0
cvtsi2ssl 0x4(%rsp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xeb9(%rip), %rdi       # 0x2104
movb $0x1, %al
callq 0x1040
leaq 0xea8(%rip), %r14       # 0x2101
leaq 0x3(%rsp), %r15
testl %ebp, %ebp
jle 0x1276
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1030
movl %eax, %ebp
jmp 0x125e
xorl %ebx, %ebx
jmp 0x129e
movq -0x18(%r14,%r15,8), %rsi
leaq 0xe1e(%rip), %rdi       # 0x20a4
jmp 0x1294
movq -0x8(%r14,%r15,8), %rsi
leaq 0xe42(%rip), %rdi       # 0x20d6
xorl %eax, %eax
callq 0x1040
pushq $0x1
popq %rbx
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/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: get_size
int get_size (MPI_Datatype t) {
   if (t == MPI_BYTE) return sizeof(char);
   if (t == MPI_DOUBLE) return sizeof(double);
   if (t == MPI_FLOAT) return sizeof(float);
   if (t == MPI_INT) return sizeof(int);
   printf ("Error: Unrecognized argument to 'get_size'\n");
   fflush (stdout);
   MPI_Abort (MPI_COMM_WORLD, TYPE_ERROR);
	return -1;  // WMJ 
}

// Assembly:
cmpq 0x448d(%rip), %rdi      # 0x5ff0
je 0x1b8a
cmpq 0x4464(%rip), %rdi      # 0x5fd0
je 0x1b8e
cmpq 0x446b(%rip), %rdi      # 0x5fe0
sete %al
cmpq 0x4429(%rip), %rdi      # 0x5fa8
sete %cl
orb %al, %cl
je 0x1b92
pushq $0x4
jmp 0x1b90
pushq $0x1
jmp 0x1b90
pushq $0x8
popq %rax
retq
pushq %rax
leaq 0x2626(%rip), %rdi      # 0x41c0
callq 0x1060
movq 0x4452(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
callq 0x1240
movq 0x4423(%rip), %rdi      # 0x5fd8
pushq $-0x3
popq %rsi
callq 0x1120
pushq $-0x1
popq %rax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: my_malloc
void *my_malloc (
   int id,     /* IN - Process rank */
   int bytes)  /* IN - Bytes to allocate */
{
   void *buffer;
   if ((buffer = malloc ((size_t) bytes)) == NULL) {
      printf ("Error: Malloc failed for process %d\n", id);
      fflush (stdout);
      MPI_Abort (MPI_COMM_WORLD, MALLOC_ERROR);
   }
   return buffer;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movslq %esi, %rdi
callq 0x10b0
movq %rax, %rbx
testq %rax, %rax
jne 0x1c08
leaq 0x2561(%rip), %rdi      # 0x4142
movl %ebp, %esi
xorl %eax, %eax
callq 0x1050
movq 0x4407(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
callq 0x1240
movq 0x43d8(%rip), %rdi      # 0x5fd8
pushq $-0x2
popq %rsi
callq 0x1120
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: terminate
void terminate (
   int   id,            /* IN - Process rank */
   char *error_message) /* IN - Message to print */
{
   if (!id) {
      printf ("Error: %s\n", error_message);
      fflush (stdout);
   }
   MPI_Finalize();
   exit (-1);
}

// Assembly:
pushq %rax
testl %edi, %edi
jne 0x1c34
leaq 0x2549(%rip), %rdi      # 0x4167
xorl %eax, %eax
callq 0x1050
movq 0x43cc(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
callq 0x1240
callq 0x1190
pushq $-0x1
popq %rdi
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: create_mixed_xfer_arrays
void create_mixed_xfer_arrays (
   int id,       /* IN - Process rank */
   int p,        /* IN - Number of processes */
   int n,        /* IN - Total number of elements */
   int **count,  /* OUT - Array of counts */
   int **disp)   /* OUT - Array of displacements */
{

   int i;

   *count = my_malloc (id, p * sizeof(int));
   *disp = my_malloc (id, p * sizeof(int));
   (*count)[0] = BLOCK_SIZE(0,p,n);
   (*disp)[0] = 0;
   for (i = 1; i < p; i++) {
      (*disp)[i] = (*disp)[i-1] + (*count)[i-1];
      (*count)[i] = BLOCK_SIZE(i,p,n);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebx
movl %esi, %r14d
movl %edi, %ebp
leal (,%r14,4), %r13d
movl %r13d, %esi
callq 0x1bc5
movq %rax, (%r12)
movl %ebp, %edi
movl %r13d, %esi
callq 0x1bc5
movq %rax, %rcx
movq %rax, (%r15)
movl %ebx, %eax
cltd
idivl %r14d
movq (%r12), %r9
movl %eax, (%r9)
andl $0x0, (%rcx)
movslq %r14d, %r10
leal (%rbx,%rbx), %esi
pushq $0x1
popq %r11
movl %ebx, %edi
cmpq %r10, %r11
jge 0x1ccb
movl -0x4(%r9,%r11,4), %eax
addl -0x4(%rcx,%r11,4), %eax
movl %eax, (%rcx,%r11,4)
movl %esi, %eax
cltd
idivl %r14d
movl %eax, %r8d
movl %edi, %eax
cltd
idivl %r14d
subl %eax, %r8d
movl %r8d, (%r9,%r11,4)
incq %r11
addl %ebx, %edi
addl %ebx, %esi
jmp 0x1c99
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: create_uniform_xfer_arrays
void create_uniform_xfer_arrays (
   int id,        /* IN - Process rank */
   int p,         /* IN - Number of processes */
   int n,         /* IN - Number of elements */
   int **count,   /* OUT - Array of counts */
   int **disp)    /* OUT - Array of displacements */
{

   int i;

   *count = my_malloc (id, p * sizeof(int));
   *disp = my_malloc (id, p * sizeof(int));
   (*count)[0] = BLOCK_SIZE(id,p,n);
   (*disp)[0] = 0;
   for (i = 1; i < p; i++) {
      (*disp)[i] = (*disp)[i-1] + (*count)[i-1];
      (*count)[i] = BLOCK_SIZE(id,p,n);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %ebx
movl %edi, %r12d
leal (,%rbx,4), %r13d
movl %r13d, %esi
callq 0x1bc5
movq %rax, (%r14)
movl %r12d, %edi
movl %r13d, %esi
callq 0x1bc5
movq %rax, %rcx
movq %rax, (%r15)
leal 0x1(%r12), %eax
imull %ebp, %eax
cltd
idivl %ebx
movl %eax, %esi
imull %r12d, %ebp
movl %ebp, %eax
cltd
idivl %ebx
subl %eax, %esi
movq (%r14), %rax
movl %esi, (%rax)
andl $0x0, (%rcx)
movslq %ebx, %rdx
pushq $0x1
popq %rdi
cmpq %rdx, %rdi
jge 0x1d57
movl -0x4(%rax,%rdi,4), %r8d
addl -0x4(%rcx,%rdi,4), %r8d
movl %r8d, (%rcx,%rdi,4)
movl %esi, (%rax,%rdi,4)
incq %rdi
jmp 0x1d3c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: replicate_block_vector
void replicate_block_vector (
   void        *ablock,  /* IN - Block-distributed vector */
   int          n,       /* IN - Elements in vector */
   void        *arep,    /* OUT - Replicated vector */
   MPI_Datatype dtype,   /* IN - Element type */
   MPI_Comm     comm)    /* IN - Communicator */
{
   int *cnt;  /* Elements contributed by each process */
   int *disp; /* Displacement in concatenated array */
   int id;    /* Process id */
   int p;     /* Processes in communicator */

   MPI_Comm_size (comm, &p);
   MPI_Comm_rank (comm, &id);
   create_mixed_xfer_arrays (id, p, n, &cnt, &disp);
   MPI_Allgatherv (ablock, cnt[id], dtype, arep, cnt,
                   disp, dtype, comm);
   free (cnt);
   free (disp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, (%rsp)
leaq 0x10(%rsp), %r13
movq %r8, %rdi
movq %r13, %rsi
callq 0x1100
leaq 0x14(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1170
movl (%r15), %edi
movl (%r13), %esi
leaq 0x20(%rsp), %r13
leaq 0x18(%rsp), %r12
movl %ebp, %edx
movq %r13, %rcx
movq %r12, %r8
callq 0x1c41
movq (%r13), %r13
movslq (%r15), %rax
movl (%r13,%rax,4), %esi
movq (%r12), %r15
movq (%rsp), %rdi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r13, %r8
movq %r15, %r9
pushq %r14
pushq %rbx
callq 0x1210
popq %rcx
popq %rdx
movq %r13, %rdi
callq 0x10f0
movq %r15, %rdi
callq 0x10f0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: read_replicated_vector
void read_replicated_vector (
   char        *s,      /* IN - File name */
   void       **v,      /* OUT - Vector */
   MPI_Datatype dtype,  /* IN - Vector type */
   int         *n,      /* OUT - Vector length */
   MPI_Comm     comm)   /* IN - Communicator */
{
   int        datum_size; /* Bytes per vector element */
   // WMJ int        i;
   int        id;         /* Process rank */
   FILE      *infileptr;  /* Input file pointer */
   int        p;          /* Number of processes */

   MPI_Comm_rank (comm, &id);
   MPI_Comm_size (comm, &p);
   datum_size = get_size (dtype);
   if (id == (p-1)) {
      infileptr = fopen (s, "r");
      if (infileptr == NULL) *n = 0;
      else fread (n, sizeof(int), 1, infileptr);
   }
   MPI_Bcast (n, 1, MPI_INT, p-1, MPI_COMM_WORLD);
   if (! *n) terminate (id, "Cannot open vector file");

   *v = my_malloc (id, *n * datum_size);

   if (id == (p-1)) {
      fread (*v, datum_size, *n, infileptr);
      fclose (infileptr);
   }
   MPI_Bcast (*v, *n, dtype, p-1, MPI_COMM_WORLD);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %rbp
movq %rsi, 0x8(%rsp)
movq %rdi, %r13
leaq 0x4(%rsp), %r15
movq %r8, %rdi
movq %r15, %rsi
callq 0x1170
movq %rsp, %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1100
movq %rbp, 0x10(%rsp)
movq %rbp, %rdi
callq 0x1b5c
movl %eax, %ebp
movl (%rbx), %eax
decl %eax
cmpl %eax, (%r15)
jne 0x2956
leaq 0x1846(%rip), %rsi      # 0x4172
movq %r13, %rdi
callq 0x10c0
testq %rax, %rax
je 0x294f
movq %rax, %r12
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rax, %rcx
callq 0x1160
jmp 0x2956
andl $0x0, (%r14)
xorl %r12d, %r12d
movl (%rsp), %ecx
decl %ecx
movq 0x3646(%rip), %rdx      # 0x5fa8
movq 0x366f(%rip), %r8       # 0x5fd8
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x1180
movl (%r14), %esi
movl 0x4(%rsp), %edi
testl %esi, %esi
je 0x29de
imull %ebp, %esi
callq 0x1bc5
movq %rax, %rdi
movq 0x8(%rsp), %rbx
movq %rax, (%rbx)
movl (%rsp), %ecx
decl %ecx
cmpl %ecx, 0x4(%rsp)
jne 0x29bb
movslq %ebp, %rsi
movslq (%r14), %rdx
movq %r12, %rcx
callq 0x1160
movq %r12, %rdi
callq 0x11c0
movq (%rbx), %rdi
movl (%rsp), %ecx
decl %ecx
movl (%r14), %esi
movq 0x3613(%rip), %r8       # 0x5fd8
movq 0x10(%rsp), %rdx
callq 0x1180
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17b1(%rip), %rsi      # 0x4196
callq 0x1c12
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: print_submatrix
void print_submatrix (
   void       **a,       /* OUT - Doubly-subscripted array */
   MPI_Datatype dtype,   /* OUT - Type of array elements */
   int          rows,    /* OUT - Matrix rows */
   int          cols)    /* OUT - Matrix cols */
{
   int i, j;

   for (i = 0; i < rows; i++) {
      for (j = 0; j < cols; j++) {
         if (dtype == MPI_DOUBLE)
            printf ("%6.3f ", ((double **)a)[i][j]);
         else {
            if (dtype == MPI_FLOAT)
               printf ("%6.3f ", ((float **)a)[i][j]);
            else if (dtype == MPI_INT)
               printf ("%6d ", ((int **)a)[i][j]);
         }
      }
      putchar ('\n');
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ebx
movq %rsi, %r15
testl %edx, %edx
cmovlel %eax, %edx
movq %rdx, (%rsp)
movq %rdi, %r12
movq 0x35bc(%rip), %r14      # 0x5fd0
xorl %r13d, %r13d
cmpq (%rsp), %r13
je 0x2a86
xorl %ebp, %ebp
cmpq %rbp, %rbx
je 0x2a79
cmpq %r14, %r15
je 0x2a52
cmpq 0x35b0(%rip), %r15      # 0x5fe0
je 0x2a5d
cmpq 0x356f(%rip), %r15      # 0x5fa8
jne 0x2a74
movq (%r12,%r13,8), %rax
movl (%rax,%rbp,4), %esi
leaq 0x176c(%rip), %rdi      # 0x41b5
xorl %eax, %eax
callq 0x1050
jmp 0x2a74
movq (%r12,%r13,8), %rax
movsd (%rax,%rbp,8), %xmm0
jmp 0x2a66
movq (%r12,%r13,8), %rax
cvtss2sd (%rax,%rbp,4), %xmm0
leaq 0x1741(%rip), %rdi      # 0x41ae
movb $0x1, %al
callq 0x1050
incq %rbp
jmp 0x2a1f
pushq $0xa
popq %rdi
callq 0x1090
incq %r13
jmp 0x2a17
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: print_subvector
void print_subvector (
   void        *a,       /* IN - Array pointer */
   MPI_Datatype dtype,   /* IN - Array type */
   int          n)       /* IN - Array size */
{
   int i;

   for (i = 0; i < n; i++) {
      if (dtype == MPI_DOUBLE)
         printf ("%6.3f ", ((double *)a)[i]);
      else {
         if (dtype == MPI_FLOAT)
            printf ("%6.3f ", ((float *)a)[i]);
         else if (dtype == MPI_INT)
            printf ("%6d \n", ((int *)a)[i]); // WMJ added /n
      }
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %ebx
movq 0x351a(%rip), %rbp      # 0x5fd0
movq 0x3523(%rip), %r13      # 0x5fe0
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x2b0d
cmpq %rbp, %r14
je 0x2aec
cmpq %r13, %r14
je 0x2af4
cmpq 0x34d2(%rip), %r14      # 0x5fa8
jne 0x2b08
movl (%r15,%r12,4), %esi
leaq 0x16d7(%rip), %rdi      # 0x41ba
xorl %eax, %eax
callq 0x1050
jmp 0x2b08
movsd (%r15,%r12,8), %xmm0
jmp 0x2afa
cvtss2sd (%r15,%r12,4), %xmm0
leaq 0x16ad(%rip), %rdi      # 0x41ae
movb $0x1, %al
callq 0x1050
incq %r12
jmp 0x2ac0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: print_col_striped_matrix
void print_col_striped_matrix (
   void       **a,       /* IN - 2D array */
   MPI_Datatype dtype,   /* IN - Type of matrix elements */
   int          m,       /* IN - Matrix rows */
   int          n,       /* IN - Matrix cols */
   MPI_Comm     comm)    /* IN - Communicator */
{
   // WMJ MPI_Status status;     /* Result of receive */
   int        datum_size; /* Bytes per matrix element */
   void      *buffer;     /* Enough room to hold 1 row */
   int        i; //  WMJ , j;
   int        id;         /* Process rank */
   int        p;          /* Number of processes */
   int*       rec_count;  /* Elements received per proc */
   int*       rec_disp;   /* Offset of each proc's block */

   MPI_Comm_rank (comm, &id);
   MPI_Comm_size (comm, &p);
   datum_size = get_size (dtype);
   create_mixed_xfer_arrays (id, p, n, &rec_count,&rec_disp);

   if (!id)
      buffer = my_malloc (id, n*datum_size);

   for (i = 0; i < m; i++) {
      MPI_Gatherv (a[i], BLOCK_SIZE(id,p,n), dtype, buffer,
         rec_count, rec_disp, dtype, 0, MPI_COMM_WORLD);
      if (!id) {
         print_subvector (buffer, dtype, n);
         putchar ('\n');
      }
   }
   free (rec_count);
   free (rec_disp);
   if (!id) {
      free (buffer);
      putchar ('\n');
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r12
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
movq %rsp, %rsi
movq %r8, %rdi
callq 0x1170
leaq 0x4(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x1100
movq %r15, %rdi
callq 0x1b5c
movl %eax, %r14d
movq %rsp, %r12
movl (%r12), %edi
movl (%r13), %esi
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
movl %ebx, %edx
callq 0x1c41
cmpl $0x0, (%r12)
jne 0x2de9
imull %ebx, %r14d
xorl %edi, %edi
movl %r14d, %esi
callq 0x1bc5
movq %rax, %r13
movq 0x20(%rsp), %r12
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
testl %ebp, %ebp
cmovlel %r14d, %ebp
cmpq %r14, %rbp
je 0x2e73
movq 0x10(%rsp), %rax
movq (%rax,%r14,8), %rdi
movl (%rsp), %ecx
leal 0x1(%rcx), %eax
imull %ebx, %eax
movl 0x4(%rsp), %r8d
cltd
idivl %r8d
movl %eax, %esi
imull %ebx, %ecx
movl %ecx, %eax
cltd
idivl %r8d
subl %eax, %esi
subq $0x8, %rsp
movq %r15, %rdx
movq %r13, %rcx
movq %r12, %r8
movq 0x10(%rsp), %r9
pushq 0x3192(%rip)            # 0x5fd8
pushq $0x0
pushq %r15
callq 0x1200
addq $0x20, %rsp
cmpl $0x0, (%rsp)
jne 0x2e6e
movq %r13, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x2a95
pushq $0xa
popq %rdi
callq 0x1090
incq %r14
jmp 0x2e01
movq %r12, %rdi
callq 0x10f0
movq 0x8(%rsp), %rdi
callq 0x10f0
cmpl $0x0, (%rsp)
jne 0x2e9b
movq %r13, %rdi
callq 0x10f0
pushq $0xa
popq %rdi
callq 0x1090
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: print_replicated_vector
void print_replicated_vector (
   void        *v,      /* IN - Address of vector */
   MPI_Datatype dtype,  /* IN - Vector element type */
   int          n,      /* IN - Elements in vector */
   MPI_Comm     comm)   /* IN - Communicator */
{
   int id;              /* Process rank */

   MPI_Comm_rank (comm, &id);
   
   if (!id) {
      print_subvector (v, dtype, n);
      printf ("\n\n");
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4(%rsp), %r12
movq %rcx, %rdi
movq %r12, %rsi
callq 0x1170
cmpl $0x0, (%r12)
jne 0x32ea
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x2a95
leaq 0xed9(%rip), %rdi       # 0x41be
callq 0x1060
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/8-Synchronization/pthread_race_condition.c
// Function: do_your_job
void *do_your_job(void *input)
{
	int number = *((int *) input);
	int i = 0;

	printf("Thread %d: starts execution.\n", number);

	while(1)
	{

		if(shared < max)		// the shared counter
		{
			shared++;		// writing shared variables
			i++;
			printf("Thread %d: shared = %d.\n", number, shared);
		}
		else
		{
			break;
		}

		sleep(rand() % 2);	// forced context switching
	}

	printf("Thread %d: termination: I'm responsible for %d updates.\n", number, i);

	pthread_exit(0);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %ebx
leaq 0xde8(%rip), %rdi       # 0x2004
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
leaq 0xdf6(%rip), %r14       # 0x2022
pushq $0x2
popq %r15
xorl %ebp, %ebp
movl 0x2e90(%rip), %edx      # 0x40c8
cmpl 0x2e8e(%rip), %edx      # 0x40cc
jge 0x1268
incl %edx
movl %edx, 0x2e80(%rip)      # 0x40c8
incl %ebp
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
callq 0x1100
cltd
idivl %r15d
movl %edx, %edi
callq 0x10f0
jmp 0x1232
leaq 0xdcc(%rip), %rdi       # 0x203b
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1030
xorl %edi, %edi
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/8-Synchronization/pthread_race_condition.c
// Function: main
int main(int argc, char *argv[])
{
	pthread_t *tid;		/* the thread identifiers */
	int thread_num;		/* the total number of threads created */
	int *id, i;

	if(argc != 3)
	{
		fprintf(stderr, "usage: %s [max value] [num of threads]\n", argv[0]);
		exit(1);
	}

	if(atoi(argv[1]) < 0)
	{
		fprintf(stderr, "1st argument must be non-negative\n");
		exit(1);
	}

	if(atoi(argv[2]) < 0)
	{
		fprintf(stderr, "Second argument must be > 0\n");
		exit(1);
	}

/* variable initialization */

	srand(time(NULL));
	max = atoi(argv[1]);
	thread_num = atoi(argv[2]);

	printf("Number of threads created = %d\n", thread_num);
	if( (tid = (pthread_t *) malloc(sizeof(pthread_t) * thread_num)) == NULL)
	{
		perror("malloc()");
		exit(1);
	}

	if( (id = (int *) malloc(sizeof(int) * thread_num)) == NULL)
	{
		perror("malloc()");
		exit(1);
	}

/* create the threads */

	for(i = 0; i < thread_num; i++)
	{
		id[i] = i;
		if(pthread_create(&tid[i], NULL, do_your_job, &id[i]) != 0)
		{
			perror("pthread_create");
			exit(0);
		}
	}

/* now wait for the thread to exit */

	for(i = 0; i < thread_num; i++)
		pthread_join(tid[i], NULL);

/* free the memory */


	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x3, %edi
jne 0x13a4
movq 0x8(%rbx), %rdi
callq 0x10b0
testl %eax, %eax
js 0x13c1
movq 0x10(%rbx), %rdi
callq 0x10b0
testl %eax, %eax
js 0x13d6
xorl %edi, %edi
callq 0x1060
movl %eax, %edi
callq 0x1040
movq 0x8(%rbx), %rdi
callq 0x10b0
movl %eax, 0x2df5(%rip)      # 0x40cc
movq 0x10(%rbx), %rdi
callq 0x10b0
movl %eax, %ebx
leaq 0xdf3(%rip), %rdi       # 0x20dc
movl %eax, %esi
xorl %eax, %eax
callq 0x1030
movslq %ebx, %r15
leaq (,%r15,8), %rdi
callq 0x1080
testq %rax, %rax
je 0x1396
movq %rax, %r14
shlq $0x2, %r15
movq %r15, %rdi
callq 0x1080
testq %rax, %rax
je 0x1396
movq %rax, %r15
xorl %ebp, %ebp
testl %ebx, %ebx
cmovlel %ebp, %ebx
leaq -0x124(%rip), %r12      # 0x120c
movq %r14, %r13
cmpq %rbp, %rbx
je 0x136d
movl %ebp, (%r15)
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1090
incq %rbp
addq $0x8, %r13
addq $0x4, %r15
testl %eax, %eax
je 0x1333
leaq 0xda4(%rip), %rdi       # 0x2105
callq 0x10a0
xorl %edi, %edi
callq 0x10c0
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x1385
movq (%r14,%r15,8), %rdi
xorl %esi, %esi
callq 0x10e0
incq %r15
jmp 0x1370
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd5f(%rip), %rdi       # 0x20fc
callq 0x10a0
jmp 0x13f2
movq 0x2c4d(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0xcbc(%rip), %rsi       # 0x2074
xorl %eax, %eax
callq 0x1050
jmp 0x13f2
movq 0x2c30(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xcca(%rip), %rdi       # 0x209c
pushq $0x22
jmp 0x13e9
movq 0x2c1b(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xcd8(%rip), %rdi       # 0x20bf
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x10d0
pushq $0x1
popq %rdi
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/nmmmnu[P]HM2/test_hm_disktable.c
// Function: dump_file
static int dump_file(const char *filename, const char *keytofind){
	hm_disktable_t *mmf = hm_disktable_opena(filename);

	if (mmf == NULL){
		printf("Can not open file\n");
		exit(1);
	}

	hm_disktable_it_t *it = hm_disktable_it_open(mmf);
	if (it == NULL){
		printf("No memory\n");
		exit(1);
	}

	const hm_pair_t *pair;
	uint64_t i = 0;
	for(pair = hm_disktable_it_first(it); pair; pair = hm_disktable_it_next(it)){
		_print_pair(pair);

		++i;

		if (i >= 10)
			break;
	}

	hm_disktable_it_close(it);

	hm_disktable_close(mmf);
	free(mmf);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x1890
testq %rax, %rax
je 0x1555
movq %rax, %rbx
movq %rax, %rdi
callq 0x1985
testq %rax, %rax
je 0x155e
movq %rax, %r14
movq %rax, %rdi
callq 0x19a5
pushq $0x9
popq %r15
testq %rax, %rax
je 0x1538
movq %rax, %rdi
callq 0x1572
subq $0x1, %r15
jb 0x1538
movq %r14, %rdi
callq 0x19af
jmp 0x151b
movq %r14, %rdi
callq 0x19a0
movq %rbx, %rdi
callq 0x18cc
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
leaq 0xbeb(%rip), %rdi       # 0x2147
jmp 0x1565
leaq 0xbd8(%rip), %rdi       # 0x213d
callq 0x1040
pushq $0x1
popq %rdi
callq 0x1150
// File: /workspace/github_c_makefile_star2_O2/nmmmnu[P]HM2/test_hm_disktable.c
// Function: print_pair
static void _print_pair(const hm_pair_t *pair){
	if (pair){
		printf("Pair is %s\n", hm_pair_valid(pair, NULL) ? "valid" : "invalid" );
		printf("Pair checksum is %s\n", hm_pair_checksumvalid(pair) ? "valid" : "invalid" );
		printf("---begin---\n");
		hm_pair_printf(pair);
		printf("----end----\n");
	}else{
		printf("Not Found\n");
	}
}

// Assembly:
testq %rdi, %rdi
je 0x15ef
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x1759
testl %eax, %eax
leaq 0xb46(%rip), %r15       # 0x20d5
leaq 0xb41(%rip), %r14       # 0x20d7
movq %r14, %rsi
cmoveq %r15, %rsi
leaq 0xb25(%rip), %rdi       # 0x20c9
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x1784
testl %eax, %eax
cmoveq %r15, %r14
leaq 0xb1d(%rip), %rdi       # 0x20dd
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0xb92(%rip), %rdi       # 0x2163
callq 0x1040
movq %rbx, %rdi
callq 0x17bf
leaq 0xb8a(%rip), %rdi       # 0x216f
popq %rbx
popq %r14
popq %r15
jmp 0x1040
leaq 0xb63(%rip), %rdi       # 0x2159
jmp 0x1040
nop
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_09/setjmp_simple.c
// Function: main
int main(int argc, char *argv[])
{
	jmp_buf env;
	int ret;

	ret = setjmp(env);
	printf("setjmp() returned %d\n", ret);
	if (ret)
		return 0;

	longjmp(env, 1);

	printf("never printed!\n");

	return 0;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rsp, %rdi
callq 0x1040
movl %eax, %ebx
leaq 0xe8f(%rip), %rdi       # 0x2004
xorl %eax, %eax
movl %ebx, %esi
callq 0x1030
testl %ebx, %ebx
je 0x118d
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbx
retq
movq %rsp, %rdi
pushq $0x1
popq %rsi
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/felipelouza[P]egap/unbwt.c
// Function: main
int main(int argc, char *argv[])
{
  char *bnam=NULL, *tnam=NULL; 

  /* ------------- read options from command line ----------- */
  if(argc==3) {
    bnam=argv[1]; tnam = argv[2];
  }
  else {
    fprintf(stderr,"Usage:  %s infile outfile\n\n", argv[0]);
    fprintf(stderr,"Takes as input a multi-bwt that uses 0x0 as the EOS symbol and recovers\n");
    fprintf(stderr,"the original sequences writing them to <outfile> separated by a newline\n\n");
    exit(1);
  }
  
  // do the inversion
  invert_bwt(bnam,tnam);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jne 0x1834
movq 0x8(%rsi), %rdi
movq 0x10(%rsi), %rsi
callq 0x124e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x27bd(%rip), %r14      # 0x3ff8
movq (%r14), %rdi
movq (%rsi), %rdx
leaq 0x9f0(%rip), %rsi       # 0x2238
xorl %eax, %eax
callq 0x1090
movq (%r14), %rcx
leaq 0x9fb(%rip), %rdi       # 0x2254
pushq $0x48
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1110
movq (%r14), %rcx
leaq 0xa2c(%rip), %rdi       # 0x229d
pushq $0x49
popq %rsi
movq %rbx, %rdx
callq 0x1110
pushq $0x1
popq %rdi
callq 0x1100
// File: /workspace/github_c_makefile_star2_O2/Zarh[P]regps3iso/main.c
// Function: GetExtension
char *GetExtension(char *path)
{
    int n = strlen(path);
    int m = n;

    while(m > 1 && path[m] != '.' && path[m] != '/') m--;
    
	
    if(strcmp(&path[m], ".0")==0 || strcmp(&path[m], ".66600")==0) { // splitted
       m--;
       while(m > 1 && path[m] != '.' && path[m] != '/') m--; 
    }
	
	if(strcasecmp(&path[m], ".bin")==0) {
		if(strcasecmp(&path[m-7], ".header.bin")==0) {
			m-=7;	
		}
	}
  
    if(path[m] == '.') return &path[m];

    return &path[n];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4010f8
movq %rax, %r14
testl %r14d, %r14d
pushq $0x1
popq %r15
cmovlel %r14d, %r15d
cmpl $0x2, %eax
jl 0x401b83
movl %eax, %ecx
movb (%rbx,%rcx), %cl
andb $-0x2, %cl
cmpb $0x2e, %cl
je 0x401b80
decl %eax
jmp 0x401b6a
movl %eax, %r15d
movslq %r15d, %r12
leaq (%rbx,%r12), %rdi
cmpb $0x2e, (%rbx,%r12)
jne 0x401b9d
cmpb $0x30, 0x1(%rdi)
jne 0x401b9d
cmpb $0x0, 0x2(%rdi)
je 0x401bad
leaq 0xc0470(%rip), %rsi     # 0x4c2014
callq 0x4010c8
testl %eax, %eax
jne 0x401bdb
movl %r15d, %eax
decl %r15d
movslq %r15d, %rcx
movq %rax, %r15
movq %rcx, %r12
cmpl $0x3, %r15d
jl 0x401bd8
leaq -0x1(%r15), %rax
movl %eax, %ecx
movb (%rbx,%rcx), %dl
andb $-0x2, %dl
leaq -0x1(%r12), %rcx
cmpb $0x2e, %dl
jne 0x401bb6
decl %r15d
leaq (%rbx,%r12), %rdi
leaq 0xc043c(%rip), %rsi     # 0x4c2022
callq 0x401098
testl %eax, %eax
jne 0x401c13
movslq %r15d, %r12
addl $-0x7, %r15d
leaq (%r12,%rbx), %rdi
addq $-0x7, %rdi
leaq 0xc0416(%rip), %rsi     # 0x4c201b
callq 0x401098
testl %eax, %eax
cmovel %r15d, %r12d
movslq %r12d, %r12
movslq %r14d, %rax
addq %rbx, %rax
cmpb $0x2e, (%rbx,%r12)
leaq (%rbx,%r12), %rcx
cmoveq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Zarh[P]regps3iso/main.c
// Function: do_task
void do_task(char *path_in, u8 task)
{
	DIR *d;
	struct dirent *dir;
	
	char path[512];
	strcpy(path, path_in);
	int l = strlen(path);
	int i;
	
	for(i=0;i<l;i++){
		if(path[i]=='\\') path[i]='/';
	}
	
	if( is_dir(path) ) {
		d = opendir(path);
		if(d==NULL) return;
		
		while ((dir = readdir(d))) {
			if(!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..")) continue;		
			
			char temp[512];
			sprintf(temp, "%s/%s", path, dir->d_name);
			
			if(is_dir(temp)) do_task(temp, task);
			else {
				
				char *ext = GetExtension(temp);
				if( strcasecmp(ext, ".header.bin") == 0 || strcasecmp(ext, ".iso") == 0) {
					do_it(temp, task);
				}
			}
		}
		closedir(d);
	} else {
		do_it(path, task);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %esi, %ebp
movq %rdi, %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x401020
movq %rbx, %rdi
callq 0x4010f8
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x403021
cmpb $0x5c, (%rsp,%rcx)
jne 0x40301c
movb $0x2f, (%rsp,%rcx)
incq %rcx
jmp 0x40300d
movq %rsp, %rdi
callq 0x402f80
testb %al, %al
je 0x4030fe
movq %rsp, %rdi
callq 0x464140
testq %rax, %rax
je 0x40310a
movq %rax, %rbx
leaq 0xbf1a6(%rip), %r14     # 0x4c21f2
leaq 0x200(%rsp), %r15
movq %rsp, %r12
movzbl %bpl, %ebp
movq %rbx, %rdi
callq 0x4643a0
testq %rax, %rax
je 0x4030f4
cmpb $0x2e, 0x13(%rax)
jne 0x403084
cmpb $0x0, 0x14(%rax)
je 0x40305b
cmpb $0x2e, 0x14(%rax)
jne 0x403084
cmpb $0x0, 0x15(%rax)
je 0x40305b
addq $0x13, %rax
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x40ddc0
movq %r15, %rdi
callq 0x402f80
movq %r15, %rdi
testb %al, %al
je 0x4030b3
movl %ebp, %esi
callq 0x402fdd
jmp 0x40305b
callq 0x401b4c
movq %rax, %r13
movq %rax, %rdi
leaq 0xbef56(%rip), %rsi     # 0x4c201b
callq 0x401098
testl %eax, %eax
je 0x4030e5
movq %r13, %rdi
leaq 0xbf188(%rip), %rsi     # 0x4c2260
callq 0x401098
testl %eax, %eax
jne 0x40305b
movq %r15, %rdi
movl %ebp, %esi
callq 0x402fac
jmp 0x40305b
movq %rbx, %rdi
callq 0x464370
jmp 0x40310a
movzbl %bpl, %esi
movq %rsp, %rdi
callq 0x402fac
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Zarh[P]regps3iso/main.c
// Function: main
int main (int argc, char **argv)
{	
	if(argc==1) print_help();
	
	u8 task = do_fixps3iso_region;
	verbose=0;
	
	int args = 1;
	if(strcmp(argv[args], "verbose") == 0){
		verbose=1;
		args++;
	}
	
	if(strcmp(argv[args], "do_read_region_info") == 0){
		task=do_read_region_info;
		args++;
	} else
	if(strcmp(argv[args], "do_get_plain_files") == 0){
		task=do_get_plain_files;
		args++;
	} else
	if(strcmp(argv[args], "do_get_enc_files") == 0){
		task=do_get_enc_files;
		args++;
	} else
	if(strcmp(argv[args], "do_fixps3iso_region") == 0){
		task=do_fixps3iso_region;
		args++;
	}
	
	u32 i;
	for(i=args;i<argc;i++) {
		do_task(argv[i], task);
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x1, %edi
je 0x4031ec
movq %rsi, %rbx
movl %edi, %ebp
movb $0x0, 0xf3297(%rip)     # 0x4f63d0
movq 0x8(%rsi), %rdi
leaq 0xbf0b4(%rip), %rsi     # 0x4c21f8
callq 0x4010c8
xorl %r15d, %r15d
testl %eax, %eax
sete 0xf327b(%rip)           # 0x4f63d0
sete %r15b
incl %r15d
movq (%rbx,%r15,8), %r14
leaq 0xbf099(%rip), %rsi     # 0x4c2200
movq %r14, %rdi
callq 0x4010c8
pushq $0x1
popq %r12
testl %eax, %eax
je 0x4031b9
leaq 0xbf096(%rip), %rsi     # 0x4c2214
movq %r14, %rdi
callq 0x4010c8
testl %eax, %eax
je 0x4031bd
leaq 0xbf096(%rip), %rsi     # 0x4c2227
movq %r14, %rdi
callq 0x4010c8
testl %eax, %eax
je 0x4031c1
leaq 0xbf094(%rip), %rsi     # 0x4c2238
movq %r14, %rdi
callq 0x4010c8
xorl %r12d, %r12d
testl %eax, %eax
sete %r12b
movb $0x3, %al
jmp 0x4031c3
xorl %eax, %eax
jmp 0x4031c3
movb $0x1, %al
jmp 0x4031c3
movb $0x2, %al
addl %r12d, %r15d
movl %ebp, %r14d
movzbl %al, %ebp
cmpq %r14, %r15
jae 0x4031e1
movq (%rbx,%r15,8), %rdi
movl %ebp, %esi
callq 0x402fdd
incq %r15
jmp 0x4031cc
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x401b38
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Zarh[P]regps3iso/iso.c
// Function: strcpy_malloc
char *strcpy_malloc(char *STR_DEFAULT)
{
	if(STR_DEFAULT==NULL) return NULL;
	u32 size = strlen(STR_DEFAULT)+1;
	char *STR = malloc(size+1);
	if(STR==NULL) return NULL;
	memset(STR, 0, size+1);
	memcpy(STR, STR_DEFAULT, size);
	return STR;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x403230
movq %rdi, %rbx
callq 0x4010f8
movq %rax, %r14
leal 0x2(%rax), %esi
pushq $0x1
popq %rdi
callq 0x42bc70
testq %rax, %rax
je 0x403230
incl %r14d
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x401048
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq